qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Narayana Murty N <nnmlinux@linux.ibm.com>
To: npiggin@gmail.com, harshpb@linux.ibm.com, qemu-ppc@nongnu.org,
	qemu-devel@nongnu.org
Cc: mahesh@linux.ibm.com, ganeshgr@linux.ibm.com
Subject: [RFC 0/4] ppc/spapr: Add support for RTAS PCI error injection on pseries
Date: Wed, 29 Oct 2025 10:06:14 -0500	[thread overview]
Message-ID: <20251029150618.186803-1-nnmlinux@linux.ibm.com> (raw)

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



             reply	other threads:[~2025-10-29 19:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29 15:06 Narayana Murty N [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251029150618.186803-1-nnmlinux@linux.ibm.com \
    --to=nnmlinux@linux.ibm.com \
    --cc=ganeshgr@linux.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --cc=mahesh@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).