[PATCH] KVM: PPC: Book3S HV: Fix L2 guest reboot failure due to empty 'arch_compat'

2024-01-18 Thread Amit Machhiwal
ty mode in KVM: Invalid This patch updates kvmppc_set_arch_compat() to use the host PVR value if 'compat_pvr' == 0 indicating that qemu doesn't want to enforce any specific PVR compat mode. Signed-off-by: Amit Machhiwal --- arch/powerpc/kvm/book3s_hv.c | 2 +- arch/power

Re: Re: [PATCH] KVM: PPC: Book3S HV: Fix L2 guest reboot failure due to empty 'arch_compat'

2024-01-29 Thread Amit Machhiwal
Hi Aneesh, Thanks for looking into the patch. My comments are inline below. On 2024/01/24 01:06 PM, Aneesh Kumar K.V wrote: > Amit Machhiwal writes: > > > Currently, rebooting a pseries nested qemu-kvm guest (L2) results in > > below error as L1 qemu sends PVR value 

[PATCH v2] KVM: PPC: Book3S HV: Fix L2 guest reboot failure due to empty 'arch_compat'

2024-02-05 Thread Amit Machhiwal
ch updates kvmppc_set_arch_compat() to use the host PVR value if 'compat_pvr' == 0 indicating that qemu doesn't want to enforce any specific PVR compat mode. Fixes: 19d31c5f1157 ("KVM: PPC: Add support for nestedv2 guests") Signed-off-by: Amit Machhiwal --- Changes v1 -> v2

Re: Re: [PATCH v2] KVM: PPC: Book3S HV: Fix L2 guest reboot failure due to empty 'arch_compat'

2024-02-05 Thread Amit Machhiwal
Hi Vaibhav, Thanks for looking into the patch. On 2024/02/05 11:05 PM, Vaibhav Jain wrote: > Hi Amit, > > Thanks for the patch. Minor comment on the patch below: > > Amit Machhiwal writes: > > > > > > > +static inline unsigned l

[PATCH v3] KVM: PPC: Book3S HV: Fix L2 guest reboot failure due to empty 'arch_compat'

2024-02-05 Thread Amit Machhiwal
ch updates kvmppc_set_arch_compat() to use the host PVR value if 'compat_pvr' == 0 indicating that qemu doesn't want to enforce any specific PVR compat mode. Fixes: 19d31c5f1157 ("KVM: PPC: Add support for nestedv2 guests") Reviewed-by: Aneesh Kumar K.V (IBM) Reviewed-by

Re: Re: [PATCH v3] KVM: PPC: Book3S HV: Fix L2 guest reboot failure due to empty 'arch_compat'

2024-02-06 Thread Amit Machhiwal
Hi Michael, Thanks for looking into the patch and your comments. On 2024/02/06 09:09 PM, Michael Ellerman wrote: > Hi Amit, > > One comment below ... > > Amit Machhiwal writes: > > Currently, rebooting a pseries nested qemu-kvm guest (L2) results in > > below error

[PATCH v4] KVM: PPC: Book3S HV: Fix L2 guest reboot failure due to empty 'arch_compat'

2024-02-06 Thread Amit Machhiwal
: 19d31c5f1157 ("KVM: PPC: Add support for nestedv2 guests") Reviewed-by: Aneesh Kumar K.V (IBM) Reviewed-by: Vaibhav Jain Signed-off-by: Amit Machhiwal --- Changes v3 -> v4: - Moved part of a code comment around implementation of `arch_compat == 0` in PowerVM to the pat

[PATCH] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-07-03 Thread Amit Machhiwal
ade for pci-bridge devices. [1] commit 407d1a51921e ("PCI: Create device tree node for bridge") Fixes: 407d1a51921e ("PCI: Create device tree node for bridge") Reported-by: Kowshik Jois B S Tested-by: Kowshik Jois B S Signed-off-by: Amit Machhiwal --- drivers/pci/remove.c | 3

Re: [PATCH] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-07-11 Thread Amit Machhiwal
Hi Rob, On 2024/07/11 06:20 AM, Rob Herring wrote: > On Wed, Jul 3, 2024 at 8:17 AM Amit Machhiwal wrote: > > > > With CONFIG_PCI_DYNAMIC_OF_NODES [1], a hot-plug and hot-unplug sequence > > of a PCI device attached to a PCI-bridge causes following kernel Oops on &g

Re: [PATCH] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-07-11 Thread Amit Machhiwal
On 2024/07/10 09:48 PM, Lizhi Hou wrote: > > On 7/5/24 12:20, Bjorn Helgaas wrote: > > [+cc Lukas, FYI] > > > > On Wed, Jul 03, 2024 at 07:46:34PM +0530, Amit Machhiwal wrote: > > > With CONFIG_PCI_DYNAMIC_OF_NODES [1], a hot-plug and hot-unplug sequence > &

Re: [PATCH] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-07-12 Thread Amit Machhiwal
Hi Lizhi, On 2024/07/11 02:18 PM, Lizhi Hou wrote: > > On 7/11/24 11:48, Amit Machhiwal wrote: > > On 2024/07/10 09:48 PM, Lizhi Hou wrote: > > > On 7/5/24 12:20, Bjorn Helgaas wrote: > > > > [+cc Lukas, FYI] > > > > > > > > On We

[PATCH v2] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-07-15 Thread Amit Machhiwal
idge") Fixes: 407d1a51921e ("PCI: Create device tree node for bridge") Reported-by: Kowshik Jois B S Signed-off-by: Lizhi Hou Signed-off-by: Amit Machhiwal --- Changes since v1: * Included Lizhi's suggested changes on V1 * Fixed below two warnings from Lizhi's changes and r

Re: [PATCH v2] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-07-25 Thread Amit Machhiwal
gt; > > > On Mon, Jul 15, 2024 at 01:52:30PM -0700, Lizhi Hou wrote: > > > > > On 7/15/24 11:55, Rob Herring wrote: > > > > > > On Mon, Jul 15, 2024 at 2:08 AM Amit Machhiwal > > > > > > wrote: > > > > > > > Wit

Re: [PATCH v2] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-07-25 Thread Amit Machhiwal
Hi Bjorn, On 2024/07/25 03:55 PM, Bjorn Helgaas wrote: > On Thu, Jul 25, 2024 at 11:15:39PM +0530, Amit Machhiwal wrote: > > ... > > The crash in question is a critical issue that we would want to have > > a fix for soon. And while this is still being figured out, is it &g

Re: [PATCH v2] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-07-29 Thread Amit Machhiwal
Hi Lizhi, On 2024/07/26 11:45 AM, Lizhi Hou wrote: > > On 7/26/24 10:52, Rob Herring wrote: > > On Thu, Jul 25, 2024 at 6:06 PM Lizhi Hou wrote: > > > Hi Amit, > > > > > > > > > I try to follow the option which add a OF flag. If Rob is ok with this, > > > I would suggest to use it instead of V

Re: [PATCH v2] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-07-29 Thread Amit Machhiwal
Hi Lizhi, On 2024/07/29 09:47 AM, Lizhi Hou wrote: > Hi Amit > > On 7/29/24 04:13, Amit Machhiwal wrote: > > Hi Lizhi, > > > > On 2024/07/26 11:45 AM, Lizhi Hou wrote: > > > On 7/26/24 10:52, Rob Herring wrote: > > > > On Thu, Jul 25, 202

Re: [PATCH v2] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-08-02 Thread Amit Machhiwal
Hi Stefan, On 2024/07/29 03:27 PM, Stefan Bader wrote: > On 26.07.24 13:37, Rob Herring wrote: > > + Ubuntu kernel list, again > > > > On Thu, Jul 25, 2024 at 11:15:39PM +0530, Amit Machhiwal wrote: > > > Hi Lizhi, Rob, > > > > > > Sorry for re

[PATCH v3] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-08-02 Thread Amit Machhiwal
f-by: Lizhi Hou Signed-off-by: Amit Machhiwal --- Changes since v2: * Drop v2 changes and introduce a different approach from Lizhi discussed over the v2 of this patch * V2: https://lore.kernel.org/all/20240715080726.2496198-1-amach...@linux.ibm.com/ Changes since v1: * Included Li

Re: [PATCH v3] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-08-16 Thread Amit Machhiwal
Hi Michael, On 2024/08/15 01:20 PM, Michael Ellerman wrote: > Bjorn Helgaas writes: > > On Sat, Aug 03, 2024 at 12:03:25AM +0530, Amit Machhiwal wrote: > >> With CONFIG_PCI_DYNAMIC_OF_NODES [1], a hot-plug and hot-unplug sequence > >> of a PCI device attached to a

Re: [PATCH v3] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-08-19 Thread Amit Machhiwal
Hi Michael, On 2024/08/17 08:59 AM, Michael Ellerman wrote: > Amit Machhiwal writes: > > On 2024/08/15 01:20 PM, Michael Ellerman wrote: > >> Bjorn Helgaas writes: > >> > On Sat, Aug 03, 2024 at 12:03:25AM +0530, Amit Machhiwal wrote: > >> >> With CO

[PATCH] KVM: PPC: Book3S HV: Add Power11 capability support for Nested PAPR guests

2024-10-28 Thread Amit Machhiwal
PAPR guest requires [2] in QEMU. [1] https://lore.kernel.org/all/20240221044623.1598642-1-...@ellerman.id.au/ [2] https://lore.kernel.org/all/20240731055022.696051-1-adit...@linux.ibm.com/ Signed-off-by: Amit Machhiwal --- arch/powerpc/include/asm/cputable.h | 11 ++- arch/powerpc/i

Re: [PATCH] powerpc/kvm: Fix typo in the kvm functions

2024-09-20 Thread Amit Machhiwal
On 2024/09/20 05:08 PM, Kajol Jain wrote: > Fix typo in the following kvm function names from: > > kmvhv_counters_tracepoint_regfunc -> kvmhv_counters_tracepoint_regfunc > kmvhv_counters_tracepoint_unregfunc -> kvmhv_counters_tracepoint_unregfunc > Nice catch! Review

[PATCH v2] KVM: PPC: Enable CAP_SPAPR_TCE_VFIO on pSeries KVM guests

2025-01-29 Thread Amit Machhiwal
("powerpc/iommu: Reimplement the iommu_table_group_ops for pSeries") Cc: sta...@vger.kernel.org Signed-off-by: Amit Machhiwal --- Changes since v1: * Addressed review comments from Ritesh * v1: https://lore.kernel.org/all/20250109132053.158436-1-amach...@linux.ibm.com/ arch/p

[PATCH] KVM: PPC: Enable CAP_SPAPR_TCE_VFIO on pSeries KVM guests

2025-01-09 Thread Amit Machhiwal
that results in slow startup times for large memory guests. Fix this by enabling the CAP_SPAPR_TCE_VFIO on the pSeries hosts for the nested PAPR guests. Fixes: f431a8cde7f1 ("powerpc/iommu: Reimplement the iommu_table_group_ops for pSeries") Cc: sta...@vger.kernel.org Signed-of

Re: [PATCH] powerpc/pseries/dlpar: Search DRC index from ibm,drc-indexes for IO add

2025-05-05 Thread Amit Machhiwal
> 1 file changed, 50 insertions(+), 2 deletions(-) > I tested this patch on fc42 pSeries KVM guest (L2) with PCI device passhthrough. The device hotplug operation without this patch fails with the below errors. While with the patch, PCI device hotplug/unplug operation

Re: [PATCH v3] powerpc/boot: Fix build with gcc 15

2025-05-05 Thread Amit Machhiwal
; v2: Move the fix outside of ifdef to apply to all subarchitectures > v3: Change BOOTCFLAGS rather than BOOTTARGETFLAGS > --- > arch/powerpc/boot/Makefile | 1 + > 1 file changed, 1 insertion(+) Compile-tested this patch with uptream Linux on fc42. This fixes the build errors with

[PATCH] KVM: PPC: Book3S HV: Fix IRQ map warnings with XICS on pSeries KVM Guest

2025-04-25 Thread Amit Machhiwal
pass producer (token 3822eed8) registration fails: -2 Fix this by restricting IRQ bypass enablement on pSeries systems by making the IRQ bypass callbacks unavailable when running on pSeries platform. Signed-off-by: Amit Machhiwal --- arch/powerpc/kvm/book3s_hv.c | 20

Re: [PATCH v2] KVM: PPC: Enable CAP_SPAPR_TCE_VFIO on pSeries KVM guests

2025-02-18 Thread Amit Machhiwal
Hi Ritesh, Thanks for reviewing the patch. My response is inline: On 2025/02/17 09:30 AM, Ritesh Harjani (IBM) wrote: > Amit Machhiwal writes: > > > Currently on book3s-hv, the capability KVM_CAP_SPAPR_TCE_VFIO is only > > available for KVM Guests running on PowerNV and not

[PATCH v3] KVM: PPC: Enable CAP_SPAPR_TCE_VFIO on pSeries KVM guests

2025-02-19 Thread Amit Machhiwal
a...@vger.kernel.org Reviewed-by: Vaibhav Jain Reviewed-by: Ritesh Harjani (IBM) Signed-off-by: Amit Machhiwal --- Changes since v2: * Updated the patch description * v2: https://lore.kernel.org/all/20250129094033.2265211-1-amach...@linux.ibm.com/ Changes since v1: * Addressed review

Re: [PATCH] powerpc/pseries/iommu: memory notifier incorrectly adds TCEs for pmemory

2025-05-07 Thread Amit Machhiwal
Hi Michal, I can recreate this issue on sles16 distro kernel but I don't observe this issue with upstream Linux 6.15-rc5 on the **same** sles16 guest. Note: the commit 6aa989ab2bd0 ("powerpc/pseries/iommu: memory notifier incorrectly adds TCEs for pmemory") was included since Linux 6.15-rc1. I t