linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Narayana Murty N <nnmlinux@linux.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: mahesh@linux.ibm.com, oohall@gmail.com, npiggin@gmail.com,
	christophe.leroy@csgroup.eu, naveen@kernel.org,
	vaibhav@linux.ibm.com, ganeshgr@linux.ibm.com,
	sbhat@linux.ibm.com
Subject: Re: [PATCH v2] powerpc/pseries/eeh: Fix pseries_eeh_err_inject
Date: Mon, 9 Sep 2024 19:34:21 +0530	[thread overview]
Message-ID: <66e3558d-a9a6-4caa-9102-7c22a695acda@linux.ibm.com> (raw)
In-Reply-To: <877cbq5k1y.fsf@mail.lhotse>


On 05/09/24 6:33 PM, Michael Ellerman wrote:
> Narayana Murty N <nnmlinux@linux.ibm.com> writes:
>> VFIO_EEH_PE_INJECT_ERR ioctl is currently failing on pseries
>> due to missing implementation of err_inject eeh_ops for pseries.
>> This patch implements pseries_eeh_err_inject in eeh_ops/pseries
>> eeh_ops. Implements support for injecting MMIO load/store error
>> for testing from user space.
>>
>> The check on PCI error type code is moved to platform code, since
>> the eeh_pe_inject_err can be allowed to more error types depending
>> on platform requirement.
>>
>> Signed-off-by: Narayana Murty N <nnmlinux@linux.ibm.com>
>> ---
>>
>> Testing:
>> ========
>> vfio-test [1] by Alex Willamson, was forked and updated to add
>> support inject error on pSeries guest and used to test this
>> patch[2].
>>
>> References:
>> ===========
>> [1] https://github.com/awilliam/tests
>> [2] https://github.com/nnmwebmin/vfio-ppc-tests/tree/vfio-ppc-ex
>>
>> ================
>> Changelog:
>> V1:https://lore.kernel.org/all/20240822082713.529982-1-nnmlinux@linux.ibm.com/
>> - Resolved build issues for ppc64|le_defconfig by moving the
>> pseries_eeh_err_inject() definition outside of the CONFIG_PCI_IOV
>> code block.
>> - New eeh_pe_inject_mmio_error wrapper function added to avoid
>> CONFIG_EEH is not set.
>   
> I don't see why that's necessary?
>
> It's only called from eeh_pseries.c, which is only built for
> PPC_PSERIES, and when PPC_PSERIES=y, EEH is always enabled.
>
>> diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
>> index 91a9fd53254f..8da6b047a4fe 100644
>> --- a/arch/powerpc/include/asm/eeh.h
>> +++ b/arch/powerpc/include/asm/eeh.h
>> @@ -308,7 +308,7 @@ int eeh_pe_reset(struct eeh_pe *pe, int option, bool include_passed);
>>   int eeh_pe_configure(struct eeh_pe *pe);
>>   int eeh_pe_inject_err(struct eeh_pe *pe, int type, int func,
>>   		      unsigned long addr, unsigned long mask);
>> -
>> +int eeh_pe_inject_mmio_error(struct pci_dev *pdev);
>>   /**
>>    * EEH_POSSIBLE_ERROR() -- test for possible MMIO failure.
>>    *
>> @@ -338,6 +338,10 @@ static inline int eeh_check_failure(const volatile void __iomem *token)
>>   	return 0;
>>   }
>>   
>> +static inline int eeh_pe_inject_mmio_error(struct pci_dev *pdev)
>> +{
>> +	return -ENXIO;
>> +}
>>   #define eeh_dev_check_failure(x) (0)
>>   
>>   static inline void eeh_addr_cache_init(void) { }
>> diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
>> index d03f17987fca..49ab11a287a3 100644
>> --- a/arch/powerpc/kernel/eeh.c
>> +++ b/arch/powerpc/kernel/eeh.c
>> @@ -1537,10 +1537,6 @@ int eeh_pe_inject_err(struct eeh_pe *pe, int type, int func,
>>   	if (!eeh_ops || !eeh_ops->err_inject)
>>   		return -ENOENT;
>>   
>> -	/* Check on PCI error type */
>> -	if (type != EEH_ERR_TYPE_32 && type != EEH_ERR_TYPE_64)
>> -		return -EINVAL;
>> -
>   
> The change log should mention why it's OK to remove these checks. You
> add the same checks in pseries_eeh_err_inject(), but what about
> pnv_eeh_err_inject() ?
>
> It is OK AFAICS, because pnv_eeh_err_inject() already contains
> equivalent checks, but you should spell that out.
>
> cheers

yes mpe. I do agree, your comments are addressed in V3 posted

here 
https://lore.kernel.org/all/20240909140220.529333-1-nnmlinux@linux.ibm.com/

regards,

Narayana Murty.



  reply	other threads:[~2024-09-09 14:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23 15:11 [PATCH v2] powerpc/pseries/eeh: Fix pseries_eeh_err_inject Narayana Murty N
2024-08-27  5:03 ` Vaibhav Jain
2024-09-04  9:18 ` Mahesh J Salgaonkar
2024-09-05 13:03 ` Michael Ellerman
2024-09-09 14:04   ` Narayana Murty N [this message]
2024-09-10  7:22     ` Michael Ellerman

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=66e3558d-a9a6-4caa-9102-7c22a695acda@linux.ibm.com \
    --to=nnmlinux@linux.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=ganeshgr@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mahesh@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=naveen@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=oohall@gmail.com \
    --cc=sbhat@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;
as well as URLs for NNTP newsgroup(s).