mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-26 15:31:35 +00:00
board_inspector: check the number of PCI domains
Today ACRN works only on platforms with a single PCI domain (which is true for most client and IoT platforms). This limitation is also used to simplify the implementation of the board inspector. As a result, on platforms with multiple PCI domains, the board inspector may crash when parsing information about PCI devices. This patch adds a check on the number of PCI domains before the board inspector attempts to extract any information, and terminates the tool early if multiple PCI domains are detected. Tracked-On: #6689 Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
parent
53efa3851e
commit
8bf5b18400
@ -80,6 +80,13 @@ def native_check():
|
|||||||
logging.error("Board inspector is running inside an unsupported Virtual Machine (VM). " \
|
logging.error("Board inspector is running inside an unsupported Virtual Machine (VM). " \
|
||||||
"Only KVM or QEMU is supported. Unexpected results may occur.")
|
"Only KVM or QEMU is supported. Unexpected results may occur.")
|
||||||
|
|
||||||
|
def check_pci_domains():
|
||||||
|
root_buses = filter(lambda x: x.startswith("pci"), os.listdir("/sys/devices"))
|
||||||
|
domain_ids = set(map(lambda x: x.split(":")[0].replace("pci", ""), root_buses))
|
||||||
|
if len(domain_ids) > 1:
|
||||||
|
logging.fatal(f"ACRN does not support platforms with multiple PCI domains {domain_ids}. Check if the BIOS has any configuration that consolidates those domains into one.")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
def bring_up_cores():
|
def bring_up_cores():
|
||||||
cpu_ids = get_offline_cpu_ids()
|
cpu_ids = get_offline_cpu_ids()
|
||||||
for id in cpu_ids:
|
for id in cpu_ids:
|
||||||
@ -96,6 +103,9 @@ def main(board_name, board_xml, args):
|
|||||||
# Check if this is native os
|
# Check if this is native os
|
||||||
native_check()
|
native_check()
|
||||||
|
|
||||||
|
# Check if there exists multiple PCI domains (which is not supported)
|
||||||
|
check_pci_domains()
|
||||||
|
|
||||||
# Bring up all cores
|
# Bring up all cores
|
||||||
bring_up_cores()
|
bring_up_cores()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user