From 58c0a47474652bf09697592d7bd3a529fe1543d1 Mon Sep 17 00:00:00 2001 From: Vijay Dhanraj Date: Thu, 27 Feb 2020 19:18:11 -0800 Subject: [PATCH] acrn-config: Fix vbar address generated by the offline tool Devices that support SR-IOV can expose their capabilities in lspci -vv command as below. The offline tool, instead of picking up the bios exposed memory region(bc000000) for the devices ends picking up the SR-IOV memory region(00000000c0000000) and generates VBAR address (in pci_devices.h). This is incorrect. This patch fixes the offline tool to take the right memory region as the VBAR address. Sample lspic -vv log: 67:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE backplane (rev 09) Subsystem: Intel Corporation Device 0000 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- Acked-by: Victor Sun --- misc/acrn-config/board_config/pci_devices_h.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/acrn-config/board_config/pci_devices_h.py b/misc/acrn-config/board_config/pci_devices_h.py index e01ad4e5c..5e3bcbb31 100644 --- a/misc/acrn-config/board_config/pci_devices_h.py +++ b/misc/acrn-config/board_config/pci_devices_h.py @@ -41,6 +41,9 @@ def parser_pci(): for line in pci_lines: # get pci bar information into pci_bar_dic if "Region" in line and "Memory at" in line: + #ignore memory region from SR-IOV capabilities + if "size=" not in line: + continue bar_num = line.split()[1].strip(':') bar_addr = get_value_after_str(line, "at") if int(bar_addr, 16) > 0xffffffff: