qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] hw/smbios: retrieve PCI address from specified device


From: Vincent Bernat
Subject: Re: [PATCH v2 2/2] hw/smbios: retrieve PCI address from specified device for Type 41
Date: Thu, 01 Apr 2021 16:26:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

 ❦  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.

Otherwise, limiting to the root bus seems a fine limitation by me. How
do I check that?
-- 
Don't just echo the code with comments - make every comment count.
            - The Elements of Programming Style (Kernighan & Plauger)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]