Re: powerpc KVM build break in linux-next (was Re: [PATCH tip/core/rcu 40/40] srcu: Parallelize callback handling)

2017-04-21 Thread Paolo Bonzini
On 21/04/2017 06:17, Paul E. McKenney wrote: >> Thanks, this looks perfect to me, and if you're happy to put it on top >> of your tree that would limit the breakage to a smaller history window, >> so that would be ideal. >> >> Tested-by: Michael Ellerman > Thank you, Michael! > > Paolo, does th

[PATCH 0/4] powerpc: Replace some bitops functions by builtin/generic ones

2017-04-21 Thread Christophe Leroy
This patchset replaces the following bitops by builtin/generic ones: - ffs() / __ffs() - fls() / __fls() / fls64() - ffz() - __ilog2() / __ilog2_u32() / __ilog2_u64() The current functions are written as inline assembly which prevents GCC to optimise them in case of constant parameters and obliges

[PATCH 1/4] powerpc: Discard ffs()/__ffs() function and use builtin functions instead

2017-04-21 Thread Christophe Leroy
With the ffs() function as defined in arch/powerpc/include/asm/bitops.h GCC will not optimise the code in case of constant parameter, as shown by the small exemple below. int ffs_test(void) { return 4 << ffs(31); } c0012334 : c0012334: 39 20 00 01 li r9,1 c0012338: 38

[PATCH 2/4] powerpc: Use builtin functions for fls()/__fls()/fls64()

2017-04-21 Thread Christophe Leroy
With the fls() functions as defined in arch/powerpc/include/asm/bitops.h GCC will not optimise the code in case of constant parameter. This patch replaces __fls() by the builtin function, and modifies fls() and fls64() to use builtins instead of inline assembly For non constant calls, the generat

[PATCH 3/4] powerpc: Replace ffz() by equivalent generic function

2017-04-21 Thread Christophe Leroy
With the ffz() function as defined in arch/powerpc/include/asm/bitops.h GCC will not optimise the code in case of constant parameter. This patch replaces ffz() by the generic function. The generic ffz(x) expects to never be called with ~x == 0 as written in the comment in include/asm-generic/bito

[PATCH 4/4] powerpc: remove __ilog2()s and use generic ones

2017-04-21 Thread Christophe Leroy
With the __ilog2() function as defined in arch/powerpc/include/asm/bitops.h, GCC will not optimise the code in case of constant parameter. The generic ilog2() function in include/linux/log2.h is written to handle the case of the constant parameter. This patch discards the three __ilog2() function

Re: [PATCH v5 1/4] printk/nmi: generic solution for safe printk in NMI

2017-04-21 Thread Petr Mladek
On Fri 2017-04-21 10:57:25, Sergey Senozhatsky wrote: > On (04/20/17 15:11), Petr Mladek wrote: > [..] > > void printk_nmi_enter(void) > > { > > - this_cpu_or(printk_context, PRINTK_NMI_CONTEXT_MASK); > > + /* > > +* The size of the extra per-CPU buffer is limited. Use it > > +* only

[PATCH v4 3/7] kprobes: validate the symbol name provided during probe registration

2017-04-21 Thread Naveen N. Rao
When a kprobe is being registered, we use the symbol_name field to lookup the address where the probe should be placed. Since this is a user-provided field, let's ensure that the length of the string is within expected limits. Signed-off-by: Naveen N. Rao --- Masami, Michael, Here's a simplified

[PATCH v4 4/7] powerpc/kprobes: Use safer string functions in kprobe_lookup_name()

2017-04-21 Thread Naveen N. Rao
Convert usage of strchr()/strncpy()/strncat() to strnchr()/memcpy()/strlcat() for simpler and safer string manipulation. Reported-by: David Laight Signed-off-by: Naveen N. Rao --- Changes: Additionally convert the strchr(). arch/powerpc/kernel/kprobes.c | 13 ++--- 1 file changed, 6 i

Re: [PATCH] hwmon: (ibmpowernv) Add min/max attributes and current sensors

2017-04-21 Thread Shilpasri G Bhat
Hi Cedric, On 04/21/2017 05:17 PM, Cédric Le Goater wrote: > Hello Shilpasri, > > On 04/21/2017 06:31 AM, Shilpasri G Bhat wrote: >> Add support for adding min/max values for the inband sensors copied by >> OCC to main memory. And also add current(mA) sensors to the list. >> >> Signed-off-by: Shi

Re: powerpc KVM build break in linux-next (was Re: [PATCH tip/core/rcu 40/40] srcu: Parallelize callback handling)

2017-04-21 Thread Paul E. McKenney
On Fri, Apr 21, 2017 at 09:27:59AM +0200, Paolo Bonzini wrote: > > > On 21/04/2017 06:17, Paul E. McKenney wrote: > >> Thanks, this looks perfect to me, and if you're happy to put it on top > >> of your tree that would limit the breakage to a smaller history window, > >> so that would be ideal. >

[PATCH v2 0/3] powerpc/mm: Fix kernel protection and implement CONFIG_DEBUG_RODATA on PPC32

2017-04-21 Thread Christophe Leroy
This patch set implements CONFIG_DEBUG_RODATA on Powerpc32 after fixing a few issues related to kernel code page protection. Changes in v2: Instead of making the entire kernel RW to patch code in ftrace, we now only change the rights on the page to be modified Christophe Leroy (3): powerpc/

[PATCH v2 1/3] powerpc/mm: Ensure change_page_attr() doesn't invalidate pinned TLBs

2017-04-21 Thread Christophe Leroy
__change_page_attr() uses flush_tlb_page(). flush_tlb_page() uses tlbie instruction, which also invalidates pinned TLBs, which is not what we expect. This patch modifies the implementation to use flush_tlb_kernel_range() instead. This will make use of tlbia which will preserve pinned TLBs. Signed

[PATCH v2 2/3] powerpc/mm: Fix kernel RAM protection after freeing unused memory on PPC32

2017-04-21 Thread Christophe Leroy
As seen below, allthough the init sections have been freed, the associated memory area is still marked as executable in the page tables. ~ dmesg [5.860093] Freeing unused kernel memory: 592K (c057 - c0604000) ~ cat /sys/kernel/debug/kernel_page_tables ---[ Start of kernel VM ]--- 0xc0

[PATCH v2 3/3] powerpc/mm: Implement CONFIG_DEBUG_RODATA on PPC32

2017-04-21 Thread Christophe Leroy
This patch implements CONFIG_DEBUG_RODATA on PPC32. As for CONFIG_DEBUG_PAGEALLOC, it deactivates BAT and LTLB mappings in order to allow page protection setup at the level of each page. As BAT/LTLB mappings are deactivated, their might be performance impact. For this reason, we keep it OFF by de

Re: [PATCH v4 3/7] kprobes: validate the symbol name provided during probe registration

2017-04-21 Thread Paul Clarke
a nit or two, below... On 04/21/2017 07:32 AM, Naveen N. Rao wrote: > diff --git a/kernel/kprobes.c b/kernel/kprobes.c > index 6a128f3a7ed1..ff9b1ac72a38 100644 > --- a/kernel/kprobes.c > +++ b/kernel/kprobes.c > @@ -1383,6 +1383,34 @@ bool within_kprobe_blacklist(unsigned long addr) > } > > /*

Re: [PATCH v4 3/7] kprobes: validate the symbol name provided during probe registration

2017-04-21 Thread Naveen N. Rao
Excerpts from Paul Clarke's message of April 21, 2017 18:41: a nit or two, below... On 04/21/2017 07:32 AM, Naveen N. Rao wrote: diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 6a128f3a7ed1..ff9b1ac72a38 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -1383,6 +1383,34 @@ bool wit

Re: [PATCH v4 4/7] powerpc/kprobes: Use safer string functions in kprobe_lookup_name()

2017-04-21 Thread Paul Clarke
On 04/21/2017 07:33 AM, Naveen N. Rao wrote: > Convert usage of strchr()/strncpy()/strncat() to > strnchr()/memcpy()/strlcat() for simpler and safer string manipulation. > > Reported-by: David Laight > Signed-off-by: Naveen N. Rao > --- > Changes: Additionally convert the strchr(). > > > arch

Re: [PATCH v2 3/3] powerpc/mm: Implement CONFIG_DEBUG_RODATA on PPC32

2017-04-21 Thread Naveen N. Rao
Excerpts from Christophe Leroy's message of April 21, 2017 18:32: This patch implements CONFIG_DEBUG_RODATA on PPC32. As for CONFIG_DEBUG_PAGEALLOC, it deactivates BAT and LTLB mappings in order to allow page protection setup at the level of each page. As BAT/LTLB mappings are deactivated, thei

Re: [PATCH v4 4/7] powerpc/kprobes: Use safer string functions in kprobe_lookup_name()

2017-04-21 Thread Paul Clarke
On 04/21/2017 08:33 AM, Paul Clarke wrote: > On 04/21/2017 07:33 AM, Naveen N. Rao wrote: >> } else if (name[0] != '.') { >> dot_name[0] = '.'; >> dot_name[1] = '\0'; >> -strncat(dot_name, name, KSYM_NAME_LEN - 2); >> +strlcat(dot_name, name, s

Re: [PATCH v2] powerpc/crypto/crct10dif-vpmsum: Fix missing preempt_disable()

2017-04-21 Thread Herbert Xu
On Thu, Apr 20, 2017 at 03:35:09PM +1000, Michael Ellerman wrote: > In crct10dif_vpmsum() we call enable_kernel_altivec() without first > disabling preemption, which is not allowed. > > It used to be sufficient just to call pagefault_disable(), because that > also disabled preemption. But the two

Re: [PATCH v3 3/7] kprobes: validate the symbol name length

2017-04-21 Thread Masami Hiramatsu
On Wed, 19 Apr 2017 16:38:22 + "Naveen N. Rao" wrote: > Excerpts from Masami Hiramatsu's message of April 19, 2017 20:07: > > On Wed, 19 Apr 2017 18:21:02 +0530 > > "Naveen N. Rao" wrote: > > > >> When a kprobe is being registered, we use the symbol_name field to > >> lookup the address whe

Re: [PATCH v3 6/7] powerpc: kprobes: emulate instructions on kprobe handler re-entry

2017-04-21 Thread Masami Hiramatsu
On Thu, 20 Apr 2017 16:11:10 +1000 Michael Ellerman wrote: > "Naveen N. Rao" writes: > > > Excerpts from Masami Hiramatsu's message of April 19, 2017 20:13: > >> > >> BTW, as I pointed, 5/7 and 6/7 should be merged since this actually > >> makes meaningful change. > > > > Yes, sorry if I wasn'

Re: [PATCH v4 4/7] powerpc/kprobes: Use safer string functions in kprobe_lookup_name()

2017-04-21 Thread Paul Clarke
Sent too soon. The suggestions don't guarantee null termination. Refined, below. (Sorry for the noise.) On 04/21/2017 08:33 AM, Paul Clarke wrote: > On 04/21/2017 07:33 AM, Naveen N. Rao wrote: >> Convert usage of strchr()/strncpy()/strncat() to >> strnchr()/memcpy()/strlcat() for simpler and s

Re: [PATCH v4 3/7] kprobes: validate the symbol name provided during probe registration

2017-04-21 Thread Masami Hiramatsu
On Fri, 21 Apr 2017 18:02:33 +0530 "Naveen N. Rao" wrote: > When a kprobe is being registered, we use the symbol_name field to > lookup the address where the probe should be placed. Since this is a > user-provided field, let's ensure that the length of the string is > within expected limits. > >

Linux 4.11: Reported regressions as of Friday, 2017-04-21

2017-04-21 Thread Thorsten Leemhuis
Hi! Find below my fourth regression report for Linux 4.11. It lists 10 regressions I'm currently aware of. 7 regressions mentioned in last weeks report got fixed. As always: Are you aware of any other regressions? Then please let me know (simply CC regressi...@leemhuis.info). And please tell me if

Re: [PATCH] video: console: Remove reference to CONFIG_8xx

2017-04-21 Thread Bartlomiej Zolnierkiewicz
On Friday, April 14, 2017 03:50:04 PM Christophe Leroy wrote: > CONFIG_8xx is deprecated and should soon be removed in favor > of CONFIG_PPC_8xx. > > Signed-off-by: Christophe Leroy Patch queued for 4.12, thanks. Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung El

RE: [PATCH v3 4/7] powerpc: kprobes: use safer string functions in kprobe_lookup_name()

2017-04-21 Thread David Laight
From: Naveen N. Rao > Sent: 19 April 2017 13:51 ... > dot_name[0] = '\0'; > - strncat(dot_name, name, sizeof(dot_name) - 1); > + strlcat(dot_name, name, sizeof(dot_name)); ... Is that really zeroing the first byte just so it can append

Re: [PATCH] hwmon: (ibmpowernv) Add min/max attributes and current sensors

2017-04-21 Thread Cédric Le Goater
Hello Shilpasri, On 04/21/2017 06:31 AM, Shilpasri G Bhat wrote: > Add support for adding min/max values for the inband sensors copied by > OCC to main memory. And also add current(mA) sensors to the list. > > Signed-off-by: Shilpasri G Bhat > --- > drivers/hwmon/ibmpowernv.c | 55 > ++

Applied "ASoC: fsl_asrc_dma: use correct direction enum type" to the asoc tree

2017-04-21 Thread Mark Brown
The patch ASoC: fsl_asrc_dma: use correct direction enum type has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sen

[PATCH 8/8] selftests: x86: override clean in lib.mk to fix warnings

2017-04-21 Thread Shuah Khan
Add override for lib.mk clean to fix the following warnings from clean target run. Makefile:44: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean' Signed-off-by: Shuah Khan --- tools/testing/selftests/x86/Makefile | 3 ++- 1 file changed,

[PATCH 2/8] selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean

2017-04-21 Thread Shuah Khan
Define CLEAN macro to allow Makefiles to override common clean target in lib.mk. This will help fix the following failures: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean' Signed-off-by: Shuah Khan --- tools/testing/selftests/lib.mk |

[PATCH 7/8] selftests: sync: override clean in lib.mk to fix warnings

2017-04-21 Thread Shuah Khan
Add override for lib.mk clean to fix the following warnings from clean target run. Makefile:24: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean' Signed-off-by: Shuah Khan --- tools/testing/selftests/sync/Makefile | 3 ++- 1 file changed

[PATCH 0/8] Fix clean target warnings

2017-04-21 Thread Shuah Khan
This patch series consists of changes to lib.mk to allow overriding common clean target from Makefiles. This fixes warnings when clean overriding and ignoring warnings. Also fixes splice clean target removing a script that runs the test from its clean target. Shuah Khan (8): selftests: splice: f

[PATCH 3/8] selftests: futex: override clean in lib.mk to fix warnings

2017-04-21 Thread Shuah Khan
Add override for lib.mk clean to fix the following warnings from clean target run. Makefile:36: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean' Signed-off-by: Shuah Khan --- tools/testing/selftests/futex/Makefile | 3 ++- 1 file change

[PATCH 4/8] selftests: gpio: override clean in lib.mk to fix warnings

2017-04-21 Thread Shuah Khan
Add override for lib.mk clean to fix the following warnings from clean target run. Makefile:11: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean' Signed-off-by: Shuah Khan --- tools/testing/selftests/gpio/Makefile | 3 ++- 1 file changed

[PATCH 1/8] selftests: splice: fix clean target to not remove default_file_splice_read.sh

2017-04-21 Thread Shuah Khan
splice clean target removes the shell script default_file_splice_read.sh that runs the splice test. Fix it to not remove this file. Signed-off-by: Shuah Khan --- tools/testing/selftests/splice/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/sp

[PATCH 6/8] selftests: splice: override clean in lib.mk to fix warnings

2017-04-21 Thread Shuah Khan
Add override for lib.mk clean to fix the following warnings from clean target run. Makefile:8: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean' Signed-off-by: Shuah Khan --- tools/testing/selftests/splice/Makefile | 3 ++- 1 file change

[PATCH 5/8] selftests: powerpc: override clean in lib.mk to fix warnings

2017-04-21 Thread Shuah Khan
Add override for lib.mk clean to fix the following warnings from clean target run. Makefile:63: warning: overriding recipe for target 'clean' ../lib.mk:55: warning: ignoring old recipe for target 'clean' Signed-off-by: Shuah Khan --- tools/testing/selftests/powerpc/Makefile | 3 ++- 1 file chan

[PATCH] powerpc/64s: use ibm, tlbiel-congruence-classes-(hash|radix) dt property

2017-04-21 Thread Nicholas Piggin
tlbiel instruction with IS!=0 on POWER7 and later Book3s CPUs invalidate TLBs belonging to a specified congruence class. In order to operate on the entire TLB, all congruence classes must be specified, requiring a software loop. This dt property specifies the number of classes that must be operate

Re: [PATCH 2/8] selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean

2017-04-21 Thread Michael Ellerman
Shuah Khan writes: > Define CLEAN macro to allow Makefiles to override common clean target > in lib.mk. This will help fix the following failures: > > warning: overriding recipe for target 'clean' > ../lib.mk:55: warning: ignoring old recipe for target 'clean' > > Signed-off-by: Shuah Khan Shou

Re: [PATCH 4/8] selftests: gpio: override clean in lib.mk to fix warnings

2017-04-21 Thread Michael Ellerman
Shuah Khan writes: > Add override for lib.mk clean to fix the following warnings from clean > target run. > > Makefile:11: warning: overriding recipe for target 'clean' > ../lib.mk:55: warning: ignoring old recipe for target 'clean' > > Signed-off-by: Shuah Khan > --- > tools/testing/selftests/

Re: [PATCH 6/8] selftests: splice: override clean in lib.mk to fix warnings

2017-04-21 Thread Michael Ellerman
Shuah Khan writes: > Add override for lib.mk clean to fix the following warnings from clean > target run. > > Makefile:8: warning: overriding recipe for target 'clean' > ../lib.mk:55: warning: ignoring old recipe for target 'clean' > > Signed-off-by: Shuah Khan > --- > tools/testing/selftests/s

Re: [PATCH 7/8] selftests: sync: override clean in lib.mk to fix warnings

2017-04-21 Thread Michael Ellerman
Shuah Khan writes: > Add override for lib.mk clean to fix the following warnings from clean > target run. > > Makefile:24: warning: overriding recipe for target 'clean' > ../lib.mk:55: warning: ignoring old recipe for target 'clean' > > Signed-off-by: Shuah Khan > --- > tools/testing/selftests/

Re: [PATCH 8/8] selftests: x86: override clean in lib.mk to fix warnings

2017-04-21 Thread Michael Ellerman
Shuah Khan writes: > Add override for lib.mk clean to fix the following warnings from clean > target run. > > Makefile:44: warning: overriding recipe for target 'clean' > ../lib.mk:55: warning: ignoring old recipe for target 'clean' > > Signed-off-by: Shuah Khan > --- > tools/testing/selftests/

Re: [PATCH v4 3/7] kprobes: validate the symbol name provided during probe registration

2017-04-21 Thread Michael Ellerman
"Naveen N. Rao" writes: > When a kprobe is being registered, we use the symbol_name field to > lookup the address where the probe should be placed. Since this is a > user-provided field, let's ensure that the length of the string is > within expected limits. What are we actually trying to protec

Re: [PATCH v2 3/3] powerpc/mm: Implement CONFIG_DEBUG_RODATA on PPC32

2017-04-21 Thread Michael Ellerman
"Naveen N. Rao" writes: > Excerpts from Christophe Leroy's message of April 21, 2017 18:32: >> diff --git a/arch/powerpc/kernel/ftrace.c >> b/arch/powerpc/kernel/ftrace.c >> index 32509de6ce4c..06d2ac53f471 100644 >> --- a/arch/powerpc/kernel/ftrace.c >> +++ b/arch/powerpc/kernel/ftrace.c >> @@ -

Re: powerpc KVM build break in linux-next (was Re: [PATCH tip/core/rcu 40/40] srcu: Parallelize callback handling)

2017-04-21 Thread Michael Ellerman
"Paul E. McKenney" writes: > On Fri, Apr 21, 2017 at 09:27:59AM +0200, Paolo Bonzini wrote: >> On 21/04/2017 06:17, Paul E. McKenney wrote: >> >> Thanks, this looks perfect to me, and if you're happy to put it on top >> >> of your tree that would limit the breakage to a smaller history window, >>

Re: [PATCH] hwmon: (ibmpowernv) Add min/max attributes and current sensors

2017-04-21 Thread Michael Ellerman
Shilpasri G Bhat writes: > On 04/21/2017 05:17 PM, Cédric Le Goater wrote: >> On 04/21/2017 06:31 AM, Shilpasri G Bhat wrote: >>> diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c >>> index 6d2e660..1f329fa8 100644 >>> --- a/drivers/hwmon/ibmpowernv.c >>> +++ b/drivers/hwmon/ibm

Re: [PATCH v2 3/3] powerpc/mm: Implement CONFIG_DEBUG_RODATA on PPC32

2017-04-21 Thread christophe leroy
Le 22/04/2017 à 08:08, Michael Ellerman a écrit : "Naveen N. Rao" writes: Excerpts from Christophe Leroy's message of April 21, 2017 18:32: diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index 32509de6ce4c..06d2ac53f471 100644 --- a/arch/powerpc/kernel/ftrace.c +++