From: Sourabh Jain <sourabhjain@linux.ibm.com>
To: Narayana Murty N <nnmlinux@linux.ibm.com>,
mahesh@linux.ibm.com, maddy@linux.ibm.com, mpe@ellerman.id.au,
christophe.leroy@csgroup.eu, oohall@gmail.com, npiggin@gmail.com,
tpearson@raptorengineering.com, alex@shazbot.org
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
sbhat@linux.ibm.com, harshpb@linux.ibm.com
Subject: Re: [PATCH v4 5/5] powerpc/powernv/eeh: Map VFIO EEH error injection to OPAL
Date: Thu, 24 Sep 2026 10:05:48 +0530 [thread overview]
Message-ID: <280fcec1-4d39-4389-9094-74ca9e89a113@linux.ibm.com> (raw)
In-Reply-To: <20260831065441.48654-6-nnmlinux@linux.ibm.com>
Can you update the commit message to explain why and how this
change is needed?
On 31/08/26 12:24, Narayana Murty N wrote:
> VFIO EEH error injection exposes a generic userspace ABI. pSeries maps
> the generic EEH error types to RTAS ibm,errinjct encodings, while
> PowerNV maps the same generic ABI values to OPAL-specific encodings.
>
> Keep EEH_ERR_TYPE_32 and EEH_ERR_TYPE_64 unchanged. The mapping is
> internal to the platform backend.
>
> Add a switch 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 -EINVAL for unsupported error types rather than comparing
> directly against OPAL constants. This decouples the VFIO/EEH
> interface from OPAL implementation details, paralleling the approach
> used on the pSeries RTAS path.
>
> Signed-off-by: Narayana Murty N <nnmlinux@linux.ibm.com>
> ---
> arch/powerpc/platforms/powernv/eeh-powernv.c | 27 +++++++++++++++-----
> 1 file changed, 21 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c
> index db3370d1673c..53c4c05aaef2 100644
> --- a/arch/powerpc/platforms/powernv/eeh-powernv.c
> +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
> @@ -1167,13 +1167,28 @@ 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_type;
opal_type is confusing... How about opal_err_type or just 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);
> - return -ERANGE;
> + /*
> + * VFIO EEH error injection exposes a generic userspace ABI.
> + * pSeries maps the generic EEH error types to RTAS ibm,errinjct
> + * encodings, while PowerNV maps the same generic ABI values to
> + * OPAL-specific encodings.
> + *
> + * Keep EEH_ERR_TYPE_32 and EEH_ERR_TYPE_64 unchanged. The
> + * mapping is internal to the platform backend.
> + */
> + switch (type) {
> + case EEH_ERR_TYPE_32:
> + opal_type = OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR;
> + break;
> + case EEH_ERR_TYPE_64:
> + opal_type = OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR64;
> + break;
> + default:
> + pr_warn("%s: Invalid error type %d\n", __func__, type);
> + return -EINVAL;
> }
>
> if (func < OPAL_ERR_INJECT_FUNC_IOA_LD_MEM_ADDR ||
> @@ -1192,7 +1207,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_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-09-24 4:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 6:54 [PATCH v4 0/5] powerpc/eeh: Add RTAS-based error injection support on pSeries Narayana Murty N
2026-08-31 6:54 ` [PATCH v4 1/5] powerpc/rtas: Handle ibm,open-errinjct return format Narayana Murty N
2026-09-01 9:22 ` Sourabh Jain
2026-09-09 5:45 ` Narayana Murty N
2026-08-31 6:54 ` [PATCH v4 2/5] vfio/spapr_tce: Normalize EEH IOA error injection addresses Narayana Murty N
2026-09-23 11:40 ` Sourabh Jain
2026-08-31 6:54 ` [PATCH v4 3/5] powerpc/pseries/eeh: Add RTAS error validation helpers Narayana Murty N
2026-09-23 12:16 ` Sourabh Jain
2026-08-31 6:54 ` [PATCH v4 4/5] powerpc/pseries/eeh: Implement RTAS-based EEH error injection Narayana Murty N
2026-09-02 5:16 ` Sourabh Jain
2026-09-09 6:07 ` Narayana Murty N
2026-09-23 10:22 ` Sourabh Jain
2026-08-31 6:54 ` [PATCH v4 5/5] powerpc/powernv/eeh: Map VFIO EEH error injection to OPAL Narayana Murty N
2026-09-24 4:35 ` Sourabh Jain [this message]
2026-09-01 18:08 ` [PATCH v4 0/5] powerpc/eeh: Add RTAS-based error injection support on pSeries 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=280fcec1-4d39-4389-9094-74ca9e89a113@linux.ibm.com \
--to=sourabhjain@linux.ibm.com \
--cc=alex@shazbot.org \
--cc=christophe.leroy@csgroup.eu \
--cc=harshpb@linux.ibm.com \
--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=sbhat@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®