Re: [PATCH 05/21] powerpc: Avoid comparison of unsigned long >= 0 in pfn_valid

2018-03-04 Thread Michael Ellerman
Mathieu Malaterre writes: > Rewrite comparison since all values compared are of type `unsigned long`. > > Fix a warning (treated as error in W=1): > > CC arch/powerpc/kernel/irq.o > In file included from ./include/linux/bug.h:5:0, > from

[PATCH 1/2] powerpc/perf: Fix kernel address leak to userspace via BHRB buffer

2018-03-04 Thread Madhavan Srinivasan
The current Branch History Rolling Buffer (BHRB) code does not check for any privilege levels before updating the data from BHRB. This leaks kernel addresses to userspace even when profiling only with userspace privileges. Add proper checks to prevent it. Signed-off-by: Madhavan Srinivasan

[PATCH 2/3] powerpc/perf: Add blacklisted events for power9 dd2.1

2018-03-04 Thread Madhavan Srinivasan
Signed-off-by: Madhavan Srinivasan --- arch/powerpc/perf/power9-events-list.h | 13 + arch/powerpc/perf/power9-pmu.c | 26 ++ 2 files changed, 39 insertions(+) diff --git a/arch/powerpc/perf/power9-events-list.h

Re: [PATCH 03/21] powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused

2018-03-04 Thread Michael Ellerman
Mathieu Malaterre writes: > Re-use the object-like macro EARLYCON_USED_OR_UNUSED to mark > `earlycon_acpi_spcr_enable` as maybe_unused. > > Fix the following warning (treated as error in W=1) > > CC arch/powerpc/kernel/setup-common.o > In file included from

Re: [PATCH 17/21] powerpc: Add missing prototype for sys_debug_setcontext

2018-03-04 Thread Michael Ellerman
Mathieu Malaterre writes: > In commit 81e7009ea46c ("powerpc: merge ppc signal.c and ppc64 signal32.c") > the function sys_debug_setcontext was added without a prototype. > > Fix compilation warning (treated as error in W=1): > > CC arch/powerpc/kernel/signal_32.o >

Re: [PATCH 15/21] powerpc: Add missing prototype for MMU_setup

2018-03-04 Thread Michael Ellerman
Mathieu Malaterre writes: > Add a function declaration for MMU_setup at the beginning of the file to > fix a warning (treated as error in W=1): > > CC kernel/sys.o > arch/powerpc/mm/init_32.c:102:13: error: no previous prototype for > ‘MMU_setup’

[PATCH] powerpc/perf: Fix kernel address leaks via Sampling registers

2018-03-04 Thread Madhavan Srinivasan
From: Michael Ellerman Current code in power_pmu_disable() does not clear the sampling registers like Sampling Instruction Address Register (SAIR) and Sampling Data Address Register (SDAR) after disabling the PMU. Since these are userspace readable and could contain kernel

[PATCH 2/2] powerpc/perf: Fix the kernel address leak to userspace via SDAR

2018-03-04 Thread Madhavan Srinivasan
Sampled Data Address Register (SDAR) is a 64-bit register that contains the effective address of the storage operand of an instruction that was being executed, possibly out-of-order, at or around the time that the Performance Monitor alert occurred. In certain scenario SDAR happen to contain the

[PATCH 1/3] powerpc/perf: Infrastructure to support addition of blacklisted events

2018-03-04 Thread Madhavan Srinivasan
Introduce code to support addition of blacklisted events for a processor version. A 'pointer' and 'int' variable to hold the number of events are added to 'struct power_pmu', along with a generic function to loop through the list to validate the given event. Generic function 'is_event_blacklisted'

[PATCH 3/3] powerpc/perf: Add blacklisted events for power9 dd2.2

2018-03-04 Thread Madhavan Srinivasan
Signed-off-by: Madhavan Srinivasan --- arch/powerpc/perf/power9-events-list.h | 15 +++ arch/powerpc/perf/power9-pmu.c | 22 ++ 2 files changed, 37 insertions(+) diff --git a/arch/powerpc/perf/power9-events-list.h

[PATCH] xmon: Clear all breakpoints when xmon is disabled via debugfs

2018-03-04 Thread Vaibhav Jain
Presently when xmon is disabled by debugfs any existing instruction/data-access breakpoints set are not disabled. This may lead to kernel oops when those breakpoints are hit as the necessary debugger hooks aren't installed. Hence this patch introduces a new function named clear_all_bpt() which is

[PATCH v2] xmon: Setup xmon debugger hooks when first break-point is set

2018-03-04 Thread Vaibhav Jain
Presently sysrq key for xmon('x') is registered during kernel init irrespective of the value of kernel param 'xmon'. Thus xmon is enabled even if 'xmon=off' is passed on the kernel command line. However this doesn't enable the kernel debugger hooks needed for instruction or data breakpoints. Thus

Re: [PATCH] xmon: Clear all breakpoints when xmon is disabled via debugfs

2018-03-04 Thread Balbir Singh
On Mon, Mar 5, 2018 at 4:31 AM, Vaibhav Jain wrote: > Presently when xmon is disabled by debugfs any existing > instruction/data-access breakpoints set are not disabled. This may > lead to kernel oops when those breakpoints are hit as the necessary > debugger hooks

Re: [PATCH v2] xmon: Setup xmon debugger hooks when first break-point is set

2018-03-04 Thread Balbir Singh
On Mon, Mar 5, 2018 at 4:30 AM, Vaibhav Jain wrote: > Presently sysrq key for xmon('x') is registered during kernel init > irrespective of the value of kernel param 'xmon'. Thus xmon is enabled > even if 'xmon=off' is passed on the kernel command line. However this >

Re: [PATCH v3 02/10] include: Move compat_timespec/ timeval to compat_time.h

2018-03-04 Thread Helge Deller
On 16.01.2018 03:18, Deepa Dinamani wrote: > All the current architecture specific defines for these > are the same. Refactor these common defines to a common > header file. > > The new common linux/compat_time.h is also useful as it > will eventually be used to hold all the defines that > are

Re: [PATCH 05/21] powerpc: Avoid comparison of unsigned long >= 0 in pfn_valid

2018-03-04 Thread christophe leroy
Le 04/03/2018 à 11:55, Michael Ellerman a écrit : Mathieu Malaterre writes: Rewrite comparison since all values compared are of type `unsigned long`. Fix a warning (treated as error in W=1): CC arch/powerpc/kernel/irq.o In file included from

Re: [PATCH] KVM: PPC: Book3S HV: Fix guest time accounting with VIRT_CPU_ACCOUNTING_GEN

2018-03-04 Thread Paul Mackerras
On Fri, Mar 02, 2018 at 11:51:56AM +0100, Laurent Vivier wrote: > Since commit 8b24e69fc47e ("KVM: PPC: Book3S HV: Close race with testing > for signals on guest entry"), if CONFIG_VIRT_CPU_ACCOUNTING_GEN is set, the > guest time is not accounted to guest time and user time, but instead to >

Re: [PATCH 3/3] powerpc/64s/idle: POWER9 ESL=0 stop avoid save/restore overhead

2018-03-04 Thread Paul Mackerras
On Thu, Mar 01, 2018 at 09:57:34PM +1000, Nicholas Piggin wrote: > On Thu, 1 Mar 2018 00:04:39 +0530 > Vaidyanathan Srinivasan wrote: > > > * Nicholas Piggin [2017-11-18 00:08:07]: [snip] > > > diff --git a/arch/powerpc/platforms/powernv/idle.c > >

Re: [PATCH 1/2] powerpc/perf: Fix kernel address leak to userspace via BHRB buffer

2018-03-04 Thread Balbir Singh
On Sun, Mar 4, 2018 at 10:55 PM, Madhavan Srinivasan wrote: > The current Branch History Rolling Buffer (BHRB) code does > not check for any privilege levels before updating the data > from BHRB. This leaks kernel addresses to userspace even when > profiling only with

Re: [PATCH AUTOSEL for 4.9 005/219] kretprobes: Ensure probe location is at function entry

2018-03-04 Thread Naveen N. Rao
Hi Sasha, Sasha Levin wrote: From: "Naveen N. Rao" [ Upstream commit 90ec5e89e393c76e19afc845d8f88a5dc8315919 ] Sorry if this is obvious, but why was this patch picked up for -stable? I don't see the upstream commit tagging -stable, so curious why this

[PATCH V2 15/27] cpufreq: powernv: Don't validate the frequency table twice

2018-03-04 Thread Viresh Kumar
The cpufreq core is already validating the CPU frequency table after calling the ->init() callback of the cpufreq drivers and the drivers don't need to do the same anymore. Though they need to set the policy->freq_table field directly from the ->init() callback now. Stop validating the frequency