mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-05 18:25:05 +00:00
static_allocator: skip ACPI objects referring all functions of a PCI device
According to section 6.1.1, ACPI Spec 6.4, _ADR of a device object under PCI/PCIe bus can use a special function number 0xFFFF to refer to all functions of a certain device. Such objects will have their own nodes in the board XML, and that causes build-time issues when a static allocator attempts to get all BDFs occupied under the root bus because 0xFFFF is not a valid function number (which ranges from 0 to 7). This patch skips ACPI devices with such addresses when listing existing BDFs. Tracked-On: #8293 Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
parent
0a4c76357e
commit
0cee1f8080
@ -81,6 +81,14 @@ def get_devs_bdf_native(board_etree):
|
|||||||
bus = int(common.get_node("../@address", node), 16)
|
bus = int(common.get_node("../@address", node), 16)
|
||||||
dev = int(address, 16) >> 16
|
dev = int(address, 16) >> 16
|
||||||
func = int(address, 16) & 0xffff
|
func = int(address, 16) & 0xffff
|
||||||
|
|
||||||
|
# According to section 6.1.1, ACPI Spec 6.4, _ADR of a device object under PCI/PCIe bus can use a special
|
||||||
|
# function number 0xFFFF to refer to all functions of a certain device. Such objects will have their own nodes
|
||||||
|
# in the board XML, but are out of the scope here as we are only interested in concrete BDFs that are already
|
||||||
|
# occupied.
|
||||||
|
#
|
||||||
|
# Thus, if the function number is 0xffff, we simply skip it.
|
||||||
|
if func != 0xffff:
|
||||||
dev_list.append(lib.lib.BusDevFunc(bus = bus, dev = dev, func = func))
|
dev_list.append(lib.lib.BusDevFunc(bus = bus, dev = dev, func = func))
|
||||||
return dev_list
|
return dev_list
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user