qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] vfio/spapr: Fix L2 crash with PCI device passthrough
@ 2025-04-08 12:40 Amit Machhiwal
  2025-04-08 12:40 ` [PATCH v3 1/2] vfio/spapr: Enhance error handling in vfio_spapr_create_window() Amit Machhiwal
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Amit Machhiwal @ 2025-04-08 12:40 UTC (permalink / raw)
  To: qemu-ppc, Nicholas Piggin, Harsh Prateek Bora
  Cc: qemu-devel, Amit Machhiwal, Vaibhav Jain, Shivaprasad G Bhat,
	Daniel Henrique Barboza, Alex Williamson, Cédric Le Goater

Hi,

This patch series addresses two aspects in vfio_spapr_create_window() that
includes the enhancement in error handling in this function and also fixes an
issue with KVM guests (L2) inside a pSeries logical partition (LPAR) with larger
memory configurations and PCI device passthrough.

The structure of the patch series is as below:

1. The first patch introduces structured error reporting in
   `vfio_spapr_create_window()` by adding an `Error **` parameter. This allows
   better propagation of failure details to the caller.

2. The second patch fixes a crash observed when booting an L2 KVM guest inside a
   pSeries LPAR with memory more than 128 GB and PCI device passthrough. The
   crash occurs due a check in KVM preventing multi-level TCEs because of not
   being supported by PowerVM hypervisor. This patch ensures that such
   configurations are avoided by first checking the supported number of levels
   returned by the `VFIO_IOMMU_SPAPR_TCE_GET_INFO` ioctl.

The fix has been tested with KVM guests on PowerVM and bare-metal enviroments
with memory sizes up to 390 GB and 450 GB respectively.

Thanks,
Amit

Changes in v3:
  * Change vfio_spapr_create_window() to return bool
  * Replace error_setg() with error_setg_errono() in vfio_spapr_create_window()
  * Pass errp instead of local Error object in vfio_spapr_create_window()
    while calling from vfio_spapr_add_section_window()
  * Modified patch #2 subject

Changes in v2:
  * Link: https://lore.kernel.org/all/20250407143119.1304513-1-amachhiw@linux.ibm.com/
  * Added Error ** parameter in vfio_spapr_create_window() for enhanced error
    handling with error_setg() and friends

v1: https://lore.kernel.org/all/20250404091721.2653539-1-amachhiw@linux.ibm.com/

Amit Machhiwal (2):
  vfio/spapr: Enhance error handling in vfio_spapr_create_window()
  vfio/spapr: Fix L2 crash with PCI device passthrough and memory > 128G

 hw/vfio/spapr.c | 69 ++++++++++++++++++++++++++++++-------------------
 1 file changed, 43 insertions(+), 26 deletions(-)


base-commit: dfaecc04c46d298e9ee81bd0ca96d8754f1c27ed
-- 
2.49.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-04-09 10:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 12:40 [PATCH v3 0/2] vfio/spapr: Fix L2 crash with PCI device passthrough Amit Machhiwal
2025-04-08 12:40 ` [PATCH v3 1/2] vfio/spapr: Enhance error handling in vfio_spapr_create_window() Amit Machhiwal
2025-04-08 12:50   ` Cédric Le Goater
2025-04-08 12:40 ` [PATCH v3 2/2] vfio/spapr: Fix L2 crash with PCI device passthrough and memory > 128G Amit Machhiwal
2025-04-08 12:50   ` Cédric Le Goater
2025-04-09 10:00 ` [PATCH v3 0/2] vfio/spapr: Fix L2 crash with PCI device passthrough Cédric Le Goater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).