qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/4] ppc/spapr: Add support for RTAS PCI error injection on pseries
@ 2025-10-29 15:06 Narayana Murty N
  2025-10-29 15:06 ` [RFC 1/4] ppc/spapr: Add VFIO EEH error injection backend Narayana Murty N
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Narayana Murty N @ 2025-10-29 15:06 UTC (permalink / raw)
  To: npiggin, harshpb, qemu-ppc, qemu-devel; +Cc: mahesh, ganeshgr

This patch series introduces RTAS-based PCI error injection infrastructure
for the QEMU pseries (sPAPR) platform. The goal is to enable QEMU to simulate
enhanced error handling (EEH) behavior for PCI devices using RTAS interfaces,
aligned with existing firmware (OPAL/RTAS) conventions on IBM Power systems.

The proposed implementation supports:

  - Backend error injection via VFIO for passthrough PCI devices
  - RTAS calls for injecting specific PCI errors (e.g., cache/TLB/bus errors)
  - Controlled access to error injection via open/close RTAS calls
  - Device Tree (DT) updates to advertise supported error injection tokens

This series tested on pseries host with kernel version v6.16.0-rc7

This series has been split into four self-contained patches for clarity:

Patch 1 introduces the VFIO error injection backend:
  - Adds 'spapr_phb_vfio_errinjct()' which injects EEH-like faults
  - Includes minimal enum definitions ('rtas_err_type', 'EEH_ERR_FUNC_...')
  - Introduces stub and headers to integrate with the PHB VFIO path

Patch 2 implements the 'ibm,errinjct' RTAS call handler:
  - Adds 'rtas_ibm_errinjct()' in spapr_pci.c
  - Handles parameter parsing, validation, and backend call dispatch
  - Registers the token in 'spapr_pci_rtas_init()'

Patch 3 adds support for session control:
  - Introduces 'ibm,open-errinjct' and 'ibm,close-errinjct' handlers
  - Tracks exclusive access using 'SpaprMachineState'
  - Provides useful RTAS return codes for access errors

Patch 4 updates the device tree:
  - Adds 'ibm,errinjct-tokens' under each PHB node
  - Lists supported tokens for guest firmware/userspace to query
  - Adds fallback blob support for token discovery


Signed-off-by: Narayana Murty N <nnmlinux@linux.ibm.com>
---
Narayana Murty N (4):
  ppc/spapr: Add VFIO EEH error injection backend
  ppc/spapr: Add ibm,errinjct RTAS call handler
  ppc/spapr: Add support for 'ibm,open-errinjct' and
    'ibm,close-errinjct'
  ppc/spapr: Advertise RTAS error injection call support via FDT
    property

 include/hw/pci-host/spapr.h |   7 ++
 include/hw/ppc/spapr.h      |  56 ++++++++-
 hw/ppc/spapr.c              | 106 +++++++++++++++++
 hw/ppc/spapr_pci.c          | 220 ++++++++++++++++++++++++++++++++++++
 hw/ppc/spapr_pci_vfio.c     |  53 +++++++++
 5 files changed, 441 insertions(+), 1 deletion(-)

-- 
2.51.0



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

end of thread, other threads:[~2025-10-29 19:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 15:06 [RFC 0/4] ppc/spapr: Add support for RTAS PCI error injection on pseries Narayana Murty N
2025-10-29 15:06 ` [RFC 1/4] ppc/spapr: Add VFIO EEH error injection backend Narayana Murty N
2025-10-29 15:06 ` [RFC 2/4] ppc/spapr: Add ibm,errinjct RTAS call handler Narayana Murty N
2025-10-29 15:06 ` [RFC 3/4] ppc/spapr: Add support for 'ibm, open-errinjct' and 'ibm, close-errinjct' Narayana Murty N
2025-10-29 15:06 ` [RFC 4/4] ppc/spapr: Advertise RTAS error injection call support via FDT property Narayana Murty N

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