Re: [RFC PATCH 9/9] powerpc: rewrite local_t using soft_irq

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 20:22:22 +0530 Madhavan Srinivasan wrote: > https://lkml.org/lkml/2008/12/16/450 > > Modifications to Rusty's benchmark code: > - Executed only local_t test > > Here are the values with the patch. > > Time in ns per iteration > > Local_t

Re: [RFC PATCH 8/9] powerpc: Support to replay PMIs

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 20:22:21 +0530 Madhavan Srinivasan wrote: > Code to replay the Performance Monitoring Interrupts(PMI). > In the masked_interrupt handler, for PMIs we reset the MSR[EE] > and return. This is due the fact that PMIs are level triggered. > In the

Re: [RFC PATCH 7/9] powerpc: Add support to mask perf interrupts

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 20:22:20 +0530 Madhavan Srinivasan wrote: > To support masking of the PMI interrupts, couple of new interrupt > handler macros are added MASKABLE_EXCEPTION_PSERIES_OOL and > MASKABLE_RELON_EXCEPTION_PSERIES_OOL. These are needed to include the >

Re: [RFC PATCH 6/9] powerpc: modify __SOFTEN_TEST to support tri-state soft_enabled flag

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 20:22:19 +0530 Madhavan Srinivasan wrote: > Foundation patch to support checking of new flag for > "paca->soft_enabled". Modify the condition checking for the > "soft_enabled" from "equal" to "greater than or equal to". Rather than a "tri-state" and

Re: [PATCH] powernv/pci: Add PHB register dump debugfs handle

2016-07-25 Thread Russell Currey
On Tue, 2016-07-26 at 11:45 +1000, Michael Ellerman wrote: > Quoting Russell Currey (2016-07-22 15:23:36) > > > > On EEH events the kernel will print a dump of relevant registers. > > If EEH is unavailable (i.e. CONFIG_EEH is disabled, a new platform > > doesn't have EEH support, etc) this

Re: [RFC PATCH 5/9] powerpc: reverse the soft_enable logic

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 20:22:18 +0530 Madhavan Srinivasan wrote: > "paca->soft_enabled" is used as a flag to mask some of interrupts. > Currently supported flags values and their details: > > soft_enabled MSR[EE] > > 0 0 Disabled (PMI

[PATCH 2/2] powerpc/64: Do load of PACAKBASE in LOAD_HANDLER

2016-07-25 Thread Michael Ellerman
The LOAD_HANDLER macro requires that you have previously loaded "reg" with PACAKBASE. Although that gives callers flexibility to get PACAKBASE in some interesting way, none of the callers actually do that. So fold the load of PACAKBASE into the macro, making it simpler for callers to use

[PATCH 1/2] powerpc/64: Correct comment on LOAD_HANDLER()

2016-07-25 Thread Michael Ellerman
The comment for LOAD_HANDLER() was wrong. The part about kdump has not been true since 1f6a93e4c35e ("powerpc: Make it possible to move the interrupt handlers away from the kernel"). Describe how it currently works, and combine the two separate comments into one. Signed-off-by: Michael Ellerman

Re: [RFC PATCH 1/9] Add #defs for paca->soft_enabled flags

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 20:22:14 +0530 Madhavan Srinivasan wrote: > Two #defs LAZY_INTERRUPT_ENABLED and > LAZY_INTERRUPT_DISABLED are added to be used > when updating paca->soft_enabled. This is a very nice patchset, but can this not be a new name? We use "soft

Re: [PATCH v3 02/11] mm: Hardened usercopy

2016-07-25 Thread Kees Cook
On Mon, Jul 25, 2016 at 7:03 PM, Michael Ellerman wrote: > Josh Poimboeuf writes: > >> On Thu, Jul 21, 2016 at 11:34:25AM -0700, Kees Cook wrote: >>> On Wed, Jul 20, 2016 at 11:52 PM, Michael Ellerman >>> wrote: >>> > Kees Cook

[PATCH] powerpc: sgy_cts1000: Fix gpio_halt_cb()'s signature

2016-07-25 Thread Andrey Smirnov
Halt callback in struct machdep_calls is declared with __noreturn attribute, so omitting that attribute in gpio_halt_cb()'s signatrue results in compilation error. Change the signature to address the problem as well as change the code of the function to avoid ever returning from the function.

[PATCH 2/2] powerpc: e8248e: Select PHYLIB only if NETDEVICES is enabled

2016-07-25 Thread Andrey Smirnov
Select PHYLIB only if NETDEVICES is enabled and MDIO_BITBANG only if PHYLIB is present to avoid warnings from Kconfig. To prevent undefined references during linking register MDIO driver only if CONFIG_MDIO_BITBANG is enabled. Signed-off-by: Andrey Smirnov ---

[PATCH 1/2] powerpc: mpc85xx_mds: Select PHYLIB only if NETDEVICES is enabled

2016-07-25 Thread Andrey Smirnov
PHYLIB depends on NETDEVICES, so to avoid unmet dependencies warning from Kconfig it needs to be selected conditionally. Also add checks if PHYLIB is built-in to avoid undefined references to PHYLIB's symbols. Signed-off-by: Andrey Smirnov ---

[PATCH 3/3] powerpc: Convert fsl_rstcr_restart to a reset handler

2016-07-25 Thread Andrey Smirnov
Convert fsl_rstcr_restart into a function to be registered with register_reset_handler() API and introduce fls_rstcr_restart_register() function that can be added as an initcall that would do aforementioned registration. Signed-off-by: Andrey Smirnov ---

[PATCH 2/3] powerpc: Call chained reset handlers during reset

2016-07-25 Thread Andrey Smirnov
Call out to all restart handlers that were added via register_restart_handler() API when restarting the machine. Signed-off-by: Andrey Smirnov --- arch/powerpc/kernel/setup-common.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH 1/3] powerpc: Factor out common code in setup-common.c

2016-07-25 Thread Andrey Smirnov
Factor out a small bit of common code in machine_restart(), machine_power_off() and machine_halt(). Signed-off-by: Andrey Smirnov --- arch/powerpc/kernel/setup-common.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git

Re: [PATCH V2 1/2] tty/hvc: Use IRQF_SHARED for OPAL hvc consoles

2016-07-25 Thread Greg KH
On Tue, Jul 26, 2016 at 02:11:11PM +1000, Michael Ellerman wrote: > Quoting Michael Ellerman (2016-07-11 16:29:20) > > Samuel Mendoza-Jonas writes: > > > > > Commit 2def86a7200c > > > ("hvc: Convert to using interrupts instead of opal events") > > > enabled the use of

Re: [PATCH V2 1/2] tty/hvc: Use IRQF_SHARED for OPAL hvc consoles

2016-07-25 Thread Michael Ellerman
Quoting Michael Ellerman (2016-07-11 16:29:20) > Samuel Mendoza-Jonas writes: > > > Commit 2def86a7200c > > ("hvc: Convert to using interrupts instead of opal events") > > enabled the use of interrupts in the hvc_driver for OPAL platforms. > > However on machines with more

Re: [PATCH v2 1/2] powerpc/mm: Fix build break when PPC_NATIVE=n

2016-07-25 Thread Stephen Rothwell
Hi Michael, On Tue, 26 Jul 2016 13:38:37 +1000 Michael Ellerman wrote: > > The recent commit to rework the hash MMU setup broke the build when > CONFIG_PPC_NATIVE=n. Fix it by adding an IS_ENABLED() check before > calling hpte_init_native(). > > Removing the else clause

Re: [PATCH v2 2/2] powerpc/mm: Rename hpte_init_lpar() and move the fallback to a header

2016-07-25 Thread Stephen Rothwell
Hi Michael, On Tue, 26 Jul 2016 13:38:38 +1000 Michael Ellerman wrote: > > hpte_init_lpar() is part of the pseries platform, so name it as such. > > Move the fallback implementation for when PSERIES=n into the header, > dropping the weak implementation. The panic() is now

[PATCH v2 2/2] powerpc/mm: Rename hpte_init_lpar() and move the fallback to a header

2016-07-25 Thread Michael Ellerman
hpte_init_lpar() is part of the pseries platform, so name it as such. Move the fallback implementation for when PSERIES=n into the header, dropping the weak implementation. The panic() is now handled by the calling code. Signed-off-by: Michael Ellerman ---

[PATCH v2 1/2] powerpc/mm: Fix build break when PPC_NATIVE=n

2016-07-25 Thread Michael Ellerman
The recent commit to rework the hash MMU setup broke the build when CONFIG_PPC_NATIVE=n. Fix it by adding an IS_ENABLED() check before calling hpte_init_native(). Removing the else clause opens the possibility that we don't set any ops, which would probably lead to a strange crash later. So add a

RE: [PATCH v3 02/11] mm: Hardened usercopy

2016-07-25 Thread Michael Ellerman
David Laight writes: > From: Josh Poimboeuf >> Sent: 22 July 2016 18:46 >> > >> > e.g. then if the pointer was in the thread_info, the second test would >> > fail, triggering the protection. >> >> FWIW, this won't work right on x86 after Andy's >>

Re: [PATCH v3 02/11] mm: Hardened usercopy

2016-07-25 Thread Michael Ellerman
Josh Poimboeuf writes: > On Thu, Jul 21, 2016 at 11:34:25AM -0700, Kees Cook wrote: >> On Wed, Jul 20, 2016 at 11:52 PM, Michael Ellerman >> wrote: >> > Kees Cook writes: >> > >> >> diff --git a/mm/usercopy.c b/mm/usercopy.c >>

Re: [PATCH] powernv/pci: Add PHB register dump debugfs handle

2016-07-25 Thread Michael Ellerman
Quoting Russell Currey (2016-07-22 15:23:36) > On EEH events the kernel will print a dump of relevant registers. > If EEH is unavailable (i.e. CONFIG_EEH is disabled, a new platform > doesn't have EEH support, etc) this information isn't readily available. > > Add a new debugfs handler to trigger

Re: [PATCH v2] include: mman: Use bool instead of int for the return value of arch_validate_prot

2016-07-25 Thread Michael Ellerman
Andrew Morton writes: > On Mon, 25 Jul 2016 15:10:06 +1000 Michael Ellerman > wrote: >> cheng...@emindsoft.com.cn writes: >> > From: Chen Gang >> > >> > For pure bool function's return value, bool is a little better

Re: [PATCH] powernv/pci: Add PHB register dump debugfs handle

2016-07-25 Thread Michael Ellerman
Tyrel Datwyler writes: > On 07/21/2016 11:36 PM, Gavin Shan wrote: >> On Fri, Jul 22, 2016 at 03:23:36PM +1000, Russell Currey wrote: >>> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c >>> b/arch/powerpc/platforms/powernv/pci-ioda.c >>> index 891fc4a..ada2f3c

Re: [PATCH v4 12/12] mm: SLUB hardened usercopy support

2016-07-25 Thread Laura Abbott
On 07/25/2016 01:45 PM, Kees Cook wrote: On Mon, Jul 25, 2016 at 12:16 PM, Laura Abbott wrote: On 07/20/2016 01:27 PM, Kees Cook wrote: Under CONFIG_HARDENED_USERCOPY, this adds object size checking to the SLUB allocator to catch any copies that may span objects. Includes

Re: [v3] UCC_GETH/UCC_FAST: Use IS_ERR_VALUE_U32 API to avoid IS_ERR_VALUE abuses.

2016-07-25 Thread David Miller
From: Arvind Yadav Date: Sat, 23 Jul 2016 23:35:51 +0530 > However, anything that passes an 'unsigned short' or 'unsigned int' > argument into IS_ERR_VALUE() is guaranteed to be broken, as are > 8-bit integers and types that are wider than 'unsigned long'. ... >

Re: [PATCH] powernv/pci: Add PHB register dump debugfs handle

2016-07-25 Thread Russell Currey
On Fri, 2016-07-22 at 16:36 +1000, Gavin Shan wrote: > On Fri, Jul 22, 2016 at 03:23:36PM +1000, Russell Currey wrote: > > > > On EEH events the kernel will print a dump of relevant registers. > > If EEH is unavailable (i.e. CONFIG_EEH is disabled, a new platform > > doesn't have EEH support,

Re: [PATCH 7/8] powerpc: Check arch.vec earlier during boot for memory features

2016-07-25 Thread kbuild test robot
Hi, [auto build test ERROR on pci/next] [cannot apply to powerpc/next next-20160725] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Michael-Bringmann/powerpc-devtree-Add-support-for-2-new-DRC

Re: [PATCH v4 12/12] mm: SLUB hardened usercopy support

2016-07-25 Thread Rik van Riel
On Mon, 2016-07-25 at 16:29 -0700, Laura Abbott wrote: > On 07/25/2016 02:42 PM, Rik van Riel wrote: > > On Mon, 2016-07-25 at 12:16 -0700, Laura Abbott wrote: > > > On 07/20/2016 01:27 PM, Kees Cook wrote: > > > > Under CONFIG_HARDENED_USERCOPY, this adds object size checking > > > > to > > > >

Re: [PATCH v2] include: mman: Use bool instead of int for the return value of arch_validate_prot

2016-07-25 Thread Andrew Morton
On Mon, 25 Jul 2016 15:10:06 +1000 Michael Ellerman wrote: > cheng...@emindsoft.com.cn writes: > > > From: Chen Gang > > > > For pure bool function's return value, bool is a little better more or > > less than int. > > > > Signed-off-by: Chen

Re: [PATCH 1/8] powerpc/firmware: Add definitions for new firmware features.

2016-07-25 Thread Tyrel Datwyler
On 07/25/2016 03:21 PM, Michael Bringmann wrote: > Firmware Features: Define new bit flags representing the presence of > new device tree properties "ibm,drc-info", and "ibm,dynamic-memory-v2". > These flags are used to tell the front end processor when the Linux > kernel supports the new

Re: [PATCH 2/8] powerpc/memory: Parse new memory property to register blocks.

2016-07-25 Thread Tyrel Datwyler
On 07/25/2016 03:21 PM, Michael Bringmann wrote: > powerpc/memory: Add parallel routines to parse the new property > "ibm,dynamic-memory-v2" property when it is present, and then to > register the relevant memory blocks with the operating system. > This property format is intended to provide a

Re: [PATCH] powernv/pci: Add PHB register dump debugfs handle

2016-07-25 Thread Gavin Shan
On Mon, Jul 25, 2016 at 10:53:49AM -0700, Tyrel Datwyler wrote: >On 07/21/2016 11:36 PM, Gavin Shan wrote: >> On Fri, Jul 22, 2016 at 03:23:36PM +1000, Russell Currey wrote: >>> On EEH events the kernel will print a dump of relevant registers. >>> If EEH is unavailable (i.e. CONFIG_EEH is

Re: [PATCH v4 12/12] mm: SLUB hardened usercopy support

2016-07-25 Thread Laura Abbott
On 07/25/2016 02:42 PM, Rik van Riel wrote: On Mon, 2016-07-25 at 12:16 -0700, Laura Abbott wrote: On 07/20/2016 01:27 PM, Kees Cook wrote: Under CONFIG_HARDENED_USERCOPY, this adds object size checking to the SLUB allocator to catch any copies that may span objects. Includes a redzone

[PATCH 8/8] powerpc: Enable support for new DRC devtree properties

2016-07-25 Thread Michael Bringmann
prom_init.c: Enable support for new DRC device tree properties "ibm,drc-info" and "ibm,dynamic-memory-v2" in initial handshake between the Linux kernel and the front end processor. Signed-off-by: Michael Bringmann --- diff -Naur linux-rhel/arch/powerpc/kernel/prom_init.c

[PATCH 7/8] powerpc: Check arch.vec earlier during boot for memory features

2016-07-25 Thread Michael Bringmann
architecture.vec5 features: The boot-time memory management needs to know the form of the "ibm,dynamic-memory-v2" property early during scanning of the flattened device tree. This patch moves execution of the function pseries_probe_fw_features() early enough to be before the scanning of the

[PATCH 6/8] hotplug/drc-info: Add code to search new devtree properties

2016-07-25 Thread Michael Bringmann
rpadlpar_core.c: Provide parallel routines to search the older device- tree properties ("ibm,drc-indexes", "ibm,drc-names", "ibm,drc-types" and "ibm,drc-power-domains"), or the new property "ibm,drc-info". The code searches for PHP PCI Slots, gets the DRC properties within the current node (using

[PATCH 5/8] pseries/drc-info: Search new DRC properties for CPU indexes

2016-07-25 Thread Michael Bringmann
pseries/drc-info: Provide parallel routines to convert between drc_index and CPU numbers at runtime, using the older device-tree properties ("ibm,drc-indexes", "ibm,drc-names", "ibm,drc-types" and "ibm,drc-power-domains"), or the new property "ibm,drc-info". Signed-off-by: Michael Bringmann

[PATCH 4/8] pseries/hotplug init: Convert new DRC memory property for hotplug runtime

2016-07-25 Thread Michael Bringmann
hotplug_init: Simplify the code needed for runtime memory hotplug and maintenance with a conversion routine that transforms the compressed property "ibm,dynamic-memory-v2" to the form of "ibm,dynamic-memory" within the "ibm,dynamic-reconfiguration-memory" property. Thus only a single set of

[PATCH 3/8] powerpc/memory: Parse new memory property to initialize structures.

2016-07-25 Thread Michael Bringmann
powerpc/memory: Add parallel routines to parse the new property "ibm,dynamic-memory-v2" property when it is present, and then to finish initialization of the relevant memory structures with the operating system. This code is shared between the boot-time initialization functions and the runtime

[PATCH 2/8] powerpc/memory: Parse new memory property to register blocks.

2016-07-25 Thread Michael Bringmann
powerpc/memory: Add parallel routines to parse the new property "ibm,dynamic-memory-v2" property when it is present, and then to register the relevant memory blocks with the operating system. This property format is intended to provide a more compact representation of memory when communicating

[PATCH 1/8] powerpc/firmware: Add definitions for new firmware features.

2016-07-25 Thread Michael Bringmann
Firmware Features: Define new bit flags representing the presence of new device tree properties "ibm,drc-info", and "ibm,dynamic-memory-v2". These flags are used to tell the front end processor when the Linux kernel supports the new properties, and by the front end processor to tell the Linux

[PATCH 0/8] powerpc/devtree: Add support for 2 new DRC properties

2016-07-25 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the

Re: [PATCH v4 12/12] mm: SLUB hardened usercopy support

2016-07-25 Thread Rik van Riel
On Mon, 2016-07-25 at 12:16 -0700, Laura Abbott wrote: > On 07/20/2016 01:27 PM, Kees Cook wrote: > > Under CONFIG_HARDENED_USERCOPY, this adds object size checking to > > the > > SLUB allocator to catch any copies that may span objects. Includes > > a > > redzone handling fix discovered by

Re: [PATCH v4 12/12] mm: SLUB hardened usercopy support

2016-07-25 Thread Kees Cook
On Mon, Jul 25, 2016 at 12:16 PM, Laura Abbott wrote: > On 07/20/2016 01:27 PM, Kees Cook wrote: >> >> Under CONFIG_HARDENED_USERCOPY, this adds object size checking to the >> SLUB allocator to catch any copies that may span objects. Includes a >> redzone handling fix

Re: [Patch v3 1/3] irqchip/qeic: move qeic driver from drivers/soc/fsl/qe

2016-07-25 Thread Jason Cooper
Hi Zhao Qiang, On Mon, Jul 25, 2016 at 04:59:54PM +0800, Zhao Qiang wrote: > move the driver from drivers/soc/fsl/qe to drivers/irqchip, > merge qe_ic.h and qe_ic.c into irq-qeic.c. > > Signed-off-by: Zhao Qiang > --- > Changes for v2: > - modify the subject and commit

Re: [PATCH v4 12/12] mm: SLUB hardened usercopy support

2016-07-25 Thread Laura Abbott
On 07/20/2016 01:27 PM, Kees Cook wrote: Under CONFIG_HARDENED_USERCOPY, this adds object size checking to the SLUB allocator to catch any copies that may span objects. Includes a redzone handling fix discovered by Michael Ellerman. Based on code from PaX and grsecurity. Signed-off-by: Kees

RE: [PATCH v2] irqchip/qeic: move qeic driver from drivers/soc/fsl/qe

2016-07-25 Thread Qiang Zhao
On Thu, Jul 07, 2016 at 10:25PM , Jason Cooper wrote: > -Original Message- > From: Jason Cooper [mailto:ja...@lakedaemon.net] > Sent: Thursday, July 07, 2016 10:25 PM > To: Qiang Zhao > Cc: o...@buserror.net; t...@linutronix.de;

Re: [PATCH] powernv/pci: Add PHB register dump debugfs handle

2016-07-25 Thread Tyrel Datwyler
On 07/21/2016 11:36 PM, Gavin Shan wrote: > On Fri, Jul 22, 2016 at 03:23:36PM +1000, Russell Currey wrote: >> On EEH events the kernel will print a dump of relevant registers. >> If EEH is unavailable (i.e. CONFIG_EEH is disabled, a new platform >> doesn't have EEH support, etc) this information

Re: [PATCH v4 00/12] mm: Hardened usercopy

2016-07-25 Thread Kees Cook
On Fri, Jul 22, 2016 at 5:36 PM, Laura Abbott wrote: > On 07/20/2016 01:26 PM, Kees Cook wrote: >> >> Hi, >> >> [This is now in my kspp -next tree, though I'd really love to add some >> additional explicit Tested-bys, Reviewed-bys, or Acked-bys. If you've >> looked through any

[PATCH v3 2/2] powerpc/pseries: Implement indexed-count hotplug memory remove

2016-07-25 Thread Sahil Mehta
Indexed-count remove for memory hotplug guarantees that a contiguous block of lmbs beginning at a specified will be unassigned (NOT that lmbs will be removed). Because of Qemu's per-DIMM memory management, the removal of a contiguous block of memory currently requires a series of individual

[PATCH v3 1/2] powerpc/pseries: Implement indexed-count hotplug memory add

2016-07-25 Thread Sahil Mehta
Indexed-count add for memory hotplug guarantees that a contiguous block of lmbs beginning at a specified will be assigned (NOT that lmbs will be added). Because of Qemu's per-DIMM memory management, the addition of a contiguous block of memory currently requires a series of individual calls.

[PATCH v3 0/2] powerpc/pseries: Implement indexed-count hotplug memory management

2016-07-25 Thread Sahil Mehta
Indexed-count memory management allows addition and removal of contiguous lmb blocks with a single command. When compared to the series of calls previously required to manage contiguous blocks, indexed-count decreases command frequency and reduces risk of buffer overflow. Changes in v2:

[RFC PATCH 9/9] powerpc: rewrite local_t using soft_irq

2016-07-25 Thread Madhavan Srinivasan
Local atomic operations are fast and highly reentrant per CPU counters. Used for percpu variable updates. Local atomic operations only guarantee variable modification atomicity wrt the CPU which owns the data and these needs to be executed in a preemption safe way. Here is the design of this

[RFC PATCH 8/9] powerpc: Support to replay PMIs

2016-07-25 Thread Madhavan Srinivasan
Code to replay the Performance Monitoring Interrupts(PMI). In the masked_interrupt handler, for PMIs we reset the MSR[EE] and return. This is due the fact that PMIs are level triggered. In the __check_irq_replay(), we enabled the MSR[EE] which will fire the interrupt for us. Patch also adds a new

[RFC PATCH 7/9] powerpc: Add support to mask perf interrupts

2016-07-25 Thread Madhavan Srinivasan
To support masking of the PMI interrupts, couple of new interrupt handler macros are added MASKABLE_EXCEPTION_PSERIES_OOL and MASKABLE_RELON_EXCEPTION_PSERIES_OOL. These are needed to include the SOFTEN_TEST and implement the support at both host and guest kernel. Couple of new irq #defs

[RFC PATCH 6/9] powerpc: modify __SOFTEN_TEST to support tri-state soft_enabled flag

2016-07-25 Thread Madhavan Srinivasan
Foundation patch to support checking of new flag for "paca->soft_enabled". Modify the condition checking for the "soft_enabled" from "equal" to "greater than or equal to". Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/exception-64s.h | 2 +-

[RFC PATCH 5/9] powerpc: reverse the soft_enable logic

2016-07-25 Thread Madhavan Srinivasan
"paca->soft_enabled" is used as a flag to mask some of interrupts. Currently supported flags values and their details: soft_enabledMSR[EE] 0 0 Disabled (PMI and HMI not masked) 1 1 Enabled "paca->soft_enabled" is initialed to 1

[RFC PATCH 4/9] powerpc: Use set_soft_enabled api to update paca->soft_enabled

2016-07-25 Thread Madhavan Srinivasan
Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/kvm_ppc.h | 2 +- arch/powerpc/kernel/irq.c | 4 ++-- arch/powerpc/kernel/setup_64.c | 3 ++- arch/powerpc/kernel/time.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff

[RFC PATCH 3/9] powerpc: move set_soft_enabled()

2016-07-25 Thread Madhavan Srinivasan
Move set_soft_enabled() from powerpc/kernel/irq.c to asm/hw_irq.c. this way updation of paca->soft_enabled can be forced wherever possible. Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/hw_irq.h | 6 ++ arch/powerpc/kernel/irq.c | 6 --

[RFC PATCH 1/9] Add #defs for paca->soft_enabled flags

2016-07-25 Thread Madhavan Srinivasan
Two #defs LAZY_INTERRUPT_ENABLED and LAZY_INTERRUPT_DISABLED are added to be used when updating paca->soft_enabled. Signed-off-by: Madhavan Srinivasan --- -If the macro names looks not right, kindly suggest arch/powerpc/include/asm/hw_irq.h | 7 +++ 1 file

[RFC PATCH 2/9] Cleanup to use LAZY_INTERRUPT_* macros for paca->soft_enabled update

2016-07-25 Thread Madhavan Srinivasan
Replace the hardcoded values used when updating paca->soft_enabled with LAZY_INTERRUPT_* #def. No logic change. Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/exception-64s.h | 2 +- arch/powerpc/include/asm/hw_irq.h| 15 ---

[RFC PATCH 0/9]powerpc: "paca->soft_enabled" based local atomic operation implementation

2016-07-25 Thread Madhavan Srinivasan
Local atomic operations are fast and highly reentrant per CPU counters. Used for percpu variable updates. Local atomic operations only guarantee variable modification atomicity wrt the CPU which owns the data and these needs to be executed in a preemption safe way. Here is the design of the

RE: [PATCH v11 4/5] powerpc/fsl: move mpc85xx.h to include/linux/fsl

2016-07-25 Thread Yangbo Lu
Hi Scott, > -Original Message- > From: Scott Wood [mailto:o...@buserror.net] > Sent: Friday, July 22, 2016 12:45 AM > To: Michael Ellerman; Arnd Bergmann > Cc: linux-...@vger.kernel.org; devicet...@vger.kernel.org; linuxppc- > d...@lists.ozlabs.org; linux-ker...@vger.kernel.org; Yangbo

Re: [PATCH 2/3] powerpc/mm: Rename hpte_init_lpar() & put fallback in a header

2016-07-25 Thread Benjamin Herrenschmidt
On Mon, 2016-07-25 at 20:36 +1000, Michael Ellerman wrote: > That would be nice, but these look fishy at least: > > arch/powerpc/platforms/cell/spu_manage.c:   if > (!firmware_has_feature(FW_FEATURE_LPAR)) > arch/powerpc/platforms/cell/spu_manage.c:   if >

Re: [PATCH for-4.8 V2 08/10] powerpc: use the jump label for cpu_has_feature

2016-07-25 Thread Kevin Hao
On Mon, Jul 25, 2016 at 04:28:49PM +1000, Nicholas Piggin wrote: > On Sat, 23 Jul 2016 14:42:41 +0530 > "Aneesh Kumar K.V" wrote: > > > From: Kevin Hao > > > > The cpu features are fixed once the probe of cpu features are done. > > And the

Re: [PATCH 1/3] powerpc/mm: Fix build break due when PPC_NATIVE=n

2016-07-25 Thread Michael Ellerman
Quoting Michael Ellerman (2016-07-25 16:17:52) > Stephen Rothwell writes: > > > Hi Michael, > > > > On Mon, 25 Jul 2016 12:57:49 +1000 Michael Ellerman > > wrote: > >> > >> The recent commit to rework the hash MMU setup broke the build when > >>

Re: [PATCH 2/3] powerpc/mm: Rename hpte_init_lpar() & put fallback in a header

2016-07-25 Thread Michael Ellerman
Benjamin Herrenschmidt writes: > On Mon, 2016-07-25 at 15:33 +1000, Michael Ellerman wrote: >> When we detect a PS3 we set both PS3_LV1 and LPAR at the same time, >> so >> there should be no way they can get out of sync, other than due to a >> bug in the code. > > I

Re: [PATCH 2/3] powerpc/mm: Rename hpte_init_lpar() & put fallback in a header

2016-07-25 Thread Benjamin Herrenschmidt
On Mon, 2016-07-25 at 15:33 +1000, Michael Ellerman wrote: > When we detect a PS3 we set both PS3_LV1 and LPAR at the same time, > so > there should be no way they can get out of sync, other than due to a > bug in the code. I thought I had changed PS3 to no longer set LPAR ? I like having a flag

RE: [PATCH v3 02/11] mm: Hardened usercopy

2016-07-25 Thread David Laight
From: Josh Poimboeuf > Sent: 22 July 2016 18:46 .. > > >> +/* > > >> + * Checks if a given pointer and length is contained by the current > > >> + * stack frame (if possible). > > >> + * > > >> + * 0: not at all on the stack > > >> + * 1: fully within a valid stack frame > > >> + * 2: fully

[Patch v3 1/3] irqchip/qeic: move qeic driver from drivers/soc/fsl/qe

2016-07-25 Thread Zhao Qiang
move the driver from drivers/soc/fsl/qe to drivers/irqchip, merge qe_ic.h and qe_ic.c into irq-qeic.c. Signed-off-by: Zhao Qiang --- Changes for v2: - modify the subject and commit msg Changes for v3: - merge .h file to .c, rename it with irq-qeic.c

[Patch v3 2/3] irqchip/qeic: merge qeic init code from platforms to a common function

2016-07-25 Thread Zhao Qiang
The codes of qe_ic init from a variety of platforms are redundant, merge them to a common function and put it to irqchip/irq-qeic.c For non-p1021_mds mpc85xx_mds boards, use "qe_ic_init(np, 0, qe_ic_cascade_low_mpic, qe_ic_cascade_high_mpic);" instead of "qe_ic_init(np, 0,

[Patch v3 3/3] irqchip/qeic: merge qeic_of_init into qe_ic_init

2016-07-25 Thread Zhao Qiang
qeic_of_init just get device_node of qeic from dtb and call qe_ic_init, pass the device_node to qe_ic_init. So merge qeic_of_init into qe_ic_init to get the qeic node in qe_ic_init. Signed-off-by: Zhao Qiang --- Changes for v2: - modify subject and commit msg

Re: [PATCH for-4.8 V2 03/10] powerpc/mm/radix: Add radix_set_pte to use in early init

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 18:36:09 +1000 Michael Ellerman wrote: > "Aneesh Kumar K.V" writes: > > > We want to use the static key based feature check in set_pte_at. > > Since we call radix__map_kernel_page early in boot before jump > > label is

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-25 Thread Simon Guo
On Thu, Jul 21, 2016 at 08:57:29PM +1000, Michael Ellerman wrote: > Can one of you send a properly formatted and signed-off patch. I will work on that. Thanks, Simon ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org

Re: [PATCH for-4.8 V2 03/10] powerpc/mm/radix: Add radix_set_pte to use in early init

2016-07-25 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: > We want to use the static key based feature check in set_pte_at. Since > we call radix__map_kernel_page early in boot before jump label is > initialized we can't call set_pte_at there. Add radix__set_pte for the > same. Although this

Re: [PATCH for-4.8 V2 03/10] powerpc/mm/radix: Add radix_set_pte to use in early init

2016-07-25 Thread Michael Ellerman
Nicholas Piggin writes: > On Sat, 23 Jul 2016 14:42:36 +0530 > "Aneesh Kumar K.V" wrote: >> @@ -102,7 +123,7 @@ int radix__map_kernel_page(unsigned long ea, >> unsigned long pa, } >> >> set_the_pte: >> -set_pte_at(_mm, ea, ptep,

Re: [PATCH v2] irqchip/qeic: move qeic driver from drivers/soc/fsl/qe

2016-07-25 Thread Scott Wood
On Mon, 2016-07-25 at 06:15 +, Qiang Zhao wrote: > On Thu, Jul 07, 2016 at 10:25PM , Jason Cooper wrote: > > > > -Original Message- > > From: Jason Cooper [mailto:ja...@lakedaemon.net] > > Sent: Thursday, July 07, 2016 10:25 PM > > To: Qiang Zhao

Re: [PATCH for-4.8 V2 00/10] Use jump label for cpu/mmu_has_feature

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 11:55:50 +0530 "Aneesh Kumar K.V" wrote: > Nicholas Piggin writes: > > > On Sat, 23 Jul 2016 14:42:33 +0530 > > "Aneesh Kumar K.V" wrote: > > > >> Changes from V1: > >> * Update

Re: [PATCH for-4.8 V2 08/10] powerpc: use the jump label for cpu_has_feature

2016-07-25 Thread Nicholas Piggin
On Sat, 23 Jul 2016 14:42:41 +0530 "Aneesh Kumar K.V" wrote: > From: Kevin Hao > > The cpu features are fixed once the probe of cpu features are done. > And the function cpu_has_feature() does be used in some hot path. > The checking of the

Re: [PATCH for-4.8 V2 00/10] Use jump label for cpu/mmu_has_feature

2016-07-25 Thread Aneesh Kumar K.V
Nicholas Piggin writes: > On Sat, 23 Jul 2016 14:42:33 +0530 > "Aneesh Kumar K.V" wrote: > >> Changes from V1: >> * Update "powerpc/mm: Convert early cpu/mmu feature check to use the >> new helpers" based on resend code changes in this area.

Re: [PATCH for-4.8 V2 03/10] powerpc/mm/radix: Add radix_set_pte to use in early init

2016-07-25 Thread Nicholas Piggin
On Sat, 23 Jul 2016 14:42:36 +0530 "Aneesh Kumar K.V" wrote: > We want to use the static key based feature check in set_pte_at. Since > we call radix__map_kernel_page early in boot before jump label is > initialized we can't call set_pte_at there. Add

Re: [PATCH 1/3] powerpc/mm: Fix build break due when PPC_NATIVE=n

2016-07-25 Thread Michael Ellerman
Stephen Rothwell writes: > Hi Michael, > > On Mon, 25 Jul 2016 12:57:49 +1000 Michael Ellerman > wrote: >> >> The recent commit to rework the hash MMU setup broke the build when >> CONFIG_PPC_NATIVE=n. Fix it by providing a fallback implementation of