From: "Michael S. Tsirkin" <mst@redhat.com>
To: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: "Cédric Le Goater" <clg@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Alex Williamson" <alex.williamson@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Sriram Yagnaraman" <sriram.yagnaraman@ericsson.com>,
"Jason Wang" <jasowang@redhat.com>,
"Keith Busch" <kbusch@kernel.org>,
"Klaus Jensen" <its@irrelevant.dk>,
"Markus Armbruster" <armbru@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
"Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH v10 06/12] pcie_sriov: Reuse SR-IOV VF device instances
Date: Sat, 20 Jul 2024 15:11:41 -0400 [thread overview]
Message-ID: <20240720151022-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <97c6ac3e-d099-4cc5-9672-1c1658f0cbc6@daynix.com>
On Sat, Jul 13, 2024 at 09:45:07PM +0900, Akihiko Odaki wrote:
> On 2024/07/10 19:52, Michael S. Tsirkin wrote:
> > On Wed, Jul 10, 2024 at 08:37:27AM +0200, Cédric Le Goater wrote:
> > > Hello,
> > >
> > > This change introduced a regression on s390x. I could have spotted it
> > > earlier. Sorry about that. Here is the scenario,
> > >
> > > QEMU now creates automatically the PCI device objects representing the
> > > VFs when the PF device is realized in pcie_sriov_pf_init(). This is
> > > good to report errors early but it has an important drawback.
> > >
> > > On s390x, PCI devices have a dual S390PCIBusDevice object. This device
> > > model has 'uid' and 'fid' properties which can be either set by the VMM
> > > or, if not, auto-generated by the S390PCIBusDevice realize handler. In
> > > the VF case, these ids are auto-generated by QEMU and they can possibly
> > > conflict with the uid number space of libvirt. The conflict is detected
> > > when the machine is created and the start is aborted with a message :
> > >
> > > 2024-07-08T12:51:42.876883Z qemu-system-s390x: -device {"driver":"zpci","uid":17,"fid":16,"target":"hostdev0","id":"zpci17"}: uid 17 already in use
> > >
> > > This problem can occur today with a s390x VM using an IGB device.
> > >
> > > It worked fine when the VFs were created at OS runtime because the initial
> > > topology of the machine was in place. Adding VFs was more or less like
> > > hotplug. AIUI, libvirt should have full control on the machine topology
> > > and so, creating VFs in QEMU at init time in the back of libvirt seems
> > > like a violation of this rule.
> > >
> > > That said, the s390x case is specific and could perhaps be handled in a
> > > special way.
> > >
> > > Thanks,
> > >
> > > C.
> >
> >
> > Thanks for reporting this Cédric. Akihiko what's your
> > plan to handle this? Do you have the time to address this issue?
>
> Creating VFs at initialization time only makes problems apparent early. Even
> without this change, hot-plugging another PCI device after realizing a VF
> results in a similar situation.
>
> A proper way to handle this is to add new properties to igb and nvme to let
> libvirt specify the VF ids. However I wonder if it is a worthwhile addition
> (i.e., if igb and nvme's SR-IOV emulation will be used with s390x and
> libvirt).
>
> Regards,
> Akihiko Odaki
Well okay but libvirt will not update overnight.
If we need time to discuss the design, I can revert for the
release and reapply after we have a fix.
--
MST
next prev parent reply other threads:[~2024-07-20 19:12 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-27 6:07 [PATCH v10 00/12] hw/pci: SR-IOV related fixes and improvements Akihiko Odaki
2024-06-27 6:07 ` [PATCH v10 01/12] hw/pci: Rename has_power to enabled Akihiko Odaki
2024-06-27 6:07 ` [PATCH v10 02/12] hw/ppc/spapr_pci: Do not create DT for disabled PCI device Akihiko Odaki
2024-06-27 6:07 ` [PATCH v10 03/12] hw/ppc/spapr_pci: Do not reject VFs created after a PF Akihiko Odaki
2024-06-27 6:07 ` [PATCH v10 04/12] pcie_sriov: Do not manually unrealize Akihiko Odaki
2024-06-27 6:07 ` [PATCH v10 05/12] pcie_sriov: Ensure VF function number does not overflow Akihiko Odaki
2024-06-27 6:07 ` [PATCH v10 06/12] pcie_sriov: Reuse SR-IOV VF device instances Akihiko Odaki
2024-07-10 6:37 ` Cédric Le Goater
2024-07-10 10:52 ` Michael S. Tsirkin
2024-07-13 12:45 ` Akihiko Odaki
2024-07-20 19:11 ` Michael S. Tsirkin [this message]
2024-06-27 6:07 ` [PATCH v10 07/12] pcie_sriov: Release VFs failed to realize Akihiko Odaki
2024-06-27 6:07 ` [PATCH v10 08/12] pcie_sriov: Remove num_vfs from PCIESriovPF Akihiko Odaki
2024-06-27 6:07 ` [PATCH v10 09/12] pcie_sriov: Register VFs after migration Akihiko Odaki
2024-06-27 6:07 ` [PATCH v10 10/12] hw/pci: Replace -1 with UINT32_MAX for romsize Akihiko Odaki
2024-06-27 6:08 ` [PATCH v10 11/12] hw/pci: Convert rom_bar into OnOffAuto Akihiko Odaki
2024-07-02 13:58 ` Michael S. Tsirkin
2024-07-03 2:15 ` BALATON Zoltan
2024-07-03 6:00 ` Michael S. Tsirkin
2024-07-03 11:00 ` BALATON Zoltan
2024-07-03 13:35 ` Michael S. Tsirkin
2024-07-03 14:56 ` Alex Williamson
2024-06-27 6:08 ` [PATCH v10 12/12] hw/qdev: Remove opts member Akihiko Odaki
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=20240720151022-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=akihiko.odaki@daynix.com \
--cc=alex.williamson@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=clg@redhat.com \
--cc=eduardo@habkost.net \
--cc=its@irrelevant.dk \
--cc=jasowang@redhat.com \
--cc=kbusch@kernel.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sriram.yagnaraman@ericsson.com \
--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).