From: Sourabh Jain <sourabhjain@linux.ibm.com>
To: Narayana Murty N <nnmlinux@linux.ibm.com>,
Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
"Oliver O'Halloran" <oohall@gmail.com>,
Timothy Pearson <tpearson@raptorengineering.com>,
Alex Williamson <alex@shazbot.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <chleroy@kernel.org>,
Ritesh Harjani <ritesh.list@gmail.com>,
Shrikanth Hegde <sshegde@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org, sbhat@linux.ibm.com, harshpb@linux.ibm.com
Subject: Re: [PATCH v6 5/5] powerpc/powernv/eeh: Map generic EEH error types to OPAL
Date: Thu, 19 Nov 2026 01:11:47 +0530 [thread overview]
Message-ID: <2ed69cf8-eca2-41ed-a100-844f9d84c2ad@linux.ibm.com> (raw)
In-Reply-To: <20261023073642.59657-6-nnmlinux@linux.ibm.com>
Hello Narayana,
For my understanding, could you clarify why this change is needed as
part of this series?
The series is about enabling RTAS-based error injection, and PowerNV
doesn't support RTAS.
How does this change fit with the earlier patches in the series?
On 23/10/26 13:06, Narayana Murty N wrote:
> eeh_pe_inject_err() is called with generic EEH error types defined in
> the VFIO/EEH userspace ABI (EEH_ERR_TYPE_32, EEH_ERR_TYPE_64). The
> PowerNV backend previously compared these generic values directly against
> OPAL firmware constants (OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR and
> OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR64).
>
> This is fragile: it relies on the generic EEH ABI values being
> numerically identical to OPAL-specific values, and would silently
> misbehave if they ever diverged.
>
> Add an explicit mapping in pnv_eeh_err_inject() that translates:
> EEH_ERR_TYPE_32 -> OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR
> EEH_ERR_TYPE_64 -> OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR64
>
> Return -ERANGE for unsupported error types, preserving the behavior
> of the original code. Decouples the VFIO/EEH interface from OPAL
> implementation details.
>
> No change to existing userspace ABI or PowerNV behavior.
>
> Signed-off-by: Narayana Murty N <nnmlinux@linux.ibm.com>
> ---
> arch/powerpc/platforms/powernv/eeh-powernv.c | 22 +++++++++++++++-----
> 1 file changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c
> index db3370d1673c..01dae760cecb 100644
> --- a/arch/powerpc/platforms/powernv/eeh-powernv.c
> +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
> @@ -1167,12 +1167,24 @@ static int pnv_eeh_err_inject(struct eeh_pe *pe, int type, int func,
> {
> struct pci_controller *hose = pe->phb;
> struct pnv_phb *phb = hose->private_data;
> + int opal_err_type;
> s64 rc;
>
> - if (type != OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR &&
> - type != OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR64) {
> - pr_warn("%s: Invalid error type %d\n",
> - __func__, type);
> + /*
> + * eeh_pe_inject_err() receives generic EEH error types from the
> + * VFIO/EEH userspace ABI. The PowerNV backend must not rely on
> + * these generic values being numerically identical to OPAL firmware
> + * values. Translate to OPAL-specific types before calling firmware.
> + */
> + switch (type) {
> + case EEH_ERR_TYPE_32:
> + opal_err_type = OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR;
> + break;
> + case EEH_ERR_TYPE_64:
> + opal_err_type = OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR64;
> + break;
> + default:
> + pr_warn("%s: Invalid error type %d\n", __func__, type);
> return -ERANGE;
> }
>
> @@ -1192,7 +1204,7 @@ static int pnv_eeh_err_inject(struct eeh_pe *pe, int type, int func,
>
> /* Do error injection */
> rc = opal_pci_err_inject(phb->opal_id, pe->addr,
> - type, func, addr, mask);
> + opal_err_type, func, addr, mask);
> if (rc != OPAL_SUCCESS) {
> pr_warn("%s: Failure %lld injecting error "
> "%d-%d to PHB#%x-PE#%x\n",
next prev parent reply other threads:[~2026-11-18 19:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 7:36 [PATCH v6 0/5] powerpc: Add RTAS based error injection support for pSeries Narayana Murty N
2026-10-23 7:36 ` [PATCH v6 1/5] powerpc/rtas: Handle ibm,open-errinjct return format Narayana Murty N
2026-11-18 11:13 ` Sourabh Jain
2026-10-23 7:36 ` [PATCH v6 2/5] powerpc/pseries/eeh: Add RTAS error injection helpers Narayana Murty N
2026-11-18 16:43 ` Sourabh Jain
2026-10-23 7:36 ` [PATCH v6 3/5] powerpc/pseries/eeh: Implement RTAS-based EEH error injection Narayana Murty N
2026-11-18 19:14 ` Sourabh Jain
2026-10-23 7:36 ` [PATCH v6 4/5] vfio/spapr_tce: Normalize EEH IOA error injection addresses Narayana Murty N
2026-11-18 19:35 ` Sourabh Jain
2026-10-23 7:36 ` [PATCH v6 5/5] powerpc/powernv/eeh: Map generic EEH error types to OPAL Narayana Murty N
2026-11-18 19:41 ` Sourabh Jain [this message]
2026-11-10 19:21 ` [PATCH v6 0/5] powerpc: Add RTAS based error injection support for pSeries tasmiya
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=2ed69cf8-eca2-41ed-a100-844f9d84c2ad@linux.ibm.com \
--to=sourabhjain@linux.ibm.com \
--cc=alex@shazbot.org \
--cc=chleroy@kernel.org \
--cc=harshpb@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mahesh@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=nnmlinux@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=oohall@gmail.com \
--cc=ritesh.list@gmail.com \
--cc=sbhat@linux.ibm.com \
--cc=sshegde@linux.ibm.com \
--cc=tpearson@raptorengineering.com \
/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
all inboxes | Powered by JetHome®