[PATCH] powerpc/powernv: Fix no return statement issue in __opal_call_trace()

2019-03-08 Thread Claudio Carvalho
Commit 75d9fc7fd94e ("powerpc/powernv: move OPAL call wrapper tracing and interrupt handling to C") adds the function: static s64 __opal_call_trace(s64 a0, s64 a1, s64 a2, s64 a3, s64 a4, s64 a5, s64 a6, s64 a7, unsigned long opcode,

[PATCH 19/20] KVM: PPC: Book3S HV: Don't use compound_order to determine host mapping size

2019-03-08 Thread Leonardo Bras
From: Nicholas Piggin THP paths can defer splitting compound pages until after the actual remap and TLB flushes to split a huge PMD/PUD. This causes radix partition scope page table mappings to get out of synch with the host qemu page table mappings. This results in random memory corruption in

Re: [PATCH v6 4/4] hugetlb: allow to free gigantic pages regardless of the configuration

2019-03-08 Thread Mike Kravetz
On 3/7/19 5:20 AM, Alexandre Ghiti wrote: > On systems without CONTIG_ALLOC activated but that support gigantic pages, > boottime reserved gigantic pages can not be freed at all. This patch > simply enables the possibility to hand back those pages to memory > allocator. > > Signed-off-by:

Re: [PATCH] powerpc/6xx: fix setup and use of SPRN_PGDIR for hash32

2019-03-08 Thread Christophe Leroy
Le 08/03/2019 à 17:03, Segher Boessenkool a écrit : On Fri, Mar 08, 2019 at 07:05:22AM +, Christophe Leroy wrote: Not only the 603 but all 6xx need SPRN_PGDIR to be initialised at startup. This patch move it from __setup_cpu_603() to start_here() and __secondary_start(), close to the

Re: [PATCH] powerpc/6xx: fix setup and use of SPRN_PGDIR for hash32

2019-03-08 Thread Segher Boessenkool
On Fri, Mar 08, 2019 at 07:05:22AM +, Christophe Leroy wrote: > Not only the 603 but all 6xx need SPRN_PGDIR to be initialised at > startup. This patch move it from __setup_cpu_603() to start_here() > and __secondary_start(), close to the initialisation of SPRN_THREAD. I thought you meant an

Re: [PATCH] pseries/energy: Use OF accessor functions to read ibm,drc-indexes

2019-03-08 Thread Vaidyanathan Srinivasan
* Gautham R Shenoy [2019-03-08 21:03:24]: > From: "Gautham R. Shenoy" > > In cpu_to_drc_index() in the case when FW_FEATURE_DRC_INFO is absent, > we currently use of_read_property() to obtain the pointer to the array > corresponding to the property "ibm,drc-indexes". The elements of this >

[PATCH] pseries/energy: Use OF accessor functions to read ibm, drc-indexes

2019-03-08 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" In cpu_to_drc_index() in the case when FW_FEATURE_DRC_INFO is absent, we currently use of_read_property() to obtain the pointer to the array corresponding to the property "ibm,drc-indexes". The elements of this array are of type __be32, but are accessed without any

Re: [PATCH v2] powerpc/mm: move warning from resize_hpt_for_hotplug()

2019-03-08 Thread Laurent Vivier
I forgot the version change note: v2: add warning messages for H_PARAMETER and H_RESOURCE Thanks, Laurent On 08/03/2019 11:54, Laurent Vivier wrote: > resize_hpt_for_hotplug() reports a warning when it cannot > resize the hash page table ("Unable to resize hash page > table to target order")

[PATCH v2] powerpc/mm: move warning from resize_hpt_for_hotplug()

2019-03-08 Thread Laurent Vivier
resize_hpt_for_hotplug() reports a warning when it cannot resize the hash page table ("Unable to resize hash page table to target order") but in some cases it's not a problem and can make user thinks something has not worked properly. This patch moves the warning to arch_remove_memory() to only

Re: [PATCH v4 04/19] powerpc: mm: Add p?d_large() definitions

2019-03-08 Thread Steven Price
On 08/03/2019 08:37, Mike Rapoport wrote: > On Wed, Mar 06, 2019 at 03:50:16PM +, Steven Price wrote: >> walk_page_range() is going to be allowed to walk page tables other than >> those of user space. For this it needs to know when it has reached a >> 'leaf' entry in the page tables. This

Re: [PATCH v5 10/10] powerpc/mm: Detect bad KUAP faults

2019-03-08 Thread Christophe Leroy
Le 08/03/2019 à 02:16, Michael Ellerman a écrit : When KUAP is enabled we have logic to detect page faults that occur outside of a valid user access region and are blocked by the AMR. What we don't have at the moment is logic to detect a fault *within* a valid user access region, that has

Re: [PATCH v5 09/10] powerpc/64s: Implement KUAP for Radix MMU

2019-03-08 Thread Christophe Leroy
Le 08/03/2019 à 02:16, Michael Ellerman a écrit : From: Russell Currey Kernel Userspace Access Prevention utilises a feature of the Radix MMU which disallows read and write access to userspace addresses. By utilising this, the kernel is prevented from accessing user data from outside of

Re: [PATCH v4 04/19] powerpc: mm: Add p?d_large() definitions

2019-03-08 Thread Mike Rapoport
On Wed, Mar 06, 2019 at 03:50:16PM +, Steven Price wrote: > walk_page_range() is going to be allowed to walk page tables other than > those of user space. For this it needs to know when it has reached a > 'leaf' entry in the page tables. This information is provided by the > p?d_large()

Re: [PATCH v5 08/10] powerpc/lib: Refactor __patch_instruction() to use __put_user_asm()

2019-03-08 Thread Christophe Leroy
Le 08/03/2019 à 02:16, Michael Ellerman a écrit : From: Russell Currey __patch_instruction() is called in early boot, and uses __put_user_size(), which includes the allow/prevent calls to enforce KUAP, which could either be called too early, or in the Radix case, forced to use "early_"

Re: [PATCH v5 05/10] powerpc: Add a framework for Kernel Userspace Access Protection

2019-03-08 Thread Christophe Leroy
Le 08/03/2019 à 02:16, Michael Ellerman a écrit : From: Christophe Leroy This patch implements a framework for Kernel Userspace Access Protection. Then subarches will have the possibility to provide their own implementation by providing setup_kuap() and allow/prevent_user_access(). Some