[PATCH 25/25] powerpc: Enable pkey subsystem

2017-09-08 Thread Ram Pai
PAPR defines 'ibm,processor-storage-keys' property. It exports two values.The first value indicates the number of data-access keys and the second indicates the number of instruction-access keys. Though this hints that keys can be either data access or instruction access only,that is not the case

[PATCH 24/25] powerpc/ptrace: Add memory protection key regset

2017-09-08 Thread Ram Pai
From: Thiago Jung Bauermann The AMR/IAMR/UAMOR are part of the program context. Allow it to be accessed via ptrace and through core files. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/pkeys.h|5 +++ arch/powerpc/include/uapi/asm/elf.h |1

[PATCH 23/25] powerpc: Deliver SEGV signal on pkey violation

2017-09-08 Thread Ram Pai
The value of the pkey, whose protection got violated, is made available in si_pkey field of the siginfo structure. Also keep the thread's pkey-register fields up2date. Signed-off-by: Ram Pai --- arch/powerpc/kernel/traps.c | 22 ++ 1 files changed, 22 insertions(+), 0 dele

[PATCH 22/25] powerpc: capture the violated protection key on fault

2017-09-08 Thread Ram Pai
Capture the protection key that got violated in paca. This value will be later used to inform the signal handler. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/paca.h |3 +++ arch/powerpc/kernel/asm-offsets.c |5 + arch/powerpc/mm/fault.c | 11 ++- 3 files

[PATCH 21/25] powerpc: introduce get_pte_pkey() helper

2017-09-08 Thread Ram Pai
get_pte_pkey() helper returns the pkey associated with a address corresponding to a given mm_struct. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/mmu-hash.h |5 + arch/powerpc/mm/hash_utils_64.c | 24 2 files changed, 29 insertion

[PATCH 20/25] powerpc: Handle exceptions caused by pkey violation

2017-09-08 Thread Ram Pai
Handle Data and Instruction exceptions caused by memory protection-key. The CPU will detect the key fault if the HPTE is already programmed with the key. However if the HPTE is not hashed, a key fault will not be detected by the hardware. The software will detect pkey violation in such a cas

[PATCH 19/25] powerpc: implementation for arch_vma_access_permitted()

2017-09-08 Thread Ram Pai
This patch provides the implementation for arch_vma_access_permitted(). Returns true if the requested access is allowed by pkey associated with the vma. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mmu_context.h |5 +++- arch/powerpc/mm/pkeys.c| 43 ++

[PATCH 18/25] powerpc: check key protection for user page access

2017-09-08 Thread Ram Pai
Make sure that the kernel does not access user pages without checking their key-protection. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/pgtable.h | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h

[PATCH 17/25] powerpc: helper to validate key-access permissions of a pte

2017-09-08 Thread Ram Pai
helper function that checks if the read/write/execute is allowed on the pte. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/pgtable.h |4 +++ arch/powerpc/include/asm/pkeys.h | 12 +++ arch/powerpc/mm/pkeys.c | 28 ++

[PATCH 16/25] powerpc: Program HPTE key protection bits

2017-09-08 Thread Ram Pai
Map the PTE protection key bits to the HPTE key protection bits, while creating HPTE entries. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/mmu-hash.h |5 + arch/powerpc/include/asm/mmu_context.h|6 ++ arch/powerpc/include/asm/pkeys.h | 13

[PATCH 15/25] powerpc: sys_pkey_mprotect() system call

2017-09-08 Thread Ram Pai
Patch provides the ability for a process to associate a pkey with a address range. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/systbl.h |1 + arch/powerpc/include/asm/unistd.h |4 +--- arch/powerpc/include/uapi/asm/unistd.h |1 + 3 files changed, 3 insertions(+), 3

[PATCH 14/25] powerpc: map vma key-protection bits to pte key bits.

2017-09-08 Thread Ram Pai
map the key protection bits of the vma to the pkey bits in the PTE. The Pte bits used for pkey are 3,4,5,6 and 57. The first four bits are the same four bits that were freed up initially in this patch series. remember? :-) Without those four bits this patch would'nt be possible. BUT, O

[PATCH 13/25] powerpc: implementation for arch_override_mprotect_pkey()

2017-09-08 Thread Ram Pai
arch independent code calls arch_override_mprotect_pkey() to return a pkey that best matches the requested protection. This patch provides the implementation. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mmu_context.h |5 +++ arch/powerpc/include/asm/pkeys.h | 17 ++-

[PATCH 12/25] powerpc: ability to associate pkey to a vma

2017-09-08 Thread Ram Pai
arch-independent code expects the arch to map a pkey into the vma's protection bit setting. The patch provides that ability. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mman.h |8 +++- arch/powerpc/include/asm/pkeys.h | 18 ++ 2 files changed, 25 insertions(

[PATCH 11/25] powerpc: introduce execute-only pkey

2017-09-08 Thread Ram Pai
This patch provides the implementation of execute-only pkey. The architecture-independent layer expects the arch-dependent layer, to support the ability to create and enable a special key which has execute-only permission. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/mmu.h |

[PATCH 10/25] powerpc: store and restore the pkey state across context switches

2017-09-08 Thread Ram Pai
Store and restore the AMR, IAMR and UAMOR register state of the task before scheduling out and after scheduling in, respectively. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/pkeys.h |4 +++ arch/powerpc/include/asm/processor.h |5 arch/powerpc/kernel/process.c|

[PATCH 09/25] powerpc: ability to create execute-disabled pkeys

2017-09-08 Thread Ram Pai
powerpc has hardware support to disable execute on a pkey. This patch enables the ability to create execute-disabled keys. Signed-off-by: Ram Pai --- arch/powerpc/include/uapi/asm/mman.h |6 ++ arch/powerpc/mm/pkeys.c | 16 2 files changed, 22 insertions(+

[PATCH 08/25] powerpc: sys_pkey_alloc() and sys_pkey_free() system calls

2017-09-08 Thread Ram Pai
Finally this patch provides the ability for a process to allocate and free a protection key. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/systbl.h |2 ++ arch/powerpc/include/asm/unistd.h |4 +--- arch/powerpc/include/uapi/asm/unistd.h |2 ++ 3 files changed, 5 inser

[PATCH 07/25] powerpc: implementation for arch_set_user_pkey_access()

2017-09-08 Thread Ram Pai
This patch provides the detailed implementation for a user to allocate a key and enable it in the hardware. It provides the plumbing, but it cannot be used till the system call is implemented. The next patch will do so. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/pkeys.h |9 +++

[PATCH 06/25] powerpc: cleaup AMR, iAMR when a key is allocated or freed

2017-09-08 Thread Ram Pai
cleanup the bits corresponding to a key in the AMR, and IAMR register, when the key is newly allocated/activated or is freed. We dont want some residual bits cause the hardware enforce unintended behavior when the key is activated or freed. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/pke

[PATCH 05/25] powerpc: helper functions to initialize AMR, IAMR and UAMOR registers

2017-09-08 Thread Ram Pai
Introduce helper functions that can initialize the bits in the AMR, IAMR and UAMOR register; the bits that correspond to the given pkey. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/pkeys.h |1 + arch/powerpc/mm/pkeys.c | 46 ++ 2 files

[PATCH 04/25] powerpc: helper function to read, write AMR, IAMR, UAMOR registers

2017-09-08 Thread Ram Pai
Implements helper functions to read and write the key related registers; AMR, IAMR, UAMOR. AMR register tracks the read,write permission of a key IAMR register tracks the execute permission of a key UAMOR register enables and disables a key Signed-off-by: Ram Pai --- arch/powerpc/include/asm/bo

[PATCH 03/25] powerpc: track allocation status of all pkeys

2017-09-08 Thread Ram Pai
Total 32 keys are available on power7 and above. However pkey 0,1 are reserved. So effectively we have 30 pkeys. On 4K kernels, we do not have 5 bits in the PTE to represent all the keys; we only have 3bits.Two of those keys are reserved; pkey 0 and pkey 1. So effectively we have 6 pkeys

[PATCH 02/25] powerpc: define an additional vma bit for protection keys.

2017-09-08 Thread Ram Pai
powerpc needs an additional vma bit to support 32 keys. Till the additional vma bit lands in include/linux/mm.h we have to define it in powerpc specific header file. This is needed to get pkeys working on power. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/pkeys.h | 18 ++

[PATCH 01/25] powerpc: initial pkey plumbing

2017-09-08 Thread Ram Pai
Basic plumbing to initialize the pkey system. Nothing is enabled yet. A later patch will enable it ones all the infrastructure is in place. Signed-off-by: Ram Pai --- arch/powerpc/Kconfig | 16 +++ arch/powerpc/include/asm/mmu_context.h |5 +++ arch/powerp

[PATCH 00/25] powerpc: Memory Protection Keys

2017-09-08 Thread Ram Pai
Memory protection keys enable applications to protect its address space from inadvertent access from or corruption by itself. These patches along with the pte-bit freeing patch series enables the protection key feature on powerpc; 4k and 64k hashpage kernels. A subsequent patch series that chang

[PATCH 7/7] powerpc: capture the PTE format changes in the dump pte report

2017-09-08 Thread Ram Pai
The H_PAGE_F_SECOND,H_PAGE_F_GIX are not in the 64K main-PTE. capture these changes in the dump pte report. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Ram Pai --- arch/powerpc/mm/dump_linuxpagetables.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/mm/

[PATCH 6/7] powerpc: use helper functions to get and set hash slots

2017-09-08 Thread Ram Pai
replace redundant code in __hash_page_4K() and flush_hash_page() with helper functions pte_get_hash_gslot() and pte_set_hash_slot() Reviewed-by: Aneesh Kumar K.V Signed-off-by: Ram Pai --- arch/powerpc/mm/hash64_4k.c | 14 ++ arch/powerpc/mm/hash_utils_64.c | 13 --

[PATCH 5/7] powerpc: Swizzle around 4K PTE bits to free up bit 5 and bit 6

2017-09-08 Thread Ram Pai
We need PTE bits 3 ,4, 5, 6 and 57 to support protection-keys, because these are the bits we want to consolidate on across all configuration to support protection keys. Bit 3,4,5 and 6 are currently used on 4K-pte kernels. But bit 9 and 10 are available. Hence we use the two available bits

[PATCH 4/7] powerpc: Free up four 64K PTE bits in 64K backed HPTE pages

2017-09-08 Thread Ram Pai
Rearrange 64K PTE bits to free up bits 3, 4, 5 and 6 in the 64K backed HPTE pages. This along with the earlier patch will entirely free up the four bits from 64K PTE. The bit numbers are big-endian as defined in the ISA3.0 This patch does the following change to 64K PTE backed by 64K H

[PATCH 3/7] powerpc: Free up four 64K PTE bits in 4K backed HPTE pages

2017-09-08 Thread Ram Pai
Rearrange 64K PTE bits to free up bits 3, 4, 5 and 6, in the 4K backed HPTE pages.These bits continue to be used for 64K backed HPTE pages in this patch, but will be freed up in the next patch. The bit numbers are big-endian as defined in the ISA3.0 The patch does the following change to t

[PATCH 2/7] powerpc: introduce pte_get_hash_gslot() helper

2017-09-08 Thread Ram Pai
Introduce pte_get_hash_gslot()() which returns the slot number of the HPTE in the global hash table. This function will come in handy as we work towards re-arranging the PTE bits in the later patches. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/h

[PATCH 1/7] powerpc: introduce pte_set_hash_slot() helper

2017-09-08 Thread Ram Pai
Introduce pte_set_hash_slot().It sets the (H_PAGE_F_SECOND|H_PAGE_F_GIX) bits at the appropriate location in the PTE of 4K PTE. For 64K PTE, it sets the bits in the second part of the PTE. Though the implementation for the former just needs the slot parameter, it does tak

[PATCH 0/7] powerpc: Free up RPAGE_RSV bits

2017-09-08 Thread Ram Pai
RPAGE_RSV0..4 pte bits are currently used for hpte slot tracking. We need these bits for memory-protection keys. Luckily these four bits are relatively easier to move among all the other candidate bits. For 64K linux-ptes backed by 4k hptes, these bits are used for tracking the

RE: Machine Check in P2010(e500v2)

2017-09-08 Thread Leo Li
> -Original Message- > From: Joakim Tjernlund [mailto:joakim.tjernl...@infinera.com] > Sent: Friday, September 08, 2017 7:51 AM > To: linuxppc-dev@lists.ozlabs.org; Leo Li ; York Sun > > Subject: Re: Machine Check in P2010(e500v2) > > On Fri, 2017-09-08 at 11:54 +0200, Joakim Tjernlund

Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on radix

2017-09-08 Thread Balbir Singh
On Thu, Sep 7, 2017 at 5:21 PM, Benjamin Herrenschmidt wrote: > On Thu, 2017-09-07 at 15:17 +1000, Anton Blanchard wrote: >> Hi, >> >> > There is a similar issue being worked on w.r.t pseries. >> > >> > https://lkml.kernel.org/r/1502357028-27465-1-git-send-email-bhar...@linux.vnet.ibm.com >> > >>

[PATCH V14 4/4] powerpc/vphn: Fix numa update end-loop bug

2017-09-08 Thread Michael Bringmann
powerpc/vphn: On Power systems with shared configurations of CPUs and memory, there are some issues with the association of additional CPUs and memory to nodes when hot-adding resources. This patch fixes an end-of-updates processing problem observed occasionally in numa_update_cpu_topology(). Sig

[PATCH V14 3/4] powerpc/hotplug: Improve responsiveness of hotplug change

2017-09-08 Thread Michael Bringmann
powerpc/hotplug: On Power systems with shared configurations of CPUs and memory, there are some issues with the association of additional CPUs and memory to nodes when hot-adding resources. During hotplug CPU operations, this patch resets the timer on topology update work function to a small value

[PATCH V14 2/4] powerpc/vphn: Improve recognition of PRRN/VPHN

2017-09-08 Thread Michael Bringmann
powerpc/vphn: On Power systems with shared configurations of CPUs and memory, there are some issues with the association of additional CPUs and memory to nodes when hot-adding resources. This patch updates the initialization checks to independently recognize PRRN or VPHN support. Signed-off-by: M

[PATCH V14 1/4] powerpc/vphn: Update CPU topology when VPHN enabled

2017-09-08 Thread Michael Bringmann
powerpc/vphn: On Power systems with shared configurations of CPUs and memory, there are some issues with the association of additional CPUs and memory to nodes when hot-adding resources. This patch corrects the currently broken capability to set the topology for shared CPUs in LPARs. At boot time

[PATCH V14 0/4] powerpc/vphn: Update CPU topology when VPHN enabled

2017-09-08 Thread Michael Bringmann
powerpc/numa: On Power systems with shared configurations of CPUs and memory, there are some issues with the association of additional CPUs and memory to nodes when hot-adding resources. This patch addresses some of those problems. First, it corrects the currently broken capability to set the top

[PATCH v3 20/20] powerpc/mm: Add speculative page fault

2017-09-08 Thread Laurent Dufour
This patch enable the speculative page fault on the PowerPC architecture. This will try a speculative page fault without holding the mmap_sem, if it returns with VM_FAULT_RETRY, the mmap_sem is acquired and the traditional page fault processing is done. Support is only provide for BOOK3S_64 curre

[PATCH v3 19/20] x86/mm: Add speculative pagefault handling

2017-09-08 Thread Laurent Dufour
From: Peter Zijlstra Try a speculative fault before acquiring mmap_sem, if it returns with VM_FAULT_RETRY continue with the mmap_sem acquisition and do the traditional fault. Signed-off-by: Peter Zijlstra (Intel) [Clearing of FAULT_FLAG_ALLOW_RETRY is now done in handle_speculative_fault()] [

[PATCH v3 18/20] perf tools: Add support for the SPF perf event

2017-09-08 Thread Laurent Dufour
Add support for the new speculative faults event. Signed-off-by: Laurent Dufour --- tools/include/uapi/linux/perf_event.h | 1 + tools/perf/util/evsel.c | 1 + tools/perf/util/parse-events.c| 4 tools/perf/util/parse-events.l| 1 + tools/perf/util/python.c

[PATCH v3 17/20] perf: Add a speculative page fault sw event

2017-09-08 Thread Laurent Dufour
Add a new software event to count succeeded speculative page faults. Signed-off-by: Laurent Dufour --- include/uapi/linux/perf_event.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index 140ae638cfd6..101e509ee39b 100644 ---

[PATCH v3 16/20] mm: Adding speculative page fault failure trace events

2017-09-08 Thread Laurent Dufour
This patch a set of new trace events to collect the speculative page fault event failures. Signed-off-by: Laurent Dufour --- include/trace/events/pagefault.h | 87 mm/memory.c | 59 ++- 2 files changed, 135 ins

[PATCH v3 15/20] mm: Try spin lock in speculative path

2017-09-08 Thread Laurent Dufour
There is a deadlock when a CPU is doing a speculative page fault and another one is calling do_unmap(). The deadlock occurred because the speculative path try to spinlock the pte while the interrupt are disabled. When the other CPU in the unmap's path has locked the pte then is waiting for all the

[PATCH v3 14/20] mm: Provide speculative fault infrastructure

2017-09-08 Thread Laurent Dufour
From: Peter Zijlstra Provide infrastructure to do a speculative fault (not holding mmap_sem). The not holding of mmap_sem means we can race against VMA change/removal and page-table destruction. We use the SRCU VMA freeing to keep the VMA around. We use the VMA seqcount to detect change (includi

[PATCH v3 13/20] mm: Introduce __page_add_new_anon_rmap()

2017-09-08 Thread Laurent Dufour
When dealing with speculative page fault handler, we may race with VMA being split or merged. In this case the vma->vm_start and vm->vm_end fields may not match the address the page fault is occurring. This can only happens when the VMA is split but in that case, the anon_vma pointer of the new VM

[PATCH v3 12/20] mm: Introduce __vm_normal_page()

2017-09-08 Thread Laurent Dufour
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 __vm_normal_page() which is receiving the vm_flags flags value

[PATCH v3 11/20] mm: Introduce __maybe_mkwrite()

2017-09-08 Thread Laurent Dufour
The current maybe_mkwrite() is getting passed the pointer to the vma structure to fetch the vm_flags field. When dealing with the speculative page fault handler, it will be better to rely on the cached vm_flags value stored in the vm_fault structure. This patch introduce a __maybe_mkwrite() servi

[PATCH v3 10/20] mm: Introduce __lru_cache_add_active_or_unevictable

2017-09-08 Thread Laurent Dufour
The speculative page fault handler which is run without holding the mmap_sem is calling lru_cache_add_active_or_unevictable() but the vm_flags is not guaranteed to remain constant. Introducing __lru_cache_add_active_or_unevictable() which has the vma flags value parameter instead of the vma pointer

[PATCH v3 09/20] mm/migrate: Pass vm_fault pointer to migrate_misplaced_page()

2017-09-08 Thread Laurent Dufour
migrate_misplaced_page() is only called during the page fault handling so it's better to pass the pointer to the struct vm_fault instead of the vma. This way during the speculative page fault path the saved vma->vm_flags could be used. Signed-off-by: Laurent Dufour --- include/linux/migrate.h |

[PATCH v3 08/20] mm: Protect SPF handler against anon_vma changes

2017-09-08 Thread Laurent Dufour
The speculative page fault handler must be protected against anon_vma changes. This is because page_add_new_anon_rmap() is called during the speculative path. In addition, don't try speculative page fault if the VMA don't have an anon_vma structure allocated because its allocation should be protec

[PATCH v3 07/20] mm: Cache some VMA fields in the vm_fault structure

2017-09-08 Thread Laurent Dufour
When handling speculative page fault, the vma->vm_flags and vma->vm_page_prot fields are read once the page table lock is released. So there is no more guarantee that these fields would not change in our back. They will be saved in the vm_fault structure before the VMA is checked for changes. This

[PATCH v3 06/20] mm: RCU free VMAs

2017-09-08 Thread Laurent Dufour
From: Peter Zijlstra Manage the VMAs with SRCU such that we can do a lockless VMA lookup. We put the fput(vma->vm_file) in the SRCU callback, this keeps files valid during speculative faults, this is possible due to the delayed fput work by Al Viro -- do we need srcu_barrier() in unmount somepla

[PATCH v3 05/20] mm: Protect VMA modifications using VMA sequence count

2017-09-08 Thread Laurent Dufour
The VMA sequence count has been introduced to allow fast detection of VMA modification when running a page fault handler without holding the mmap_sem. This patch provides protection against the VMA modification done in : - madvise() - mremap() - mpol_rebind_policy()

[PATCH v3 04/20] mm: VMA sequence count

2017-09-08 Thread Laurent Dufour
From: Peter Zijlstra Wrap the VMA modifications (vma_adjust/unmap_page_range) with sequence counts such that we can easily test if a VMA is changed. The unmap_page_range() one allows us to make assumptions about page-tables; when we find the seqcount hasn't changed we can assume page-tables are

[PATCH v3 03/20] mm: Introduce pte_spinlock for FAULT_FLAG_SPECULATIVE

2017-09-08 Thread Laurent Dufour
When handling page fault without holding the mmap_sem the fetch of the pte lock pointer and the locking will have to be done while ensuring that the VMA is not touched in our back. So move the fetch and locking operations in a dedicated function. Signed-off-by: Laurent Dufour --- mm/memory.c |

[PATCH v3 02/20] mm: Prepare for FAULT_FLAG_SPECULATIVE

2017-09-08 Thread Laurent Dufour
From: Peter Zijlstra When speculating faults (without holding mmap_sem) we need to validate that the vma against which we loaded pages is still valid when we're ready to install the new PTE. Therefore, replace the pte_offset_map_lock() calls that (re)take the PTL with pte_map_lock() which can fa

[PATCH v3 01/20] mm: Dont assume page-table invariance during faults

2017-09-08 Thread Laurent Dufour
From: Peter Zijlstra One of the side effects of speculating on faults (without holding mmap_sem) is that we can race with free_pgtables() and therefore we cannot assume the page-tables will stick around. Remove the reliance on the pte pointer. Signed-off-by: Peter Zijlstra (Intel) --- mm/memo

[PATCH v3 00/20] Speculative page faults

2017-09-08 Thread Laurent Dufour
This is a port on kernel 4.13 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 better concurrency for massively threaded process since the page fault han

Re: [PATCH v3 00/20] Speculative page faults

2017-09-08 Thread Laurent Dufour
On 08/09/2017 19:32, Laurent Dufour wrote: > This is a port on kernel 4.13 of the work done by Peter Zijlstra to > handle page fault without holding the mm semaphore [1]. Sorry for the noise, I got trouble sending the whole series through this email. I will try again. Cheers, Laurent.

[PATCH v3 01/20] mm: Dont assume page-table invariance during faults

2017-09-08 Thread Laurent Dufour
From: Peter Zijlstra One of the side effects of speculating on faults (without holding mmap_sem) is that we can race with free_pgtables() and therefore we cannot assume the page-tables will stick around. Remove the reliance on the pte pointer. Signed-off-by: Peter Zijlstra (Intel) --- mm/memo

[PATCH v3 00/20] Speculative page faults

2017-09-08 Thread Laurent Dufour
This is a port on kernel 4.13 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 better concurrency for massively threaded process since the page fault han

Re: Machine Check in P2010(e500v2)

2017-09-08 Thread Joakim Tjernlund
On Fri, 2017-09-08 at 11:54 +0200, Joakim Tjernlund wrote: > On Thu, 2017-09-07 at 18:54 +, Leo Li wrote: > > > -Original Message- > > > From: Joakim Tjernlund [mailto:joakim.tjernl...@infinera.com] > > > Sent: Thursday, September 07, 2017 3:41 AM > > > To: linuxppc-dev@lists.ozlabs.org

[PATCH V3] cxl: Add support for POWER9 DD2

2017-09-08 Thread Christophe Lombard
The PSL initialization sequence has been updated to DD2. This patch adapts to the changes, retaining compatibility with DD1. The patch includes some changes to DD1 fix-ups as well. Tests performed on some of the old/new hardware. The function is_page_fault(), for POWER9, lists the Translation Che

Re: [PATCH v3 2/2] cxl: Enable global TLBIs for cxl contexts

2017-09-08 Thread Nicholas Piggin
On Fri, 8 Sep 2017 20:54:02 +1000 Nicholas Piggin wrote: > On Fri, 8 Sep 2017 09:34:39 +0200 > Frederic Barrat wrote: > > > Le 08/09/2017 à 08:56, Nicholas Piggin a écrit : > > > On Sun, 3 Sep 2017 20:15:13 +0200 > > > Frederic Barrat wrote: > > > > > >> The PSL and nMMU need to see al

Re: [PATCH v3 2/2] cxl: Enable global TLBIs for cxl contexts

2017-09-08 Thread Nicholas Piggin
On Fri, 8 Sep 2017 09:34:39 +0200 Frederic Barrat wrote: > Le 08/09/2017 à 08:56, Nicholas Piggin a écrit : > > On Sun, 3 Sep 2017 20:15:13 +0200 > > Frederic Barrat wrote: > > > >> The PSL and nMMU need to see all TLB invalidations for the memory > >> contexts used on the adapter. For the h

Re: [PATCH] ASoC: fsl_ssi: Override bit clock rate based on slot number

2017-09-08 Thread Arnaud Mouiche
On 08/09/2017 07:42, Nicolin Chen wrote: On Thu, Sep 07, 2017 at 10:23:43PM -0700, Nicolin Chen wrote: The set_sysclk() now is used to override the output bit clock rate. But this is not a common way to implement a set_dai_sysclk(). And this creates a problem when a general machine driver (simp

Re: [PATCH v2 2/2] powerpc/powernv/npu: Don't explicitly flush nmmu tlb

2017-09-08 Thread kbuild test robot
-Use-flush_all_mm-instead-of-flush_tlb_mm/20170908-080828 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-allmodconfig (attached as .config) compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705 reproduce: wget https

Re: Machine Check in P2010(e500v2)

2017-09-08 Thread Joakim Tjernlund
On Thu, 2017-09-07 at 18:54 +, Leo Li wrote: > > -Original Message- > > From: Joakim Tjernlund [mailto:joakim.tjernl...@infinera.com] > > Sent: Thursday, September 07, 2017 3:41 AM > > To: linuxppc-dev@lists.ozlabs.org; Leo Li ; York Sun > > > > Subject: Re: Machine Check in P2010(e500

Re: [PATCH v2 00/20] Speculative page faults

2017-09-08 Thread Laurent Dufour
On 21/08/2017 04:26, Sergey Senozhatsky wrote: > Hello, > > On (08/18/17 00:04), Laurent Dufour wrote: >> This is a port on kernel 4.13 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

Unable to handle kernel paging request for unaligned access

2017-09-08 Thread Michal Sojka
Hi all, commit 31bfdb036f12 ("powerpc: Use instruction emulation infrastructure to handle alignment faults", 2017-08-30) breaks my MPC5200B system. Boot log is below. Let me know if you need more information to debug the problem. Best regards, -Michal Sojka Linux version 4.13.0-rc2+ (wsh@steelp

Re: [PATCH] ASoC: fsl_ssi: Override bit clock rate based on slot number

2017-09-08 Thread Łukasz Majewski
Hi Nicolin, On Thu, Sep 07, 2017 at 10:23:43PM -0700, Nicolin Chen wrote: The set_sysclk() now is used to override the output bit clock rate. But this is not a common way to implement a set_dai_sysclk(). And this creates a problem when a general machine driver (simple-card for example) tries to

Re: [PATCH v3 2/2] cxl: Enable global TLBIs for cxl contexts

2017-09-08 Thread Frederic Barrat
Le 08/09/2017 à 08:56, Nicholas Piggin a écrit : On Sun, 3 Sep 2017 20:15:13 +0200 Frederic Barrat wrote: The PSL and nMMU need to see all TLB invalidations for the memory contexts used on the adapter. For the hash memory model, it is done by making all TLBIs global as soon as the cxl drive

Re: [PATCH] powerpc/mm: Fix missing mmap_sem release

2017-09-08 Thread Laurent Dufour
On 07/09/2017 22:51, Davidlohr Bueso wrote: > On Thu, 07 Sep 2017, Laurent Dufour wrote: > >> The commit b5c8f0fd595d ("powerpc/mm: Rework mm_fault_error()") reviewed >> the way the error path is managed in __do_page_fault() but it was a bit too >> agressive when handling a case by returning witho

Re: [RFC PATCH 8/8] powerpc/64s/radix: Only flush local TLB for spurious fault flushes

2017-09-08 Thread Nicholas Piggin
On Fri, 8 Sep 2017 14:44:37 +1000 Nicholas Piggin wrote: > On Fri, 08 Sep 2017 08:05:38 +1000 > Benjamin Herrenschmidt wrote: > > > On Fri, 2017-09-08 at 00:51 +1000, Nicholas Piggin wrote: > > > When permissiveness is relaxed, or found to have been relaxed by > > > another thread, we flush t