[PATCH 0/4] powerpc/xive: add support for H_INT_RESET

2018-04-03 Thread Cédric Le Goater
H_INT_RESET performs a reset of the Hypervisor internal interrupt structures, removing all settings done with H_INT_SET_SOURCE_CONFIG and H_INT_SET_QUEUE_CONFIG. This is most important for kdump and kexec to be able to restart in a clean state. First patch closes a window in the kexec sequence in

[PATCH 3/4] powerpc/xive: shutdown XIVE when kexec or kdump is performed

2018-04-03 Thread Cédric Le Goater
The hcall H_INT_RESET should be called to make sure XIVE is fully reseted. Signed-off-by: Cédric Le Goater --- arch/powerpc/platforms/pseries/kexec.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/pseries/kexec.c b/arch/powerpc/platforms/pserie

[PATCH 4/4] powerpc/xive: prepare all hcalls to support long busy delays

2018-04-03 Thread Cédric Le Goater
This is not the case for the moment, but future releases of pHyp might need to introduce some synchronisation routines under the hood which would make the XIVE hcalls longer to complete. As this was done for H_INT_RESET, let's wrap the other hcalls in a loop catching the H_LONG_BUSY_* codes. Sign

[PATCH 2/4] powerpc/xive: fix hcall H_INT_RESET to support long busy delays

2018-04-03 Thread Cédric Le Goater
The hcall H_INT_RESET can take some time to complete and in such cases it returns H_LONG_BUSY_* codes requiring the machine to sleep for a while before retrying. Signed-off-by: Cédric Le Goater --- arch/powerpc/sysdev/xive/spapr.c | 53 1 file changed, 48

[PATCH 1/4] powerpc/64/kexec: fix race in kexec when XIVE is shutdowned

2018-04-03 Thread Cédric Le Goater
The kexec_state KEXEC_STATE_IRQS_OFF barrier is reached by all secondary CPUs before the kexec_cpu_down() operation is called on secondaries. This can raise conflicts and provoque errors in the XIVE hcalls when XIVE is shutdowned with H_INT_RESET on the primary CPU. To synchronize the kexec_cpu_do

[PATCH] cxl: Fix possible deadlock when processing page faults from cxllib

2018-04-03 Thread Frederic Barrat
cxllib_handle_fault() is called by an external driver when it needs to have the host process page faults for a buffer which may cover several pages. Currently the function holds the mm->mmap_sem semaphore with read access while iterating over the buffer, since it could spawn several VMAs. When call

Re: [PATCH v3 4/7] powerpc/fadump: exclude memory holes while reserving memory in second kernel.

2018-04-03 Thread Hari Bathini
On Monday 02 April 2018 12:00 PM, Mahesh J Salgaonkar wrote: From: Mahesh Salgaonkar The second kernel, during early boot after the crash, reserves rest of the memory above boot memory size to make sure it does not touch any of the dump memory area. It uses memblock_reserve() that reserves th

Re: [PATCH] cxl: Fix possible deadlock when processing page faults from cxllib

2018-04-03 Thread Laurent Dufour
On 03/04/2018 11:43, Frederic Barrat wrote: > cxllib_handle_fault() is called by an external driver when it needs to > have the host process page faults for a buffer which may cover several > pages. Currently the function holds the mm->mmap_sem semaphore with > read access while iterating over th

Re: [PATCH v3 6/7] powerpc/fadump: Do not allow hot-remove memory from fadump reserved area.

2018-04-03 Thread Mahesh Jagannath Salgaonkar
On 04/03/2018 08:48 AM, Pingfan Liu wrote: > I think CMA has protected us from hot-remove, so this patch is not necessary. Yes, but only if the memory from declared CMA region is allocated using cma_alloc(). The rest of the memory inside CMA region which hasn't been cma_allocat-ed can still be hot

Re: [PATCH v3 4/7] powerpc/fadump: exclude memory holes while reserving memory in second kernel.

2018-04-03 Thread Mahesh Jagannath Salgaonkar
On 04/03/2018 03:21 PM, Hari Bathini wrote: > > > On Monday 02 April 2018 12:00 PM, Mahesh J Salgaonkar wrote: >> From: Mahesh Salgaonkar >> >> The second kernel, during early boot after the crash, reserves rest of >> the memory above boot memory size to make sure it does not touch any >> of the

Re: [PATCH] cxl: Fix possible deadlock when processing page faults from cxllib

2018-04-03 Thread Vaibhav Jain
Frederic Barrat writes: > cxllib_handle_fault() is called by an external driver when it needs to > have the host process page faults for a buffer which may cover several > pages. Currently the function holds the mm->mmap_sem semaphore with > read access while iterating over the buffer, since it c

Re: [PATCH 2/2] smp: introduce kick_active_cpus_sync()

2018-04-03 Thread Mark Rutland
Hi Yury, On Sun, Apr 01, 2018 at 02:11:08PM +0300, Yury Norov wrote: > +/* > + * Flush I-cache if CPU is in extended quiescent state > + */ This comment is misleading. An ISB doesn't touch the I-cache; it forces a context synchronization event. > + .macro isb_if_eqs > +#ifndef CONFIG_TINY_R

[PATCH v2] cxl: Fix possible deadlock when processing page faults from cxllib

2018-04-03 Thread Frederic Barrat
cxllib_handle_fault() is called by an external driver when it needs to have the host resolve page faults for a buffer. The buffer can cover several pages and VMAs. The function iterates over all the pages used by the buffer, based on the page size of the VMA. To ensure some stability while process

Re: [PATCH v2] cxl: Fix possible deadlock when processing page faults from cxllib

2018-04-03 Thread Laurent Dufour
On 03/04/2018 15:54, Frederic Barrat wrote: > cxllib_handle_fault() is called by an external driver when it needs to > have the host resolve page faults for a buffer. The buffer can cover > several pages and VMAs. The function iterates over all the pages used > by the buffer, based on the page size

[PATCH 1/4] libnvdimm: Add of_node to region and bus descriptors

2018-04-03 Thread Oliver O'Halloran
We want to be able to cross reference the region and bus devices with the device tree node that they were spawned from. libNVDIMM handles creating the actual devices for these internally, so we need to pass in a pointer to the relevant node in the descriptor. Signed-off-by: Oliver O'Halloran Acke

[PATCH 3/4] doc/devicetree: Persistent memory region bindings

2018-04-03 Thread Oliver O'Halloran
Add device-tree binding documentation for the nvdimm region driver. Cc: devicet...@vger.kernel.org Signed-off-by: Oliver O'Halloran --- v2: Changed name from nvdimm-region to pmem-region. Cleaned up the example binding and fixed the overlapping regions. Added support for multiple regions

[PATCH 2/4] libnvdimm: Add device-tree based driver

2018-04-03 Thread Oliver O'Halloran
This patch adds peliminary device-tree bindings for persistent memory regions. The driver registers a libnvdimm bus for each pmem-region node and each address range under the node is converted to a region within that bus. Signed-off-by: Oliver O'Halloran --- v2: Made each bus have a separate node

[PATCH 4/4] powerpc/powernv: Create platform devs for nvdimm buses

2018-04-03 Thread Oliver O'Halloran
Scan the devicetree for an nvdimm-bus compatible and create a platform device for them. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/opal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c

[RESEND v2 1/4] libnvdimm: Add of_node to region and bus descriptors

2018-04-03 Thread Oliver O'Halloran
We want to be able to cross reference the region and bus devices with the device tree node that they were spawned from. libNVDIMM handles creating the actual devices for these internally, so we need to pass in a pointer to the relevant node in the descriptor. Signed-off-by: Oliver O'Halloran Acke

[RESEND v2 2/4] libnvdimm: Add device-tree based driver

2018-04-03 Thread Oliver O'Halloran
This patch adds peliminary device-tree bindings for persistent memory regions. The driver registers a libnvdimm bus for each pmem-region node and each address range under the node is converted to a region within that bus. Signed-off-by: Oliver O'Halloran --- v2: Made each bus have a separate node

[RESEND v2 3/4] doc/devicetree: Persistent memory region bindings

2018-04-03 Thread Oliver O'Halloran
Add device-tree binding documentation for the nvdimm region driver. Cc: devicet...@vger.kernel.org Signed-off-by: Oliver O'Halloran --- v2: Changed name from nvdimm-region to pmem-region. Cleaned up the example binding and fixed the overlapping regions. Added support for multiple regions

[RESEND v2 4/4] powerpc/powernv: Create platform devs for nvdimm buses

2018-04-03 Thread Oliver O'Halloran
Scan the devicetree for an nvdimm-bus compatible and create a platform device for them. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/opal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c

Re: [PATCH v2] cxl: Fix possible deadlock when processing page faults from cxllib

2018-04-03 Thread Frederic Barrat
Le 03/04/2018 à 16:06, Laurent Dufour a écrit : On 03/04/2018 15:54, Frederic Barrat wrote: cxllib_handle_fault() is called by an external driver when it needs to have the host resolve page faults for a buffer. The buffer can cover several pages and VMAs. The function iterates over all the pag

Re: [PATCH] cxl: Fix possible deadlock when processing page faults from cxllib

2018-04-03 Thread Aneesh Kumar K.V
On 04/03/2018 03:13 PM, Frederic Barrat wrote: cxllib_handle_fault() is called by an external driver when it needs to have the host process page faults for a buffer which may cover several pages. Currently the function holds the mm->mmap_sem semaphore with read access while iterating over the buf

Re: [PATCH] cxl: Fix possible deadlock when processing page faults from cxllib

2018-04-03 Thread Aneesh Kumar K.V
On 04/03/2018 08:10 PM, Aneesh Kumar K.V wrote: On 04/03/2018 03:13 PM, Frederic Barrat wrote: cxllib_handle_fault() is called by an external driver when it needs to have the host process page faults for a buffer which may cover several pages. Currently the function holds the mm->mmap_sem semaph

[PATCH] selftests/powerpc: Fix copyloops build since Power4 assembler change

2018-04-03 Thread Michael Ellerman
The recent commit 15a3204d24a3 ("powerpc/64s: Set assembler machine type to POWER4") set the machine type in our ASFLAGS when building the kernel, and removed some ".machine power4" directives from various asm files. This broke the selftests build on old toolchains (that don't assume Power4), beca

Re: [1/3] powerpc/64s/idle: POWER9 implement a separate idle stop function for hotplug

2018-04-03 Thread Michael Ellerman
On Fri, 2017-11-17 at 14:08:05 UTC, Nicholas Piggin wrote: > Implement a new function to invoke stop, power9_offline_stop, which is > like power9_idle_stop but used by the cpu hotplug code. > > Move KVM secondary state manipulation code to the offline case. > > Signed-off-by: Nicholas Piggin > R

Re: [2/3] powerpc/64s/idle: avoid sync for KVM state when waking from idle

2018-04-03 Thread Michael Ellerman
On Fri, 2017-11-17 at 14:08:06 UTC, Nicholas Piggin wrote: > When waking from a CPU idle instruction (e.g., nap or stop), the sync > for ordering the KVM secondary thread state can be avoided if there > wakeup is coming from a kernel context rather than KVM context. > > This improves performance f

Re: [1/9] powerpc/64s: cputable add all POWER9 features to CPU_FTRS_ALWAYS

2018-04-03 Thread Michael Ellerman
On Tue, 2018-02-20 at 19:08:24 UTC, Nicholas Piggin wrote: > Signed-off-by: Nicholas Piggin Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/b842bd0f7a61b129a672f8b038325e cheers

Re: powerpc/boot: Remove duplicate typedefs from libfdt_env.h

2018-04-03 Thread Michael Ellerman
On Fri, 2018-03-16 at 21:54:43 UTC, Mark Greer wrote: > When building a uImage or zImage using ppc6xx_defconfig and some other > defconfigs, the following error occurs: > > BOOTCC arch/powerpc/boot/fdt.o > In file included from arch/powerpc/boot/fdt.c:51:0: > ../arch/powerpc/boot/libfdt_env

Re: powerpc/mm/radix: Fix always false comparison against MMU_NO_CONTEXT

2018-04-03 Thread Michael Ellerman
On Thu, 2018-03-22 at 21:03:18 UTC, Mathieu Malaterre wrote: > In commit 9690c1574268 ("powerpc/mm/radix: Fix always false comparison > against MMU_NO_CONTEXT") an issue was discovered where `mm->context.id` was > being truncated to an `unsigned int`, while the PID is actually an > `unsigned long`.

Re: powerpc/64s: sreset panic if there is no debugger or crash dump handlers

2018-04-03 Thread Michael Ellerman
On Mon, 2018-03-26 at 15:01:16 UTC, Nicholas Piggin wrote: > system_reset_exception does most of its own crash handling now, > invoking the debugger or crash dumps if they are registered. If not, > then it goes through to die() to print stack traces, and then is > supposed to panic (according to co

Re: powerpc/64s: return more carefully from sreset NMI

2018-04-03 Thread Michael Ellerman
On Mon, 2018-03-26 at 15:01:03 UTC, Nicholas Piggin wrote: > System Reset, being an NMI, must return more carefully than other > interrupts. It has traditionally returned via the nromal return > from exception path, but that has a number of problems. > > - r13 does not get restored if returning to

Re: powerpc: Clear branch trap (MSR.BE) before delivering SIGTRAP

2018-04-03 Thread Michael Ellerman
On Mon, 2018-03-26 at 16:55:21 UTC, Matt Evans wrote: > When using SIG_DBG_BRANCH_TRACING, MSR.BE is left enabled in the > user context when single_step_exception() prepares the SIGTRAP > delivery. The resulting branch-trap-within-the-SIGTRAP-handler > isn't healthy. > > Commit 2538c2d08f46141550

Re: [1/2] powerpc: Move default security feature flags

2018-04-03 Thread Michael Ellerman
On Fri, 2018-03-30 at 17:28:24 UTC, Mauricio Faria de Oliveira wrote: > This moves the definition of the default security feature flags > (i.e., enabled by default) closer to the security feature flags. > > This can be used to restore current flags to the default flags. > > Signed-off-by: Maurici

Re: [1/2] KVM: PPC: Book3S HV: Fix ppc_breakpoint_available compile error

2018-04-03 Thread Michael Ellerman
On Sun, 2018-04-01 at 05:50:35 UTC, Nicholas Piggin wrote: > arch/powerpc/kvm/book3s_hv.c: In function ‘kvmppc_h_set_mode’: > arch/powerpc/kvm/book3s_hv.c:745:8: error: implicit declaration of function > ‘ppc_breakpoint_available’; did you mean ‘hw_breakpoint_disable’? > [-Werror=impl

Re: [V2] powerpc: Fix oops due to wrong access of lppaca on non virtualized platform

2018-04-03 Thread Michael Ellerman
On Mon, 2018-04-02 at 07:33:37 UTC, "Aneesh Kumar K.V" wrote: > Commit 8e0b634b1327 ("powerpc/64s: Do not allocate lppaca if we are not > virtualized") removed allocation of lppaca on non virtualized platform. But > with > CONFIG_PPC_SPLPAR enabled, we do access lppaca non-virtualized platform in

Re: selftests/powerpc: Fix copyloops build since Power4 assembler change

2018-04-03 Thread Michael Ellerman
On Tue, 2018-04-03 at 15:53:18 UTC, Michael Ellerman wrote: > The recent commit 15a3204d24a3 ("powerpc/64s: Set assembler machine > type to POWER4") set the machine type in our ASFLAGS when building the > kernel, and removed some ".machine power4" directives from various asm > files. > > This brok

Re: [1/3] powerpc/64s/idle: POWER9 implement a separate idle stop function for hotplug

2018-04-03 Thread Nicholas Piggin
On Wed, 4 Apr 2018 02:03:18 +1000 (AEST) Michael Ellerman wrote: > On Fri, 2017-11-17 at 14:08:05 UTC, Nicholas Piggin wrote: > > Implement a new function to invoke stop, power9_offline_stop, which is > > like power9_idle_stop but used by the cpu hotplug code. > > > > Move KVM secondary state m

Re: [RESEND v2 2/4] libnvdimm: Add device-tree based driver

2018-04-03 Thread Dan Williams
On Tue, Apr 3, 2018 at 7:24 AM, Oliver O'Halloran wrote: > This patch adds peliminary device-tree bindings for persistent memory > regions. The driver registers a libnvdimm bus for each pmem-region > node and each address range under the node is converted to a region > within that bus. > > Signed-

Re: [RESEND v2 3/4] doc/devicetree: Persistent memory region bindings

2018-04-03 Thread Dan Williams
On Tue, Apr 3, 2018 at 7:24 AM, Oliver O'Halloran wrote: > Add device-tree binding documentation for the nvdimm region driver. > > Cc: devicet...@vger.kernel.org > Signed-off-by: Oliver O'Halloran > --- > v2: Changed name from nvdimm-region to pmem-region. > Cleaned up the example binding and

Re: [PATCH v9 06/24] mm: make pte_unmap_same compatible with SPF

2018-04-03 Thread Jerome Glisse
On Tue, Mar 13, 2018 at 06:59:36PM +0100, Laurent Dufour wrote: > pte_unmap_same() is making the assumption that the page table are still > around because the mmap_sem is held. > This is no more the case when running a speculative page fault and > additional check must be made to ensure that the fi

Re: [PATCH v3 1/7] powerpc/fadump: Move the metadata region to start of the reserved area.

2018-04-03 Thread Hari Bathini
Mahesh, I think we should explicitly document that production and capture kernel versions should be same. For changes like below, older/newer production kernel vs capture kernel is bound to fail. Of course, production and capture kernel versions would be the same case usually but for the uniniti

Re: [PATCH v9 15/24] mm: Introduce __vm_normal_page()

2018-04-03 Thread Jerome Glisse
On Tue, Mar 13, 2018 at 06:59:45PM +0100, Laurent Dufour wrote: > When dealing with the speculative fault path we should use the VMA's field > cached value stored in the vm_fault structure. > > Currently vm_normal_page() is using the pointer to the VMA to fetch the > vm_flags value. This patch pro

[PATCH v4 00/10] powerpc64/ftrace: Add support for ftrace_modify_call() and a few other fixes

2018-04-03 Thread Naveen N. Rao
This is v4 of the patches posted at: https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg130739.html This series has been tested using mambo for p8 (hash) and p9 (radix). v4 changes: - flip the paca field from 'ftrace_disabled' to 'ftrace_enabled' to signify a default disable policy

[PATCH v4 01/10] powerpc64/ftrace: Add a field in paca to disable ftrace in unsafe code paths

2018-04-03 Thread Naveen N. Rao
We have some C code that we call into from real mode where we cannot take any exceptions. Though the C functions themselves are mostly safe, if these functions are traced, there is a possibility that we may take an exception. For instance, in certain conditions, the ftrace code uses WARN(), which u

[PATCH v4 02/10] powerpc64/ftrace: Disable ftrace during kvm guest entry/exit

2018-04-03 Thread Naveen N. Rao
During guest entry/exit, we switch over to/from the guest MMU context. While doing so, we set our state to KVM_GUEST_MODE_HOST_HV to note down the fact that we cannot take any exceptions in the hypervisor code. Since ftrace may be enabled and since it can result in us taking a trap, disable ftrace

[PATCH v4 03/10] powerpc64/ftrace: Rearrange #ifdef sections in ftrace.h

2018-04-03 Thread Naveen N. Rao
Re-arrange the last #ifdef section in preparation for a subsequent change. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/ftrace.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h index 9

[PATCH v4 04/10] powerpc64/ftrace: Add helpers to hard disable ftrace

2018-04-03 Thread Naveen N. Rao
Add some helpers to enable/disable ftrace through paca->ftrace_enabled. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/ftrace.h | 17 + 1 file changed, 17 insertions(+) diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h index ebfc0b846

[PATCH v4 05/10] powerpc64/ftrace: Delay enabling ftrace on secondary cpus

2018-04-03 Thread Naveen N. Rao
On the boot cpu, though we enable paca->ftrace_enabled in early_setup() (via cpu_ready_for_interrupts()), we don't start tracing until much later since ftrace is not initialized yet and since we only support DYNAMIC_FTRACE on powerpc. However, it is possible that ftrace has been initialized by the

[PATCH v4 06/10] powerpc64/ftrace: Disable ftrace during hotplug

2018-04-03 Thread Naveen N. Rao
Disable ftrace when a cpu is about to go offline. When the cpu is woken up, ftrace will get enabled in start_secondary(). Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/smp.c | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c i

[PATCH v4 07/10] powerpc64/kexec: Hard disable ftrace before switching to the new kernel

2018-04-03 Thread Naveen N. Rao
If function_graph tracer is enabled during kexec, we see the below exception in the simulator: root@(none):/# kexec -e kvm: exiting hardware virtualization kexec_core: Starting new kernel [ 19.262020070,5] OPAL: Switch to big-endian OS kexec: Starting switc

[PATCH v4 08/10] powerpc64/module: Tighten detection of mcount call sites with -mprofile-kernel

2018-04-03 Thread Naveen N. Rao
For R_PPC64_REL24 relocations, we suppress emitting instructions for TOC load/restore in the relocation stub if the relocation is for _mcount() call when using -mprofile-kernel ABI. To detect this, we check if the preceding instructions are per the standard set of instructions emitted by gcc: eith

[PATCH v4 09/10] powerpc64/ftrace: Use the generic version of ftrace_replace_code()

2018-04-03 Thread Naveen N. Rao
Our implementation matches that of the generic version, which also handles FTRACE_UPDATE_MODIFY_CALL. So, remove our implementation in favor of the generic version. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/trace/ftrace.c | 36 1 file changed, 36 d

[PATCH v4 10/10] powerpc64/ftrace: Implement support for ftrace_regs_caller()

2018-04-03 Thread Naveen N. Rao
With -mprofile-kernel, we always save the full register state in ftrace_caller(). While this works, this is inefficient if we're not interested in the register state, such as when we're using the function tracer. Rename the existing ftrace_caller() as ftrace_regs_caller() and provide a simpler imp

Re: [PATCH v9 00/24] Speculative page faults

2018-04-03 Thread Jerome Glisse
On Tue, Mar 13, 2018 at 06:59:30PM +0100, Laurent Dufour wrote: > This is a port on kernel 4.16 of the work done by Peter Zijlstra to > handle page fault without holding the mm semaphore [1]. > > The idea is to try to handle user space page faults without holding the > mmap_sem. This should allow

Re: [PATCH v9 06/24] mm: make pte_unmap_same compatible with SPF

2018-04-03 Thread David Rientjes
On Tue, 3 Apr 2018, Jerome Glisse wrote: > > diff --git a/mm/memory.c b/mm/memory.c > > index 21b1212a0892..4bc7b0bdcb40 100644 > > --- a/mm/memory.c > > +++ b/mm/memory.c > > @@ -2309,21 +2309,29 @@ static bool pte_map_lock(struct vm_fault *vmf) > > * parts, do_swap_page must check under lock b

Re: [PATCH 2/4] libnvdimm: Add device-tree based driver

2018-04-03 Thread kbuild test robot
Hi Oliver, I love your patch! Yet something to improve: [auto build test ERROR on linux-nvdimm/libnvdimm-for-next] [also build test ERROR on v4.16 next-20180403] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day

Re: [PATCH v9 15/24] mm: Introduce __vm_normal_page()

2018-04-03 Thread David Rientjes
On Tue, 3 Apr 2018, Jerome Glisse wrote: > > When dealing with the speculative fault path we should use the VMA's field > > cached value stored in the vm_fault structure. > > > > Currently vm_normal_page() is using the pointer to the VMA to fetch the > > vm_flags value. This patch provides a new

Re: [PATCH v9 06/24] mm: make pte_unmap_same compatible with SPF

2018-04-03 Thread Jerome Glisse
On Tue, Apr 03, 2018 at 01:40:18PM -0700, David Rientjes wrote: > On Tue, 3 Apr 2018, Jerome Glisse wrote: > > > > diff --git a/mm/memory.c b/mm/memory.c > > > index 21b1212a0892..4bc7b0bdcb40 100644 > > > --- a/mm/memory.c > > > +++ b/mm/memory.c > > > @@ -2309,21 +2309,29 @@ static bool pte_map_

Re: [PATCH] cxl: Fix possible deadlock when processing page faults from cxllib

2018-04-03 Thread Frederic Barrat
Le 03/04/2018 à 16:40, Aneesh Kumar K.V a écrit : On 04/03/2018 03:13 PM, Frederic Barrat wrote: cxllib_handle_fault() is called by an external driver when it needs to have the host process page faults for a buffer which may cover several pages. Currently the function holds the mm->mmap_sem se

Re: [PATCH v9 04/24] mm: Prepare for FAULT_FLAG_SPECULATIVE

2018-04-03 Thread David Rientjes
On Wed, 28 Mar 2018, Laurent Dufour wrote: > >> diff --git a/include/linux/mm.h b/include/linux/mm.h > >> index 4d02524a7998..2f3e98edc94a 100644 > >> --- a/include/linux/mm.h > >> +++ b/include/linux/mm.h > >> @@ -300,6 +300,7 @@ extern pgprot_t protection_map[16]; > >> #define FAULT_FLAG_USER

Re: [mm] b1f0502d04: INFO:trying_to_register_non-static_key

2018-04-03 Thread David Rientjes
On Wed, 28 Mar 2018, Laurent Dufour wrote: > On 26/03/2018 00:10, David Rientjes wrote: > > On Wed, 21 Mar 2018, Laurent Dufour wrote: > > > >> I found the root cause of this lockdep warning. > >> > >> In mmap_region(), unmap_region() may be called while vma_link() has not > >> been > >> called.

Re: [mm] b1f0502d04: INFO:trying_to_register_non-static_key

2018-04-03 Thread David Rientjes
On Tue, 3 Apr 2018, David Rientjes wrote: > > >> I found the root cause of this lockdep warning. > > >> > > >> In mmap_region(), unmap_region() may be called while vma_link() has not > > >> been > > >> called. This happens during the error path if call_mmap() failed. > > >> > > >> The only to fix

[RFC 1/2] powerpc/swiotlb: Dont free up allocated SWIOTLB slab on POWER

2018-04-03 Thread Anshuman Khandual
Even though SWIOTLB slab gets allocated and initialized on powerpc with swiotlb_init() called during mem_init(), it gets released away again on POWER platform because 'ppc_swiotlb_enable' never gets set. The function swiotlb_detect_4g() checks for 4GB memory and then sets the variable 'ppc_swiotlb_

[RFC 2/2] powerpc/swiotlb: Make swiotlb_dma_ops available on POWER

2018-04-03 Thread Anshuman Khandual
Generic swiotlb_dma_ops structure is available under CONFIG_DMA_DIRECT_OPS configuration. Hence select it on POWER platform. Signed-off-by: Anshuman Khandual --- arch/powerpc/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 73ce5dd0764

Re: [PATCH 2/2] smp: introduce kick_active_cpus_sync()

2018-04-03 Thread Yury Norov
Hi Mark, Thank you for review. On Tue, Apr 03, 2018 at 02:48:32PM +0100, Mark Rutland wrote: > Hi Yury, > > On Sun, Apr 01, 2018 at 02:11:08PM +0300, Yury Norov wrote: > > +/* > > + * Flush I-cache if CPU is in extended quiescent state > > + */ > > This comment is misleading. An ISB doesn't tou

Re: [PATCH] powerpc: Clear branch trap (MSR.BE) before delivering SIGTRAP

2018-04-03 Thread Michael Ellerman
Matt Evans writes: >> On 28 Mar 2018, at 11:36, Matt Evans wrote: >>> On 28 Mar 2018, at 06:54, Michael Ellerman wrote: >>> Matt Evans writes: When using SIG_DBG_BRANCH_TRACING, MSR.BE is left enabled in the user context when single_step_exception() prepares the SIGTRAP delivery.