Re: [PATCH 2/3] pci/hotplug/pnv-php: Disable surprise hotplug capability on conflicts

2017-02-15 Thread Vaibhav Jain
Andrew Donnellan writes: >> >> Cc: # v4.9+ >> Fixes: 360aebd85a4c ("drivers/pci/hotplug: Support surprise hotplug in >> powernv driver") >> Signed-off-by: Gavin Shan > Reviewed-by: Andrew Donnellan

Re: [PATCH 1/3] pci/hotplug/pnv-php: Remove WARN_ON() in pnv_php_put_slot()

2017-02-15 Thread Vaibhav Jain
Andrew Donnellan writes: >> Cc: # v4.8+ >> Fixes: 66725152fb9f ("PCI/hotplug: PowerPC PowerNV PCI hotplug driver") >> Signed-off-by: Gavin Shan > > Reviewed-by: Andrew Donnellan

Re: powerpc/pseries: Fix build break when MEMORY_HOTREMOVE=n

2017-02-15 Thread Michael Ellerman
On Thu, 2017-02-16 at 03:01:18 UTC, Michael Ellerman wrote: > We broke the build when CONFIG_MEMORY_HOTREMOVE=n: > > arch/powerpc/platforms/pseries/hotplug-memory.c:821:8: error: implicit > declaration of function 'dlpar_memory_readd_by_index' > > Add a dummy to fix it. > > Fixes:

Re: powerpc/mm: Fix build break with BOOK3S_64=n and MEMORY_HOTPLUG=y

2017-02-15 Thread Michael Ellerman
On Wed, 2017-02-15 at 10:54:37 UTC, Michael Ellerman wrote: > The recently merged HPT (Hash Page Table) resize support broke the build > when BOOK3S_64=n (ie. 32-bit or 64-bit Book3E) and MEMORY_HOTPLUG=y: > > arch/powerpc/mm/mem.o: In function `.arch_add_memory': > (.text+0x4e4): undefined

Re: [1/3] powerpc/xmon Update ppc-dis/opc.c and ppc.h

2017-02-15 Thread Michael Ellerman
On Thu, 2017-02-02 at 05:03:42 UTC, Balbir Singh wrote: > Upgrade ppc-opc.c, ppc-dis.c and ppc.h to the > versions belonging to the following commit > > 65b650b4c7463f4508bed523c24ab0031a5ae5cd > * ppc-dis.c (print_insn_powerpc): Don't skip all operands > after setting skip_optional. > > This

Re: [1/3] powerpc/mm/radix: Update pte update sequence for pte clear case

2017-02-15 Thread Michael Ellerman
On Thu, 2017-02-09 at 02:58:19 UTC, "Aneesh Kumar K.V" wrote: > In the kernel we do follow the below sequence in different code paths. > pte = ptep_get_clear(ptep) > > set_pte_at(ptep, pte) > > We do that for mremap, autonuma protection update and softdirty clearing. This > implies our

Re: powerpc/mm: Update PROTFAULT handling in the page fault path

2017-02-15 Thread Michael Ellerman
On Mon, 2017-01-30 at 16:12:59 UTC, "Aneesh Kumar K.V" wrote: > With radix, we can get page fault with DSISR_PROTFAULT value set in case of > PROT_NONE or autonuma mapping. The PROT_NONE case in handled by the vma check > where we consider the access bad. For autonuma we should fall through and >

Re: powerpc/xmon: Fix data-breakpoint

2017-02-15 Thread Michael Ellerman
On Tue, 2016-11-22 at 09:25:59 UTC, Ravi Bangoria wrote: > Xmon data-breakpoint feature is broken. > > Whenever there is a watchpoint match occurs, hw_breakpoint_handler will > be called by do_break via notifier chains mechanism. If watchpoint is > registered by xmon, hw_breakpoint_handler won't

Re: [1/3] drivers/pci/hotplug: Handle presence detection change properly

2017-02-15 Thread Michael Ellerman
On Wed, 2017-01-11 at 00:50:06 UTC, Gavin Shan wrote: > The surprise hotplug is driven by interrupt in PowerNV PCI hotplug > driver. In the interrupt handler, pnv_php_interrupt(), we bail when > pnv_pci_get_presence_state() returns zero wrongly. It causes the > presence change event is always

Re: [2/3] powerpc/asm: Define STACK_OFFSET macro in asm-offsets.c

2017-02-15 Thread Michael Ellerman
On Thu, 2016-06-02 at 04:29:47 UTC, Rashmica Gupta wrote: > There are quite a few entries in asm-offests.c look like this: > DEFINE(REG, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, reg)); > > So define a local MACRO to clean this up: > STACK_OFFSET(sym, val) DEFINE(sym, STACK_FRAME_OVERHEAD + \

Re: [1/3] powerpc/asm: Use OFFSET macro in asm-offsets.c

2017-02-15 Thread Michael Ellerman
On Thu, 2016-06-02 at 04:29:46 UTC, Rashmica Gupta wrote: > A lot of entries in asm-offests.c look like this: > DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); > > But there is a common macro, OFFSET, which makes this cleaner: > OFFSET(TI_flags, thread_info, flags), so use this. > >

Re: more POLL... fun

2017-02-15 Thread Michael Ellerman
On Fri, 2015-12-04 at 17:30:31 UTC, Al Viro wrote: > On Fri, Dec 04, 2015 at 06:13:54PM +0100, Arnd Bergmann wrote: > > > Yes, I think that would be best. Do you want me to send that patch, or do > > you prefer to do it yourself? In theory that patch should also go into > > stable > > kernels,

Re: [PATCH 2/3] pci/hotplug/pnv-php: Disable surprise hotplug capability on conflicts

2017-02-15 Thread Gavin Shan
On Thu, Feb 16, 2017 at 03:31:48PM +1100, Andrew Donnellan wrote: >On 16/02/17 10:22, Gavin Shan wrote: >>The root port or PCIe switch downstream port might have been associated >>with driver other than pnv-php. The MSI or MSIx might also have been >>enabled by that driver (e.g. pcieport_drv).

[PATCH 2/2] powerpc/mm: Blacklist SLB symbols from kprobe

2017-02-15 Thread Michael Ellerman
We can't sensibly take a trap at this point. So, blacklist these symbols. Reported-by: Anton Blanchard Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman --- arch/powerpc/mm/slb_low.S | 8 1 file

[PATCH 1/2] powerpc/mm: Convert slb_finish_load[_1T] to local symbols

2017-02-15 Thread Michael Ellerman
slb_finish_load and slb_finish_load_1T are both only used within slb_low.S, so make them local symbols. This makes the code a little clearer, as it's more obvious neither is intended to be an entry point from arbitrary other code, only the uses in this file. It also prevents them being used with

Re: [PATCH] powerpc/64: Call H_REGISTER_PROC_TBL when running as a HPT guest on POWER9

2017-02-15 Thread Suraj Jitindar Singh
On Thu, 2017-02-16 at 16:03 +1100, Paul Mackerras wrote: > On POWER9, since commit cc3d2940133d ("powerpc/64: Enable use of > radix > MMU under hypervisor on POWER9", 2017-01-30), we set both the radix > and > HPT bits in the client-architecture-support (CAS) vector, which tells > the hypervisor

Re: [PATCHv3 4/4] MAINTAINERS: Remove powerpc's opal match

2017-02-15 Thread Michael Ellerman
Jon Derrick writes: > PPC's 'opal' match pattern also matches block/sed-opal.c, where it looks > like the 'arch/powerpc' file pattern should be enough to match powerpc > opal code by itself. Remove the opal regex pattern from powerpc. We thought of it first. Can't

Re: [PATCH] powerpc/xmon: Fix an unexpected xmon onoff state change

2017-02-15 Thread Michael Ellerman
Pan Xinhui writes: > Once xmon is triggered by sysrq-x, it is enabled always afterwards even > if it is disabled during boot. This will cause a system reset interrut > fail to dump. So keep xmon in its original state after exit. > > Signed-off-by: Pan Xinhui

[PATCH] powerpc/64: Call H_REGISTER_PROC_TBL when running as a HPT guest on POWER9

2017-02-15 Thread Paul Mackerras
On POWER9, since commit cc3d2940133d ("powerpc/64: Enable use of radix MMU under hypervisor on POWER9", 2017-01-30), we set both the radix and HPT bits in the client-architecture-support (CAS) vector, which tells the hypervisor that we can do either radix or HPT. According to PAPR, if we use this

Re: [kernel-hardening] Re: [PATCH 1/2] powerpc: mm: support ARCH_MMAP_RND_BITS

2017-02-15 Thread Bhupesh Sharma
Hi Michael, On Fri, Feb 10, 2017 at 4:41 PM, Bhupesh Sharma wrote: > On Fri, Feb 10, 2017 at 4:31 PM, Michael Ellerman wrote: >> Bhupesh Sharma writes: >> >>> HI Michael, >>> >>> On Thu, Feb 2, 2017 at 3:53 PM, Michael Ellerman

Re: [PATCH 1/3] pci/hotplug/pnv-php: Remove WARN_ON() in pnv_php_put_slot()

2017-02-15 Thread Andrew Donnellan
On 16/02/17 10:22, Gavin Shan wrote: The WARN_ON() causes unnecessary backtrace when putting the parent slot, which is likely to be NULL. WARNING: CPU: 2 PID: 1071 at drivers/pci/hotplug/pnv_php.c:85 \ pnv_php_release+0xcc/0x150 [pnv_php] : Call Trace:

Re: [PATCH 3/3] pci/hotplug/pnv-php: Disable MSI and PCI device properly

2017-02-15 Thread Andrew Donnellan
On 16/02/17 10:22, Gavin Shan wrote: pnv_php_disable_irq() can be called in two paths: Bailing path in pnv_php_enable_irq() or releasing slot. The MSI (or MSIx) interrupts is disabled unconditionally in pnv_php_disable_irq(). It's wrong because that might be enabled by drivers other than

Re: [PATCH v7 2/4] powerpc/pseries: Revert 'Auto-online hotplugged memory'

2017-02-15 Thread Michael Ellerman
Nathan Fontenot writes: > Revert the patch patch to auto-online hotplugged memory, commit > id ec999072442a. Using the auto-online acpability does online added > memory but does not update the associated device struct to > indicate that the memory is online. The result

Re: [PATCH 2/3] pci/hotplug/pnv-php: Disable surprise hotplug capability on conflicts

2017-02-15 Thread Andrew Donnellan
On 16/02/17 10:22, Gavin Shan wrote: The root port or PCIe switch downstream port might have been associated with driver other than pnv-php. The MSI or MSIx might also have been enabled by that driver (e.g. pcieport_drv). Attempt to enable MSI incurs below backtrace: PowerPC PowerNV PCI

Re: [PATCH] powerpc/pseries: Fix build break when MEMORY_HOTREMOVE=n

2017-02-15 Thread Michael Ellerman
Nathan Fontenot writes: > On 02/15/2017 09:01 PM, Michael Ellerman wrote: >> We broke the build when CONFIG_MEMORY_HOTREMOVE=n: >> >> arch/powerpc/platforms/pseries/hotplug-memory.c:821:8: error: implicit >> declaration of function 'dlpar_memory_readd_by_index' >>

Re: [PATCH] powerpc/pseries: Fix build break when MEMORY_HOTREMOVE=n

2017-02-15 Thread Nathan Fontenot
On 02/15/2017 09:01 PM, Michael Ellerman wrote: > We broke the build when CONFIG_MEMORY_HOTREMOVE=n: > > arch/powerpc/platforms/pseries/hotplug-memory.c:821:8: error: implicit > declaration of function 'dlpar_memory_readd_by_index' > > Add a dummy to fix it. > > Fixes: e70d59700fc3

[PATCH] powerpc/pseries: Fix build break when MEMORY_HOTREMOVE=n

2017-02-15 Thread Michael Ellerman
We broke the build when CONFIG_MEMORY_HOTREMOVE=n: arch/powerpc/platforms/pseries/hotplug-memory.c:821:8: error: implicit declaration of function 'dlpar_memory_readd_by_index' Add a dummy to fix it. Fixes: e70d59700fc3 ("powerpc/pseries: Introduce memory hotplug READD operation")

[PATCH] powerpc/64: Disable use of radix under a hypervisor

2017-02-15 Thread Paul Mackerras
Currently, if the kernel is running on a POWER9 processor under a hypervisor, it may try to use the radix MMU even though it doesn't have the necessary code to do so (it doesn't negotiate use of radix, and it doesn't do the H_REGISTER_PROC_TBL hcall). If the hypervisor supports both radix and

Re: [PATCH 2/2] powerpc/powernv/opal-dump : Use IRQ_HANDLED instead of numbers in interrupt handler

2017-02-15 Thread Jeremy Kerr
Hi Mukesh, > The return value of an interrupt handler is the special type > irqreturn_t. An interrupt handler can return two special values, > IRQ_NONE or IRQ_HANDLED. Yep, you can assume that the reader knows that level of the interrupt handler API :) What we want to know is how that change in

Re: [PATCH v7 1/4] powerpc/pseries: dlpar_memory_readd_by_index() when MEMORY_HOTREMOVE not defined

2017-02-15 Thread David Gibson
On Wed, Feb 15, 2017 at 01:45:22PM -0500, Nathan Fontenot wrote: > Add a definition for dlpar_memory_readd_by_index() that returns > -EOPNOTSUPP to correct a build error when the config option > MEMORY_HOTREMOVE is not set. > > Signed-off-by: Nathan Fontenot

Re: [PATCH 2/2] powerpc/mm/autonuma: Switch ppc64 to its own implementeation of saved write

2017-02-15 Thread Aneesh Kumar K.V
On Thursday 16 February 2017 03:16 AM, Andrew Morton wrote: On Thu, 9 Feb 2017 08:30:59 +0530 "Aneesh Kumar K.V" wrote: With this our protnone becomes a present pte with READ/WRITE/EXEC bit cleared. By default we also set _PAGE_PRIVILEGED on such pte. This

Re: [PATCHv3 4/4] MAINTAINERS: Remove powerpc's opal match

2017-02-15 Thread Andrew Donnellan
On 16/02/17 11:37, Stewart Smith wrote: Jon Derrick writes: PPC's 'opal' match pattern also matches block/sed-opal.c, where it looks like the 'arch/powerpc' file pattern should be enough to match powerpc opal code by itself. Remove the opal regex pattern from

Re: [PATCH] powernv/opal: Handle OPAL_WRONG_STATE error from OPAL fails

2017-02-15 Thread Stewart Smith
Vipin K Parashar writes: > On Monday 13 February 2017 06:13 AM, Michael Ellerman wrote: >> Vipin K Parashar writes: >> >>> OPAL returns OPAL_WRONG_STATE for XSCOM operations >>> >>> done to read any core FIR which is sleeping, offline. >> OK.

Re: [PATCHv3 4/4] MAINTAINERS: Remove powerpc's opal match

2017-02-15 Thread Stewart Smith
Jon Derrick writes: > PPC's 'opal' match pattern also matches block/sed-opal.c, where it looks > like the 'arch/powerpc' file pattern should be enough to match powerpc > opal code by itself. Remove the opal regex pattern from powerpc. This patch will end up missing

Re: [PATCHv4 4/4] MAINTAINERS: Remove powerpc's opal match

2017-02-15 Thread Andrew Donnellan
On 16/02/17 08:45, Jon Derrick wrote: PPC's 'opal' match pattern also matches block/sed-opal.c, where it looks like the 'arch/powerpc' file pattern should be enough to match powerpc opal code by itself. Remove the opal regex pattern from powerpc. Signed-off-by: Jon Derrick

[PATCH 3/3] pci/hotplug/pnv-php: Disable MSI and PCI device properly

2017-02-15 Thread Gavin Shan
pnv_php_disable_irq() can be called in two paths: Bailing path in pnv_php_enable_irq() or releasing slot. The MSI (or MSIx) interrupts is disabled unconditionally in pnv_php_disable_irq(). It's wrong because that might be enabled by drivers other than pnv-php. This disables MSI (or MSIx)

[PATCH 1/3] pci/hotplug/pnv-php: Remove WARN_ON() in pnv_php_put_slot()

2017-02-15 Thread Gavin Shan
The WARN_ON() causes unnecessary backtrace when putting the parent slot, which is likely to be NULL. WARNING: CPU: 2 PID: 1071 at drivers/pci/hotplug/pnv_php.c:85 \ pnv_php_release+0xcc/0x150 [pnv_php] : Call Trace: [c003bc007c10] [dad613c4]

[PATCH 0/3] pci/hotplug/pnv-php: More bug fixes

2017-02-15 Thread Gavin Shan
This series bases on the series: https://patchwork.ozlabs.org/patch/713513. This series fixes couple of issues: * Remove WARN_ON() in pnv_php_put_slot(). The parent slot's refcount is decreased when releasing PCI slot. The parent slot can be NULL and no need to give a warning. *

[PATCH 2/3] pci/hotplug/pnv-php: Disable surprise hotplug capability on conflicts

2017-02-15 Thread Gavin Shan
The root port or PCIe switch downstream port might have been associated with driver other than pnv-php. The MSI or MSIx might also have been enabled by that driver (e.g. pcieport_drv). Attempt to enable MSI incurs below backtrace: PowerPC PowerNV PCI Hotplug Driver version: 0.1 [

Re: [PATCH 00/10] PCI: dwc: Rework and cleanup designware driver

2017-02-15 Thread Bjorn Helgaas
On Wed, Feb 15, 2017 at 06:48:09PM +0530, Kishon Vijay Abraham I wrote: > This series reworks designware driver in preparation for adding endpoint > mode support to designware driver. > > This series was previously sent as part of endpoint support series > https://lkml.org/lkml/2017/1/13/562 > >

[PATCHv4 4/4] MAINTAINERS: Remove powerpc's opal match

2017-02-15 Thread Jon Derrick
PPC's 'opal' match pattern also matches block/sed-opal.c, where it looks like the 'arch/powerpc' file pattern should be enough to match powerpc opal code by itself. Remove the opal regex pattern from powerpc. Signed-off-by: Jon Derrick --- MAINTAINERS | 1 - 1 file

[PATCHv4 3/4] block/sed: Check received header lengths

2017-02-15 Thread Jon Derrick
Add a buffer size check against discovery and response header lengths before we loop over their buffers. Signed-off-by: Jon Derrick Reviewed-by: Scott Bauer --- block/sed-opal.c | 35 +-- 1 file changed, 21

[PATCHv4 2/4] block/sed: Add helper to qualify response tokens

2017-02-15 Thread Jon Derrick
Add helper which verifies the response token is valid and matches the expected value. Merges token_type and response_get_token. Signed-off-by: Jon Derrick Reviewed-by: Scott Bauer --- block/sed-opal.c | 61

[PATCHv4 1/4] block/sed: Use ssize_t on atom parsers to return errors

2017-02-15 Thread Jon Derrick
The short atom parser can return an errno from decoding but does not currently return the error as a signed value. Convert all of the parsers to ssize_t. Signed-off-by: Jon Derrick Reviewed-by: Scott Bauer --- block/sed-opal.c | 28

[PATCHv4 0/4] OPAL patches

2017-02-15 Thread Jon Derrick
Just a couple of fixes for sed-opal to prevent faulty firmware from allowing us to go off in the weeds, and a helper to remove some duplicate code. v3->v4: uses IS_ERR since tok is embedded in the response buffer and cannot be NULL v2->v3: corrected the bad calculation on the response parser

Re: [PATCHv3 2/4] block/sed: Add helper to qualify response tokens

2017-02-15 Thread Scott Bauer
On Wed, Feb 15, 2017 at 12:42:07PM -0700, Jon Derrick wrote: > Add helper which verifies the response token is valid and matches the > expected value. Merges token_type and response_get_token. > > Signed-off-by: Jon Derrick > --- > block/sed-opal.c | 61 >

Re: [PATCH] powerpc/xmon: Fix an unexpected xmon onoff state change

2017-02-15 Thread Guilherme G. Piccoli
On 15/02/2017 05:49, Pan Xinhui wrote: > Once xmon is triggered by sysrq-x, it is enabled always afterwards even > if it is disabled during boot. This will cause a system reset interrut > fail to dump. So keep xmon in its original state after exit. > > Signed-off-by: Pan Xinhui

Re: [PATCHv3 3/4] block/sed: Check received header lengths

2017-02-15 Thread Scott Bauer
On Wed, Feb 15, 2017 at 12:42:08PM -0700, Jon Derrick wrote: > Add a buffer size check against discovery and response header lengths > before we loop over their buffers. > > Signed-off-by: Jon Derrick Reviewed-by: Scott Bauer

Re: [PATCHv3 1/4] block/sed: Use ssize_t on atom parsers to return errors

2017-02-15 Thread Scott Bauer
On Wed, Feb 15, 2017 at 12:42:06PM -0700, Jon Derrick wrote: > The short atom parser can return an errno from decoding but does not > currently return the error as a signed value. Convert all of the parsers > to ssize_t. > > Signed-off-by: Jon Derrick Reviewed-by:

[PATCHv3 4/4] MAINTAINERS: Remove powerpc's opal match

2017-02-15 Thread Jon Derrick
PPC's 'opal' match pattern also matches block/sed-opal.c, where it looks like the 'arch/powerpc' file pattern should be enough to match powerpc opal code by itself. Remove the opal regex pattern from powerpc. Signed-off-by: Jon Derrick --- MAINTAINERS | 1 - 1 file

[PATCHv3 3/4] block/sed: Check received header lengths

2017-02-15 Thread Jon Derrick
Add a buffer size check against discovery and response header lengths before we loop over their buffers. Signed-off-by: Jon Derrick --- block/sed-opal.c | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git

[PATCHv3 1/4] block/sed: Use ssize_t on atom parsers to return errors

2017-02-15 Thread Jon Derrick
The short atom parser can return an errno from decoding but does not currently return the error as a signed value. Convert all of the parsers to ssize_t. Signed-off-by: Jon Derrick --- block/sed-opal.c | 28 ++-- 1 file changed, 14

[PATCHv3 2/4] block/sed: Add helper to qualify response tokens

2017-02-15 Thread Jon Derrick
Add helper which verifies the response token is valid and matches the expected value. Merges token_type and response_get_token. Signed-off-by: Jon Derrick --- block/sed-opal.c | 61 +++- 1 file changed, 25

[PATCHv3 0/4] OPAL patches

2017-02-15 Thread Jon Derrick
Just a couple of fixes for sed-opal to prevent faulty firmware from allowing us to go off in the weeds, and a helper to remove some duplicate code. v2->v3: corrected the bad calculation on the response parser check and changed it to only check the subpacket length v1->v2: left tok->len as a

[PATCHv2 4/4] MAINTAINERS: Remove powerpc's opal match

2017-02-15 Thread Jon Derrick
PPC's 'opal' match pattern also matches block/sed-opal.c, where it looks like the 'arch/powerpc' file pattern should be enough to match powerpc opal code by itself. Remove the opal regex pattern from powerpc. Signed-off-by: Jon Derrick --- MAINTAINERS | 1 - 1 file

[PATCHv2 3/4] block/sed: Check received header lengths

2017-02-15 Thread Jon Derrick
Add a buffer size check against discovery and response header lengths before we loop over their buffers. Signed-off-by: Jon Derrick --- block/sed-opal.c | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git

[PATCHv2 2/4] block/sed: Add helper to qualify response tokens

2017-02-15 Thread Jon Derrick
Add helper which verifies the response token is valid and matches the expected value. Merges token_type and response_get_token. Signed-off-by: Jon Derrick --- block/sed-opal.c | 61 +++- 1 file changed, 25

[PATCHv2 1/4] block/sed: Use ssize_t on atom parsers to return errors

2017-02-15 Thread Jon Derrick
The short atom parser can return an errno from decoding but does not currently return the error as a signed value. Convert all of the parsers to ssize_t. Signed-off-by: Jon Derrick --- block/sed-opal.c | 28 ++-- 1 file changed, 14

[PATCHv2 0/4] OPAL patches

2017-02-15 Thread Jon Derrick
Just a couple of fixes for sed-opal to prevent faulty firmware from allowing us to go off in the weeds, and a helper to remove some duplicate code. v1->v2: left tok->len as a size_t got everyone important on the same email thread Jon Derrick (4): block/sed: Use ssize_t on atom parsers to

Re: [PATCH] powernv/opal: Handle OPAL_WRONG_STATE error from OPAL fails

2017-02-15 Thread Vipin K Parashar
Hi Michael, Thanks!! for review. Answers to your questions as below: On Monday 13 February 2017 06:13 AM, Michael Ellerman wrote: Vipin K Parashar writes: OPAL returns OPAL_WRONG_STATE for XSCOM operations done to read any core FIR which is sleeping, offline.

[PATCH v7 4/4] powerpc/pseries: Implement indexed-count hotplug memory remove

2017-02-15 Thread Nathan Fontenot
From: 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

[PATCH v7 3/4] powerpc/pseries: Implement indexed-count hotplug memory add

2017-02-15 Thread Nathan Fontenot
From: Sahil Mehta Indexed-count add for memory hotplug guarantees that a contiguous block of lmbs beginning at a specified will be assigned, any LMBs in this range that are not already assigned will be DLPAR added. Because of Qemu's per-DIMM memory management, the

[PATCH v7 2/4] powerpc/pseries: Revert 'Auto-online hotplugged memory'

2017-02-15 Thread Nathan Fontenot
Revert the patch patch to auto-online hotplugged memory, commit id ec999072442a. Using the auto-online acpability does online added memory but does not update the associated device struct to indicate that the memory is online. The result of this is that memoryXX/online file in sysfs still reports

[PATCH v7 1/4] powerpc/pseries: dlpar_memory_readd_by_index() when MEMORY_HOTREMOVE not defined

2017-02-15 Thread Nathan Fontenot
Add a definition for dlpar_memory_readd_by_index() that returns -EOPNOTSUPP to correct a build error when the config option MEMORY_HOTREMOVE is not set. Signed-off-by: Nathan Fontenot --- arch/powerpc/platforms/pseries/hotplug-memory.c |5 + 1 file changed, 5

[PATCH v7 0/4] powerpc/pseries: Implement indexed-count memory hotplug

2017-02-15 Thread Nathan Fontenot
Indexed-count memory hotplug allows addition and removal of contiguous lmb blocks with a single command. This update will help with memory DLPAR for Linux KVM guests and Qemu. The management of memory in Qemu on a per-DIMM basis currently requires that DLPAR operations are done in a series of

Re: [PATCH 1/3] powerpc: kprobes: fix handling of function offsets on ABIv2

2017-02-15 Thread Naveen N. Rao
On 2017/02/16 12:17AM, Masami Hiramatsu wrote: > On Tue, 14 Feb 2017 14:08:01 +0530 > "Naveen N. Rao" wrote: > > > commit 239aeba76409 ("perf powerpc: Fix kprobe and kretprobe handling > > with kallsyms on ppc64le") changed how we use the offset field in struct >

[PATCH] powerpc/fadump: set an upper limit for boot memory size

2017-02-15 Thread Hari Bathini
By default, 5% of system RAM is reserved for preserving boot memory. Alternatively, a user can specify the amount of memory to reserve. See Documentation/powerpc/firmware-assisted-dump.txt for details. In addition to the memory reserved for preserving boot memory, some more memory is reserved, to

Re: [PATCH 1/3] powerpc: kprobes: fix handling of function offsets on ABIv2

2017-02-15 Thread Masami Hiramatsu
On Tue, 14 Feb 2017 14:08:01 +0530 "Naveen N. Rao" wrote: > commit 239aeba76409 ("perf powerpc: Fix kprobe and kretprobe handling > with kallsyms on ppc64le") changed how we use the offset field in struct > kprobe on ABIv2. perf now offsets from the GEP (Global

Re: [PATCH v5 01/15] stacktrace/x86: add function for detecting reliable stack traces

2017-02-15 Thread Josh Poimboeuf
On Wed, Feb 15, 2017 at 01:18:40PM +0100, Miroslav Benes wrote: > On Mon, 13 Feb 2017, Josh Poimboeuf wrote: > > > For live patching and possibly other use cases, a stack trace is only > > useful if it can be assured that it's completely reliable. Add a new > > save_stack_trace_tsk_reliable()

[PATCH 02/10] PCI: dwc: *all*: Add platform_set_drvdata

2017-02-15 Thread Kishon Vijay Abraham I
Add platform_set_drvdata in all designware based drivers to store the private data structure of the driver so that dev_set_drvdata can be used to get back private data structure in add_pcie_port/host_init. This is in preparation for splitting struct pcie_port into core and host only structures.

[RFT PATCH 05/10] PCI: dwc: *all*: Split *struct pcie_port* into host only and core structures

2017-02-15 Thread Kishon Vijay Abraham I
Keep only the host specific members in *struct pcie_port* and move the common members (i.e common to both host and endpoint) to *struct dw_pcie*. This is in preparation for adding endpoint mode support to designware driver. While at that also fix checkpatch warnings. Cc: Jingoo Han

[PATCH 06/10] PCI: dwc: designware: Parse *num-lanes* property in dw_pcie_setup_rc

2017-02-15 Thread Kishon Vijay Abraham I
*num-lanes* dt property is parsed in dw_pcie_host_init. However *num-lanes* property is applicable to both root complex mode and endpoint mode. As a first step, move the parsing of this property outside dw_pcie_host_init. This is in preparation for splitting pcie-designware.c to pcie-designware.c

[PATCH 01/10] PCI: dwc: designware: Move the register defines to designware header file

2017-02-15 Thread Kishon Vijay Abraham I
No functional change. Move the register defines and other macros from pcie-designware.c to pcie-designware.h. This is in preparation to split the pcie-designware.c file into designware core file and host specific file. While at that also fix a checkpatch warning. Reviewed-By: Joao Pinto

[PATCH 00/10] PCI: dwc: Rework and cleanup designware driver

2017-02-15 Thread Kishon Vijay Abraham I
This series reworks designware driver in preparation for adding endpoint mode support to designware driver. This series was previously sent as part of endpoint support series https://lkml.org/lkml/2017/1/13/562 Validate pci host only in pci-dra7xx. Any help in validating other platforms would be

[PATCH 08/10] PCI: dwc: Split pcie-designware.c into host and core files

2017-02-15 Thread Kishon Vijay Abraham I
Split pcie-designware.c into pcie-designware-host.c that contains the host specific parts of the driver and pcie-designware.c that contains the parts used by both host driver and endpoint driver. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/dwc/Makefile |

[PATCH 10/10] PCI: dwc: Remove dependency of designware to CONFIG_PCI

2017-02-15 Thread Kishon Vijay Abraham I
CONFIG_PCI is used to enable the host mode PCI. In preparation for adding endpoint mode support to designware driver, remove the dependency of designware to CONFIG_PCI and make only the host specific part depend on CONFIG_PCI. Signed-off-by: Kishon Vijay Abraham I ---

[PATCH 09/10] PCI: dwc: Create a new config symbol to enable pci dwc host

2017-02-15 Thread Kishon Vijay Abraham I
Now that pci designware host has a separate file, create a new config symbol to select the host only driver. This will enable to independently select host support and endpoint suppor (when it's added). Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/dwc/Kconfig |

[PATCH 07/10] PCI: dwc: designware: Fix style errors in pcie-designware.c

2017-02-15 Thread Kishon Vijay Abraham I
No functional change. Fix all checkpatch warnings and check errors in pcie-designware.c Acked-By: Joao Pinto Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/dwc/pcie-designware.c | 42 ++--- 1 file changed, 21

[PATCH 03/10] PCI: dwc: *all*: Rename cfg_read/cfg_write to read/write

2017-02-15 Thread Kishon Vijay Abraham I
No functional change. dw_pcie_cfg_read/dw_pcie_cfg_write doesn't do anything specific to access configuration space. It can be just renamed to dw_pcie_read/dw_pcie_write and used to read/write data to dbi space. Cc: Jingoo Han Cc: Murali Karicheri Cc:

[PATCH 04/10] PCI: dwc: designware: Get device pointer at the start of dw_pcie_host_init

2017-02-15 Thread Kishon Vijay Abraham I
No functional change. Get device pointer at the beginning of dw_pcie_host_init instead of getting it all over dw_pcie_host_init. This is in preparation for splitting struct pcie_port into host and core structures (Once split pcie_port will not have device pointer). Signed-off-by: Kishon Vijay

Re: [PATCH v5 01/15] stacktrace/x86: add function for detecting reliable stack traces

2017-02-15 Thread Miroslav Benes
On Mon, 13 Feb 2017, Josh Poimboeuf wrote: > For live patching and possibly other use cases, a stack trace is only > useful if it can be assured that it's completely reliable. Add a new > save_stack_trace_tsk_reliable() function to achieve that. > > Note that if the target task isn't the

Re: linux-next: manual merge of the kvm tree with the powerpc tree

2017-02-15 Thread Paolo Bonzini
On 15/02/2017 12:16, Michael Ellerman wrote: >> However, the reason was that this is simply not how topic branches >> should work: topic branches should be the base for other work, they >> shouldn't contain _all_ the work. > > I think that's an overly specific definition of what a topic branch

Re: linux-next: manual merge of the kvm tree with the powerpc tree

2017-02-15 Thread Michael Ellerman
Paolo Bonzini writes: > On 14/02/2017 09:45, Michael Ellerman wrote: >>> If possible, please pull only up to "powerpc/64: Allow for relocation-on >>> interrupts from guest to host" and cherry-pick the top two patches >>> ("powerpc/64: CONFIG_RELOCATABLE support for hmi

[PATCH] powerpc/mm: Fix build break with BOOK3S_64=n and MEMORY_HOTPLUG=y

2017-02-15 Thread Michael Ellerman
The recently merged HPT (Hash Page Table) resize support broke the build when BOOK3S_64=n (ie. 32-bit or 64-bit Book3E) and MEMORY_HOTPLUG=y: arch/powerpc/mm/mem.o: In function `.arch_add_memory': (.text+0x4e4): undefined reference to `.resize_hpt_for_hotplug' Fix it by adding a dummy

Re: linux-next: manual merge of the kvm tree with the powerpc tree

2017-02-15 Thread Michael Ellerman
Stephen Rothwell writes: > Hi all, > > Today's linux-next merge of the kvm tree got a conflict in: > > arch/powerpc/kvm/book3s_hv_rm_xics.c > > between commit: > > ab9bad0ead9a ("powerpc/powernv: Remove separate entry for OPAL real mode > calls") > > from the powerpc

Re: [PATCH 2/2] powerpc/powernv/opal-dump : Use IRQ_HANDLED instead of numbers in interrupt handler

2017-02-15 Thread Mukesh Ojha
Hi Jeremy, On Wednesday 15 February 2017 08:48 AM, Jeremy Kerr wrote: Hi Mukesh, Converts all the return explicit number to a more proper IRQ_HANDLED, which looks proper incase of interrupt handler returning case. This looks good to me, but can you describe the effects of those changes to

Re: [RFC] implement QUEUED spinlocks on powerpc

2017-02-15 Thread panxinhui
在 2017/2/13 下午5:08, panxinhui 写道: > > > 在 2017/2/7 下午2:46, Eric Dumazet 写道: >> On Mon, Feb 6, 2017 at 10:21 PM, panxinhui wrote: >> >>> hi all >>> I do some netperf tests and get some benchmark results. >>> I also attach my test script and

[PATCH] powerpc: Document irq enable/disable toggle in migrate_irqs()

2017-02-15 Thread Michael Ellerman
This code is undocumented and unclear, and we've already had one patch sent to remove it because it's "paradoxical and unnecessary". So document it to save our future selves from puzzling over it. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/irq.c | 8 1

Re: [PATCH v6 00/12]powerpc: "paca->soft_enabled" based local atomic operation implementation

2017-02-15 Thread Madhavan Srinivasan
On Wednesday 08 February 2017 06:14 PM, Michael Ellerman wrote: Madhavan Srinivasan writes: Hi mpe, Any update on this series. Have also fixed the naming issue with patch 12 and with this series applied, "paca->soft_enabled" becomes "paca->soft_disabled_mask"