[edk2-devel] [PATCH v2 0/4] Add extra pci roots support for Arm

Ard Biesheuvel ard.biesheuvel at arm.com
Thu Dec 17 13:37:30 UTC 2020


On 12/17/20 2:23 PM, Laszlo Ersek wrote:
> On 12/15/20 13:52, Jiahui Cen wrote:
>> For x86, Linux does not handle the pci resource assignment. But for arm, it
>> would assign all the pci resources, unless we explicitly let Linux preserve
>> PCI resource alignment made by firmware, using "PCI Boot Configuration"
>> _DSM function.
> 
> This difference between x86 and arm seems inexplicable to me.
> 
>> What do you think of adding "PCI Boot Configuration" _DSM function into
>> dsdt table to make kernel use firmware's resource configuration?
> 
> The relevant kernel commits seem to be:
> 
> - 18e94a338436 ("PCI: Make a shareable UUID for PCI firmware ACPI _DSM",
> 2015-04-08)
> 
> - a78cf9657ba5 ("PCI/ACPI: Evaluate PCI Boot Configuration _DSM",
> 2019-06-21)
> 
> I've also read now section "4.6.5. _DSM for Ignoring PCI Boot
> Configurations" in the "PCI(TM) Firmware Specification,
> Revision 3.1, December 13, 2010".
> 
> Basically if this _DSM#5 function exists, it tells the OS whether it is
> required to honor the firmware-assigned resources (value 0), or if it is
> free to reassign (value 1). If the function does not exist at all, then,
> "the operating system may continue to use the legacy handling regarding
> the boot configuration".
> 
> Without knowing more, I consider it a bug that aarch64 Linux uses a
> default strategy (in the absence of the _DSM#5 function) that is the
> opposite of the x86 default. But, you seem to be right that there is a
> specified way to convince arm64 Linux otherwise. Can you indeed add this
> _DSM#5 function to the "virt" machine's ACPI generator, returning value
> 0, and see if it makes a difference?
> 

That is not going to work, unfortunately. We had a very long discussion
in the PCI SIG firmware subteam about this, and some changes were made
IIRC, but the code does not exist yet in Linux.

For historical reason, Linux/arm64 always reassigns PCI bus and memory
resources: the ARM port on which arm64 is based does not assume the
existence of any firmware, let only a PCI BIOS that carries out all
those things. When ACPI boot on Linux/arm64 came about, this nuance got
missed, and so even though the presence of rich firmware can obviously
be relied upon in this case, the PCI layer still reassigns some of the
resources in many cases. Note that Linux/x86 might do the same, but is
less likely to do so for modern systems. (My personal favorite is the
Linux/x86 quirk that bases this decision on the BIOS year from DMI)

One thing that does seem to help on AArch64 is to ensure that the bus
padding is the same for hotplug capable root ports, because this is the
most common reason for reassigning bus numbers.

HTH,
Ard.




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69124): https://edk2.groups.io/g/devel/message/69124
Mute This Topic: https://groups.io/mt/78135572/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list