Re: [PATCH] powerpc/powernv/npu: Fix oops in pnv_try_setup_npu_table_group()

2019-01-09 Thread Greg Kurz
On Wed, 9 Jan 2019 17:45:53 +0100 Frederic Barrat wrote: > Le 09/01/2019 à 17:25, Greg Kurz a écrit : > > On Wed, 9 Jan 2019 16:13:42 +0100 > > Frederic Barrat wrote: > > > >> With a recent change around IOMMU group, a system with an opencapi > >>

Re: [PATCH v4 0/4] ocxl: OpenCAPI Cleanup

2019-03-25 Thread Greg Kurz
Hi Alastair, I forgot to mention it during v3 but please don't link new version of a patchset to the previous one with --in-reply-to. This is to ensure I can see them in my email client without having to scroll back many days in the past (which likely means a fair number of e-mails on

Re: [PATCH v4 3/4] ocxl: Remove superfluous 'extern' from headers

2019-03-25 Thread Greg Kurz
On Mon, 25 Mar 2019 16:34:54 +1100 "Alastair D'Silva" wrote: > From: Alastair D'Silva > > The 'extern' keyword adds no value here. > > Signed-off-by: Alastair D'Silva > --- Reviewed-by: Greg Kurz > drivers/misc/ocxl/ocxl_internal.h | 54 +++-

Re: [PATCH v4 4/4] ocxl: Remove some unused exported symbols

2019-03-25 Thread Greg Kurz
On Mon, 25 Mar 2019 16:34:55 +1100 "Alastair D'Silva" wrote: > From: Alastair D'Silva > > Remove some unused exported symbols. > > Signed-off-by: Alastair D'Silva > --- Reviewed-by: Greg Kurz > drivers/misc/ocxl/config.c| 4 +--- > driv

Re: [PATCH 1/5] ocxl: Rename struct link to ocxl_link

2019-02-27 Thread Greg Kurz
, 27 February 2019 6:55 PM > >>> To: Alastair D'Silva ; 'Alastair D'Silva' > >>> > >>> Cc: 'Greg Kurz' ; 'Frederic Barrat' > >>> ; 'Arnd Bergmann' ; 'Greg Kroah- > >>> Hartman' ; linuxppc-dev@lists.ozlabs.org; > >>> linux-ker..

Re: [PATCH 1/5] ocxl: Rename struct link to ocxl_link

2019-02-27 Thread Greg Kurz
On Wed, 27 Feb 2019 15:57:37 +1100 "Alastair D'Silva" wrote: > From: Alastair D'Silva > > The term 'link' is ambiguous (especially when the struct is used for a > list), so rename it for clarity. > > Signed-off-by: Alastair D'Silva > Reviewed-by: Greg Kurz &g

Re: [PATCH 5/5] ocxl: Remove some unused exported symbols

2019-03-14 Thread Greg Kurz
On Thu, 14 Mar 2019 13:23:21 +1100 "Alastair D'Silva" wrote: > On Wed, 2019-03-13 at 10:10 +0100, Greg Kurz wrote: > > On Wed, 13 Mar 2019 15:07:01 +1100 > > "Alastair D'Silva" wrote: > > > > > From: Alastair D'Silva > > > > &g

Re: [PATCH 4/5] ocxl: Remove superfluous 'extern' from headers

2019-03-13 Thread Greg Kurz
On Wed, 13 Mar 2019 15:07:00 +1100 "Alastair D'Silva" wrote: > From: Alastair D'Silva > > The 'extern' keyword adds no value here. > > Signed-off-by: Alastair D'Silva > --- Reviewed-by: Greg Kurz > drivers/misc/ocxl/ocxl_internal.h | 54 +++-

Re: [PATCH 5/5] ocxl: Remove some unused exported symbols

2019-03-13 Thread Greg Kurz
On Wed, 13 Mar 2019 15:07:01 +1100 "Alastair D'Silva" wrote: > From: Alastair D'Silva > > Remove some unused exported symbols. > > Signed-off-by: Alastair D'Silva > --- > drivers/misc/ocxl/config.c| 2 -- > drivers/misc/ocxl/ocxl_internal.h | 23 +++ >

Re: [PATCH 2/5] ocxl: Clean up printf formats

2019-03-13 Thread Greg Kurz
On Wed, 13 Mar 2019 15:06:58 +1100 "Alastair D'Silva" wrote: > From: Alastair D'Silva > > Use %# instead of using a literal '0x' > > Signed-off-by: Alastair D'Silva > --- Reviewed-by: Greg Kurz > drivers/misc/ocxl/config.c | 6 +++--- > drivers/misc

Re: [PATCH 6/7] ocxl: afu_irq only deals with IRQ IDs, not offsets

2019-03-15 Thread Greg Kurz
On Wed, 13 Mar 2019 15:15:21 +1100 "Alastair D'Silva" wrote: > From: Alastair D'Silva > > The use of offsets is required only in the frontend, so alter > the IRQ API to only work with IRQ IDs in the backend. > > Signed-off-by: Alastair D'Silva > --- > drivers/misc/ocxl/afu_irq.c | 31

Re: [PATCH] powerpc/pseries: Fix xive=off command line

2019-05-17 Thread Greg Kurz
On Wed, 15 May 2019 10:54:42 + Sasha Levin wrote: > Hi, > Hi, > [This is an automated email] > > This commit has been processed because it contains a "Fixes:" tag, > fixing commit: eac1e731b59e powerpc/xive: guest exploitation of the XIVE > interrupt controller. > > The bot has tested

Re: [PATCH] ocxl: Fix concurrent AFU open and device removal

2019-06-24 Thread Greg Kurz
On Mon, 24 Jun 2019 17:39:26 +0200 Frederic Barrat wrote: > Le 24/06/2019 à 17:24, Greg Kurz a écrit : > > On Mon, 24 Jun 2019 16:41:48 +0200 > > Frederic Barrat wrote: > > > >> If an ocxl device is unbound through sysfs at the same time its AFU is >

Re: [PATCH] ocxl: Fix concurrent AFU open and device removal

2019-06-24 Thread Greg Kurz
u *afu) > > ocxl_file_make_invisible(info); > ocxl_sysfs_unregister_afu(info); > + free_minor(info); Since the IDR entry is added by ocxl_file_register_afu(), it seems to make sense to undo that in ocxl_file_unregister_afu(). Out of curiosity, was there any historical reason to do this in info_release() in the first place ? Reviewed-by: Greg Kurz > device_unregister(>dev); > } >

Re: [PATCH] powerpc/powernv/npu: Fix reference leak

2019-05-13 Thread Greg Kurz
Michael, Any comments on this patch ? Should I repost with a shorter comment as suggested by Alexey ? Cheers, -- Greg On Mon, 29 Apr 2019 12:36:59 +0200 Greg Kurz wrote: > On Mon, 29 Apr 2019 16:01:29 +1000 > Alexey Kardashevskiy wrote: > > > On 20/04/2019 01:34,

Re: [PATCH v2] ocxl: Fix potential memory leak on context creation

2019-05-20 Thread Greg Kurz
ext forever, which is a safer practice IMHO. Patch is correct anyway, so: Reviewed-by: Greg Kurz > drivers/misc/ocxl/context.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/misc/ocxl/context.c b/drivers/misc/ocxl/context.c > index bab9c9364184..24e4fb010275 10064

[PATCH] powerpc/pseries: Fix xive=off command line

2019-05-15 Thread Greg Kurz
s XIVE. Fixes: eac1e731b59e ("powerpc/xive: guest exploitation of the XIVE interrupt controller") Cc: sta...@vger.kernel.org # v4.20 Reported-by: Pavithra R. Prakash Signed-off-by: Greg Kurz --- eac1e731b59e is a v4.16 commit actually but this patch only applies cleanly to v4.20 and ne

Re: [PATCH] powerpc/powernv/npu: Fix reference leak

2019-05-14 Thread Greg Kurz
On Tue, 14 May 2019 21:13:40 +1000 Michael Ellerman wrote: > Greg Kurz writes: > > Michael, > > > > Any comments on this patch ? Should I repost with a shorter comment > > as suggested by Alexey ? > > No the longer comment seems fine to me. > > I'm not

Re: [PATCH] powerpc/powernv/npu: Fix reference leak

2019-04-29 Thread Greg Kurz
On Mon, 29 Apr 2019 16:01:29 +1000 Alexey Kardashevskiy wrote: > On 20/04/2019 01:34, Greg Kurz wrote: > > Since 902bdc57451c, get_pci_dev() calls pci_get_domain_bus_and_slot(). This > > has the effect of incrementing the reference count of the PCI device, as > > exp

Re: [PATCH] vfio-pci/nvlink2: Fix potential VMA leak

2019-05-07 Thread Greg Kurz
On Tue, 7 May 2019 11:52:44 +1000 Sam Bobroff wrote: > On Mon, May 06, 2019 at 03:58:45PM -0600, Alex Williamson wrote: > > On Fri, 19 Apr 2019 17:37:17 +0200 > > Greg Kurz wrote: > > > > > If vfio_pci_register_dev_region() fails then we should rollback >

[PATCH] vfio-pci/nvlink2: Fix potential VMA leak

2019-04-19 Thread Greg Kurz
If vfio_pci_register_dev_region() fails then we should rollback previous changes, ie. unmap the ATSD registers. Signed-off-by: Greg Kurz --- drivers/vfio/pci/vfio_pci_nvlink2.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vfio/pci/vfio_pci_nvlink2.c b/drivers/vfio/pci

[PATCH] powerpc/powernv/npu: Fix reference leak

2019-04-19 Thread Greg Kurz
: 902bdc57451c ("powerpc/powernv/idoa: Remove unnecessary pcidev from pci_dn") Cc: sta...@vger.kernel.org # v4.16 Signed-off-by: Greg Kurz --- arch/powerpc/platforms/powernv/npu-dma.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv

[PATCH] KVM: PPC: Book3S HV: XIVE: Fix typo in comment

2019-07-03 Thread Greg Kurz
Cc: triv...@kernel.org Signed-off-by: Greg Kurz --- arch/powerpc/kvm/book3s_xive.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c index 1fcb3d6f1db8..e3169e8bf1fc 100644 --- a/arch/powerpc/kvm/book3s_xive.c

[PATCH] powerpc/xive: Fix bogus error code returned by OPAL

2019-09-10 Thread Greg Kurz
URCE which is the usual error returned upon resource exhaustion. Signed-off-by: Greg Kurz --- arch/powerpc/sysdev/xive/native.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c index 37

Re: [PATCH] KVM: PPC: Book3S HV: Tunable to configure maximum # of vCPUs per VM

2019-09-11 Thread Greg Kurz
On Wed, 11 Sep 2019 12:30:48 +1000 David Gibson wrote: > On Tue, Sep 10, 2019 at 06:49:34PM +0200, Greg Kurz wrote: > > Each vCPU of a VM allocates a XIVE VP in OPAL which is associated with > > 8 event queue (EQ) descriptors, one for each priority. A POWER9 socket > > can h

[PATCH] KVM: PPC: Book3S HV: Tunable to configure maximum # of vCPUs per VM

2019-09-10 Thread Greg Kurz
treme load and memory exhaustion but the VMs did start. Signed-off-by: Greg Kurz --- arch/powerpc/include/asm/kvm_host.h |1 + arch/powerpc/kvm/book3s_hv.c | 32 arch/powerpc/kvm/book3s_xive.c|2 +- arch/powerpc/kvm/book3s_xive_native.c |

Re: [PATCH trivial] KVM: PPC: Remove superfluous check for non-zero return value

2019-09-18 Thread Greg Kurz
On Wed, 18 Sep 2019 18:44:36 +0200 Greg Kurz wrote: > On Wed, 11 Sep 2019 21:52:35 +0200 > Thomas Huth wrote: > > > After the kfree()s haven been removed in the previous > > commit 9798f4ea71ea ("fix rollback when kvmppc_xive_create fails"), > > the code

Re: [PATCH trivial] KVM: PPC: Remove superfluous check for non-zero return value

2019-09-18 Thread Greg Kurz
> > Signed-off-by: Thomas Huth > --- This looks like a good candidate for trivial, hence Cc'ing Jiri and adding trivial keyword in subject. Reviewed-by: Greg Kurz > arch/powerpc/kvm/book3s_xive.c| 5 + > arch/powerpc/kvm/book3s_xive_native.c | 5 + > 2 files change

[PATCH v2] powerpc/xive: Fix bogus error code returned by OPAL

2019-09-11 Thread Greg Kurz
URCE which is the usual error returned upon resource exhaustion. Cc: sta...@vger.kernel.org # v4.12+ Signed-off-by: Greg Kurz --- v2: - fix syntax error in changelog - Cc stable - rename original OPAL wrapper - rewrite fixup wrapper (style, use s64 and u32) --- arch/powerpc/include/

Re: [PATCH] powerpc/xive: Fix bogus error code returned by OPAL

2019-09-11 Thread Greg Kurz
On Thu, 12 Sep 2019 00:26:19 +1000 Michael Ellerman wrote: > Hi Greg, > Bom dia ! :) > Couple of comments ... > > Greg Kurz writes: > > There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call > > to return the 32-bit value 0x wh

Re: [PATCH 2/2] powerpc/xive: Add a check for memory allocation failure

2019-08-01 Thread Greg Kurz
On Thu, 1 Aug 2019 10:32:42 +0200 Christophe JAILLET wrote: > The result of this kzalloc is not checked. Add a check and corresponding > error handling code. > > Signed-off-by: Christophe JAILLET > --- Reviewed-by: Greg Kurz > Note that 'xive_irq_bitmap_add()' failur

Re: [PATCH 1/2] powerpc/xive: Use GFP_KERNEL instead of GFP_ATOMIC in 'xive_irq_bitmap_add()'

2019-08-01 Thread Greg Kurz
On Thu, 1 Aug 2019 10:32:31 +0200 Christophe JAILLET wrote: > There is no need to use GFP_ATOMIC here. GFP_KERNEL should be enough. > GFP_KERNEL is also already used for another allocation just a few lines > below. > > Signed-off-by: Christophe JAILLET > --- Good catch.

[PATCH 1/6] KVM: PPC: Book3S HV: XIVE: initialize private pointer when VPs are allocated

2019-09-23 Thread Greg Kurz
by: Cédric Le Goater Signed-off-by: Greg Kurz --- arch/powerpc/kvm/book3s_xive.c| 13 +++-- arch/powerpc/kvm/book3s_xive_native.c | 13 +++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xi

[PATCH 6/6] KVM: PPC: Book3S HV: XIVE: Allow userspace to set the # of VPs

2019-09-23 Thread Greg Kurz
. Since the legacy XIVE KVM device is exposed to userspace through the XICS KVM API, a new attribute group is added to it for this purpose. While here, fix the syntax of the existing KVM_DEV_XICS_GRP_SOURCES in the XICS documentation. Signed-off-by: Greg Kurz --- Documentation/virt/kvm/devices

[PATCH 0/6] KVM: PPC: Book3S: HV: XIVE: Allocate less VPs in OPAL

2019-09-23 Thread Greg Kurz
Le Goater (1): KVM: PPC: Book3S HV: XIVE: initialize private pointer when VPs are allocated Greg Kurz (5): KVM: PPC: Book3S HV: XIVE: Set kvm->arch.xive when VPs are allocated KVM: PPC: Book3S HV: XIVE: Ensure VP isn't already in use KVM: PPC: Book3S HV: XIVE: Comp

[PATCH 4/6] KVM: PPC: Book3S HV: XIVE: Compute the VP id in a common helper

2019-09-23 Thread Greg Kurz
Reduce code duplication by consolidating the checking of vCPU ids and VP ids to a common helper used by both legacy and native XIVE KVM devices. And explain the magic with a comment. Signed-off-by: Greg Kurz --- arch/powerpc/kvm/book3s_xive.c| 42

[PATCH 5/6] KVM: PPC: Book3S HV: XIVE: Make VP block size configurable

2019-09-23 Thread Greg Kurz
uld hence only need 256 VPs instead of 2048. If the stride is set to match the number of threads per core, this goes further down to 32. This will be exposed to userspace by a subsequent patch. Signed-off-by: Greg Kurz --- arch/powerpc/kvm/book3s_xive.c|

[PATCH 2/6] KVM: PPC: Book3S HV: XIVE: Set kvm->arch.xive when VPs are allocated

2019-09-23 Thread Greg Kurz
Fixes: 5422e95103cf ("KVM: PPC: Book3S HV: XIVE: Replace the 'destroy' method by a 'release' method") Signed-off-by: Greg Kurz --- arch/powerpc/kvm/book3s_xive.c| 11 +-- arch/powerpc/kvm/book3s_xive_native.c |2 +- 2 files changed, 6 insertions(+), 7 deletions(-) d

[PATCH 3/6] KVM: PPC: Book3S HV: XIVE: Ensure VP isn't already in use

2019-09-23 Thread Greg Kurz
tch irq 4161. 0001 (kvm-1-2392) vs. 0001 (kvm-1-348) Check the VP id instead of the vCPU id when a new vCPU is connected. The allocation of the XIVE CPU structure in kvmppc_xive_connect_vcpu() is moved after the check to avoid the need for rollback. Signed-off-by: Greg Kurz --- arch/powe

Re: [PATCH 1/6] KVM: PPC: Book3S HV: XIVE: initialize private pointer when VPs are allocated

2019-09-24 Thread Greg Kurz
On Tue, 24 Sep 2019 15:28:55 +1000 Paul Mackerras wrote: > On Mon, Sep 23, 2019 at 05:43:37PM +0200, Greg Kurz wrote: > > From: Cédric Le Goater > > > > Do not assign the device private pointer before making sure the XIVE > > VPs are allocated in OPAL and test poin

Re: [PATCH v2 4/6] KVM: PPC: Book3S HV: XIVE: Compute the VP id in a common helper

2019-09-30 Thread Greg Kurz
On Mon, 30 Sep 2019 14:01:56 +0200 Cédric Le Goater wrote: > On 27/09/2019 13:53, Greg Kurz wrote: > > Reduce code duplication by consolidating the checking of vCPU ids and VP > > ids to a common helper used by both legacy and native XIVE KVM devices. > > And explain the

[PATCH v2 0/6] KVM: PPC: Book3S: HV: XIVE: Allocate less VPs in OPAL

2019-09-27 Thread Greg Kurz
-- Greg --- Greg Kurz (6): KVM: PPC: Book3S HV: XIVE: Set kvm->arch.xive when VPs are allocated KVM: PPC: Book3S HV: XIVE: Ensure VP isn't already in use KVM: PPC: Book3S HV: XIVE: Show VP id in debugfs KVM: PPC: Book3S HV: XIVE: Compute the VP id in a common helper

[PATCH v2 1/6] KVM: PPC: Book3S HV: XIVE: Set kvm->arch.xive when VPs are allocated

2019-09-27 Thread Greg Kurz
ocated in OPAL. Cc: sta...@vger.kernel.org # v5.2 Fixes: 5422e95103cf ("KVM: PPC: Book3S HV: XIVE: Replace the 'destroy' method by a 'release' method") Signed-off-by: Greg Kurz Reviewed-by: Cédric Le Goater --- arch/powerpc/kvm/book3s_xive.c| 11 +--

[PATCH v2 2/6] KVM: PPC: Book3S HV: XIVE: Ensure VP isn't already in use

2019-09-27 Thread Greg Kurz
w vCPU is connected. The allocation of the XIVE CPU structure in kvmppc_xive_connect_vcpu() is moved after the check to avoid the need for rollback. Cc: sta...@vger.kernel.org # v4.12+ Signed-off-by: Greg Kurz Reviewed-by: Cédric Le Goater --- v2: - more detailed changelog --- arch/power

[PATCH v2 4/6] KVM: PPC: Book3S HV: XIVE: Compute the VP id in a common helper

2019-09-27 Thread Greg Kurz
Reduce code duplication by consolidating the checking of vCPU ids and VP ids to a common helper used by both legacy and native XIVE KVM devices. And explain the magic with a comment. Signed-off-by: Greg Kurz --- arch/powerpc/kvm/book3s_xive.c| 42

[PATCH v2 3/6] KVM: PPC: Book3S HV: XIVE: Show VP id in debugfs

2019-09-27 Thread Greg Kurz
Print out the VP id of each connected vCPU, this allow to see: - the VP block base in which OPAL encodes information that may be useful when debugging - the packed vCPU id which may differ from the raw vCPU id if the latter is >= KVM_MAX_VCPUS (2048) Signed-off-by: Greg Kurz --- a

[PATCH v2 5/6] KVM: PPC: Book3S HV: XIVE: Make VP block size configurable

2019-09-27 Thread Greg Kurz
uld hence only need 256 VPs instead of 2048. If the stride is set to match the number of threads per core, this goes further down to 32. This will be exposed to userspace by a subsequent patch. Signed-off-by: Greg Kurz --- v2: - update nr_server check and clip down to KVM_MAX_VC

[PATCH v2 6/6] KVM: PPC: Book3S HV: XIVE: Allow userspace to set the # of VPs

2019-09-27 Thread Greg Kurz
of the existing KVM_DEV_XICS_GRP_SOURCES in the XICS documentation. Signed-off-by: Greg Kurz Reviewed-by: Cédric Le Goater --- v2: - changelog update --- Documentation/virt/kvm/devices/xics.txt | 14 -- Documentation/virt/kvm/devices/xive.txt |8 arch/powerpc/include/uapi/asm

[PATCH] KVM: PPC: Book3S HV: XIVE: Free previous EQ page when setting up a new one

2019-11-11 Thread Greg Kurz
H_INT_SET_QUEUE_CONFIG isn't a hot path. Reported-by: Satheesh Rajendran Cc: sta...@vger.kernel.org # v5.2 Fixes: 13ce3297c576 ("KVM: PPC: Book3S HV: XIVE: Add controls for the EQ configuration") Signed-off-by: Greg Kurz --- arch/powerpc/kvm/book3s_xive_native.c | 21 ---

Re: [PATCH 3/3] powerpc/pseries: Fixup config space size of OpenCAPI devices

2019-11-09 Thread Greg Kurz
On Thu, 7 Nov 2019 09:46:25 +0100 christophe lombard wrote: > On 05/11/2019 06:01, Andrew Donnellan wrote: > > On 22/10/19 6:52 pm, christophe lombard wrote: > >> Fix up the pci config size of the OpenCAPI PCIe devices in the pseries > >> environment. > >> Most of OpenCAPI PCIe devices have 4096

[PATCH v2 1/2] KVM: PPC: Book3S HV: XIVE: Free previous EQ page when setting up a new one

2019-11-13 Thread Greg Kurz
XIVE: Add controls for the EQ configuration") Signed-off-by: Cédric Le Goater Signed-off-by: Greg Kurz --- v2: use wrapper as suggested by Cedric --- arch/powerpc/kvm/book3s_xive_native.c | 31 ++- 1 file changed, 22 insertions(+), 9 deletions(-) diff --

[PATCH v2 2/2] KVM: PPC: Book3S HV: XIVE: Fix potential page leak on error path

2019-11-13 Thread Greg Kurz
ation") Signed-off-by: Greg Kurz --- arch/powerpc/kvm/book3s_xive_native.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c index 0e1fc5a16729..d83adb1e1490 100644 --- a/arch/p

Re: [PATCH] KVM: PPC: Book3S HV: XIVE: Free previous EQ page when setting up a new one

2019-11-12 Thread Greg Kurz
On Mon, 11 Nov 2019 12:26:25 +0100 Cédric Le Goater wrote: > On 11/11/2019 10:49, Greg Kurz wrote: > > The EQ page is allocated by the guest and then passed to the hypervisor > > with the H_INT_SET_QUEUE_CONFIG hcall. A reference is taken on the page > > before hand

[PATCH] powerpc/xive: Drop extern qualifiers from header function prototypes

2019-11-15 Thread Greg Kurz
As reported by ./scripts/checkpatch.pl --strict: CHECK: extern prototypes should be avoided in .h files Signed-off-by: Greg Kurz --- arch/powerpc/include/asm/xive.h | 92 --- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/arch/powerpc

Re: [PATCH] powerpc/xive: skip ioremap() of ESB pages for LSI interrupts

2019-12-04 Thread Greg Kurz
irq_data *data) > data->esb_shift = esb_shift; > data->trig_page = trig_page; > > + data->hw_irq = hw_irq; > + This is a side effect in the case where the XIVE_IRQ_FLAG_H_INT_ESB flag isn't set and ioremap() fails. But I guess a sane caller shouldn't look at

Re: [PATCH] powerpc/xive: skip ioremap() of ESB pages for LSI interrupts

2019-12-04 Thread Greg Kurz
On Thu, 5 Dec 2019 00:30:56 +1100 (AEDT) Michael Ellerman wrote: > On Tue, 2019-12-03 at 16:36:42 UTC, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= > wrote: > > The PCI INTx interrupts and other LSI interrupts are handled differently > > under a sPAPR platform. When the interrupt source

Re: [PATCH v3] ocxl: Fix potential memory leak on context creation

2019-12-09 Thread Greg Kurz
On Mon, 9 Dec 2019 11:55:13 +0100 Frederic Barrat wrote: > If we couldn't fully init a context, we were leaking memory. > > Fixes: b9721d275cc2 ("ocxl: Allow external drivers to use OpenCAPI contexts") > Signed-off-by: Frederic Barrat > --- Reviewed-by: Gre

Re: [PATCH v2 0/6] KVM: PPC: Book3S: HV: XIVE: Allocate less VPs in OPAL

2019-10-16 Thread Greg Kurz
On Fri, 27 Sep 2019 13:53:32 +0200 Greg Kurz wrote: > This brings some fixes and allows to start more VMs with an in-kernel > XIVE or XICS-on-XIVE device. > > Changes since v1 (https://patchwork.ozlabs.org/cover/1166099/): > - drop a useless patch > - add a patch to show

Re: [PATCH 0/2] vfio pci: Add support for OpenCAPI devices

2019-10-24 Thread Greg Kurz
Hi Christophe, Sorry, I didn't have time to look at your other series yet and likely the same for this one with the upcoming KVM Forum... :-\ Anyway, for any VFIO related patch, don't forget to Cc the maintainer, Alex Williamson . Cheers, -- Greg On Thu, 24 Oct 2019 15:28:03 +0200 christophe

Re: [Very RFC 40/46] powernv/npu: Don't drop refcount when looking up GPU pci_devs

2019-11-27 Thread Greg Kurz
On Wed, 27 Nov 2019 18:09:40 +1100 Alexey Kardashevskiy wrote: > > > On 20/11/2019 12:28, Oliver O'Halloran wrote: > > The comment here implies that we don't need to take a ref to the pci_dev > > because the ioda_pe will always have one. This implies that the current > > expection is that the

Re: [Very RFC 40/46] powernv/npu: Don't drop refcount when looking up GPU pci_devs

2019-11-27 Thread Greg Kurz
On Wed, 27 Nov 2019 10:10:13 +0100 Frederic Barrat wrote: > > > Le 27/11/2019 à 09:24, Greg Kurz a écrit : > > On Wed, 27 Nov 2019 18:09:40 +1100 > > Alexey Kardashevskiy wrote: > > > >> > >> > >> On 20/11/2019 12:28, Oliver O'Halloran wr

Re: [Very RFC 40/46] powernv/npu: Don't drop refcount when looking up GPU pci_devs

2019-11-27 Thread Greg Kurz
On Wed, 27 Nov 2019 10:47:45 +0100 Frederic Barrat wrote: > > > Le 27/11/2019 à 10:33, Greg Kurz a écrit : > > On Wed, 27 Nov 2019 10:10:13 +0100 > > Frederic Barrat wrote: > > > >> > >> > >> Le 27/11/2019 à 09:24, Greg Kurz a écrit :

Re: [PATCH] powerpc/xive: Prevent page fault issues in the machine crash handler

2019-10-31 Thread Greg Kurz
nce on sPAPR guests. > > To fix, force the mapping of the ESB page when an interrupt is being > mapped in the Linux IRQ number space. This is done by setting the > initial state of the interrupt to OFF which is not necessarily the > case on PowerNV. > > Signed-off-by: Cédric Le Goat

Re: [Very RFC 40/46] powernv/npu: Don't drop refcount when looking up GPU pci_devs

2019-11-27 Thread Greg Kurz
On Wed, 27 Nov 2019 20:40:00 +1100 "Oliver O'Halloran" wrote: > On Wed, Nov 27, 2019 at 8:34 PM Greg Kurz wrote: > > > > > > If everyone is ok with leaking a reference in the NPU case, I guess > > this isn't a problem. But if we move forward with Oliv

Re: [PATCH 3/6] KVM: PPC: Book3S HV: XIVE: Ensure VP isn't already in use

2019-09-24 Thread Greg Kurz
On Tue, 24 Sep 2019 15:33:28 +1000 Paul Mackerras wrote: > On Mon, Sep 23, 2019 at 05:43:48PM +0200, Greg Kurz wrote: > > We currently prevent userspace to connect a new vCPU if we already have > > one with the same vCPU id. This is good but unfortunately not enough, > >

[PATCH] powerpc/xive: Fix bogus error code returned by OPAL

2019-09-23 Thread Greg Kurz
URCE which is the usual error returned upon resource exhaustion. Cc: sta...@vger.kernel.org # v4.12+ Signed-off-by: Greg Kurz Reviewed-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/156821713818.1985334.14123187368108582810.st...@bahia.lan (cherry picked f

Re: [PATCH 5/6] KVM: PPC: Book3S HV: XIVE: Make VP block size configurable

2019-09-25 Thread Greg Kurz
On Mon, 23 Sep 2019 17:44:00 +0200 Greg Kurz wrote: > The XIVE VP is an internal structure which allow the XIVE interrupt > controller to maintain the interrupt context state of vCPUs non > dispatched on HW threads. > > When a guest is started, the XIVE KVM device allocates a

Re: QEMU/KVM snapshot restore bug

2020-02-12 Thread Greg Kurz
On Tue, 11 Feb 2020 04:57:52 +0100 dftxbs3e wrote: > Hello, > > I took a snapshot of a ppc64 (big endian) VM from a ppc64 (little endian) > host using `virsh snapshot-create-as --domain --name ` > A big endian guest doing XIVE ?!? I'm pretty sure we didn't do much testing, if any, on such a

Re: [PATCH v3 04/27] ocxl: Remove unnecessary externs

2020-02-26 Thread Greg Kurz
auro Carvalho Chehab > > ; David S. Miller ; > > Rob Herring ; Anton Blanchard ; > > Krzysztof Kozlowski ; Mahesh Salgaonkar > > ; Madhavan Srinivasan > > ; Cédric Le Goater ; Anju T > > Sudhakar ; Hari Bathini > > ; Thomas Gleixner ; Greg > > Kurz ; N

Re: [PATCH v3 04/27] ocxl: Remove unnecessary externs

2020-02-26 Thread Greg Kurz
On Wed, 26 Feb 2020 22:15:23 +0800 'Baoquan He' wrote: > On 02/26/20 at 10:01am, Greg Kurz wrote: > > On Wed, 26 Feb 2020 19:26:34 +1100 > > "Alastair D'Silva" wrote: > > > > > > -Original Message- > > > > From: Baoqua

Re: [RFC PATCH v1] powerpc/prom_init: disable XIVE in Secure VM.

2020-03-04 Thread Greg Kurz
On Tue, 3 Mar 2020 10:56:45 -0800 Ram Pai wrote: > On Tue, Mar 03, 2020 at 06:45:20PM +0100, Greg Kurz wrote: > > On Tue, 3 Mar 2020 09:02:05 -0800 > > Ram Pai wrote: > > > > > On Tue, Mar 03, 2020 at 07:50:08AM +0100, Cédric Le Goater wrote: > > > &

Re: [RFC PATCH v1] powerpc/prom_init: disable XIVE in Secure VM.

2020-03-03 Thread Greg Kurz
On Tue, 3 Mar 2020 09:02:05 -0800 Ram Pai wrote: > On Tue, Mar 03, 2020 at 07:50:08AM +0100, Cédric Le Goater wrote: > > On 3/3/20 12:32 AM, David Gibson wrote: > > > On Fri, Feb 28, 2020 at 11:54:04PM -0800, Ram Pai wrote: > > >> XIVE is not correctly enabled for Secure VM in the KVM Hypervisor

Re: [RFC PATCH v1] powerpc/prom_init: disable XIVE in Secure VM.

2020-03-02 Thread Greg Kurz
; Cc: Michael Ellerman > Cc: Thiago Jung Bauermann > Cc: Michael Anderson > Cc: Sukadev Bhattiprolu > Cc: Alexey Kardashevskiy > Cc: Paul Mackerras > Cc: Greg Kurz > Cc: Cedric Le Goater > Cc: David Gibson > Signed-off-by: Ram Pai > --- > arch/powerpc/kernel/prom

Re: [EXTERNAL] Re: [RFC PATCH v1] powerpc/prom_init: disable XIVE in Secure VM.

2020-03-04 Thread Greg Kurz
On Tue, 3 Mar 2020 20:18:18 +0100 Cédric Le Goater wrote: > >> BTW: I figured, I dont need this intermin patch to disable xive for > >> secure VM. Just doing "svm=on xive=off" on the kernel command line is > >> sufficient for now. * > >> > > > > No it is not. If the hypervisor doesn't

Re: [PATCH 18/18] powerpc/fault: Use analyse_instr() to check for store with updates to sp

2020-02-07 Thread Greg Kurz
On Thu, 19 Dec 2019 01:11:33 +1100 Daniel Axtens wrote: > Jordan Niethe writes: > > > A user-mode access to an address a long way below the stack pointer is > > only valid if the instruction is one that would update the stack pointer > > to the address accessed. This is checked by directly

Re: [PATCH v2 05/27] powerpc: Map & release OpenCAPI LPC memory

2020-01-21 Thread Greg Kurz
On Tue, 21 Jan 2020 17:46:12 +1100 Andrew Donnellan wrote: > On 3/12/19 2:46 pm, Alastair D'Silva wrote: > > From: Alastair D'Silva > > > > This patch adds platform support to map & release LPC memory. > > Might want to explain what LPC is. > > Otherwise: > > Reviewed-by: Andrew Donnellan

Re: [PATCH] powerpc/xive: discard ESB load value when interrupt is invalid

2020-01-14 Thread Greg Kurz
On Tue, 14 Jan 2020 08:44:54 +0100 Cédric Le Goater wrote: > On 1/14/20 2:14 AM, Michael Ellerman wrote: > > Cédric Le Goater writes: > >> On 1/13/20 2:01 PM, Cédric Le Goater wrote: > >>> From: Frederic Barrat > >>> > >>> A load on an ESB page returning all 1's means that the underlying > >>>

Re: [PATCH 3/4] powerpc/xmon: Add source flags to output of XIVE interrupts

2020-03-10 Thread Greg Kurz
On Fri, 6 Mar 2020 16:01:42 +0100 Cédric Le Goater wrote: > Some firmwares or hypervisors can advertise different source > characteristics. Track their value under XMON. What we are mostly > interested in is the StoreEOI flag. > > Signed-off-by: Cédric Le Goater > --- Revi

Re: [PATCH 1/4] powerpc/xive: Use XIVE_BAD_IRQ instead of zero to catch non configured IPIs

2020-03-10 Thread Greg Kurz
On Fri, 6 Mar 2020 16:01:40 +0100 Cédric Le Goater wrote: > When a CPU is brought up, an IPI number is allocated and recorded > under the XIVE CPU structure. Invalid IPI numbers are tracked with > interrupt number 0x0. > > On the PowerNV platform, the interrupt number space starts at 0x10 and

Re: [PATCH 2/4] powerpc/xive: Fix xmon support on the PowerNV platform

2020-03-10 Thread Greg Kurz
VE interrupts") > Cc: sta...@vger.kernel.org # v5.4+ > Signed-off-by: Cédric Le Goater > --- Reviewed-by: Greg Kurz > arch/powerpc/sysdev/xive/common.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/arch/powerpc/sysdev/xive/common.c > b/arch/

Re: [PATCH v4 00/25] Add support for OpenCAPI Persistent Memory devices

2020-04-02 Thread Greg Kurz
On Thu, 02 Apr 2020 21:06:01 +1100 Michael Ellerman wrote: > "Oliver O'Halloran" writes: > > On Thu, Apr 2, 2020 at 2:42 PM Michael Ellerman wrote: > >> "Alastair D'Silva" writes: > >> >> -Original Message- > >> >> From: Dan Williams > >> >> > >> >> On Sun, Mar 29, 2020 at 10:23 PM

Re: [PATCH 2/4] ocxl: Access interrupt trigger page from xive directly

2020-04-03 Thread Greg Kurz
> --- Reviewed-by: Greg Kurz > drivers/misc/ocxl/afu_irq.c | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/misc/ocxl/afu_irq.c b/drivers/misc/ocxl/afu_irq.c > index 70f8f1c3929d..b30ec0ef7be7 100644 > --- a/drivers/misc/ocxl

Re: [PATCH 4/4] ocxl: Remove custom service to allocate interrupts

2020-04-03 Thread Greg Kurz
--- Nice diffstat :) Reviewed-by: Greg Kurz > 2 files changed, 33 deletions(-) > > diff --git a/arch/powerpc/include/asm/pnv-ocxl.h > b/arch/powerpc/include/asm/pnv-ocxl.h > index 7de82647e761..e90650328c9c 100644 > --- a/arch/powerpc/include/asm/pnv-ocxl.h > +++ b/arch/po

Re: [PATCH 3/4] ocxl: Don't return trigger page when allocating an interrupt

2020-04-03 Thread Greg Kurz
It also allows ocxl to use the xive native interface to allocate > interrupts, instead of its custom service. > > Signed-off-by: Frederic Barrat > --- Reviewed-by: Greg Kurz > drivers/misc/ocxl/Kconfig | 2 +- > drivers/misc/ocxl/afu_irq.c | 4 +--- >

Re: [PATCH v2] powerpc/XIVE: SVM: share the event-queue page with the Hypervisor.

2020-03-26 Thread Greg Kurz
uot;kernel_irqchip=off" on the QEMU pseries > machine. > > Cc: kvm-...@vger.kernel.org > Cc: linuxppc-dev@lists.ozlabs.org > Cc: Michael Ellerman > Cc: Thiago Jung Bauermann > Cc: Michael Anderson > Cc: Sukadev Bhattiprolu > Cc: Alexey Kardashevskiy > Cc: P

Re: [PATCH] powerpc/prom_init: Include the termination message in ibm,os-term RTAS call

2020-03-25 Thread Greg Kurz
On Wed, 25 Mar 2020 21:06:22 +1100 Michael Ellerman wrote: > Fabiano Rosas writes: > > > QEMU can now print the ibm,os-term message[1], so let's include it in > > the RTAS call. E.g.: > > > > qemu-system-ppc64: OS terminated: Switch to secure mode failed. > > > > 1-

[PATCH 3/3] KVM: PPC: Kill kvmppc_ops::mmu_destroy() and kvmppc_mmu_destroy()

2020-03-18 Thread Greg Kurz
These are only used by HV KVM and BookE, and in both cases they are nops. Signed-off-by: Greg Kurz --- arch/powerpc/include/asm/kvm_ppc.h |2 -- arch/powerpc/kvm/book3s.c |5 - arch/powerpc/kvm/book3s_hv.c |6 -- arch/powerpc/kvm/book3s_pr.c |1

[PATCH 2/3] KVM: PPC: Move kvmppc_mmu_init() PR KVM

2020-03-18 Thread Greg Kurz
This is only relevant to PR KVM. Make it obvious by moving the function declaration to the Book3s header and rename it with a _pr suffix. Signed-off-by: Greg Kurz --- arch/powerpc/include/asm/kvm_ppc.h|1 - arch/powerpc/kvm/book3s.h |1 + arch/powerpc/kvm

[PATCH 0/3] KVM: PPC: Fix host kernel crash with PR KVM

2020-03-18 Thread Greg Kurz
. And worse, most of the indirection isn't needed because only PR KVM has some MMU data to free when the vCPU is destroyed. Fix the issue (patch 1) and simplify the code (patch 2 and 3). -- Greg --- Greg Kurz (3): KVM: PPC: Fix kernel crash with PR KVM KVM: PPC: Move kvmppc_mmu_init() PR

[PATCH 1/3] KVM: PPC: Fix kernel crash with PR KVM

2020-03-18 Thread Greg Kurz
be called. Drop the line in the error path of kvm_arch_vcpu_create(). Fixes: ff030fdf5573 ("KVM: PPC: Move kvm_vcpu_init() invocation to common code") Signed-off-by: Greg Kurz --- arch/powerpc/kvm/book3s_pr.c |1 + arch/powerpc/kvm/powerpc.c |2 -- 2 files changed, 1 insertion(+),

Re: [PATCH] KVM: PPC: Book3S HV: Skip kvmppc_uvmem_free if Ultravisor is not supported

2020-03-20 Thread Greg Kurz
8 > f8010010 f821ff81 486249a1 6000 7c7d1b78 712a0002 40820084 > ---[ end trace 5774ef4dc2c98279 ]--- > > So this patch checks if kvmppc_uvmem_init actually allocated anything > before running kvmppc_uvmem_free. > > Fixes: ca9f4942670c ("KVM: PPC: Book3S HV: Suppo

Re: [PATCH 1/2] KVM: PPC: Book3S HV: check caller of H_SVM_* Hcalls

2020-03-20 Thread Greg Kurz
On Fri, 20 Mar 2020 11:26:42 +0100 Laurent Dufour wrote: > The Hcall named H_SVM_* are reserved to the Ultravisor. However, nothing > prevent a malicious VM or SVM to call them. This could lead to weird result > and should be filtered out. > > Checking the Secure bit of the calling MSR ensure

Re: [PATCH 1/2] KVM: PPC: Book3S HV: check caller of H_SVM_* Hcalls

2020-03-24 Thread Greg Kurz
On Tue, 24 Mar 2020 10:43:23 +1100 Paul Mackerras wrote: > On Fri, Mar 20, 2020 at 01:22:48PM +0100, Greg Kurz wrote: > > On Fri, 20 Mar 2020 11:26:42 +0100 > > Laurent Dufour wrote: > > > > > The Hcall named H_SVM_* are reserved to the Ultravisor. However, nothin

Re: [PATCH] KVM: PPC: Book3S HV: relax check on H_SVM_INIT_ABORT

2020-05-20 Thread Greg Kurz
On Wed, 20 May 2020 18:51:10 +0200 Laurent Dufour wrote: > The commit 8c47b6ff29e3 ("KVM: PPC: Book3S HV: Check caller of H_SVM_* > Hcalls") added checks of secure bit of SRR1 to filter out the Hcall > reserved to the Ultravisor. > > However, the Hcall H_SVM_INIT_ABORT is made by the Ultravisor

Re: [PATCH v2] KVM: PPC: Book3S HV: relax check on H_SVM_INIT_ABORT

2020-05-20 Thread Greg Kurz
ABORT, this hcall will be > filtered out in kvmppc_h_svm_init_abort() because kvm->arch.secure_guest is > not set in that case. > > Fixes: 8c47b6ff29e3 ("KVM: PPC: Book3S HV: Check caller of H_SVM_* Hcalls") > Signed-off-by: Laurent Dufour > --- Reviewed-by: Greg Ku

Re: [PATCH] KVM: PPC: Book3S HV: Do not allocate HPT for a nested guest

2020-09-11 Thread Greg Kurz
On Fri, 11 Sep 2020 10:08:10 +0200 Michal Suchánek wrote: > On Fri, Sep 11, 2020 at 10:01:33AM +0200, Greg Kurz wrote: > > On Fri, 11 Sep 2020 09:45:36 +0200 > > Greg Kurz wrote: > > > > > On Fri, 11 Sep 2020 01:16:07 -0300 > > > Fabiano Rosas wrote: >

Re: [PATCH] KVM: PPC: Book3S HV: Do not allocate HPT for a nested guest

2020-09-11 Thread Greg Kurz
544821] f86d1098 6000 6000 4899 e8ad0fe8 e8c500a0 e9264140 > 75290002 > [ 538.544886] 7d1602a6 7cec42a6 40820008 7d0807b4 <7d164ba6> 7d083a14 > f90d10a0 480104fd > [ 538.544953] ---[ end trace 74423e2b948c2e0c ]--- > > This patch makes the KVM_PPC_ALLOCATE_HT

Re: [PATCH] KVM: PPC: Book3S HV: Do not allocate HPT for a nested guest

2020-09-11 Thread Greg Kurz
On Fri, 11 Sep 2020 09:45:36 +0200 Greg Kurz wrote: > On Fri, 11 Sep 2020 01:16:07 -0300 > Fabiano Rosas wrote: > > > The current nested KVM code does not support HPT guests. This is > > informed/enforced in some ways: > > > > - Hosts < P9 will not be

[PATCH] KVM: PPC: Don't return -ENOTSUPP to userspace in ioctls

2020-09-11 Thread Greg Kurz
doesn't call the KVM_GET_FPU and KVM_SET_FPU ioctls on POWER anyway since they are not supported, and _buggily_ ignores anything but -EPERM for KVM_GET_DIRTY_LOG. [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html Signed-off-by: Greg Kurz --- arch/powerpc/kvm/book3s.c

Re: [PATCH] powerpc/pci: Fix PHB removal/rescan on PowerNV

2020-10-14 Thread Greg Kurz
On Thu, 8 Oct 2020 06:37:02 +0200 Cédric Le Goater wrote: > On 10/8/20 4:23 AM, Oliver O'Halloran wrote: > > On Fri, Sep 25, 2020 at 7:23 PM Cédric Le Goater wrote: > >> > >> To fix an issue with PHB hotplug on pSeries machine (HPT/XIVE), commit > >> 3a3181e16fbd introduced a PPC specific

<    1   2   3   >