From: "Michael S. Tsirkin" <mst@redhat.com>
To: Vincent Bernat <vincent@bernat.ch>
Cc: "Igor Mammedov" <imammedo@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH v2 2/2] hw/smbios: retrieve PCI address from specified device for Type 41
Date: Thu, 1 Apr 2021 12:32:28 -0400 [thread overview]
Message-ID: <20210401123148-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <m3k0pmjd1x.fsf@bernat.ch>
On Thu, Apr 01, 2021 at 04:26:50PM +0200, Vincent Bernat wrote:
> ❦ 1 avril 2021 09:59 -04, Michael S. Tsirkin:
>
> >> + /*
> >> + * TODO: Extract the appropriate value. Most of the
> >> + * time, this will be 0.
> >> + */
> >> + t->segment_group_number = cpu_to_le16(0);
> >> + t->bus_number = pci_dev_bus_num(pdev);
> >> + t->device_number = pdev->devfn;
> >
> > Problem is, for devices behind bridges for example, bus is only
> > configured by guest, after pci has been enumerated.
> >
> > So I suspect this either
> > - needs to be limited to only work for the root bus
> > - needs to be re-evaluted on guest access, like we do
> > with ACPI
>
> Or the address can be provided by the user. I didn't want to keep that
> at this is error prone and there may be surprises after adding a device
> or after a QEMU upgrade.
Or on guest changes.
>
> Otherwise, limiting to the root bus seems a fine limitation by me. How
> do I check that?
pci_bus_is_root will do this. Pls document the reason for the
limitation.
> --
> Don't just echo the code with comments - make every comment count.
> - The Elements of Programming Style (Kernighan & Plauger)
next prev parent reply other threads:[~2021-04-01 16:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-01 8:25 [PATCH v2 1/2] hw/smbios: support for type 41 (onboard devices extended information) Vincent Bernat
2021-04-01 8:25 ` [PATCH v2 2/2] hw/smbios: retrieve PCI address from specified device for Type 41 Vincent Bernat
2021-04-01 9:38 ` Daniel P. Berrangé
2021-04-01 10:07 ` Vincent Bernat
2021-04-01 10:19 ` Daniel P. Berrangé
2021-04-01 12:27 ` Vincent Bernat
2021-04-01 13:59 ` Michael S. Tsirkin
2021-04-01 14:26 ` Vincent Bernat
2021-04-01 16:32 ` Michael S. Tsirkin [this message]
2021-04-01 8:41 ` [PATCH v2 1/2] hw/smbios: support for type 41 (onboard devices extended information) Daniel P. Berrangé
2021-04-01 8:46 ` Vincent Bernat
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=20210401123148-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=berrange@redhat.com \
--cc=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vincent@bernat.ch \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.