Re: [PATCH 07/14] powerpc: Add support for restartable sequences

2018-05-28 Thread Mathieu Desnoyers
- On May 24, 2018, at 3:03 AM, Michael Ellerman m...@ellerman.id.au wrote: > Mathieu Desnoyers writes: >> - On May 23, 2018, at 4:14 PM, Mathieu Desnoyers >> mathieu.desnoy...@efficios.com wrote: > ... >>> >>> Hi Boqun, >>> >>> I tried your patch in a ppc64 le environment, and it does n

Re: [PATCH v11 00/26] Speculative page faults

2018-05-28 Thread Laurent Dufour
On 28/05/2018 07:23, Song, HaiyanX wrote: > > Some regression and improvements is found by LKP-tools(linux kernel > performance) on V9 patch series > tested on Intel 4s Skylake platform. Hi, Thanks for reporting this benchmark results, but you mentioned the "V9 patch series" while responding to

Re: [PATCH v11 00/26] Speculative page faults

2018-05-28 Thread Haiyan Song
Hi Laurent, Yes, these tests are done on V9 patch. Best regards, Haiyan Song On Mon, May 28, 2018 at 09:51:34AM +0200, Laurent Dufour wrote: > On 28/05/2018 07:23, Song, HaiyanX wrote: > > > > Some regression and improvements is found by LKP-tools(linux kernel > > performance) on V9 patch ser

Re: [PATCH v11 00/26] Speculative page faults

2018-05-28 Thread Laurent Dufour
On 28/05/2018 10:22, Haiyan Song wrote: > Hi Laurent, > > Yes, these tests are done on V9 patch. Do you plan to give this V11 a run ? > > > Best regards, > Haiyan Song > > On Mon, May 28, 2018 at 09:51:34AM +0200, Laurent Dufour wrote: >> On 28/05/2018 07:23, Song, HaiyanX wrote: >>> >>> Some

Re: [PATCH 2/2] powerpc/mm/radix: Change pte relax sequence to handle nest MMU hang

2018-05-28 Thread Nicholas Piggin
On Fri, 25 May 2018 21:19:17 +0530 "Aneesh Kumar K.V" wrote: > When relaxing access (read -> read_write update), pte need to be marked > invalid > to handle a nest MMU bug. We also need to do a tlb flush after the pte is > marked invalid before updating the pte with new access bits. > > We also

Re: [PATCH] powerpc/mm/hugetlb: Use the correct page size when flushing hugepage tlb

2018-05-28 Thread Nicholas Piggin
On Tue, 22 May 2018 14:42:09 +0530 "Aneesh Kumar K.V" wrote: > We used wrong page size (mmu_virtual_psize) when doing a tlbflush after > pte update. This patch update the flush to use hugetlb page size. > The page size is derived from hugetlb hstate. > > Now that ptep_set_access_flags won't be c

[PATCH v5 0/3] powerpc/lib: Optimisation of memcmp() and __clear_user() for PPC32

2018-05-28 Thread Christophe Leroy
This serie intends to optimise memcmp() and __clear_user() for PPC32 in the same spirit as already done on PPC64. The first patch moves PPC32 specific functions from string.S into a dedicated file named string_32.S The second patch rewrites __clear_user() by using dcbz intruction The third patch r

[PATCH v5 1/3] powerpc/lib: move PPC32 specific functions out of string.S

2018-05-28 Thread Christophe Leroy
In preparation of optimisation patches, move PPC32 specific memcmp() and __clear_user() into string_32.S Signed-off-by: Christophe Leroy --- arch/powerpc/lib/Makefile| 5 +-- arch/powerpc/lib/string.S| 61 - arch/powerpc/lib/string_32.S | 72 +

[PATCH v5 2/3] powerpc/lib: optimise 32 bits __clear_user()

2018-05-28 Thread Christophe Leroy
Rewrite clear_user() on the same principle as memset(0), making use of dcbz to clear complete cache lines. This code is a copy/paste of memset(), with some modifications in order to retrieve remaining number of bytes to be cleared, as it needs to be returned in case of error. On a MPC885, through

[PATCH v5 3/3] powerpc/lib: optimise PPC32 memcmp

2018-05-28 Thread Christophe Leroy
At the time being, memcmp() compares two chunks of memory byte per byte. This patch optimises the comparison by comparing word by word. A small benchmark performed on an 8xx comparing two chuncks of 512 bytes performed 10 times gives: Before : 5852274 TB ticks After: 1488638 TB ticks This

Re: [PATCH v6 1/4] powerpc/64: Align bytes before fall back to .Lshort in powerpc64 memcmp()

2018-05-28 Thread Segher Boessenkool
On Fri, May 25, 2018 at 12:07:33PM +0800, wei.guo.si...@gmail.com wrote: > _GLOBAL(memcmp) > cmpdi cr1,r5,0 > > - /* Use the short loop if both strings are not 8B aligned */ > - or r6,r3,r4 > + /* Use the short loop if the src/dst addresses are not > + * with the sa

RE: [PATCH v11 00/26] Speculative page faults

2018-05-28 Thread Wang, Kemi
Full run would take one or two weeks depended on our resource available. Could you pick some ones up, e.g. those have performance regression? -Original Message- From: owner-linux...@kvack.org [mailto:owner-linux...@kvack.org] On Behalf Of Laurent Dufour Sent: Monday, May 28, 2018 4:55 PM

Re: [PATCH v6 2/4] powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision

2018-05-28 Thread Segher Boessenkool
On Fri, May 25, 2018 at 12:07:34PM +0800, wei.guo.si...@gmail.com wrote: > + /* save and restore cr0 */ > + mfocrf r5,64 > + EXIT_VMX_OPS > + mtocrf 64,r5 > + b .LcmpAB_lightweight That's cr1, not cr0. You can use mcrf instead, it is cheaper (esp. if you have it in a n

Re: [PATCH] sound: Use octal not symbolic permissions

2018-05-28 Thread Takashi Iwai
On Wed, 23 May 2018 21:20:59 +0200, Joe Perches wrote: > > Convert the S_ symbolic permissions to their octal equivalents as > using octal and not symbolic permissions is preferred by many as more > readable. > > see: https://lkml.org/lkml/2016/8/2/1945 > > Done with automated conversion via: >

Re: [PATCH v6 2/4] powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision

2018-05-28 Thread Michael Ellerman
Hi Simon, wei.guo.si...@gmail.com writes: > diff --git a/arch/powerpc/lib/memcmp_64.S b/arch/powerpc/lib/memcmp_64.S > index f20e883..4ba7bb6 100644 > --- a/arch/powerpc/lib/memcmp_64.S > +++ b/arch/powerpc/lib/memcmp_64.S > @@ -174,6 +235,13 @@ _GLOBAL(memcmp) > blr > > .Llong: > +#ifdef

[PATCH v2] powerpc/32: implement strlen() in assembly

2018-05-28 Thread Christophe Leroy
The generic implementation of strlen() reads strings byte per byte. This patch implements strlen() in assembly for PPC32 based on a read of entire words, in the same spirit as what some other arches and glibc do. For long strings, the time spent in strlen is reduced by 50-60% Signed-off-by: Chri

Re: [PATCH] powerpc/64s: Clear PCR on boot

2018-05-28 Thread Benjamin Herrenschmidt
On Sat, 2018-05-26 at 20:45 -0700, Guenter Roeck wrote: > > I already have a patch, or at least one that does the trick for me. > Getting qemu patched was not the problem. I just want to be sure that > the problem is indeed a qemu problem. Hey Guenter ! It's not quite the right patch though. The

[PATCH] powerpc/Makefile: fix build failure by disabling attribute-alias warning

2018-05-28 Thread Christophe Leroy
Latest GCC version emit many warnings similar to the following one. As arch/powerpc code is built with -Werror, this breaks build with GCC 8.1 This patch inhibits that warning Signed-off-by: Christophe Leroy --- arch/powerpc/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/p

Re: [PATCH] powerpc/Makefile: fix build failure by disabling attribute-alias warning

2018-05-28 Thread Segher Boessenkool
On Mon, May 28, 2018 at 02:17:49PM +, Christophe Leroy wrote: > Latest GCC version emit many warnings similar to the following one. You didn't actually show an example? This warning should detect serious problems, so don't disable it without first investigating please. What do you call "late

Re: [PATCH] powerpc/Makefile: fix build failure by disabling attribute-alias warning

2018-05-28 Thread Christophe Leroy
On 05/28/2018 02:17 PM, Christophe Leroy wrote: Latest GCC version emit many warnings similar to the following one. Oops, forgot to include the failure text: In file included from arch/powerpc/kernel/syscalls.c:24: ./include/linux/syscalls.h:233:18: warning: 'sys_mmap2' alias between functi

Re: [PATCH] powerpc/Makefile: fix build failure by disabling attribute-alias warning

2018-05-28 Thread Christophe LEROY
Le 28/05/2018 à 16:37, Segher Boessenkool a écrit : On Mon, May 28, 2018 at 02:17:49PM +, Christophe Leroy wrote: Latest GCC version emit many warnings similar to the following one. You didn't actually show an example? Yes I forgot: In file included from arch/powerpc/kernel/syscalls.c

Re: [PATCH] powerpc/Makefile: fix build failure by disabling attribute-alias warning

2018-05-28 Thread Segher Boessenkool
On Mon, May 28, 2018 at 02:39:37PM +, Christophe Leroy wrote: > In file included from arch/powerpc/kernel/syscalls.c:24: > ./include/linux/syscalls.h:233:18: warning: 'sys_mmap2' alias between > functions of incompatible types 'long int(long unsigned int, size_t, > long unsigned int, long u

[PATCH] powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2018-05-28 Thread Michal Suchanek
We now have barrier_nospec as mitigation so print it in cpu_show_spectre_v1 when enabled. Signed-off-by: Michal Suchanek --- arch/powerpc/kernel/security.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c ind

Re: [PATCH] powerpc/Makefile: fix build failure by disabling attribute-alias warning

2018-05-28 Thread Mathieu Malaterre
On Mon, May 28, 2018 at 5:07 PM, Segher Boessenkool wrote: > On Mon, May 28, 2018 at 02:39:37PM +, Christophe Leroy wrote: >> In file included from arch/powerpc/kernel/syscalls.c:24: >> ./include/linux/syscalls.h:233:18: warning: 'sys_mmap2' alias between >> functions of incompatible types 'lo

[PATCH] powerpc/64: Fix build failure with GCC 8.1

2018-05-28 Thread Christophe Leroy
CC arch/powerpc/kernel/nvram_64.o arch/powerpc/kernel/nvram_64.c: In function 'nvram_create_partition': arch/powerpc/kernel/nvram_64.c:1042:2: error: 'strncpy' specified bound 12 equals destination size [-Werror=stringop-truncation] strncpy(new_part->header.name, name, 12); ^~~~

[PATCH] cpuidle/powernv : Add Description for cpuidle state

2018-05-28 Thread Abhishek Goel
Names of cpuidle states were being used for description of states in POWER as no descriptions were added in device tree. This patch reads description for idle states which have been added in device tree. The description for idle states in case of POWER can be printed using "cpupower monitor -l" or

Re: [PATCH][RFC] [powerpc] arch_ptrace() uses of access_ok() are pointless

2018-05-28 Thread Mathieu Malaterre
On Mon, May 28, 2018 at 12:34 AM, Al Viro wrote: > make it use copy_{from,to}_user(), rather than access_ok() + > __copy_... > > Signed-off-by: Al Viro > --- > arch/powerpc/kernel/ptrace.c | 22 +++--- > 1 file changed, 7 insertions(+), 15 deletions(-) > > diff --git a/arch/power

Re: [PATCH][RFC] [powerpc] arch_ptrace() uses of access_ok() are pointless

2018-05-28 Thread Al Viro
> Maybe this is just an RFC, but: > > CALL../arch/powerpc/kernel/systbl_chk.sh > ../arch/powerpc/kernel/ptrace.c: In function ‘arch_ptrace’: > ../arch/powerpc/kernel/ptrace.c:3086:4: error: expected ‘)’ before ‘return’ > return -EFAULT; > ^~ and the same a few lines later. Wh

Re: [PATCH] powerpc/64: Fix build failure with GCC 8.1

2018-05-28 Thread Benjamin Herrenschmidt
On Mon, 2018-05-28 at 16:37 +, Christophe Leroy wrote: > CC arch/powerpc/kernel/nvram_64.o > arch/powerpc/kernel/nvram_64.c: In function 'nvram_create_partition': > arch/powerpc/kernel/nvram_64.c:1042:2: error: 'strncpy' specified bound 12 > equals destination size [-Werror=stringop-tru

[PATCH v2] selftests/powerpc: Add perf breakpoint test

2018-05-28 Thread Michael Neuling
This tests perf hardware breakpoints (ie PERF_TYPE_BREAKPOINT) on powerpc. Signed-off-by: Michael Neuling --- v2: - fix failure noticed by mpe - rewrite to explicitly test all options (rather than randomly) --- .../selftests/powerpc/ptrace/.gitignore | 1 + .../testing/selftests/powe

Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices

2018-05-28 Thread Benjamin Herrenschmidt
On Fri, 2018-05-25 at 20:45 +0300, Michael S. Tsirkin wrote: > On Thu, May 24, 2018 at 08:27:04AM +1000, Benjamin Herrenschmidt wrote: > > On Wed, 2018-05-23 at 21:50 +0300, Michael S. Tsirkin wrote: > > > > > I re-read that discussion and I'm still unclear on the > > > original question, since I

Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices

2018-05-28 Thread Benjamin Herrenschmidt
On Tue, 2018-05-29 at 09:48 +1000, Benjamin Herrenschmidt wrote: > > Well it's not supposed to be much slower for the static case. > > > > vhost has a cache so should be fine. > > > > A while ago Paolo implemented a translation cache which should be > > perfect for this case - most of the code go

Re: [PATCH-RESEND] cxl: Disable prefault_mode in Radix mode

2018-05-28 Thread Michael Ellerman
Vaibhav Jain writes: > From: Vaibhav Jain > > Currently we see a kernel-oops reported on Power-9 while attaching a > context to an AFU, with radix-mode and sysfs attr 'prefault_mode' set > to anything other than 'none'. The backtrace of the oops is of this > form: > > Unable to handle kernel pag

Re: [PATCH] powerpc/mm/hugetlb: Use the correct page size when flushing hugepage tlb

2018-05-28 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: > We used wrong page size (mmu_virtual_psize) when doing a tlbflush after > pte update. This patch update the flush to use hugetlb page size. > The page size is derived from hugetlb hstate. This sounds bad. Or is it not for some reason? Either way a Fixes tag would be

Re: [PATCH] cpuidle/powernv : Add Description for cpuidle state

2018-05-28 Thread Stewart Smith
Abhishek Goel writes: > @@ -215,7 +216,7 @@ static inline void add_powernv_state(int index, const > char *name, >u64 psscr_val, u64 psscr_mask) > { > strlcpy(powernv_states[index].name, name, CPUIDLE_NAME_LEN); > - strlcpy(powernv_states[index].desc,

[PATCH] printk: make printk_safe_flush safe in NMI context

2018-05-28 Thread Hoeun Ryu
From: Hoeun Ryu Make printk_safe_flush() safe in NMI context. And printk_safe_flush_on_panic() is folded into this function. The prototype of printk_safe_flush() is changed to "void printk_safe_flush(bool panic)". nmi_trigger_cpumask_backtrace() can be called in NMI context. For example the f

Re: [PATCH-RESEND] cxl: Disable prefault_mode in Radix mode

2018-05-28 Thread Vaibhav Jain
Michael Ellerman writes: > Vaibhav Jain writes: > >> From: Vaibhav Jain >> >> Currently we see a kernel-oops reported on Power-9 while attaching a >> context to an AFU, with radix-mode and sysfs attr 'prefault_mode' set >> to anything other than 'none'. The backtrace of the oops is of this >> f

Re: [PATCH] powerpc/mm/hugetlb: Use the correct page size when flushing hugepage tlb

2018-05-28 Thread Nicholas Piggin
On Tue, 29 May 2018 11:33:56 +1000 Michael Ellerman wrote: > "Aneesh Kumar K.V" writes: > > > We used wrong page size (mmu_virtual_psize) when doing a tlbflush after > > pte update. This patch update the flush to use hugetlb page size. > > The page size is derived from hugetlb hstate. > > Th

Re: [PATCH] powerpc/mm/hugetlb: Use the correct page size when flushing hugepage tlb

2018-05-28 Thread Aneesh Kumar K.V
On 05/29/2018 07:39 AM, Nicholas Piggin wrote: On Tue, 29 May 2018 11:33:56 +1000 Michael Ellerman wrote: "Aneesh Kumar K.V" writes: We used wrong page size (mmu_virtual_psize) when doing a tlbflush after pte update. This patch update the flush to use hugetlb page size. The page size is der

[PATCH v2] powerpc/64: Fix build failure with GCC 8.1

2018-05-28 Thread Christophe Leroy
CC arch/powerpc/kernel/nvram_64.o arch/powerpc/kernel/nvram_64.c: In function 'nvram_create_partition': arch/powerpc/kernel/nvram_64.c:1042:2: error: 'strncpy' specified bound 12 equals destination size [-Werror=stringop-truncation] strncpy(new_part->header.name, name, 12); ^~~~

[PATCH] powerpc64/module elfv1: Set opd addresses after module relocation

2018-05-28 Thread Naveen N. Rao
module_frob_arch_sections() is called before the module is moved to its final location. The function descriptor section addresses we are setting here are thus invalid. Fix this by processing opd section during module_finalize() Fixes: 5633e85b2c313 ("powerpc64: Add .opd based function descriptor

[PATCH v2] powerpc: fix build failure by disabling attribute-alias warning

2018-05-28 Thread Christophe Leroy
Latest GCC version emit the following warnings As arch/powerpc code is built with -Werror, this breaks build with GCC 8.1 This patch inhibits those warnings CC arch/powerpc/kernel/syscalls.o In file included from arch/powerpc/kernel/syscalls.c:24: ./include/linux/syscalls.h:233:18: error: