From: Niklas Schnelle <schnelle@linux.ibm.com>
To: Farhan Ali <alifm@linux.ibm.com>,
Alex Williamson <alex.williamson@redhat.com>,
Bjorn Helgaas <helgaas@kernel.org>
Cc: linux-s390@vger.kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, mjrosato@linux.ibm.com
Subject: Re: [PATCH v1 5/6] vfio-pci/zdev: Perform platform specific function reset for zPCI
Date: Thu, 14 Aug 2025 21:55:00 +0200 [thread overview]
Message-ID: <d6ca10cd8b131fabed1c5dba5917b95a3df95324.camel@linux.ibm.com> (raw)
In-Reply-To: <350a9bd5-c2a9-4206-98fd-8a7913d36112@linux.ibm.com>
On Thu, 2025-08-14 at 09:33 -0700, Farhan Ali wrote:
> On 8/14/2025 6:12 AM, Niklas Schnelle wrote:
> > On Wed, 2025-08-13 at 16:56 -0600, Alex Williamson wrote:
> > > On Wed, 13 Aug 2025 14:52:24 -0700
> > > Farhan Ali <alifm@linux.ibm.com> wrote:
> > >
> > > > On 8/13/2025 1:30 PM, Alex Williamson wrote:
> > > > > On Wed, 13 Aug 2025 10:08:19 -0700
> > > > > Farhan Ali <alifm@linux.ibm.com> wrote:
> > > > >
> > > > > > For zPCI devices we should drive a platform specific function reset
> > > > > > as part of VFIO_DEVICE_RESET. This reset is needed recover a zPCI device
> > > > > > in error state.
> > > > > >
> > > > > > Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
> > > > > > ---
> > > > > > arch/s390/pci/pci.c | 1 +
> > > > > > drivers/vfio/pci/vfio_pci_core.c | 4 ++++
> > > > > > drivers/vfio/pci/vfio_pci_priv.h | 5 ++++
> > > > > > drivers/vfio/pci/vfio_pci_zdev.c | 39 ++++++++++++++++++++++++++++++++
> > > > > > 4 files changed, 49 insertions(+)
>
--- snip ---
> > Now for pci_reset_hotplug_slot() via VFIO_DEVICE_PCI_HOT_RESET I'm not
> > sure why that won't work as is. @Farhan do you know?
>
> VFIO_DEVICE_PCI_HOT_RESET would have been sufficient interface for
> majority of PCI devices on s390x as that would drive a bus reset. It was
> sufficient as most devices were single bus devices. But in the latest
> generation of machines (z17) we expose true SR-IOV and an OS can have
> access to both PF and VFs and so these are on the same bus and can have
> different ownership based on what is bound to vfio-pci.
>
Talked to Farhan a bit off list. I think the problem boils down to
this. The s390 PCI support, due to there always being a hypervisor,
does hot and cold plug on a per PCI function basis. And so the hotplug
driver's reset_slot() is just a wrapper around zpci_hot_reset_device()
and also does per PCI function reset.
Now when doing a VFIO_PCI_HOT_RESET this still doesn't give us a usable
per function reset because vfio_pci_ioctl_get_pci_hot_reset_info()'s
grouping assumes, quite naturally, that as a slot reset this will reset
an entire slot and so the ownership checks fail when we use this reset
on e.g. an SR-IOV capable device with PFs + VFs where s390 exposes
their PCI topology even while retaining per function hotplug.
As some more background, we've had the virtual PCI topology for SR-IOV
capable devices since commit 44510d6fa0c0 ("s390/pci: Handling
multifunctions") added in v6.9 but only with z17 will they be generally
available.
Thanks,
Niklas
next prev parent reply other threads:[~2025-08-14 19:55 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 17:08 [PATCH v1 0/6] Error recovery for vfio-pci devices on s390x Farhan Ali
2025-08-13 17:08 ` [PATCH v1 1/6] s390/pci: Restore airq unconditionally for the zPCI device Farhan Ali
2025-08-14 11:32 ` Niklas Schnelle
2025-08-14 16:42 ` Farhan Ali
2025-08-13 17:08 ` [PATCH v1 2/6] s390/pci: Update the logic for detecting passthrough device Farhan Ali
2025-08-13 17:08 ` [PATCH v1 3/6] s390/pci: Store PCI error information for passthrough devices Farhan Ali
2025-08-13 17:08 ` [PATCH v1 4/6] vfio-pci/zdev: Setup a zpci memory region for error information Farhan Ali
2025-08-13 20:30 ` Alex Williamson
2025-08-13 21:25 ` Farhan Ali
2025-08-13 21:42 ` Alex Williamson
2025-08-13 17:08 ` [PATCH v1 5/6] vfio-pci/zdev: Perform platform specific function reset for zPCI Farhan Ali
2025-08-13 20:30 ` Alex Williamson
2025-08-13 21:52 ` Farhan Ali
2025-08-13 22:56 ` Alex Williamson
2025-08-14 13:12 ` Niklas Schnelle
2025-08-14 16:33 ` Farhan Ali
2025-08-14 19:55 ` Niklas Schnelle [this message]
2025-08-14 20:57 ` Alex Williamson
2025-08-14 22:33 ` Farhan Ali
2025-08-14 5:22 ` kernel test robot
2025-08-14 7:42 ` kernel test robot
2025-08-13 17:08 ` [PATCH v1 6/6] vfio: Allow error notification and recovery for ISM device Farhan Ali
2025-08-14 20:48 ` Bjorn Helgaas
2025-08-14 21:02 ` Farhan Ali
2025-08-15 20:48 ` Alex Williamson
2025-08-15 21:36 ` Farhan Ali
2025-08-13 17:45 ` [PATCH v1 0/6] 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=d6ca10cd8b131fabed1c5dba5917b95a3df95324.camel@linux.ibm.com \
--to=schnelle@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=alifm@linux.ibm.com \
--cc=helgaas@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mjrosato@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).