qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Rosato <mjrosato@linux.ibm.com>
To: "Akihiko Odaki" <akihiko.odaki@daynix.com>,
	"Cédric Le Goater" <clg@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"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>,
	"Eric Farman" <farman@linux.ibm.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH for-9.2 v15 04/11] s390x/pci: Check for multifunction after device realization
Date: Wed, 11 Sep 2024 09:53:21 -0400	[thread overview]
Message-ID: <8dbc553b-c3ae-4f11-accb-6dee10e9758e@linux.ibm.com> (raw)
In-Reply-To: <eaebda7d-c61e-4ed8-a6b9-98e5f48f26ff@daynix.com>

On 9/11/24 6:58 AM, Akihiko Odaki wrote:
> On 2024/09/11 18:38, Cédric Le Goater wrote:
>> +Matthew +Eric
>>
>> Side note for the maintainers :
>>
>> Before this change, the igb device, which is multifunction, was working
>> fine under Linux.
>>
>> Was there a fix in Linux since :
>>
>>    57da367b9ec4 ("s390x/pci: forbid multifunction pci device")
>>    6069bcdeacee ("s390x/pci: Move some hotplug checks to the pre_plug handler")
>>
>> ?
The timing of those particular commits predates the linux s390 kernel support of multifunction/SR-IOV.  At that time it was simply not possible on s390.

>>
>> s390 PCI devices do not have extended capabilities, so the igb device
>> does not expose the SRIOV capability and only the PF is accessible but
>> it doesn't seem to be an issue. (Btw, CONFIG_PCI_IOV is set to y in the
>> default Linux config which is unexpected)

The linux config option makes sense because the s390 kernel now supports SR-IOV/multifunction.

> 
> Doesn't s390x really see extended capabilities? hw/s390x/s390-pci-inst.c has a call pci_config_size() and pci_host_config_write_common(), which means it is exposing the whole PCI Express configuration space. Why can't s390x use extended capabilities then?
> 

So, rather than poking around in config space, s390 (and thus the s390 kernel) has an extra layer of 'capabilities' that it generally relies on to determine device functionality called 'CLP'.  Basically, there are pieces of CLP that are not currently generated (or forwarded from the host in the case of passthrough) by QEMU that would be needed by the guest to recognize the SRIOV/multifunction capability of a device, despite what config space has in it.  I suspect this is exactly why only the PF was available to your igb device then (missing CLP info made the device appear to not have multifunction capability as far as the s390 guest is concerned - fwiw adding CLP emulation to enable that is on our todo list).

Sounds like the short-term solution here would be to continue allowing the PF without multifunction being visible to the guest (so as to not regress prior functionality) and then aim for proper support after with the necessary CLP pieces. 

Thanks,
Matt


  parent reply	other threads:[~2024-09-11 15:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23  5:00 [PATCH for-9.2 v15 00/11] hw/pci: SR-IOV related fixes and improvements Akihiko Odaki
2024-08-23  5:00 ` [PATCH for-9.2 v15 01/11] hw/pci: Rename has_power to enabled Akihiko Odaki
2024-08-23  5:00 ` [PATCH for-9.2 v15 02/11] hw/ppc/spapr_pci: Do not create DT for disabled PCI device Akihiko Odaki
2024-08-23  5:00 ` [PATCH for-9.2 v15 03/11] hw/ppc/spapr_pci: Do not reject VFs created after a PF Akihiko Odaki
2024-08-23  5:00 ` [PATCH for-9.2 v15 04/11] s390x/pci: Check for multifunction after device realization Akihiko Odaki
2024-09-10 13:22   ` Cédric Le Goater
2024-09-11  9:38   ` Cédric Le Goater
2024-09-11 10:58     ` Akihiko Odaki
2024-09-11 11:23       ` Michael S. Tsirkin
2024-09-11 13:53       ` Matthew Rosato [this message]
2024-09-11 15:15         ` Akihiko Odaki
2024-09-11 21:11           ` Matthew Rosato
2024-09-12  6:40             ` Akihiko Odaki
2024-08-23  5:00 ` [PATCH for-9.2 v15 05/11] pcie_sriov: Do not manually unrealize Akihiko Odaki
2024-08-23  5:00 ` [PATCH for-9.2 v15 06/11] pcie_sriov: Reuse SR-IOV VF device instances Akihiko Odaki
2024-08-23  5:00 ` [PATCH for-9.2 v15 07/11] pcie_sriov: Release VFs failed to realize Akihiko Odaki
2024-08-23  5:00 ` [PATCH for-9.2 v15 08/11] pcie_sriov: Remove num_vfs from PCIESriovPF Akihiko Odaki
2024-08-23  5:00 ` [PATCH for-9.2 v15 09/11] pcie_sriov: Register VFs after migration Akihiko Odaki
2024-08-23  5:00 ` [PATCH for-9.2 v15 10/11] hw/pci: Use -1 as the default value for rombar Akihiko Odaki
2024-08-23  5:00 ` [PATCH for-9.2 v15 11/11] hw/qdev: Remove opts member Akihiko Odaki
2024-09-10  9:21 ` [PATCH for-9.2 v15 00/11] hw/pci: SR-IOV related fixes and improvements Michael S. Tsirkin
2024-09-10  9:33   ` Akihiko Odaki
2024-09-10 11:47     ` Michael S. Tsirkin
2024-09-10 13:21     ` Cédric Le Goater
2024-09-10 13:34       ` Michael S. Tsirkin
2024-09-10 14:13         ` Cédric Le Goater
2024-09-10 15:27           ` Michael S. Tsirkin
2024-09-11  3:05             ` Akihiko Odaki
2024-09-11 10:00               ` Michael S. Tsirkin
2024-09-11 10:09               ` Cédric Le Goater

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=8dbc553b-c3ae-4f11-accb-6dee10e9758e@linux.ibm.com \
    --to=mjrosato@linux.ibm.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=farman@linux.ibm.com \
    --cc=its@irrelevant.dk \
    --cc=jasowang@redhat.com \
    --cc=kbusch@kernel.org \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sriram.yagnaraman@ericsson.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).