LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Narayana Murty N <nnmlinux@linux.ibm.com>
To: Sourabh Jain <sourabhjain@linux.ibm.com>,
	mahesh@linux.ibm.com, maddy@linux.ibm.com, mpe@ellerman.id.au,
	christophe.leroy@csgroup.eu, gregkh@linuxfoundation.org,
	oohall@gmail.com, npiggin@gmail.com
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	tyreld@linux.ibm.com, vaibhav@linux.ibm.com, sbhat@linux.ibm.com,
	ganeshgr@linux.ibm.com, haren@linux.ibm.com, thuth@redhat.com
Subject: Re: [PATCH v3 5/5] powerpc/powernv/eeh: Map VFIO EEH error injection to OPAL
Date: Wed, 5 Aug 2026 11:53:41 +0530	[thread overview]
Message-ID: <1e9ba55b-9126-419e-9dc1-c560822b11db@linux.ibm.com> (raw)
In-Reply-To: <09563f43-9514-4fc2-9e90-f9ad9f528bea@linux.ibm.com>

Hi Sourabh,

On 05/08/26 12:01 AM, Sourabh Jain wrote:
>
>
> As per the title this series is about RTAS-based error injection on 
> pSeries.
>
> Then why do we have powernv/opal patch part of this series?
>
> - Sourabh Jain
>
The guest running on povernv host also a pseries guest. VFIO will take 
care of
translating the calls to respective platforms. So as a platform 
comparability
the changes are made in this series.

Regards,
Narayana.

>
> On 21/07/26 09:08, Narayana Murty N wrote:
>> The EEH error-injection interface passes the generic userspace ABI
>> values EEH_ERR_TYPE_32 and EEH_ERR_TYPE_64 to the platform backend.
>>
>> The PowerNV backend currently compares those generic values directly
>> with OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR and
>> OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR64. Although the corresponding values
>> are currently numerically identical, this implicitly couples the
>> generic EEH ABI to the OPAL firmware encoding.
>>
>> Explicitly translate the generic EEH error types to their OPAL
>> equivalents in pnv_eeh_err_inject(). Keep the platform-specific
>> encoding within the PowerNV backend and reject unsupported generic
>> types with -EINVAL.
>>
>> No userspace ABI values are changed.
>>
>> Signed-off-by: Narayana Murty N <nnmlinux@linux.ibm.com>
>> ---
>>   arch/powerpc/platforms/powernv/eeh-powernv.c | 36 +++++++++++++++++---
>>   1 file changed, 32 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c 
>> b/arch/powerpc/platforms/powernv/eeh-powernv.c
>> index db3370d1673c..b0bcd014a133 100644
>> --- a/arch/powerpc/platforms/powernv/eeh-powernv.c
>> +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
>> @@ -1169,11 +1169,39 @@ static int pnv_eeh_err_inject(struct eeh_pe 
>> *pe, int type, int func,
>>       struct pnv_phb *phb = hose->private_data;
>>       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",
>> +    /*
>> +     * Map generic EEH error-type ABI values to OPAL-specific type 
>> codes.
>> +     * EEH_ERR_TYPE_32 and EEH_ERR_TYPE_64 are the only types 
>> supported by
>> +     * OPAL.  Additional generic types defined in the UAPI header 
>> are valid
>> +     * for pSeries RTAS but unsupported here; return -EOPNOTSUPP for 
>> those.
>> +     * Unknown or invalid values return -EINVAL.
>> +     *
>> +     * Note: currently OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR  == 0 ==
>> +     * EEH_ERR_TYPE_32 and OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR64 == 1 ==
>> +     * EEH_ERR_TYPE_64, but the explicit switch makes the coupling
>> +     * visible and allows the values to diverge independently.
>> +     */
>> +    switch (type) {
>> +    case EEH_ERR_TYPE_32:
>> +        type = OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR;
>> +        break;
>> +    case EEH_ERR_TYPE_64:
>> +        type = OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR64;
>> +        break;
>> +    case EEH_ERR_TYPE_RECOVERED_SPECIAL_EVENT:
>> +    case EEH_ERR_TYPE_CORRUPTED_PAGE:
>> +    case EEH_ERR_TYPE_CORRUPTED_DCACHE_START:
>> +    case EEH_ERR_TYPE_CORRUPTED_DCACHE_END:
>> +    case EEH_ERR_TYPE_CORRUPTED_ICACHE_START:
>> +    case EEH_ERR_TYPE_CORRUPTED_ICACHE_END:
>> +    case EEH_ERR_TYPE_CORRUPTED_TLB_START:
>> +    case EEH_ERR_TYPE_CORRUPTED_TLB_END:
>> +        pr_warn("%s: EEH error type %d not supported by OPAL\n",
>>               __func__, type);
>> -        return -ERANGE;
>> +        return -EOPNOTSUPP;
>> +    default:
>> +        pr_warn("%s: unsupported EEH error type %d\n", __func__, type);
>> +        return -EINVAL;
>>       }
>>         if (func < OPAL_ERR_INJECT_FUNC_IOA_LD_MEM_ADDR ||
>



  reply	other threads:[~2026-08-05  6:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21  3:38 [PATCH v3 0/5] powerpc/eeh: Add RTAS-based error injection support on pSeries Narayana Murty N
2026-07-21  3:38 ` [PATCH v3 1/5] powerpc/rtas: Handle ibm,open-errinjct return format Narayana Murty N
2026-08-04  5:52   ` Sourabh Jain
2026-07-21  3:38 ` [PATCH v3 2/5] powerpc/rtas: Allocate ibm,errinjct buffer below RTAS limit Narayana Murty N
2026-08-04  7:22   ` Sourabh Jain
2026-07-21  3:38 ` [PATCH v3 3/5] powerpc/pseries/eeh: Add RTAS error validation helpers Narayana Murty N
2026-08-04 18:05   ` Sourabh Jain
2026-07-21  3:38 ` [PATCH v3 4/5] powerpc/pseries/eeh: Implement RTAS-based EEH error injection Narayana Murty N
2026-08-04 18:26   ` Sourabh Jain
2026-07-21  3:38 ` [PATCH v3 5/5] powerpc/powernv/eeh: Map VFIO EEH error injection to OPAL Narayana Murty N
2026-08-04 18:31   ` Sourabh Jain
2026-08-05  6:23     ` Narayana Murty N [this message]
2026-08-09 12:00       ` Sourabh Jain

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=1e9ba55b-9126-419e-9dc1-c560822b11db@linux.ibm.com \
    --to=nnmlinux@linux.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=ganeshgr@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haren@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=npiggin@gmail.com \
    --cc=oohall@gmail.com \
    --cc=sbhat@linux.ibm.com \
    --cc=sourabhjain@linux.ibm.com \
    --cc=thuth@redhat.com \
    --cc=tyreld@linux.ibm.com \
    --cc=vaibhav@linux.ibm.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