The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Farhan Ali <alifm@linux.ibm.com>
To: Alex Williamson <alex@shazbot.org>
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, helgaas@kernel.org,
	schnelle@linux.ibm.com, mjrosato@linux.ibm.com
Subject: Re: [PATCH v20 2/3] vfio-pci/zdev: Add a device feature for error information
Date: Thu, 13 Aug 2026 09:26:14 -0700	[thread overview]
Message-ID: <ade2ea72-9491-4c03-8b67-08011c2c7328@linux.ibm.com> (raw)
In-Reply-To: <20260717152650.3cfc2d10@shazbot.org>


On 7/17/2026 2:26 PM, Alex Williamson wrote:
> On Tue, 30 Jun 2026 09:55:52 -0700
> Farhan Ali <alifm@linux.ibm.com> wrote:
>
>> For zPCI devices, we have platform specific error information. The platform
>> firmware provides this error information to the operating system in an
>> architecture specific mechanism. To enable recovery from userspace for
>> these devices, we want to expose this error information to userspace. Add a
>> new device feature to expose this information.
>>
>> Userspace needs to be provide a buffer of fixed size. This size is provided
>> to userspace via the VFIO_DEVICE_INFO_CAP_ZPCI_BASE capability.
>>
>> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
>> Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
>> Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
>> ---
>>   arch/s390/include/asm/pci.h      |  2 ++
>>   arch/s390/pci/pci_event.c        | 19 ++++++++++++++
>>   drivers/vfio/pci/vfio_pci_core.c |  2 ++
>>   drivers/vfio/pci/vfio_pci_priv.h |  9 +++++++
>>   drivers/vfio/pci/vfio_pci_zdev.c | 45 ++++++++++++++++++++++++++++++--
>>   include/uapi/linux/vfio.h        | 23 ++++++++++++++++
>>   include/uapi/linux/vfio_zdev.h   |  2 ++
>>   7 files changed, 100 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h
>> index 016386f7ef4a..88a125b92bdd 100644
>> --- a/arch/s390/include/asm/pci.h
>> +++ b/arch/s390/include/asm/pci.h
>> @@ -364,6 +364,8 @@ int zpci_clear_error_state(struct zpci_dev *zdev);
>>   int zpci_reset_load_store_blocked(struct zpci_dev *zdev);
>>   void zpci_start_mediated_recovery(struct zpci_dev *zdev);
>>   void zpci_stop_mediated_recovery(struct zpci_dev *zdev);
>> +int zpci_get_pending_error(struct zpci_dev *zdev,
>> +			   struct zpci_ccdf_err *ccdf);
>>   
>>   #ifdef CONFIG_NUMA
>>   
>> diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c
>> index 8934b640a095..3ad16038e005 100644
>> --- a/arch/s390/pci/pci_event.c
>> +++ b/arch/s390/pci/pci_event.c
>> @@ -77,6 +77,25 @@ static int zpci_store_pci_error(struct pci_dev *pdev,
>>   	return 0;
>>   }
>>   
>> +int zpci_get_pending_error(struct zpci_dev *zdev,
>> +			   struct zpci_ccdf_err *ccdf)
>> +{
>> +	int head = 0;
> Nit, unnecessary initialization.
>
> Otherwise LGTM and I can drop the initialization on commit if there's
> no other reason for respin.  I think we just need a branch from Bjorn
> to base this on once he's happy with the PCI series.  Thanks,
>
> Alex

Hi Alex,

Bjorn has accepted the PCI patches and merged it to his pci/slot 
tree[1]. Would you be able to merge the vfio patches? I was able to 
apply these patches on 7.2-rc7 and didn't have any conflicts. But let me 
know if you need me to respin.

Thanks again for all your help reviewing this series.

Thanks

Farhan



>
>> +
>> +	guard(mutex)(&zdev->pending_errs_lock);
>> +
>> +	if (!zdev->pending_errs.count)
>> +		return -ENOMSG;
>> +
>> +	head = zdev->pending_errs.head % ZPCI_ERR_PENDING_MAX;
>> +	memcpy(ccdf, &zdev->pending_errs.err[head],
>> +	       sizeof(struct zpci_ccdf_err));
>> +	zdev->pending_errs.head++;
>> +	zdev->pending_errs.count--;
>> +	return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(zpci_get_pending_error);
>> +
>>   void zpci_start_mediated_recovery(struct zpci_dev *zdev)
>>   {
>>   	guard(mutex)(&zdev->pending_errs_lock);

  reply	other threads:[~2026-08-13 16:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30 16:55 [PATCH v20 0/3] [VFIO] Error recovery for vfio-pci devices on s390x Farhan Ali
2026-06-30 16:55 ` [PATCH v20 1/3] s390/pci: Store PCI error information for passthrough devices Farhan Ali
2026-06-30 16:55 ` [PATCH v20 2/3] vfio-pci/zdev: Add a device feature for error information Farhan Ali
2026-07-17 21:26   ` Alex Williamson
2026-08-13 16:26     ` Farhan Ali [this message]
2026-08-17 17:38       ` Alex Williamson
2026-06-30 16:55 ` [PATCH v20 3/3] vfio/pci: Remove the pcie check for VFIO_PCI_ERR_IRQ_INDEX Farhan Ali
2026-07-13 18:52 ` [PATCH v20 0/3] [VFIO] Error recovery for vfio-pci devices on s390x Farhan Ali

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=ade2ea72-9491-4c03-8b67-08011c2c7328@linux.ibm.com \
    --to=alifm@linux.ibm.com \
    --cc=alex@shazbot.org \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=schnelle@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