Re: [PATCH 1/3] tools include powerpc: Grab a copy of arch/powerpc/include/uapi/asm/unistd.h

2018-02-16 Thread Ravi Bangoria
Oops.. Really sorry about that. I've tested acme/perf/core on ubuntu ppc32 with and without libaudit-dev and it's working fine. Thank you very much for fixing it, Ravi On 02/16/2018 11:20 PM, Arnaldo Carvalho de Melo wrote: > Em Fri, Feb 16, 2018 at 02:29:01PM -0300, Arnaldo Carvalho de Melo

Re: [PATCH V2] cxl: Fix timebase synchronization status on P9

2018-02-16 Thread Vaibhav Jain
Frederic Barrat writes: > I'm also wondering if it wouldn't be simpler to always update the > timebase_synced flag dynamically, even on p8. That way we wouldn't need > to have the p8 specific code to check for synchronization in > cxl_setup_psl_timebase(). p8 and

Re: [PATCH V2] cxl: Fix timebase synchronization status on P9

2018-02-16 Thread Vaibhav Jain
Frederic Barrat writes: > I'm also wondering if it wouldn't be simpler to always update the > timebase_synced flag dynamically, even on p8. That way we wouldn't need > to have the p8 specific code to check for synchronization in > cxl_setup_psl_timebase(). p8 and

Re: [PATCH V2] cxl: Fix timebase synchronization status on P9

2018-02-16 Thread Frederic Barrat
Le 16/02/2018 à 11:02, Vaibhav Jain a écrit : Frederic Barrat writes: I'm also wondering if it wouldn't be simpler to always update the timebase_synced flag dynamically, even on p8. That way we wouldn't need to have the p8 specific code to check for

Re: [PATCH V2] cxl: Fix timebase synchronization status on P9

2018-02-16 Thread Frederic Barrat
Le 15/02/2018 à 17:52, Christophe Lombard a écrit : The PSL Timebase register is updated by the PSL to maintain the timebase. On P9, the Timebase value is only provided by the CAPP as received the last time a timebase request was performed. The timebase requests are initiated through the

Re: [PATCH v2] cxl: Check if PSL data-cache is available before issue flush request

2018-02-16 Thread Frederic Barrat
Le 15/02/2018 à 16:49, Vaibhav Jain a écrit : PSL9D doesn't have a data-cache that needs to be flushed before resetting the card. However when cxl tries to flush data-cache on such a card, it times-out as PSL_Control register never indicates flush operation complete due to missing data-cache.

[PATCH] ocxl: Fix potential bad errno on irq allocation

2018-02-16 Thread Frederic Barrat
Fix some issues found by a static checker: When allocating an AFU interrupt, if the driver cannot copy the output parameters to userland, the errno value was not set to EFAULT Remove a (now) useless cast. Reported-by: Dan Carpenter Signed-off-by: Frederic Barrat

Re: [PATCH 2/3] rfi-flush: Make it possible to call setup_rfi_flush() again

2018-02-16 Thread Mauricio Faria de Oliveira
Hi Michal and Michael, On 02/15/2018 05:13 AM, Michal Suchánek wrote: From: Michael Ellerman For PowerVM migration we want to be able to call setup_rfi_flush() again after we've migrated the partition. To support that we need to check that we're not trying to allocate the

[PATCH v8 07/24] mm: VMA sequence count

2018-02-16 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

[PATCH v8 10/24] mm: Protect SPF handler against anon_vma changes

2018-02-16 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

[PATCH v8 13/24] mm: Introduce __lru_cache_add_active_or_unevictable

2018-02-16 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

[PATCH v8 08/24] mm: Protect VMA modifications using VMA sequence count

2018-02-16 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() - mpol_rebind_policy() -

[PATCH v8 11/24] mm: Cache some VMA fields in the vm_fault structure

2018-02-16 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.

[PATCH v8 14/24] mm: Introduce __maybe_mkwrite()

2018-02-16 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()

Re: [RFC][PATCH bpf v2 1/2] bpf: allow 64-bit offsets for bpf function calls

2018-02-16 Thread Naveen N. Rao
Daniel Borkmann wrote: On 02/15/2018 05:25 PM, Daniel Borkmann wrote: On 02/13/2018 05:05 AM, Sandipan Das wrote: The imm field of a bpf_insn is a signed 32-bit integer. For JIT-ed bpf-to-bpf function calls, it stores the offset from __bpf_call_base to the start of the callee function. For

Re: [PATCH 1/3] tools include powerpc: Grab a copy of arch/powerpc/include/uapi/asm/unistd.h

2018-02-16 Thread Arnaldo Carvalho de Melo
Em Fri, Feb 16, 2018 at 01:52:45PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Mon, Jan 29, 2018 at 02:04:15PM +0530, Ravi Bangoria escreveu: > > Will be used for generating the syscall id/string translation table. > > > > Signed-off-by: Ravi Bangoria > > ---

Re: [PATCH 1/3] tools include powerpc: Grab a copy of arch/powerpc/include/uapi/asm/unistd.h

2018-02-16 Thread Arnaldo Carvalho de Melo
Em Fri, Feb 16, 2018 at 01:56:16PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Fri, Feb 16, 2018 at 01:52:45PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Mon, Jan 29, 2018 at 02:04:15PM +0530, Ravi Bangoria escreveu: > > > Will be used for generating the syscall id/string translation

[PATCH v8 09/24] mm: protect mremap() against SPF hanlder

2018-02-16 Thread Laurent Dufour
If a thread is remapping an area while another one is faulting on the destination area, the SPF handler may fetch the vma from the RB tree before the pte has been moved by the other thread. This means that the moved ptes will overwrite those create by the page fault handler leading to page leaked.

[PATCH v8 12/24] mm/migrate: Pass vm_fault pointer to migrate_misplaced_page()

2018-02-16 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

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

2018-02-16 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

[PATCH v8 18/24] mm: Provide speculative fault infrastructure

2018-02-16 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

[PATCH v8 21/24] perf tools: Add support for the SPF perf event

2018-02-16 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 +

[PATCH v8 24/24] powerpc/mm: Add speculative page fault

2018-02-16 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. The speculative path is only tried for

[PATCH v8 16/24] mm: Introduce __page_add_new_anon_rmap()

2018-02-16 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

[PATCH v8 17/24] mm: Protect mm_rb tree with a rwlock

2018-02-16 Thread Laurent Dufour
This change is inspired by the Peter's proposal patch [1] which was protecting the VMA using SRCU. Unfortunately, SRCU is not scaling well in that particular case, and it is introducing major performance degradation due to excessive scheduling operations. To allow access to the mm_rb tree without

[PATCH v8 20/24] perf: Add a speculative page fault sw event

2018-02-16 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

[PATCH v8 19/24] mm: Adding speculative page fault failure trace events

2018-02-16 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 | 62

[PATCH V3] cxl: Fix timebase synchronization status on P9

2018-02-16 Thread Christophe Lombard
The PSL Timebase register is updated by the PSL to maintain the timebase. On P9, the Timebase value is only provided by the CAPP as received the last time a timebase request was performed. The timebase requests are initiated through the adapter configuration or application registers. The specific

Re: [PATCH 1/3] tools include powerpc: Grab a copy of arch/powerpc/include/uapi/asm/unistd.h

2018-02-16 Thread Arnaldo Carvalho de Melo
Em Mon, Jan 29, 2018 at 02:04:15PM +0530, Ravi Bangoria escreveu: > Will be used for generating the syscall id/string translation table. > > Signed-off-by: Ravi Bangoria > --- > tools/arch/powerpc/include/uapi/asm/unistd.h | 399 > +++ >

[PATCH v8 23/24] x86/mm: Add speculative pagefault handling

2018-02-16 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

[PATCH v8 22/24] mm: Speculative page fault handler return VMA

2018-02-16 Thread Laurent Dufour
When the speculative page fault handler is returning VM_RETRY, there is a chance that VMA fetched without grabbing the mmap_sem can be reused by the legacy page fault handler. By reusing it, we avoid calling find_vma() again. To achieve, that we must ensure that the VMA structure will not be

[PATCH v8 03/24] powerpc/mm: Define CONFIG_SPECULATIVE_PAGE_FAULT

2018-02-16 Thread Laurent Dufour
Define CONFIG_SPECULATIVE_PAGE_FAULT for BOOK3S_64 and SMP. This enables the Speculative Page Fault handler. Support is only provide for BOOK3S_64 currently because: - require CONFIG_PPC_STD_MMU because checks done in set_access_flags_filter() - require BOOK3S because we can't support for

[PATCH v8 00/24] Speculative page faults

2018-02-16 Thread Laurent Dufour
This is a port on kernel 4.15 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

[PATCH v8 05/24] mm: Introduce pte_spinlock for FAULT_FLAG_SPECULATIVE

2018-02-16 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

Re: [PATCH] powerpc/eeh: Add conditional check on notify_resume

2018-02-16 Thread Mauro Rodrigues
On Thu, Feb 15, 2018 at 12:49:51PM -0600, Bryant G. Ly wrote: > From: "Juan J. Alvarez" > > EEH structure is not populated with function > notify resume when running on systems that do not support > it, i.e: BMC. Hence adding a conditional check for NULL for >

[PATCH v8 01/24] mm: Introduce CONFIG_SPECULATIVE_PAGE_FAULT

2018-02-16 Thread Laurent Dufour
This configuration variable will be used to build the code needed to handle speculative page fault. By default it is turned off, and activated depending on architecture support. Suggested-by: Thomas Gleixner Signed-off-by: Laurent Dufour ---

[PATCH v8 04/24] mm: Prepare for FAULT_FLAG_SPECULATIVE

2018-02-16 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

[PATCH v8 02/24] x86/mm: Define CONFIG_SPECULATIVE_PAGE_FAULT

2018-02-16 Thread Laurent Dufour
Introduce CONFIG_SPECULATIVE_PAGE_FAULT which turns on the Speculative Page Fault handler when building for 64bits with SMP. Cc: Thomas Gleixner Signed-off-by: Laurent Dufour --- arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git

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

2018-02-16 Thread Laurent Dufour
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 final page table are still there. This is now done by calling

[GIT PULL 00/41] perf/core improvements and fixes

2018-02-16 Thread Arnaldo Carvalho de Melo
+0100) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-4.17-20180216 for you to fetch changes up to 21316ac6803d4a1aadd74b896db8d60a92cd1140: perf tests shell lib: Use a wildcard to remove the vfs_getname probe

[PATCH 34/41] perf powerpc: Generate system call table from asm/unistd.h

2018-02-16 Thread Arnaldo Carvalho de Melo
From: Ravi Bangoria This should speed up accessing new system calls introduced with the kernel rather than waiting for libaudit updates to include them. Signed-off-by: Ravi Bangoria Cc: Alexander Shishkin

[PATCH 33/41] tools include powerpc: Grab a copy of arch/powerpc/include/uapi/asm/unistd.h

2018-02-16 Thread Arnaldo Carvalho de Melo
From: Ravi Bangoria Will be used for generating the syscall id/string translation table. Committer notes: Update it already to catch with these csets applied since Ravi first submitted this patch: 3350eb2ea127 powerpc: sys_pkey_mprotect() system call

[PATCH 35/41] perf trace powerpc: Use generated syscall table

2018-02-16 Thread Arnaldo Carvalho de Melo
From: Ravi Bangoria This should speed up accessing new system calls introduced with the kernel rather than waiting for libaudit updates to include them. It also enables users to specify wildcards, for example, perf trace -e 'open*', just like was already

Re: [PATCH 1/3] tools include powerpc: Grab a copy of arch/powerpc/include/uapi/asm/unistd.h

2018-02-16 Thread Arnaldo Carvalho de Melo
Em Fri, Feb 16, 2018 at 02:03:36PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Fri, Feb 16, 2018 at 01:56:16PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Fri, Feb 16, 2018 at 01:52:45PM -0300, Arnaldo Carvalho de Melo escreveu: > > > Em Mon, Jan 29, 2018 at 02:04:15PM +0530, Ravi Bangoria

Re: [PATCH 1/3] tools include powerpc: Grab a copy of arch/powerpc/include/uapi/asm/unistd.h

2018-02-16 Thread Arnaldo Carvalho de Melo
Em Fri, Feb 16, 2018 at 02:08:12PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Fri, Feb 16, 2018 at 02:03:36PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Fri, Feb 16, 2018 at 01:56:16PM -0300, Arnaldo Carvalho de Melo escreveu: > > > Em Fri, Feb 16, 2018 at 01:52:45PM -0300, Arnaldo

Re: [PATCH 1/3] tools include powerpc: Grab a copy of arch/powerpc/include/uapi/asm/unistd.h

2018-02-16 Thread Arnaldo Carvalho de Melo
Em Fri, Feb 16, 2018 at 02:29:01PM -0300, Arnaldo Carvalho de Melo escreveu: > Humm, we need to create two tables, one for 32-bit and another for 64, > even with ppc not having (AFAIK) clashes in syscall numbers for 32/64... > > Trying to do it now. Now seems to work, take a look at my perf/core

[PATCH 21/23] gcc-plugins: move GCC version check for PowerPC to Kconfig

2018-02-16 Thread Masahiro Yamada
For PowerPC, GCC 5.2 is the requirement for GCC plugins. Move the version check to Kconfig, and remove the ugly checker. Signed-off-by: Masahiro Yamada --- arch/powerpc/Kconfig | 2 +- scripts/Makefile.gcc-plugins | 8 2 files changed, 1

[PATCH 00/23] kconfig: move compiler capability tests to Kconfig

2018-02-16 Thread Masahiro Yamada
I brushed up the implementation in this version. In the previous RFC, CC_HAS_ was described by using 'option shell=', like this: config CC_HAS_STACKPROTECTOR bool option shell="$CC -Werror -fstack-protector -c -x c /dev/null" After I thought a bit more, the following syntax is

[PATCH RESEND] powerpc/5200: dts: digsy_mtc.dts: fix rv3029 compatible

2018-02-16 Thread Alexandre Belloni
The proper compatible for rv3029 is microcrystal,rv3029. Acked-by: Anatolij Gustschin Signed-off-by: Alexandre Belloni --- Hi, I'm resending that one because I prefer not taking DT patches through the RTC tree.