From: Farhan Ali <alifm@linux.ibm.com>
To: "Cédric Le Goater" <clg@redhat.com>,
qemu-devel@nongnu.org, qemu-s390x@nongnu.org
Cc: mjrosato@linux.ibm.com, thuth@redhat.com, alex.williamson@redhat.com
Subject: Re: [PATCH v2 2/4] vfio/pci: Add an architecture specific error handler
Date: Wed, 3 Sep 2025 09:49:47 -0700 [thread overview]
Message-ID: <17b1213d-d076-4e0f-b43e-657abc002e9c@linux.ibm.com> (raw)
In-Reply-To: <0699f897-3aeb-4104-919b-c96cdab4d4e7@redhat.com>
On 9/1/2025 4:28 AM, Cédric Le Goater wrote:
> On 8/25/25 23:24, Farhan Ali wrote:
>> Provide a architecture specific error handling callback, that can be
>> used
>> by platforms to handle PCI errors for passthrough devices.
>>
>> Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
>> ---
>> hw/vfio/pci.c | 5 +++++
>> hw/vfio/pci.h | 1 +
>> 2 files changed, 6 insertions(+)
>>
>> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
>> index 07257d0fa0..3c71d19306 100644
>> --- a/hw/vfio/pci.c
>> +++ b/hw/vfio/pci.c
>> @@ -3026,6 +3026,11 @@ static void vfio_err_notifier_handler(void
>> *opaque)
>> return;
>> }
>> + if (vdev->arch_err_handler) {
>> + vdev->arch_err_handler(vdev);
>
>
> I am not sure that the "architecture specific error handling"
> will be implemented this way but we need to check for potential
> errors.
Thanks for reviewing, do you have any suggestions on how to implement
the architecture/device specific error handling?
>
> So, please make the handler return a bool and add an extra
> 'Error **' parameter.
>
>
Sure, I can change that. Are you suggesting the change to bool return
for the handler to report any failures in the handler (through errp)?
Thanks
Farhan
>
> Thanks,
>
> C.
>
>
>
>
>> + return;
>> + }
>> +
>> /*
>> * TBD. Retrieve the error details and decide what action
>> * needs to be taken. One of the actions could be to pass
>> diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
>> index 810a842f4a..45d4405e47 100644
>> --- a/hw/vfio/pci.h
>> +++ b/hw/vfio/pci.h
>> @@ -145,6 +145,7 @@ struct VFIOPCIDevice {
>> EventNotifier err_notifier;
>> EventNotifier req_notifier;
>> int (*resetfn)(struct VFIOPCIDevice *);
>> + void (*arch_err_handler)(struct VFIOPCIDevice *);
>
>> uint32_t vendor_id;
>> uint32_t device_id;
>> uint32_t sub_vendor_id;
>
>
next prev parent reply other threads:[~2025-09-03 16:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 21:24 [PATCH v2 0/4] Error recovery for zPCI passthrough devices Farhan Ali
2025-08-25 21:24 ` [PATCH v2 1/4] [NOTFORMERGE] linux-headers: Update for zpci vfio device Farhan Ali
2025-08-25 21:24 ` [PATCH v2 2/4] vfio/pci: Add an architecture specific error handler Farhan Ali
2025-09-01 11:28 ` Cédric Le Goater
2025-09-03 16:49 ` Farhan Ali [this message]
2025-09-09 20:56 ` Cédric Le Goater
2025-08-25 21:24 ` [PATCH v2 3/4] s390x/pci: Add PCI error handling for vfio pci devices Farhan Ali
2025-09-01 11:25 ` Cédric Le Goater
2025-09-03 17:12 ` Farhan Ali
2025-09-03 17:49 ` Matthew Rosato
2025-09-09 7:59 ` Cédric Le Goater
2025-08-25 21:24 ` [PATCH v2 4/4] s390x/pci: Reset a device in error state Farhan Ali
2025-09-01 11:17 ` Cédric Le Goater
2025-09-03 17:13 ` 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=17b1213d-d076-4e0f-b43e-657abc002e9c@linux.ibm.com \
--to=alifm@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=clg@redhat.com \
--cc=mjrosato@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.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).