Re: [PATCH kernel] KVM: PPC: Book3s: Fix warning about xics_rm_h_xirr_x

2022-06-22 Thread Greg Kurz
ot. > > Fixes: b22af9041927 ("KVM: PPC: Book3s: Remove real mode interrupt controller > hcalls handlers") > Signed-off-by: Alexey Kardashevskiy > --- FWIW Reviewed-by: Greg Kurz > arch/powerpc/kvm/book3s_xics.h | 1 + > 1 file changed, 1 insertion(+) > &g

Re: [PATCH] powerpc/xive: Change IRQ domain to a tree domain

2021-11-16 Thread Greg Kurz
On Tue, 16 Nov 2021 15:49:13 +0100 Cédric Le Goater wrote: > On 11/16/21 15:23, Greg Kurz wrote: > > On Tue, 16 Nov 2021 14:40:22 +0100 > > Cédric Le Goater wrote: > > > >> Commit 4f86a06e2d6e ("irqdomain: Make normal and nomap irqdomains > >> excl

Re: [PATCH] powerpc/xive: Change IRQ domain to a tree domain

2021-11-16 Thread Greg Kurz
stance, a linux KVM guest with virtio-rng and virtio-balloon > devices. > > Cc: Marc Zyngier > Cc: sta...@vger.kernel.org # v5.14+ > Fixes: 4f86a06e2d6e ("irqdomain: Make normal and nomap irqdomains exclusive") > Signed-off-by: Cédric Le Goater > --- >

Re: [PATCH v2] KVM: PPC: Defer vtime accounting 'til after IRQ handling

2021-10-07 Thread Greg Kurz
in the code as for x86 > Works for me. As you stated in your answer, someone can polish the code later on. Reviewed-by: Greg Kurz > arch/powerpc/kvm/book3s_hv.c | 24 > 1 file changed, 20 insertions(+), 4 deletions(-) > > diff --git a/arch/powerpc/kvm/book3s_hv

Re: [PATCH] KVM: PPC: Defer vtime accounting 'til after IRQ handling

2021-10-06 Thread Greg Kurz
On Wed, 6 Oct 2021 09:37:45 +0200 Laurent Vivier wrote: > Commit 61bd0f66ff92 has moved guest_enter() out of the interrupt > protected area to be able to have updated tick counters, but > commit 112665286d08 moved back to this area to avoid wrong > context warning (or worse). > > None of them

Re: [PATCH] memblock: make for_each_mem_range() traverse MEMBLOCK_HOTPLUG regions

2021-07-12 Thread Greg Kurz
09 ]--- > > Making for_each_mem_range() include MEMBLOCK_HOTPLUG regions in the > traversal fixes this issue. > > Link: https://bugzilla.redhat.com/show_bug.cgi?id=1976100 > Fixes: b10d6bca8720 ("arch, drivers: replace for_each_membock() with > for_each_mem_range()") > Sign

Re: [PATCH] powerpc: Fix initrd corruption with relative jump labels

2021-06-15 Thread Greg Kurz
On Mon, 14 Jun 2021 17:57:40 +0200 Greg Kurz wrote: > On Mon, 14 Jun 2021 23:14:40 +1000 > Michael Ellerman wrote: > > > Commit b0b3b2c78ec0 ("powerpc: Switch to relative jump labels") switched > > us to using relative jump labels. That involves changing the c

Re: [PATCH] powerpc: Fix initrd corruption with relative jump labels

2021-06-14 Thread Greg Kurz
Fixes: b0b3b2c78ec0 ("powerpc: Switch to relative jump labels") > Reported-by: Anastasia Kovaleva > Reported-by: Roman Bolshakov > Reported-by: Greg Kurz > Reported-by: Daniel Axtens > Signed-off-by: Michael Ellerman > --- Great thanks for debugging this issue ! I

Re: [PATCH] Revert "powerpc: Switch to relative jump labels"

2021-06-07 Thread Greg Kurz
On Tue, 01 Jun 2021 17:36:15 +1000 Michael Ellerman wrote: > Roman Bolshakov writes: > > On Sat, May 29, 2021 at 09:39:49AM +1000, Michael Ellerman wrote: > >> Roman Bolshakov writes: > >> > This reverts commit b0b3b2c78ec075cec4721986a95abbbac8c3da4f. > >> > > >> > Otherwise, direct kernel

Re: [PATCH] Revert "powerpc: Switch to relative jump labels"

2021-05-28 Thread Greg Kurz
gt; > Cc: Christophe Leroy > Reported-by: Anastasia Kovaleva > Signed-off-by: Roman Bolshakov > --- I'm observing the very same issue and reverting the offending commit fixes it indeed. Until someone has investigated the root cause, this looks like a reasonable bug fix to me. Reviewed-

Re: [PATCH] vfio/pci: Revert nvlink removal uAPI breakage

2021-05-04 Thread Greg Kurz
On Tue, 04 May 2021 09:52:02 -0600 Alex Williamson wrote: > Revert the uAPI changes from the below commit with notice that these > regions and capabilities are no longer provided. > > Fixes: b392a1989170 ("vfio/pci: remove vfio_pci_nvlink2") > Reported-by: Greg Ku

Re: remove the nvlink2 pci_vfio subdriver v2

2021-05-04 Thread Greg Kurz
On Tue, 4 May 2021 15:30:15 +0200 Greg Kroah-Hartman wrote: > On Tue, May 04, 2021 at 03:20:34PM +0200, Greg Kurz wrote: > > On Tue, 4 May 2021 14:59:07 +0200 > > Greg Kroah-Hartman wrote: > > > > > On Tue, May 04, 2021 at 02:22:36PM +0200, Greg Kurz wrote: > &

Re: remove the nvlink2 pci_vfio subdriver v2

2021-05-04 Thread Greg Kurz
On Tue, 4 May 2021 14:59:07 +0200 Greg Kroah-Hartman wrote: > On Tue, May 04, 2021 at 02:22:36PM +0200, Greg Kurz wrote: > > On Fri, 26 Mar 2021 07:13:09 +0100 > > Christoph Hellwig wrote: > > > > > Hi all, > > > > > > the nvlink2 vfio sub

Re: remove the nvlink2 pci_vfio subdriver v2

2021-05-04 Thread Greg Kurz
On Fri, 26 Mar 2021 07:13:09 +0100 Christoph Hellwig wrote: > Hi all, > > the nvlink2 vfio subdriver is a weird beast. It supports a hardware > feature without any open source component - what would normally be > the normal open source userspace that we require for kernel drivers, > although

Re: [PATCH v3 0/9] powerpc/xive: Map one IPI interrupt per node

2021-04-01 Thread Greg Kurz
On Thu, 1 Apr 2021 11:18:10 +0200 Cédric Le Goater wrote: > Hello, > > On 4/1/21 10:04 AM, Greg Kurz wrote: > > On Wed, 31 Mar 2021 16:45:05 +0200 > > Cédric Le Goater wrote: > > > >> > >> Hello, > >> > >> ipistorm [*] can b

Re: [PATCH v3 0/9] powerpc/xive: Map one IPI interrupt per node

2021-04-01 Thread Greg Kurz
On Wed, 31 Mar 2021 16:45:05 +0200 Cédric Le Goater wrote: > > Hello, > > ipistorm [*] can be used to benchmark the raw interrupt rate of an > interrupt controller by measuring the number of IPIs a system can > sustain. When applied to the XIVE interrupt controller of POWER9 and > POWER10

Re: [PATCH] powerpc/numa: Fix topology_physical_package_id() on pSeries

2021-03-15 Thread Greg Kurz
e > Signed-off-by: Cédric Le Goater > --- Makes sense. FWIW Reviewed-by: Greg Kurz > arch/powerpc/include/asm/topology.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/include/asm/topology.h > b/arch/powerpc/include/asm/topology

Re: [PATCH v2 1/8] powerpc/xive: Use cpu_to_node() instead of ibm,chip-id property

2021-03-12 Thread Greg Kurz
;> On 3/9/21 6:08 PM, Daniel Henrique Barboza wrote: > >>>> > >>>> > >>>> On 3/9/21 12:33 PM, Cédric Le Goater wrote: > >>>>> On 3/8/21 6:13 PM, Greg Kurz wrote: > >>>>>> On Wed, 3 Mar 2021 18:48:50 +0100 > >>

[PATCH] powerpc/xmon: Check cpu id in commands "c#", "dp#" and "dx#"

2021-03-09 Thread Greg Kurz
fall back to the #-less version of the command. Signed-off-by: Greg Kurz --- arch/powerpc/xmon/xmon.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 80fbf8968f77..d3d6e044228e 100644 --- a/arch/powerpc/xmon/xmon.c

Re: [PATCH v2 8/8] powerpc/xive: Map one IPI interrupt per node

2021-03-09 Thread Greg Kurz
3871 1042749 0 0 0 0 XIVE-IPI 0 Edge IPI-0 17: 0 0 0 0 2123 1019 1263 1288 XIVE-IPI 1 Edge IPI-1 IPIs are mapped to the appropriate nodes, and the number

Re: [PATCH v2 7/8] powerpc/xive: Fix xmon command "dxi"

2021-03-09 Thread Greg Kurz
IRQ 0x0bad : no config rc=-6 Note that this also allows to show IPIs: 6:mon> dxi 0 IRQ 0x : target=0x0 prio=06 lirq=0x10 This is a bit inconsistent with output of the 0-argument form of "dxi", which filters them out for a reason that isn't obvious to me. No big deal thoug

Re: [PATCH v2 4/8] powerpc/xive: Simplify xive_core_debug_show()

2021-03-09 Thread Greg Kurz
On Tue, 9 Mar 2021 10:13:39 +0100 Greg Kurz wrote: > On Mon, 8 Mar 2021 19:11:11 +0100 > Cédric Le Goater wrote: > > > On 3/8/21 7:07 PM, Greg Kurz wrote: > > > On Wed, 3 Mar 2021 18:48:53 +0100 > > > Cédric Le Goater wrote: > > > > >

Re: [PATCH v2 6/8] powerpc/xive: Simplify the dump of XIVE interrupts under xmon

2021-03-09 Thread Greg Kurz
On Wed, 3 Mar 2021 18:48:55 +0100 Cédric Le Goater wrote: > Move the xmon routine under XIVE subsystem and rework the loop on the > interrupts taking into account the xive_irq_domain to filter out IPIs. > > Signed-off-by: Cédric Le Goater > --- Nice again ! :) Reviewe

Re: [PATCH v2 5/8] powerpc/xive: Drop check on irq_data in xive_core_debug_show()

2021-03-09 Thread Greg Kurz
t; state") > Signed-off-by: Cédric Le Goater > --- Reviewed-by: Greg Kurz > arch/powerpc/sysdev/xive/common.c | 21 ++--- > 1 file changed, 10 insertions(+), 11 deletions(-) > > diff --git a/arch/powerpc/sysdev/xive/common.c > b/arch/powerpc/sysdev/xive/c

Re: [PATCH v2 4/8] powerpc/xive: Simplify xive_core_debug_show()

2021-03-09 Thread Greg Kurz
On Mon, 8 Mar 2021 19:11:11 +0100 Cédric Le Goater wrote: > On 3/8/21 7:07 PM, Greg Kurz wrote: > > On Wed, 3 Mar 2021 18:48:53 +0100 > > Cédric Le Goater wrote: > > > >> Now that the IPI interrupt has its own domain, the checks on the HW > >> interrupt

Re: [PATCH v2 2/8] powerpc/xive: Introduce an IPI interrupt domain

2021-03-08 Thread Greg Kurz
PI interrupt from other interrupts of the system. > > Simplify the XIVE interrupt domain by introducing a specific domain > for the IPI. > > Signed-off-by: Cédric Le Goater > --- Nice ! Reviewed-by: Greg Kurz > arch/powerpc/sysdev/xive/common.c | 51 +---

Re: [PATCH v2 4/8] powerpc/xive: Simplify xive_core_debug_show()

2021-03-08 Thread Greg Kurz
houldn't this have the following tags ? Reported-by: kernel test robot Reported-by: Dan Carpenter Fixes: 930914b7d528 ("powerpc/xive: Add a debugfs file to dump internal XIVE state") Anyway, Reviewed-by: Greg Kurz > arch/powerpc/sysdev/xive/common.c | 18 -- > 1

Re: [PATCH v2 3/8] powerpc/xive: Remove useless check on XIVE_IPI_HW_IRQ

2021-03-08 Thread Greg Kurz
On Wed, 3 Mar 2021 18:48:52 +0100 Cédric Le Goater wrote: > The IPI interrupt has its own domain now. Testing the HW interrupt > number is not needed anymore. > > Signed-off-by: Cédric Le Goater > --- Reviewed-by: Greg Kurz > arch/powerpc/sysdev/xive/common.c | 3 +-- &g

Re: [PATCH v2 1/8] powerpc/xive: Use cpu_to_node() instead of ibm,chip-id property

2021-03-08 Thread Greg Kurz
On Wed, 3 Mar 2021 18:48:50 +0100 Cédric Le Goater wrote: > The 'chip_id' field of the XIVE CPU structure is used to choose a > target for a source located on the same chip when possible. This field > is assigned on the PowerNV platform using the "ibm,chip-id" property > on pSeries under KVM

[PATCH v2] powerpc/pseries: Don't enforce MSI affinity with kdump

2021-02-15 Thread Greg Kurz
kdump. Simply revert to the previous working behavior of ignoring affinity masks in this case only. Fixes: 9ea69a55b3b9 ("powerpc/pseries: Pass MSI affinity to irq_create_mapping()") Cc: lviv...@redhat.com Cc: sta...@vger.kernel.org Reviewed-by: Laurent Vivier Reviewed-by: Cédric Le Go

[PATCH] powerpc/pseries: Don't enforce MSI affinity with kdump

2021-02-12 Thread Greg Kurz
kdump. Simply revert to the previous working behavior of ignoring affinity masks in this case only. Fixes: 9ea69a55b3b9 ("powerpc/pseries: Pass MSI affinity to irq_create_mapping()") Cc: lviv...@redhat.com Cc: sta...@vger.kernel.org Signed-off-by: Greg Kurz --- arch/powerp

Re: [RFC Qemu PATCH v2 1/2] spapr: drc: Add support for async hcalls at the drc level

2020-12-21 Thread Greg Kurz
On Mon, 21 Dec 2020 13:08:53 +0100 Greg Kurz wrote: > Hi Shiva, > > On Mon, 30 Nov 2020 09:16:39 -0600 > Shivaprasad G Bhat wrote: > > > The patch adds support for async hcalls at the DRC level for the > > spapr devices. To be used by spapr-scm device

Re: [RFC Qemu PATCH v2 0/2] spapr: nvdimm: Asynchronus flush hcall support

2020-12-21 Thread Greg Kurz
On Mon, 30 Nov 2020 09:16:14 -0600 Shivaprasad G Bhat wrote: > The nvdimm devices are expected to ensure write persistent during power > failure kind of scenarios. > > The libpmem has architecture specific instructions like dcbf on power > to flush the cache data to backend nvdimm device during

Re: [RFC Qemu PATCH v2 2/2] spapr: nvdimm: Implement async flush hcalls

2020-12-21 Thread Greg Kurz
On Mon, 30 Nov 2020 09:17:24 -0600 Shivaprasad G Bhat wrote: > When the persistent memory beacked by a file, a cpu cache flush instruction > is not sufficient to ensure the stores are correctly flushed to the media. > > The patch implements the async hcalls for flush operation on demand from

Re: [RFC Qemu PATCH v2 1/2] spapr: drc: Add support for async hcalls at the drc level

2020-12-21 Thread Greg Kurz
Hi Shiva, On Mon, 30 Nov 2020 09:16:39 -0600 Shivaprasad G Bhat wrote: > The patch adds support for async hcalls at the DRC level for the > spapr devices. To be used by spapr-scm devices in the patch/es to follow. > > Signed-off-by: Shivaprasad G Bhat > --- The overall idea looks good but I

Re: [PATCH 12/13] powerpc/xive: Simplify xive_do_source_eoi()

2020-12-09 Thread Greg Kurz
indeed. Reviewed-by: Greg Kurz > arch/powerpc/sysdev/xive/common.c | 72 ++- > 1 file changed, 33 insertions(+), 39 deletions(-) > > diff --git a/arch/powerpc/sysdev/xive/common.c > b/arch/powerpc/sysdev/xive/common.c > index fe6229dd3241..fb438203d5e

Re: [PATCH 07/13] powerpc/xive: Add a debug_show handler to the XIVE irq_domain

2020-12-09 Thread Greg Kurz
On Tue, 8 Dec 2020 16:11:18 +0100 Cédric Le Goater wrote: > Full state of the Linux interrupt descriptors can be dumped under > debugfs when compiled with CONFIG_GENERIC_IRQ_DEBUGFS. Add support for > the XIVE interrupt controller. > > Signed-off-by: Cédric Le Goater > --- >

Re: [PATCH 13/13] powerpc/xive: Improve error reporting of OPAL calls

2020-12-09 Thread Greg Kurz
On Tue, 8 Dec 2020 16:11:24 +0100 Cédric Le Goater wrote: > Introduce a vp_err() macro to standardize error reporting. > > Signed-off-by: Cédric Le Goater > --- Reviewed-by: Greg Kurz > arch/powerpc/sysdev/xive/native.c | 28 > 1 file chan

Re: [PATCH 11/13] powerpc/xive: Remove P9 DD1 flag XIVE_IRQ_FLAG_EOI_FW

2020-12-09 Thread Greg Kurz
hich is now unused. > > Signed-off-by: Cédric Le Goater > --- Reviewed-by: Greg Kurz Same suggestion as with previous patch. > arch/powerpc/include/asm/opal-api.h | 2 +- > arch/powerpc/include/asm/xive.h | 2 +- > arch/powerpc/sysdev/xive/xive-i

Re: [PATCH 10/13] powerpc/xive: Remove P9 DD1 flag XIVE_IRQ_FLAG_MASK_FW

2020-12-09 Thread Greg Kurz
: Cédric Le Goater > --- Reviewed-by: Greg Kurz In case a v2 is required, same suggestion to comment out the removed items entirely, plus fix an indent nit > arch/powerpc/include/asm/opal-api.h | 2 +- > arch/powerpc/include/asm/xive.h | 2 +- > arch/power

Re: [PATCH 09/13] powerpc/xive: Remove P9 DD1 flag XIVE_IRQ_FLAG_SHIFT_BUG

2020-12-08 Thread Greg Kurz
: Cédric Le Goater > --- Reviewed-by: Greg Kurz Just a minor suggestion in case you need to post a v2. See below. > arch/powerpc/include/asm/opal-api.h | 2 +- > arch/powerpc/include/asm/xive.h | 2 +- > arch/powerpc/kvm/book3s_xive_native.c | 3 --- > arch/power

Re: [PATCH 08/13] powerpc: Increase NR_IRQS range to support more KVM guests

2020-12-08 Thread Greg Kurz
On Tue, 8 Dec 2020 16:11:19 +0100 Cédric Le Goater wrote: > PowerNV systems can handle up to 4K guests and 1M interrupt numbers > per chip. Increase the range of allowed interrupts to support a larger > number of guests. > > Signed-off-by: Cédric Le Goater > --- Revi

Re: [PATCH 03/13] powerpc/xive: Introduce XIVE_IPI_HW_IRQ

2020-12-08 Thread Greg Kurz
handle EOI. This can cause > performance issues in some benchmark (ipistorm) on multichip systems. > > Clarify the use of the 0 value, it will help in improving multichip > support. > > Signed-off-by: Cédric Le Goater > --- Reviewed-by: Greg Kurz > arch/powerpc/sysdev/xive/

Re: [PATCH 02/13] powerpc/xive: Rename XIVE_IRQ_NO_EOI to show its a flag

2020-12-08 Thread Greg Kurz
erently from the rest. > > Signed-off-by: Cédric Le Goater > --- Reviewed-by: Greg Kurz > arch/powerpc/include/asm/xive.h | 2 +- > arch/powerpc/kvm/book3s_xive.c| 4 ++-- > arch/powerpc/sysdev/xive/common.c | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) >

[PATCH] KVM: PPC: Book3S HV: XIVE: Fix vCPU id sanity check

2020-11-30 Thread Greg Kurz
_xive_vcpu_id_valid() so that it checks the packed vCPU id is below xive->nr_servers, which is explicitly what we want. Fixes: 062cfab7069f ("KVM: PPC: Book3S HV: XIVE: Make VP block size configurable") Cc: sta...@vger.kernel.org # v5.5+ Signed-off-by: Greg Kurz --- arch/powerpc

Re: [PATCH v3 2/2] powerpc/pseries: pass MSI affinity to irq_create_mapping()

2020-11-25 Thread Greg Kurz
On Wed, 25 Nov 2020 16:42:30 + Marc Zyngier wrote: > On 2020-11-25 16:24, Laurent Vivier wrote: > > On 25/11/2020 17:05, Denis Kirjanov wrote: > >> On 11/25/20, Laurent Vivier wrote: > >>> With virtio multiqueue, normally each queue IRQ is mapped to a CPU. > >>> > >>> But since commit

Re: [PATCH v2 1/2] genirq: add an irq_create_mapping_affinity() function

2020-11-25 Thread Greg Kurz
t; to pass NULL for the affinity parameter. > > No functional change. > > Signed-off-by: Laurent Vivier > --- Reviewed-by: Greg Kurz > include/linux/irqdomain.h | 12 ++-- > kernel/irq/irqdomain.c| 13 - > 2 files changed, 18 insertions(+), 7 delet

Re: [PATCH v2 2/2] powerpc/pseries: pass MSI affinity to irq_create_mapping()

2020-11-25 Thread Greg Kurz
rtqueues are correctly dispatched between the CPUs > on pseries. > Since it is public, maybe add: BugId: https://bugzilla.redhat.com/show_bug.cgi?id=1702939 ? > Signed-off-by: Laurent Vivier > --- Anyway, Reviewed-by: Greg Kurz > arch/powerpc/platforms/pseries/msi.c | 3 ++- &

Re: [PATCH] KVM: PPC: Book3S: Assign boolean values to a bool variable

2020-11-06 Thread Greg Kurz
NG: Assignment of 0/1 to bool > variable > > Reported-by: Tosk Robot > Signed-off-by: Kaixu Xia > --- Reviewed-by: Greg Kurz > arch/powerpc/kvm/book3s_xics.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/kvm/book3s

Re: [PATCH] KVM: PPC: Book3S HV: XIVE: Fix possible oops when accessing ESB page

2020-11-05 Thread Greg Kurz
lid ESB page for source 8 ! > > Fix that by checking the validity of the KVM XIVE interrupt structure. > > Reported-by: Greg Kurz > Signed-off-by: Cédric Le Goater > --- Looks sane to me. QEMU still crashes on SIGBUS but no more oops at least. Tested-by: Greg Kurz > arc

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

[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] 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
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

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 v2] powerpc/pseries/hotplug-cpu: wait indefinitely for vCPU death

2020-08-12 Thread Greg Kurz
h the cleanup, causing the race with > the XIVE cleanup code executed by the unplugged CPU. > > Fix this by waiting indefinitely, but also making an effort to avoid > spurious lockup messages by allowing for rescheduling after polling > the CPU status and printing a warning if we wai

Re: [PATCH] powerpc/pseries/hotplug-cpu: increase wait time for vCPU death

2020-08-04 Thread Greg Kurz
time. > How long should that be ? > > > Fixes: eac1e731b59ee ("powerpc/xive: guest exploitation of the XIVE > > interrupt controller") > > Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1856588 > > This is not public. > I'll have a look at c

Re: [PATCH -next] powerpc/xive: Remove unused inline function xive_kexec_teardown_cpu()

2020-07-15 Thread Greg Kurz
On Wed, 15 Jul 2020 10:50:40 +0800 YueHaibing wrote: > commit e27e0a94651e ("powerpc/xive: Remove xive_kexec_teardown_cpu()") > left behind this, remove it. > > Signed-off-by: YueHaibing > --- Reviewed-by: Greg Kurz > arch/powerpc/include/asm/xive.h | 1 - &

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 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 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 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 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-

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 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] 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

[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 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(+),

[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

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 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: [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: [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: [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: [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: [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: 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 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 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] 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] 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: [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: [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 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: [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

[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

[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

[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 --

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] 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

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

  1   2   3   >