Re: [PATCH V1 09/10] arch/kmap: Define kmap_atomic_prot() for all arch's

2020-05-02 Thread Ira Weiny
On Fri, May 01, 2020 at 04:20:20AM +0100, Al Viro wrote: > On Fri, May 01, 2020 at 03:37:34AM +0100, Al Viro wrote: > > On Thu, Apr 30, 2020 at 01:38:44PM -0700, ira.we...@intel.com wrote: > > > > > -static inline void *kmap_atomic(struct page *page) > > > +static inline void

Re: [PATCH v3 3/3] mm/page_alloc: Keep memoryless cpuless node 0 offline

2020-05-02 Thread Christopher Lameter
On Fri, 1 May 2020, Srikar Dronamraju wrote: > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -116,8 +116,10 @@ EXPORT_SYMBOL(latent_entropy); > */ > nodemask_t node_states[NR_NODE_STATES] __read_mostly = { > [N_POSSIBLE] = NODE_MASK_ALL, > +#ifdef CONFIG_NUMA > + [N_ONLINE] =

Re: [PATCH v3 1/3] powerpc/numa: Set numa_node for all possible cpus

2020-05-02 Thread Christopher Lameter
On Fri, 1 May 2020, Srikar Dronamraju wrote: > - for_each_present_cpu(cpu) > - numa_setup_cpu(cpu); > + for_each_possible_cpu(cpu) { > + /* > + * Powerpc with CONFIG_NUMA always used to have a node 0, > + * even if it was memoryless or

[PATCH] powerpc/5200: update contact email

2020-05-02 Thread Wolfram Sang
My 'pengutronix' address is defunct for years. Merge the entries and use the proper contact address. Signed-off-by: Wolfram Sang --- arch/powerpc/boot/dts/pcm032.dts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/boot/dts/pcm032.dts

Re: [PATCH 0/7] sha1 library cleanup

2020-05-02 Thread Jason A. Donenfeld
Thanks for this series. I like the general idea. I think it might make sense, though, to separate things out into sha1.h and sha256.h. That will be nice preparation work for when we eventually move obsolete primitives into some subdirectory.

[PATCH 0/7] sha1 library cleanup

2020-05-02 Thread Eric Biggers
sounds very generic and important, like it's the header to include if you're doing cryptographic hashing in the kernel. But actually it only includes the library implementation of the SHA-1 compression function (not even the full SHA-1). This should basically never be used anymore; SHA-1 is no

[PATCH 2/7] crypto: powerpc/sha1 - remove unused temporary workspace

2020-05-02 Thread Eric Biggers
From: Eric Biggers The PowerPC implementation of SHA-1 doesn't actually use the 16-word temporary array that's passed to the assembly code. This was probably meant to correspond to the 'W' array that lib/sha1.c uses. However, in sha1-powerpc-asm.S these values are actually stored in GPRs

[PATCH 3/7] crypto: powerpc/sha1 - prefix the "sha1_" functions

2020-05-02 Thread Eric Biggers
From: Eric Biggers Prefix the PowerPC SHA-1 functions with "powerpc_sha1_" rather than "sha1_". This allows us to rename the library function sha_init() to sha1_init() without causing a naming collision. Cc: linuxppc-dev@lists.ozlabs.org Cc: Benjamin Herrenschmidt Cc: Michael Ellerman Cc:

Re: [PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP

2020-05-02 Thread Dan Williams
On Sat, May 2, 2020 at 2:27 AM David Hildenbrand wrote: > > >> Now, let's clarify what I want regarding virtio-mem: > >> > >> 1. kexec should not add virtio-mem memory to the initial firmware > >>memmap. The driver has to be in charge as discussed. > >> 2. kexec should not place kexec images

[PATCH] powerpc/64s: Fix unrecoverable SLB crashes due to preemption check

2020-05-02 Thread Michael Ellerman
Hugh reported that his trusty G5 crashed after a few hours under load with an "Unrecoverable exception 380". The crash is in interrupt_return() where we check lazy_irq_pending(), which calls get_paca() and with CONFIG_DEBUG_PREEMPT=y that goes to check_preemption_disabled() via

Re: [PATCH v7 11/28] powerpc: Use a datatype for instructions

2020-05-02 Thread kbuild test robot
Hi Jordan, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v5.7-rc3 next-20200501] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option

[powerpc:next-test] BUILD SUCCESS 64c245a2974a376bb02dd94d1d03719d3a167e86

2020-05-02 Thread kbuild test robot
adder875_defconfig powerpc ep8248e_defconfig powerpc g5_defconfig powerpc mpc512x_defconfig m68k randconfig-a001-20200502 mips randconfig-a001-20200502 nds32randconfig-a001-20200502

[PATCH] powerpc/powernv: Fix a warning message

2020-05-02 Thread Christophe JAILLET
Fix a cut'n'paste error in a warning message. This should be 'cpu-idle-state-residency-ns' to match the property searched in the previous 'of_property_read_u32_array()' Fixes: 9c7b185ab2fe ("powernv/cpuidle: Parse dt idle properties into global structure") Signed-off-by: Christophe JAILLET ---

Re: [RFC 1/3] powernv/cpuidle : Support for pre-entry and post exit of stop state in firmware

2020-05-02 Thread Nicholas Piggin
Excerpts from Abhishek's message of April 30, 2020 3:52 pm: > Hi Nick, > > Have you posted out the kernel side of "opal v4" patchset? > I could only find the opal patchset. I just posted some new ones. I have some change sfor the cpuidle side but I haven't really looked to see what needs

[powerpc:topic/uaccess] BUILD SUCCESS b44f687386875b714dae2afa768e73401e45c21c

2020-05-02 Thread kbuild test robot
g5_defconfig m68k randconfig-a001-20200502 mips randconfig-a001-20200502 nds32randconfig-a001-20200502 alpharandconfig-a001-20200502 parisc randconfig-a001-20200502 riscvrandconfig-a001-20200502

[PATCH v2 28/28] powerpc/book3s64/keys/kuap: Reset AMR/IAMR values on kexec

2020-05-02 Thread Aneesh Kumar K.V
We can kexec into a kernel that doesn't use memory keys for kernel mapping (such as an older kernel which doesn't support kuap/kuep with hash translation). We need to make sure we reset the AMR/IAMR value on kexec otherwise, the new kernel will use key 0 for kernel mapping and the old AMR value

[PATCH v2 27/28] powerpc/selftest/ptrace-pkey: IAMR and uamor cannot be updated by ptrace

2020-05-02 Thread Aneesh Kumar K.V
Both IAMR and uamor are privileged and cannot be updated by userspace. Hence we also don't allow ptrace interface to update them. Don't update them in the test. Also expected_iamr is only changed if we can allocate a DISABLE_EXECUTE pkey. Signed-off-by: Aneesh Kumar K.V ---

[PATCH v2 26/28] powerpc/selftest/ptrace-pkey: Update the test to mark an invalid pkey correctly

2020-05-02 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- .../selftests/powerpc/ptrace/ptrace-pkey.c| 30 --- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c index

[PATCH v2 25/28] powerpc/selftest/ptrave-pkey: Rename variables to make it easier to follow code

2020-05-02 Thread Aneesh Kumar K.V
Rename variable to indicate that they are invalid values which we will use to test ptrace update of pkeys. Signed-off-by: Aneesh Kumar K.V --- .../selftests/powerpc/ptrace/ptrace-pkey.c| 26 +-- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git

[PATCH v2 24/28] powerpc/book3s64/keys: Print information during boot.

2020-05-02 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index bb127e4e2dd2..5d320ac2ba04 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++

[PATCH v2 23/28] powerpc/book3s64/hash/kuep: Enable KUEP on hash

2020-05-02 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index e94585fad5c4..bb127e4e2dd2 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++

[PATCH v2 22/28] powerpc/book3s64/hash/kuap: Enable kuap on hash

2020-05-02 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index 0f4fc2876fc8..e94585fad5c4 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++

[PATCH v2 21/28] powerpc/book3s64/kuep: Use Key 3 to implement KUEP with hash translation.

2020-05-02 Thread Aneesh Kumar K.V
Radix use IAMR Key 0 and hash translation use IAMR key 3. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/book3s/64/kup.h b/arch/powerpc/include/asm/book3s/64/kup.h index

[PATCH v2 20/28] powerpc/book3s64/kuap: Use Key 3 to implement KUAP with hash translation.

2020-05-02 Thread Aneesh Kumar K.V
Radix use AMR Key 0 and hash translation use AMR key 3. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/64/kup.h b/arch/powerpc/include/asm/book3s/64/kup.h

[PATCH v2 19/28] powerpc/book3s64/kuap: Improve error reporting with KUAP

2020-05-02 Thread Aneesh Kumar K.V
With hash translation use DSISR_KEYFAULT to identify a wrong access. With Radix we look at the AMR value and type of fault. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/32/kup.h | 4 +-- arch/powerpc/include/asm/book3s/64/kup.h | 28

[PATCH v2 18/28] powerpc/book3s64/kuap: Restrict access to userspace based on userspace AMR

2020-05-02 Thread Aneesh Kumar K.V
If an application has configured address protection such that read/write is denied using pkey even the kernel should receive a FAULT on accessing the same. This patch use user AMR value stored in pt_regs.kuap to achieve the same. Signed-off-by: Aneesh Kumar K.V ---

[PATCH v2 17/28] powerpc/book3s64/pkeys: Don't update SPRN_AMR when in kernel mode.

2020-05-02 Thread Aneesh Kumar K.V
Now that kernel correctly store/restore userspace AMR/IAMR values, avoid manipulating AMR and IAMR from the kernel on behalf of userspace. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 23 arch/powerpc/include/asm/processor.h | 5 --

[PATCH v2 16/28] powerpc/ptrace-view: Use pt_regs values instead of thread_struct based one.

2020-05-02 Thread Aneesh Kumar K.V
We will remove thread.amr/iamr/uamor in a later patch Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kernel/ptrace/ptrace-view.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/ptrace/ptrace-view.c

[PATCH v2 15/28] powerpc/book3s64/pkeys: Reset userspace AMR correctly on exec

2020-05-02 Thread Aneesh Kumar K.V
On fork, we inherit from the parent and on exec, we should switch to default_amr values. Also, avoid changing the AMR register value within the kernel. The kernel now runs with different AMR values. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 2 ++

[PATCH v2 14/28] powerpc/book3s64/pkeys: Inherit correctly on fork.

2020-05-02 Thread Aneesh Kumar K.V
Child thread.kuap value is inherited from the parent in copy_thread_tls. We still need to make sure when the child returns from a fork in the kernel we start with the kernel default AMR value. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kernel/process.c | 7 +++ 1 file changed, 7

[PATCH v2 13/28] powerpc/book3s64/kuep: Store/restore userspace IAMR correctly on entry and exit from kernel

2020-05-02 Thread Aneesh Kumar K.V
This prepare kernel to operate with a different value than userspace IAMR. For this, IAMR needs to be saved and restored on entry and return from the kernel. If MMU_FTR_KEY is enabled we always use the key mechanism to implement KUEP feature. If MMU_FTR_KEY is not supported and if we support

[PATCH v2 12/28] powerpc/book3s64/pkeys: Store/restore userspace AMR correctly on entry and exit from kernel

2020-05-02 Thread Aneesh Kumar K.V
This prepare kernel to operate with a different value than userspace AMR. For this, AMR needs to be saved and restored on entry and return from the kernel. With KUAP we modify kernel AMR when accessing user address from the kernel via copy_to/from_user interfaces. If MMU_FTR_KEY is enabled we

[PATCH v2 11/28] powerpc/exec: Set thread.regs early during exec

2020-05-02 Thread Aneesh Kumar K.V
In later patches during exec, we would like to access default regs.kuap to control access to the user mapping. Having thread.regs set early makes the code changes simpler. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kernel/process.c | 24 1 file changed, 12

[PATCH v2 10/28] powerpc/book3s64/kuap: Use Key 3 for kernel mapping with hash translation

2020-05-02 Thread Aneesh Kumar K.V
This patch updates kernel hash page table entries to use storage key 3 for its mapping. This implies all kernel access will now use key 3 to control READ/WRITE. The patch also prevents the allocation of key 3 from userspace and UAMOR value is updated such that userspace cannot modify key 3.

[PATCH v2 09/28] powerpc/book3s64/kuap: Move UAMOR setup to key init function

2020-05-02 Thread Aneesh Kumar K.V
With hash translation, the kernel will use key 3 for implementing KUAP feature. Hence the default UAMOR value depends on what other keys are marked reserved. Move the UAMOR initialization to pkeys init. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 2 ++

[PATCH v2 08/28] powerpc/book3s64/kuap/kuep: Make KUAP and KUEP a subfeature of PPC_MEM_KEYS

2020-05-02 Thread Aneesh Kumar K.V
The next set of patches adds support for kuap with hash translation. Hence make KUAP a BOOK3S_64 feature. Also make it a subfeature of PPC_MEM_KEYS. Hash translation is going to use pkeys to support KUAP/KUEP. Adding this dependency reduces the code complexity and enables us to move some of the

[PATCH v2 07/28] powerpc/book3s64/kuap: Rename MMU_FTR_RADIX_KUAP to MMU_FTR_KUAP

2020-05-02 Thread Aneesh Kumar K.V
The next set of patches adds support for kuap with hash translation. In preparation for that rename/move kuap related functions to non radix names. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 18 +- arch/powerpc/include/asm/mmu.h | 6

[PATCH v2 06/28] powerpc/book3s64/kuep: Move KUEP related function outside radix

2020-05-02 Thread Aneesh Kumar K.V
The next set of patches adds support for kuep with hash translation. In preparation for that rename/move kuap related functions to non radix names. Also set MMU_FTR_KUEP and add the missing isync(). Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 1 +

[PATCH v2 05/28] powerpc/book3s64/kuap: Move KUAP related function outside radix

2020-05-02 Thread Aneesh Kumar K.V
The next set of patches adds support for kuap with hash translation. In preparation for that rename/move kuap related functions to non radix names. Signed-off-by: Aneesh Kumar K.V --- .../asm/book3s/64/{kup-radix.h => kup.h} | 6 +++--- arch/powerpc/include/asm/kup.h | 2

[PATCH v2 04/28] powerpc/book3s64/pkeys: Use MMU_FTR_PKEY instead of pkey_disabled static key

2020-05-02 Thread Aneesh Kumar K.V
Instead of pkey_disabled static key use mmu feature MMU_FTR_PKEY. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/pkeys.h | 2 +- arch/powerpc/include/asm/pkeys.h | 14 ++ arch/powerpc/mm/book3s64/pkeys.c | 16 +++- 3 files

[PATCH v2 03/28] powerpc/book3s64/pkeys: Use execute_pkey_disable static key

2020-05-02 Thread Aneesh Kumar K.V
Use execute_pkey_disabled static key to check for execute key support instead of pkey_disabled. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/pkeys.h | 10 +- arch/powerpc/mm/book3s64/pkeys.c | 5 - 2 files changed, 5 insertions(+), 10 deletions(-) diff --git

[PATCH v2 02/28] powerpc/book3s64/kuep: Add MMU_FTR_KUEP

2020-05-02 Thread Aneesh Kumar K.V
This will be used to enable/disable Kernel Userspace Execution Prevention (KUEP). Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/mmu.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index

[PATCH v2 01/28] powerpc/book3s64/pkeys: Enable MMU_FTR_PKEY

2020-05-02 Thread Aneesh Kumar K.V
Parse storage keys related device tree entry in early_init_devtree and enable MMU feature MMU_FTR_PKEY if pkeys are supported. MMU feature is used instead of CPU feature because this enables us to group MMU_FTR_KUAP and MMU_FTR_PKEY in asm feature fixup code. Signed-off-by: Aneesh Kumar K.V ---

[PATCH v2 00/28] Kernel userspace access/execution prevention with hash translation

2020-05-02 Thread Aneesh Kumar K.V
This patch series implements KUAP and KUEP with hash translation mode using memory keys. The kernel now uses memory protection key 3 to control access to the kernel. Kernel page table entries are now configured with key 3. Access to locations configured with any other key value is denied when in

[RFC PATCH 10/10] powerpc/powernv: OPAL V4 Implement vm_map/unmap service

2020-05-02 Thread Nicholas Piggin
This implements os_vm_map, os_vm_unmap. OPAL uses EA regions that is specifies in OPAL_FIND_VM_AREA for these mappings, so provided the page tables are allocated at init-time and not freed, these services can be provided without memory allocation / blocking. Signed-off-by: Nicholas Piggin ---

[RFC PATCH 09/10] powerpc/powernv: OPAL V4 OS services

2020-05-02 Thread Nicholas Piggin
This implements OPAL_REGISTER_OS_OPS and implements the printf service. When this API is called, OPAL switches to V4 mode which requires the OS to subsequently handle its program interrupts and printf calls. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/opal-api.h| 7

[RFC PATCH 08/10] powerpc/powernv: Set up an mm context to call OPAL in

2020-05-02 Thread Nicholas Piggin
This creates an mm context to be used for OPAL V4 calls, which is populated with ptes according to querying OPAL_FIND_VM_AREA. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/powernv/opal-call.c | 21 +++- arch/powerpc/platforms/powernv/opal.c | 119 - 2

[RFC PATCH 07/10] powerpc/powernv: Add OPAL_FIND_VM_AREA API

2020-05-02 Thread Nicholas Piggin
This will be used in the next patch. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/opal-api.h| 15 ++- arch/powerpc/include/asm/opal.h| 2 ++ arch/powerpc/platforms/powernv/opal-call.c | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff

[RFC PATCH 06/10] powerpc/powernv: opal use new opal call entry point if it exists

2020-05-02 Thread Nicholas Piggin
OPAL may advertise new endian-specific entry point which has different calling conventions including using the caller's stack, but otherwise provides the standard OPAL call API without any changes required to the OS. Signed-off-by: Nicholas Piggin --- arch/powerpc/boot/opal.c

[RFC PATCH 05/10] powerpc/powernv: Don't translate kernel addresses to real addresses for OPAL

2020-05-02 Thread Nicholas Piggin
A random assortment of OPAL callers use __pa() on pointers (others don't). This is not required because __pa() behaves the same as __va() when translation is off. In order to run OPAL with translation on, the effective addresses have to be used. Signed-off-by: Nicholas Piggin ---

[RFC PATCH 04/10] powerpc/powernv: avoid polling in opal_get_chars

2020-05-02 Thread Nicholas Piggin
OPAL console IO should avoid locks and complexity where possible, to maximise the chance of it working if there are crashes or bugs. This poll is not necessary, opal_console_read can handle no input. In a future patch, Linux will provide a console service to OPAL via the OPAL console, so it must

[RFC PATCH 03/10] powerpc/powernv: Use OPAL_REPORT_TRAP to cope with trap interrupts from OPAL

2020-05-02 Thread Nicholas Piggin
This isn't used yet, because OPAL is nice enough not to cause unexpected program check interrupts to the OS. A future patch will allow OPAL to start using traps. Like so. [OPAL] < assert failed at core/opal.c:814 > [OPAL] . [OPAL] . [OPAL] . [OPAL] OO__) [OPAL]

[RFC PATCH 02/10] powerpc/powernv: Wire up OPAL address lookups

2020-05-02 Thread Nicholas Piggin
Use ARCH_HAS_SYMBOL_LOOKUP to look up the opal symbol table. This allows crashes and xmon debugging to print firmware symbols. Oops: System Reset, sig: 6 [#1] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA PowerNV Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted

[RFC PATCH 00/10] OPAL V4

2020-05-02 Thread Nicholas Piggin
"OPAL V4" is a proposed new approach to running and calling PowerNV OPAL firmware. OPAL calls use the caller's (kernel) stack, which vastly simplifies re-entrancy concerns around doing things like idle and machine check OPAL drivers. The OS can get at symbol and assert metadata to help with

[RFC PATCH 01/10] kallsyms: architecture specific symbol lookups

2020-05-02 Thread Nicholas Piggin
Provide CONFIG_ARCH_HAS_SYMBOL_LOOKUP which allows architectures to do their own symbol/address lookup if kernel and module lookups miss. powerpc will use this to deal with firmware symbols. Signed-off-by: Nicholas Piggin --- include/linux/kallsyms.h | 20

[PATCH v2 12/12] powerpc/book3s64/pkeys: Mark all the pkeys above max pkey as reserved

2020-05-02 Thread Aneesh Kumar K.V
The hypervisor can return less than max allowed pkey (for ex: 31) instead of 32. We should mark all the pkeys above max allowed as reserved so that we avoid the allocation of the wrong pkey(for ex: key 31 in the above case) by userspace. Signed-off-by: Aneesh Kumar K.V ---

[PATCH v2 11/12] powerpc/book3s64/pkeys: Make initial_allocation_mask static

2020-05-02 Thread Aneesh Kumar K.V
initial_allocation_mask is not used outside this file. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/pkeys.h | 1 - arch/powerpc/mm/book3s64/pkeys.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/pkeys.h

[PATCH v2 10/12] powerpc/book3s64/pkeys: Convert pkey_total to max_pkey

2020-05-02 Thread Aneesh Kumar K.V
max_pkey now represents max key value that userspace can allocate. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/pkeys.h | 7 +-- arch/powerpc/mm/book3s64/pkeys.c | 14 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git

[PATCH v2 09/12] powerpc/book3s64/pkeys: Simplify pkey disable branch

2020-05-02 Thread Aneesh Kumar K.V
Make the default value FALSE (pkey enabled) and set to TRUE when we find the total number of keys supported to be zero. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/pkeys.h | 2 +- arch/powerpc/mm/book3s64/pkeys.c | 7 +++ 2 files changed, 4 insertions(+), 5 deletions(-)

[PATCH v2 08/12] powerpc/book3s64/pkeys: Convert execute key support to static key

2020-05-02 Thread Aneesh Kumar K.V
Convert the bool to a static key like pkey_disabled. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index

[PATCH v2 07/12] powerpc/book3s64/pkeys: kill cpu feature key CPU_FTR_PKEY

2020-05-02 Thread Aneesh Kumar K.V
We don't use CPU_FTR_PKEY anymore. Remove the feature bit and mark it free. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/cputable.h | 10 +- arch/powerpc/kernel/dt_cpu_ftrs.c | 6 -- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git

[PATCH v2 06/12] powerpc/book3s64/pkeys: Prevent key 1 modification from userspace.

2020-05-02 Thread Aneesh Kumar K.V
Key 1 is marked reserved by ISA. Setup uamor to prevent userspace modification of the same. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index

[PATCH v2 05/12] powerpc/book3s64/pkeys: Simplify the key initialization

2020-05-02 Thread Aneesh Kumar K.V
Add documentation explaining the execute_only_key. The reservation and initialization mask details are also explained in this patch. No functional change in this patch. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 186 ++- 1 file changed,

[PATCH v2 04/12] powerpc/book3s64/pkeys: Explain key 1 reservation details

2020-05-02 Thread Aneesh Kumar K.V
This explains the details w.r.t key 1. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index 1199fc2bfaec..d60e6bfa3e03 100644 ---

[PATCH v2 03/12] powerpc/book3s64/pkeys: Move pkey related bits in the linux page table

2020-05-02 Thread Aneesh Kumar K.V
To keep things simple, all the pkey related bits are kept together in linux page table for 64K config with hash translation. With hash-4k kernel requires 4 bits to store slots details. This is done by overloading some of the RPN bits for storing the slot details. Due to this PKEY_BIT0 on the 4K

[PATCH v2 02/12] powerpc/book3s64/pkeys: pkeys are supported only on hash on book3s.

2020-05-02 Thread Aneesh Kumar K.V
Move them to hash specific file and add BUG() for radix path. --- .../powerpc/include/asm/book3s/64/hash-pkey.h | 32 arch/powerpc/include/asm/book3s/64/pkeys.h| 25 + arch/powerpc/include/asm/pkeys.h | 37 --- 3 files changed, 64

[PATCH v2 01/12] powerpc/book3s64/pkeys: Fixup bit numbering

2020-05-02 Thread Aneesh Kumar K.V
This number the pkey bit such that it is easy to follow. PKEY_BIT0 is the lower order bit. This makes further changes easy to follow. No functional change in this patch other than linux page table for hash translation now maps pkeys differently. Signed-off-by: Aneesh Kumar K.V ---

[PATCH v2 00/12] powerpc/book3s/64/pkeys: Simplify the code

2020-05-02 Thread Aneesh Kumar K.V
This patch series update the pkey subsystem with more documentation and rename variables so that it is easy to follow the code. The last patch does fix a problem where we are treating keys above max_pkey as available. But userspace is not impacted because using that key in mprotect_pkey returns

[powerpc:fixes-test] BUILD SUCCESS e2abb0f00606ece8b191679bbc3f9246738fb88e

2020-05-02 Thread kbuild test robot
adder875_defconfig powerpc ep8248e_defconfig powerpc g5_defconfig powerpc mpc512x_defconfig m68k randconfig-a001-20200502 mips randconfig-a001-20200502 nds32randconfig-a001

Re: [PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP

2020-05-02 Thread David Hildenbrand
>> Now, let's clarify what I want regarding virtio-mem: >> >> 1. kexec should not add virtio-mem memory to the initial firmware >>memmap. The driver has to be in charge as discussed. >> 2. kexec should not place kexec images onto virtio-mem memory. That >>would end badly. >> 3. kexec

[powerpc:topic/uaccess-ppc] BUILD SUCCESS 4fe5cda9f89d0aea8e915b7c96ae34bda4e12e51

2020-05-02 Thread kbuild test robot
adder875_defconfig powerpc ep8248e_defconfig powerpc g5_defconfig powerpc mpc512x_defconfig m68k randconfig-a001-20200502 mips randconfig-a001-20200502 nds32randconfig-a001-20200502 alpha