Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-25 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 26, 2020 6:26 am: > On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: >> diff --git a/arch/powerpc/include/asm/hw_irq.h >> b/arch/powerpc/include/asm/hw_irq.h >> index 3a0db7b0b46e..35060be09073 100644 >> ---

[PATCH v3 3/3] powerpc/pseries: Add KVM guest doorbell restrictions

2020-07-25 Thread Nicholas Piggin
KVM guests have certain restrictions and performance quirks when using doorbells. This patch moves the EPAPR KVM guest test so it can be shared with PSERIES, and uses that in doorbell setup code to apply the KVM guest quirks and improves IPI performance for two cases: - PowerVM guests may now

[PATCH v3 2/3] powerpc/pseries: Use doorbells even if XIVE is available

2020-07-25 Thread Nicholas Piggin
KVM supports msgsndp in guests by trapping and emulating the instruction, so it was decided to always use XIVE for IPIs if it is available. However on PowerVM systems, msgsndp can be used and gives better performance. On large systems, high XIVE interrupt rates can have sub-linear scaling, and

[PATCH v3 1/3] powerpc: inline doorbell sending functions

2020-07-25 Thread Nicholas Piggin
These are only called in one place for a given platform, so inline them for performance. Tested-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/dbell.h | 67 ++-- arch/powerpc/kernel/dbell.c | 55 -- 2

[PATCH v3 0/3] powerpc/pseries: IPI doorbell improvements

2020-07-25 Thread Nicholas Piggin
Since v2: - Fixed ppc32 compile error - Tested-by from Cedric Nicholas Piggin (3): powerpc: inline doorbell sending functions powerpc/pseries: Use doorbells even if XIVE is available powerpc/pseries: Add KVM guest doorbell restrictions arch/powerpc/include/asm/dbell.h | 67

[PATCH 9/9] powerpc: powernv: pci.h: delete duplicated word

2020-07-25 Thread Randy Dunlap
Drop the repeated word "for". Signed-off-by: Randy Dunlap Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/platforms/powernv/pci.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---

[PATCH 8/9] powerpc: smu.h: delete duplicated word

2020-07-25 Thread Randy Dunlap
Drop the repeated word "the". Signed-off-by: Randy Dunlap Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/include/asm/smu.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---

[PATCH 7/9] powerpc: reg.h: delete duplicated word

2020-07-25 Thread Randy Dunlap
Drop the repeated word "a". Signed-off-by: Randy Dunlap Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/include/asm/reg.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---

[PATCH 6/9] powerpc: ppc_asm.h: delete duplicated word

2020-07-25 Thread Randy Dunlap
Drop the repeated word "in". Signed-off-by: Randy Dunlap Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/include/asm/ppc_asm.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---

[PATCH 2/9] powerpc: book3s: radix-4k.h: delete duplicated word

2020-07-25 Thread Randy Dunlap
Drop the repeated word "per". Signed-off-by: Randy Dunlap Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/include/asm/book3s/64/radix-4k.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---

[PATCH 1/9] powerpc: book3s: mmu-hash.h: delete duplicated word

2020-07-25 Thread Randy Dunlap
Drop the repeated word "below". Signed-off-by: Randy Dunlap Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/include/asm/book3s/64/mmu-hash.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---

[PATCH 0/9] powerpc: delete duplicated words

2020-07-25 Thread Randy Dunlap
Drop duplicated words in arch/powerpc/ header files. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org arch/powerpc/include/asm/book3s/64/mmu-hash.h |2 +- arch/powerpc/include/asm/book3s/64/radix-4k.h |2 +-

[PATCH 4/9] powerpc: epapr_hcalls.h: delete duplicated words

2020-07-25 Thread Randy Dunlap
Drop the repeated words "file" and "the". Signed-off-by: Randy Dunlap Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/include/asm/epapr_hcalls.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---

[PATCH 3/9] powerpc: cputime.h: delete duplicated word

2020-07-25 Thread Randy Dunlap
Drop the repeated word "use". Signed-off-by: Randy Dunlap Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/include/asm/cputime.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---

[PATCH 5/9] powerpc: hw_breakpoint.h: delete duplicated word

2020-07-25 Thread Randy Dunlap
Drop the repeated word "the". Signed-off-by: Randy Dunlap Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/include/asm/hw_breakpoint.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---

[PATCH] selftests/powerpc: Skip vmx/vsx tests on older CPUs

2020-07-25 Thread Michael Ellerman
These tests use VSX or newer VMX instructions, so need to be skipped on older CPUs to avoid SIGILL'ing. Signed-off-by: Michael Ellerman --- tools/testing/selftests/powerpc/math/Makefile | 8 tools/testing/selftests/powerpc/math/vmx_preempt.c | 3 +++

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-25 Thread Peter Zijlstra
On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: > diff --git a/arch/powerpc/include/asm/hw_irq.h > b/arch/powerpc/include/asm/hw_irq.h > index 3a0db7b0b46e..35060be09073 100644 > --- a/arch/powerpc/include/asm/hw_irq.h > +++ b/arch/powerpc/include/asm/hw_irq.h > @@ -200,17

Re: [PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-25 Thread Waiman Long
On 7/25/20 1:26 PM, Peter Zijlstra wrote: On Fri, Jul 24, 2020 at 03:10:59PM -0400, Waiman Long wrote: On 7/24/20 4:16 AM, Will Deacon wrote: On Thu, Jul 23, 2020 at 08:47:59PM +0200, pet...@infradead.org wrote: On Thu, Jul 23, 2020 at 02:32:36PM -0400, Waiman Long wrote: BTW, do you have

Re: [PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-25 Thread Peter Zijlstra
On Fri, Jul 24, 2020 at 03:10:59PM -0400, Waiman Long wrote: > On 7/24/20 4:16 AM, Will Deacon wrote: > > On Thu, Jul 23, 2020 at 08:47:59PM +0200, pet...@infradead.org wrote: > > > On Thu, Jul 23, 2020 at 02:32:36PM -0400, Waiman Long wrote: > > > > BTW, do you have any comment on my v2 lock

Re: [PATCH v2] powerpc/uaccess: simplify the get_fs() set_fs() logic

2020-07-25 Thread Michael Ellerman
Hi Christophe, Unfortunately this would collide messily with "uaccess: remove segment_eq" in linux-next, so I'll ask you to do a respin based on that, some comments below. Christophe Leroy writes: > On powerpc, we only have USER_DS and KERNEL_DS > > Today, this is managed as an 'unsigned long'

[PATCH -next] powerpc/papr_scm: Make some symbols static

2020-07-25 Thread Wei Yongjun
The sparse tool complains as follows: arch/powerpc/platforms/pseries/papr_scm.c:97:1: warning: symbol 'papr_nd_regions' was not declared. Should it be static? arch/powerpc/platforms/pseries/papr_scm.c:98:1: warning: symbol 'papr_ndr_lock' was not declared. Should it be static? Those variables

[PATCH v3 14/14] powerpc/eeh: Move PE tree setup into the platform

2020-07-25 Thread Oliver O'Halloran
The EEH core has a concept of a "PE tree" to support PowerNV. The PE tree follows the PCI bus structures because a reset asserted on an upstream bridge will be propagated to the downstream bridges. On pseries there's a 1-1 correspondence between what the guest sees are a PHB and a PE so the "tree"

[PATCH v3 13/14] powerpc/eeh: Drop pdn use in eeh_pe_tree_insert()

2020-07-25 Thread Oliver O'Halloran
This is mostly just to make the subsequent diffs less noisy. No functional changes. One thing that needs calling out is the removal of the "config_addr" variable and replacing it with edev->bdfn. The contents of edev->bdfn are the same, however it's worth pointing out that what RTAS calls a

[PATCH v3 12/14] powerpc/eeh: Rename eeh_{add_to|remove_from}_parent_pe()

2020-07-25 Thread Oliver O'Halloran
The naming of eeh_{add_to|remove_from}_parent_pe() doesn't really reflect what they actually do. If the PE referred to be edev->pe_config_addr already exists under that PHB then the edev is added to that PE. However, if the PE doesn't exist the a new one is created for the edev. The bulk of the

[PATCH v3 11/14] powerpc/eeh: Remove class code field from edev

2020-07-25 Thread Oliver O'Halloran
The edev->class_code field is never referenced anywhere except for the platform specific probe functions. The same information is available in the pci_dev for PowerNV and in the pci_dn on pseries so we can remove the field. Signed-off-by: Oliver O'Halloran --- v2: no changes v3: no changes ---

[PATCH v3 10/14] powerpc/eeh: Remove spurious use of pci_dn in eeh_dump_dev_log

2020-07-25 Thread Oliver O'Halloran
Retrieve the domain, bus, device, and function numbers from the edev. Signed-off-by: Oliver O'Halloran --- v2: no change v3: no change --- arch/powerpc/kernel/eeh.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/kernel/eeh.c

[PATCH v3 09/14] powerpc/eeh: Pass eeh_dev to eeh_ops->{read|write}_config()

2020-07-25 Thread Oliver O'Halloran
Mechanical conversion of the eeh_ops interfaces to use eeh_dev to reference a specific device rather than pci_dn. No functional changes. Signed-off-by: Oliver O'Halloran --- v2: no change v3: no change --- arch/powerpc/include/asm/eeh.h | 4 +- arch/powerpc/kernel/eeh.c

[PATCH v3 08/14] powerpc/eeh: Pass eeh_dev to eeh_ops->resume_notify()

2020-07-25 Thread Oliver O'Halloran
Mechanical conversion of the eeh_ops interfaces to use eeh_dev to reference a specific device rather than pci_dn. No functional changes. Signed-off-by: Oliver O'Halloran --- v2: no changes v3: no changes --- arch/powerpc/include/asm/eeh.h | 2 +- arch/powerpc/kernel/eeh_driver.c

[PATCH v3 07/14] powerpc/eeh: Pass eeh_dev to eeh_ops->restore_config()

2020-07-25 Thread Oliver O'Halloran
Mechanical conversion of the eeh_ops interfaces to use eeh_dev to reference a specific device rather than pci_dn. No functional changes. Signed-off-by: Oliver O'Halloran --- v2: no changes v3: no changes --- arch/powerpc/include/asm/eeh.h | 2 +- arch/powerpc/kernel/eeh.c

[PATCH v3 06/14] powerpc/eeh: Remove VF config space restoration

2020-07-25 Thread Oliver O'Halloran
There's a bunch of strange things about this code. First up is that none of the fields being written to are functional for a VF. The SR-IOV specification lists then as "Reserved, but OS should preserve" so writing new values to them doesn't do anything and is clearly wrong from a correctness

[PATCH v3 05/14] powerpc/eeh: Kill off eeh_ops->get_pe_addr()

2020-07-25 Thread Oliver O'Halloran
This is used in precisely one place which is in pseries specific platform code. There's no need to have the callback in eeh_ops since the platform chooses the EEH PE addresses anyway. The PowerNV implementation has always been a stub too so remove it. Signed-off-by: Oliver O'Halloran

[PATCH v3 04/14] powerpc/pseries: Stop using pdn->pe_number

2020-07-25 Thread Oliver O'Halloran
The pci_dn->pe_number field is mainly used to track the IODA PE number of a device on PowerNV. At some point it grew a user in the pseries SR-IOV support which muddies the waters a bit, so remove it. Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy --- v2: no change v3: no

[PATCH v3 03/14] powerpc/eeh: Move vf_index out of pci_dn and into eeh_dev

2020-07-25 Thread Oliver O'Halloran
Drivers that do not support the PCI error handling callbacks are handled by tearing down the device and re-probing them. If the device being removed is a virtual function then we need to know the VF index so it can be removed using the pci_iov_{add|remove}_virtfn() API. Currently this is handled

[PATCH v3 02/14] powerpc/eeh: Remove eeh_dev.c

2020-07-25 Thread Oliver O'Halloran
The only thing in this file is eeh_dev_init() which is allocates and initialises an eeh_dev based on a pci_dn. This is only ever called from pci_dn.c so move it into there and remove the file. Signed-off-by: Oliver O'Halloran --- v2: no change v3: no change --- arch/powerpc/include/asm/eeh.h |

[PATCH v3 01/14] powerpc/eeh: Remove eeh_dev_phb_init_dynamic()

2020-07-25 Thread Oliver O'Halloran
This function is a one line wrapper around eeh_phb_pe_create() and despite the name it doesn't create any eeh_dev structures. Replace it with direct calls to eeh_phb_pe_create() since that does what it says on the tin and removes a layer of indirection. Signed-off-by: Oliver O'Halloran --- v2:

Re: [PATCH v3 0/4] powerpc/mm/radix: Memory unplug fixes

2020-07-25 Thread David Gibson
On Fri, Jul 24, 2020 at 09:52:14PM +1000, Michael Ellerman wrote: > Bharata B Rao writes: > > On Tue, Jul 21, 2020 at 10:25:58PM +1000, Michael Ellerman wrote: > >> Bharata B Rao writes: > >> > On Tue, Jul 21, 2020 at 11:45:20AM +1000, Michael Ellerman wrote: > >> >> Nathan Lynch writes: > >>