Re: [PATCH v5 09/10] VAS: Define vas_tx_win_open()

2017-06-06 Thread Sukadev Bhattiprolu
Sukadev Bhattiprolu [suka...@linux.vnet.ibm.com] wrote: > +static void *map_paste_region(char *name, uint64_t start, int len) > +{ > + void *map; > + > + if (!request_mem_region(start, len, name)) { > + pr_devel("%s(): request_mem_region(0x%llx, %d) failed\n", > +

Re: [PATCH 10/16] powerpc: vio: use dev_groups and not dev_attrs for bus_type

2017-06-06 Thread Benjamin Herrenschmidt
On Wed, 2017-06-07 at 07:45 +0200, Greg Kroah-Hartman wrote: > On Wed, Jun 07, 2017 at 09:04:41AM +1000, Benjamin Herrenschmidt wrote: > > On Tue, 2017-06-06 at 21:30 +0200, Greg Kroah-Hartman wrote: > > > >   > > > >   static struct device_attribute vio_dev_attrs[] = { > > > >    

Re: [PATCH] driver core: remove CLASS_ATTR usage

2017-06-06 Thread Michael Ellerman
Greg KH writes: > From: Greg Kroah-Hartman > > There was only 2 remaining users of CLASS_ATTR() so let's finally get > rid of them and force everyone to use the correct RW/RO/WO versions > instead. > > Cc: Benjamin Herrenschmidt

[PATCH] selftests/powerpc: Add a test of a simple copy/paste

2017-06-06 Thread Michael Ellerman
Power9 has two new instructions, copy and paste, which copy a cacheline and then paste it somewhere. We already have a test that the kernel correctly aborts the copy on context switch, but we don't have a simple test to confirm copy/paste itself actually works. So add one. Signed-off-by: Michael

Re: [PATCH v9 05/10] powerpc/perf: IMC pmu cpumask and cpuhotplug support

2017-06-06 Thread Anju T Sudhakar
Hi Thomas, Thank you for reviewing the patch. On Tuesday 06 June 2017 02:09 PM, Thomas Gleixner wrote: On Mon, 5 Jun 2017, Anju T Sudhakar wrote: +/* + * nest_imc_stop : Does OPAL call to stop nest engine. + */ +static void nest_imc_stop(int *cpu_opal_rc) +{ + int rc; + + rc =

Re: [PATCH v3 3/9] powerpc/kprobes/optprobes: Move over to patch_instruction

2017-06-06 Thread Balbir Singh
On Wed, 2017-06-07 at 00:42 +0530, Naveen N. Rao wrote: > On 2017/06/06 02:29PM, Balbir Singh wrote: > > With text moving to read-only migrate optprobes to using > > the patch_instruction infrastructure. Without this optprobes > > will fail and complain. > > > > + /* We can optimize this via

Re: [PATCH 10/16] powerpc: vio: use dev_groups and not dev_attrs for bus_type

2017-06-06 Thread Greg Kroah-Hartman
On Wed, Jun 07, 2017 at 09:04:41AM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2017-06-06 at 21:30 +0200, Greg Kroah-Hartman wrote: > > >   > > >   static struct device_attribute vio_dev_attrs[] = { > > >    __ATTR_RO(name), > > > @@ -1573,6 +1576,13 @@ static struct device_attribute

[PATCH 2/2] mtd: powernv_flash: Lock around concurrent access to OPAL

2017-06-06 Thread Cyril Bur
OPAL can only manage one flash access at a time and will return an OPAL_BUSY error for each concurrent access to the flash. The simplest way to prevent this from happening is with a mutex. Signed-off-by: Cyril Bur --- This is to address

[PATCH 1/2] mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON()

2017-06-06 Thread Cyril Bur
BUG_ON() should be reserved in situations where we can not longer guarantee the integrity of the system. In the case where powernv_flash_async_op() receives an impossible op, we can still guarantee the integrity of the system. Signed-off-by: Cyril Bur --- I think patches to

Re: [PATCH v2] cxl: Avoid double free_irq() for psl,slice interrupts

2017-06-06 Thread Frederic Barrat
Le 02/06/2017 à 18:56, Vaibhav Jain a écrit : During an eeh call to cxl_remove can result in double free_irq of psl,slice interrupts. This can happen if perst_reloads_same_image == 1 and call to cxl_configure_adapter() fails during slot_reset callback. In such a case we see a kernel oops with

Re: [PATCH] powerpc/mm/radix: Only add X for pages overlapping kernel text

2017-06-06 Thread Balbir Singh
On Tue, Jun 6, 2017 at 3:48 PM, Michael Ellerman wrote: > Currently we map the whole linear mapping with PAGE_KERNEL_X. Instead we > should check if the page overlaps the kernel text and only then add > PAGE_KERNEL_X. > > Note that we still use 1G pages if they're available,

Re: [PATCH] cxl: Fix error path on bad ioctl

2017-06-06 Thread Michael Ellerman
Frederic Barrat writes: > Fix error path if we can't copy user structure on > CXL_IOCTL_START_WORK ioctl. To be clear the error is that returning via the out label will unlock cxl->status_mutex, which has not been locked. Please spell it out for me :) This should

[PATCH v2] cxl: Fix error path on bad ioctl

2017-06-06 Thread Frederic Barrat
Fix error path if we can't copy user structure on CXL_IOCTL_START_WORK ioctl. We shouldn't unlock the context status mutex as it was not locked (yet). Signed-off-by: Frederic Barrat Cc: sta...@vger.kernel.org Fixes: 0712dc7e73e5 ("cxl: Fix issues when unmapping

Re: [PATCH v2] cxl: Avoid double free_irq() for psl,slice interrupts

2017-06-06 Thread Michael Ellerman
Vaibhav Jain writes: > During an eeh call to cxl_remove can result in double free_irq of > psl,slice interrupts. This can happen if perst_reloads_same_image == 1 > and call to cxl_configure_adapter() fails during slot_reset > callback. In such a case we see a kernel

Re: [Patch 2/2]: powerpc/hotplug/mm: Fix hot-add memory node assoc

2017-06-06 Thread Michael Ellerman
Michael Bringmann writes: > On 06/01/2017 04:36 AM, Michael Ellerman wrote: >> Do you actually see mention of nodes 0 and 8 in the dmesg? > > When the 'numa.c' code is built with debug messages, and the system was > given that configuration by pHyp, yes, I did. > >> What

Re: [PATCH] powerpc/mm/radix: Only add X for pages overlapping kernel text

2017-06-06 Thread Michael Ellerman
Balbir Singh writes: > On Tue, Jun 6, 2017 at 3:48 PM, Michael Ellerman wrote: >> Currently we map the whole linear mapping with PAGE_KERNEL_X. Instead we >> should check if the page overlaps the kernel text and only then add >> PAGE_KERNEL_X. ... >>

Re: [PATCH v9 10/10] powerpc/perf: Thread imc cpuhotplug support

2017-06-06 Thread Thomas Gleixner
On Mon, 5 Jun 2017, Anju T Sudhakar wrote: > static void thread_imc_mem_alloc(int cpu_id) > { > - u64 ldbar_addr, ldbar_value; > int phys_id = topology_physical_package_id(cpu_id); > > per_cpu_add[cpu_id] = (u64)alloc_pages_exact_nid(phys_id, >

Re: [PATCH v2] powerpc/numa: Fix percpu allocations to be NUMA aware

2017-06-06 Thread Nicholas Piggin
On Tue, 6 Jun 2017 20:23:57 +1000 Michael Ellerman wrote: > In commit 8c272261194d ("powerpc/numa: Enable USE_PERCPU_NUMA_NODE_ID"), we > switched to the generic implementation of cpu_to_node(), which uses a percpu > variable to hold the NUMA node for each CPU. > >

Re: [PATCH v9 05/10] powerpc/perf: IMC pmu cpumask and cpuhotplug support

2017-06-06 Thread Thomas Gleixner
On Mon, 5 Jun 2017, Anju T Sudhakar wrote: > +/* > + * nest_imc_stop : Does OPAL call to stop nest engine. > + */ > +static void nest_imc_stop(int *cpu_opal_rc) > +{ > + int rc; > + > + rc = opal_imc_counters_stop(OPAL_IMC_COUNTERS_NEST); > + if (rc) > +

Re: [PATCH] cxl: Fix error path on bad ioctl

2017-06-06 Thread Frederic Barrat
Le 06/06/2017 à 11:20, Michael Ellerman a écrit : Frederic Barrat writes: Fix error path if we can't copy user structure on CXL_IOCTL_START_WORK ioctl. To be clear the error is that returning via the out label will unlock cxl->status_mutex, which has not been

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-06 Thread Michael Ellerman
christophe leroy writes: > Le 05/06/2017 à 12:45, Michael Ellerman a écrit : >> Christophe LEROY writes: >> >>> Le 02/06/2017 à 11:26, Michael Ellerman a écrit : Christophe Leroy writes: > Only the

Re: [PATCH v3 1/2] tty: add compat_ioctl callbacks

2017-06-06 Thread Arnd Bergmann
On Sat, Jun 3, 2017 at 3:51 PM, Aleksa Sarai wrote: > In order to avoid future diversions between fs/compat_ioctl.c and > drivers/tty/pty.c, define .compat_ioctl callbacks for the relevant > tty_operations structs. Since both pty_unix98_ioctl() and > pty_bsd_ioctl() are compatible

Re: [PATCH v3 1/2] tty: add compat_ioctl callbacks

2017-06-06 Thread Aleksa Sarai
diff --git a/Makefile b/Makefile index 470bd4d9513a..fb689286d83a 100644 --- a/Makefile +++ b/Makefile @@ -401,6 +401,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common \

[PATCH v2] workqueue: Fix edge cases for calc of pool's cpumask

2017-06-06 Thread Michael Bringmann
On NUMA systems with dynamic processors, the content of the cpumask may change over time. As new processors are added via DLPAR operations, workqueues are created for them. Depending upon the order in which CPUs are added/removed, we may run into problems with the content of the cpumask used by

Re: [PATCH v2] workqueue: Fix edge cases for calc of pool's cpumask

2017-06-06 Thread Tejun Heo
Hello, Michael. It would have been better to continue debugging in the prev thread. This still seems incorrect for the same reason as before. On Tue, Jun 06, 2017 at 09:09:40AM -0500, Michael Bringmann wrote: > On NUMA systems with dynamic processors, the content of the cpumask > may change over

Re: [PATCH v2] workqueue: Fix edge cases for calc of pool's cpumask

2017-06-06 Thread Tejun Heo
Hello, On Tue, Jun 06, 2017 at 09:34:05AM -0500, Michael Bringmann wrote: > >> diff --git a/kernel/workqueue.c b/kernel/workqueue.c > >> index c74bf39..460de61 100644 > >> --- a/kernel/workqueue.c > >> +++ b/kernel/workqueue.c > >> @@ -3366,6 +3366,9 @@ static struct worker_pool

Re: [PATCH v2] workqueue: Fix edge cases for calc of pool's cpumask

2017-06-06 Thread Michael Bringmann
On 06/06/2017 09:20 AM, Tejun Heo wrote: > Hello, Michael. > > It would have been better to continue debugging in the prev thread. > This still seems incorrect for the same reason as before. > > On Tue, Jun 06, 2017 at 09:09:40AM -0500, Michael Bringmann wrote: >> On NUMA systems with dynamic

power server power consumption problem

2017-06-06 Thread ??????????
I use ipmitool measuring power server power consumption, getting the following results without total power consumption as the following picture, do I add all power values as total power consumption? I am eager to receive someone's replay??Thanks??

Re: [PATCH 10/16] powerpc: vio: use dev_groups and not dev_attrs for bus_type

2017-06-06 Thread Benjamin Herrenschmidt
On Tue, 2017-06-06 at 21:30 +0200, Greg Kroah-Hartman wrote: > >   > >   static struct device_attribute vio_dev_attrs[] = { > >    __ATTR_RO(name), > > @@ -1573,6 +1576,13 @@ static struct device_attribute vio_dev_attrs[] = { > >    __ATTR_RO(modalias), > >    __ATTR_NULL > >   }; > >

[PATCH] powernv: Properly mask POWER9 DD1 PVR for different chip types

2017-06-06 Thread Michael Neuling
Bits 48:51 in the PVR for POWER9 represent different chip types (scale up vs out and 12 vs 24 core). Current chips have 0 here, but could be non-zero in the future. This changes the POWER9 DD1 mask to correctly ignore these bits 48:51. Signed-off-by: Michael Neuling ---

Re: [PATCH v3 2/9] powerpc/kprobes: Move kprobes over to patch_instruction

2017-06-06 Thread Balbir Singh
On Wed, 2017-06-07 at 00:35 +0530, Naveen N. Rao wrote: > Hi Balbir, > > On 2017/06/06 02:29PM, Balbir Singh wrote: > > arch_arm/disarm_probe use direct assignment for copying > > instructions, replace them with patch_instruction > > > > Signed-off-by: Balbir Singh > >

Re: [PATCH 08/16] powerpc: ps3: use dev_groups and not dev_attrs for bus_type

2017-06-06 Thread Geoff Levand
On 06/06/2017 12:22 PM, Greg Kroah-Hartman wrote: > The dev_attrs field has long been "depreciated" and is finally being > removed, so move the driver to use the "correct" dev_groups field > instead for struct bus_type. > arch/powerpc/platforms/ps3/system-bus.c | 10 ++ > 1 file changed,

[PATCH v2 2/3] EDAC: altera: simplify calculation of total memory

2017-06-06 Thread Chris Packham
Use of_address_to_resource() and resource_size() instead of manually parsing the "reg" property from the "memory" node(s). Signed-off-by: Chris Packham --- Changes in v2: - New drivers/edac/altera_edac.c | 24 1 file changed, 8

[PATCH v2 1/3] EDAC: mv64x60: calculate memory size correctly

2017-06-06 Thread Chris Packham
The #address-cells and #size-cells properties need to be accounted for when dealing with the "memory" device tree node. Use of_address_to_resource() and resource_size() to retrieve the size of the memory node which will automatically take the #cells into account. Signed-off-by: Chris Packham

[PATCH v2 3/3] EDAC: cpc925: simplify calculation of total memory

2017-06-06 Thread Chris Packham
Use of_address_to_resource() and resource_size() instead of manually parsing the "reg" property from the "memory" node(s). Signed-off-by: Chris Packham --- Changes in v2: - New drivers/edac/cpc925_edac.c | 32 ++-- 1 file changed,

EDAC: simplify total memory calculation

2017-06-06 Thread Chris Packham
This take the approach used by cell_edac.c to obtain the total memory from the devicetree and applies it to mv64x60_edac.c, altera_edac.c and cpc925_edac.c which were all manually parsing the reg property. In the case of mv64x60 this actually fixes cases where #address/size-cells != 1. For altera

Re: [PATCH v3 1/3] EDAC: mv64x60: check driver registration success

2017-06-06 Thread Chris Packham
Hi Borislav, On 30/05/17 09:21, Chris Packham wrote: > Check the return status of platform_driver_register() in > mv64x60_edac_init(). Only output messages and initialise the > edac_op_state if the registration is successful. > > Signed-off-by: Chris Packham >

Re: [PATCH v9 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging

2017-06-06 Thread Anju T Sudhakar
Hi Thomas, On Tuesday 06 June 2017 03:39 PM, Thomas Gleixner wrote: On Mon, 5 Jun 2017, Anju T Sudhakar wrote: +static void cleanup_all_core_imc_memory(struct imc_pmu *pmu_ptr) +{ + struct imc_mem_info *ptr = pmu_ptr->mem_info; + + if (!ptr) + return; That's

Re: [PATCH v3 1/2] tty: add compat_ioctl callbacks

2017-06-06 Thread Arnd Bergmann
On Tue, Jun 6, 2017 at 1:05 PM, Aleksa Sarai wrote: >>> diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c >>> index 65799575c666..2a6bd9ae3f8b 100644 >>> --- a/drivers/tty/pty.c >>> +++ b/drivers/tty/pty.c >>> @@ -481,6 +481,16 @@ static int pty_bsd_ioctl(struct tty_struct *tty,

Re: [PATCH v4 1/2] tty: add compat_ioctl callbacks

2017-06-06 Thread Arnd Bergmann
On Sat, Jun 3, 2017 at 4:15 PM, Aleksa Sarai wrote: > In order to avoid future diversions between fs/compat_ioctl.c and > drivers/tty/pty.c, define .compat_ioctl callbacks for the relevant > tty_operations structs. Since both pty_unix98_ioctl() and > pty_bsd_ioctl() are compatible

Re: [PATCH] powerpc/numa: Fix percpu allocations to be NUMA aware

2017-06-06 Thread Balbir Singh
On Fri, Jun 2, 2017 at 3:14 PM, Michael Ellerman wrote: > In commit 8c272261194d ("powerpc/numa: Enable USE_PERCPU_NUMA_NODE_ID"), we > switched to the generic implementation of cpu_to_node(), which uses a percpu > variable to hold the NUMA node for each CPU. > >

[PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH

2017-06-06 Thread Murilo Opsfelder Araujo
When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the following: drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release': vfio_pci.c:(.text+0xa98): undefined reference to `.vfio_spapr_pci_eeh_release' drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_open':

Re: [PATCH] powerpc/numa: Fix percpu allocations to be NUMA aware

2017-06-06 Thread Michael Ellerman
Nicholas Piggin writes: > On Fri, 02 Jun 2017 19:54:32 +1000 > Michael Ellerman wrote: > >> >> @@ -672,10 +672,19 @@ static void __init pcpu_fc_free(void *ptr, size_t >> >> size) >> >> >> >> static int pcpu_cpu_distance(unsigned int from, unsigned int

Re: [PATCH v9 07/10] powerpc/perf: PMU functions for Core IMC and hotplugging

2017-06-06 Thread Thomas Gleixner
On Mon, 5 Jun 2017, Anju T Sudhakar wrote: > +static void cleanup_all_core_imc_memory(struct imc_pmu *pmu_ptr) > +{ > + struct imc_mem_info *ptr = pmu_ptr->mem_info; > + > + if (!ptr) > + return; That's pointless. > + for (; ptr; ptr++) { for (ptr =

[PATCH v2] powerpc/numa: Fix percpu allocations to be NUMA aware

2017-06-06 Thread Michael Ellerman
In commit 8c272261194d ("powerpc/numa: Enable USE_PERCPU_NUMA_NODE_ID"), we switched to the generic implementation of cpu_to_node(), which uses a percpu variable to hold the NUMA node for each CPU. Unfortunately we neglected to notice that we use cpu_to_node() in the allocation of our percpu

Re: [PATCH V3 1/2] powerpc/numa: Update CPU topology when VPHN enabled

2017-06-06 Thread Michael Ellerman
Michael Bringmann writes: > This build appears to be using V3 of the patch. V4 of the patch corrected > the placement > of the local variables with respect to '#ifdef CONFIG_PPC_SPLPAR'. Yes it is, you can tell because it's a reply to "PATCH V3". cheers

[PATCH v4] powerpc/mm: Only read faulting instruction when necessary in do_page_fault()

2017-06-06 Thread Christophe Leroy
Commit a7a9dcd882a67 ("powerpc: Avoid taking a data miss on every userspace instruction miss") has shown that limiting the read of faulting instruction to likely cases improves performance. This patch goes further into this direction by limiting the read of the faulting instruction to the only

Re: [PATCH 2/5] powerpc/mm: split store_updates_sp() in two parts in do_page_fault()

2017-06-06 Thread Christophe LEROY
Le 06/06/2017 à 13:00, Michael Ellerman a écrit : christophe leroy writes: Le 05/06/2017 à 12:45, Michael Ellerman a écrit : Christophe LEROY writes: Le 02/06/2017 à 11:26, Michael Ellerman a écrit : Christophe Leroy

[PATCH] driver core: remove CLASS_ATTR usage

2017-06-06 Thread Greg KH
From: Greg Kroah-Hartman There was only 2 remaining users of CLASS_ATTR() so let's finally get rid of them and force everyone to use the correct RW/RO/WO versions instead. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc:

Re: [Patch 2/2]: powerpc/hotplug/mm: Fix hot-add memory node assoc

2017-06-06 Thread Michael Bringmann
On 06/06/2017 04:48 AM, Michael Ellerman wrote: > Michael Bringmann writes: >> On 06/01/2017 04:36 AM, Michael Ellerman wrote: >>> Do you actually see mention of nodes 0 and 8 in the dmesg? >> >> When the 'numa.c' code is built with debug messages, and the system was >>

[PATCH 10/16] powerpc: vio: use dev_groups and not dev_attrs for bus_type

2017-06-06 Thread Greg Kroah-Hartman
The dev_attrs field has long been "depreciated" and is finally being removed, so move the driver to use the "correct" dev_groups field instead for struct bus_type. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman

[PATCH 07/16] macintosh: use dev_groups and not dev_attrs for bus_type

2017-06-06 Thread Greg Kroah-Hartman
The dev_attrs field has long been "depreciated" and is finally being removed, so move the driver to use the "correct" dev_groups field instead for struct bus_type. Cc: Benjamin Herrenschmidt Cc: Signed-off-by: Greg Kroah-Hartman

Re: [PATCH v3 2/9] powerpc/kprobes: Move kprobes over to patch_instruction

2017-06-06 Thread Naveen N. Rao
Hi Balbir, On 2017/06/06 02:29PM, Balbir Singh wrote: > arch_arm/disarm_probe use direct assignment for copying > instructions, replace them with patch_instruction > > Signed-off-by: Balbir Singh > --- > arch/powerpc/kernel/kprobes.c | 4 ++-- > 1 file changed, 2

Re: [PATCH v3 3/9] powerpc/kprobes/optprobes: Move over to patch_instruction

2017-06-06 Thread Naveen N. Rao
On 2017/06/06 02:29PM, Balbir Singh wrote: > With text moving to read-only migrate optprobes to using > the patch_instruction infrastructure. Without this optprobes > will fail and complain. > > Signed-off-by: Balbir Singh > --- > arch/powerpc/kernel/optprobes.c | 58 >

[PATCH 11/16] powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type

2017-06-06 Thread Greg Kroah-Hartman
The dev_attrs field has long been "depreciated" and is finally being removed, so move the driver to use the "correct" dev_groups field instead for struct bus_type. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman

[PATCH 08/16] powerpc: ps3: use dev_groups and not dev_attrs for bus_type

2017-06-06 Thread Greg Kroah-Hartman
The dev_attrs field has long been "depreciated" and is finally being removed, so move the driver to use the "correct" dev_groups field instead for struct bus_type. Cc: Geoff Levand Cc: Benjamin Herrenschmidt Cc: Paul Mackerras

[PATCH 09/16] powerpc: ibmebus: use dev_groups and not dev_attrs for bus_type

2017-06-06 Thread Greg Kroah-Hartman
The dev_attrs field has long been "depreciated" and is finally being removed, so move the driver to use the "correct" dev_groups field instead for struct bus_type. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman

Re: [PATCH 10/16] powerpc: vio: use dev_groups and not dev_attrs for bus_type

2017-06-06 Thread Greg Kroah-Hartman
On Tue, Jun 06, 2017 at 09:22:15PM +0200, Greg Kroah-Hartman wrote: > The dev_attrs field has long been "depreciated" and is finally being > removed, so move the driver to use the "correct" dev_groups field > instead for struct bus_type. > > Cc: Benjamin Herrenschmidt >