acrn-hypervisor/misc/config_tools
Junjie Mao 0aa899271d board_inspector/extractors: extract device information
This patch extracts information on devices and put them under the
`/acrn-config/devices` node in the board XML.

The generated XML looks like the following:

  <devices>
    <bus type="system">
      <acpi_object>\_SB_</acpi_object>
      <bus id="PNP0A08" type="pci" address="0x0" description="...">
        <vendor>0x8086</vendor>
        <identifier>0x591f</identifier>
        <subsystem_vendor>0x1028</subsystem_vendor>
        <subsystem_identifier>0x07a1</subsystem_identifier>
        <class>0x060000</class>
        <acpi_object>\_SB_.PCI0</acpi_object>
        <resource type="bus_number" min="0x0" max="0x3e" len="0x3f"/>
        <resource type="io_port" min="0x0" max="0xcf7" len="0xcf8"/>
        <resource type="io_port" min="0xcf8" max="0xcf8" len="0x8"/>
        <resource type="io_port" min="0xd00" max="0xffff" len="0xf300"/>
        <resource type="memory" min="0x10000" max="0x1ffff" len="0x0"/>
        <resource type="memory" min="0xa0000" max="0xbffff" len="0x20000"/>
        <resource type="memory" min="0xc0000" max="0xc3fff" len="0x4000"/>
        <resource type="memory" min="0xc4000" max="0xc7fff" len="0x4000"/>
        ...
        <capability id="vendor_specific"/>
        <device address="0x1"> ... </device>
        ...
      <bus>
    <bus>
    <device> ... <device>
  <devices>

The hierarchy of devices are based on the hierarchy of device objects in
the ACPI namespace (which is established by interpreting the ACPI DSDT and
SSDT tables). Typically most device objects are under the predefined
`_SB_` (i.e. System Bus) object under which an object representing the PCI
root complex (`\_SB_.PCI0` in the example above) can be found. The PCI
devices attached to bus 0 are listed as children of the PCI root complex
node.

For each bus or device, the board inspector tries best to parse the
information from both ACPI device objects and PCI configuration space to
extract the following:

- the model (via `_HID` object and PCI vendor ID, device ID and class code),
- assigned resources (via `_CRS` object and PCI BARs),
- capabilities (via the PCI capability list)

v1 -> v2:
 - Fix references to undeclared modules or variables.
 - Make the ACPI extractor advanced and not enabled by default.
 - Extract the secondary I/O and memory-mapped I/O addresses of bridges.

Tracked-On: #5922
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-05-16 19:02:00 +08:00
..
acpi_gen config_tools: update condition for bootargs error check 2021-02-09 09:00:46 +08:00
acpi_template config_tools: add PTCT configs 2021-02-24 09:27:42 +08:00
board_config hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
board_inspector board_inspector/extractors: extract device information 2021-05-16 19:02:00 +08:00
config_app config-tools: change default industry kata vm id to 7 2021-04-20 10:28:11 +08:00
data config-tools: NVMX_ENABLED defaults to 'n' in all scenario config files 2021-05-13 16:16:30 +08:00
hv_config config_tools: update IVSHMEM_SHM_SIZE part for HV_RAM_SIZE calculation 2021-04-23 11:23:55 +08:00
kconfig acrn-config: Reorg config tool folder 2021-01-27 11:08:28 +08:00
launch_config config_tools: add psram config in launch config 2021-03-03 16:15:52 +08:00
library config-tools: refine append_node and add get_node 2021-05-07 14:39:08 +08:00
scenario_config hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
schema config-tools: fix the regular expression of ivshmem region name 2021-05-14 10:50:38 +08:00
static_allocators config-tools: add pio static allocator 2021-05-07 14:39:08 +08:00
xforms config-tools: add NVMX_ENABLED feature and GUEST_FLAG_NVMX_ENABLED flag 2021-05-13 16:16:30 +08:00
README acrn-config: Reorg config tool folder 2021-01-27 11:08:28 +08:00

folder structure

	Kconfig		: Select working scenario and target board, configure ACRN hypervisor capabilities and features.
	target		: Get target board information under native Linux environment and generate board_info XML.
	board_config	: Parse board_info XML and scenario XML to generate board related configuration files under misc/acrn-config/xmls/board-xmls/ folder.
	scenario_config	: Parse board_info XML and scenario XML to generate scenario based VM configuration files under misc/acrn-config/xmls/config-xmls/$(BOARD)/ folder.
	launch_config	: Parse board_info XML, scenario XML and devicemodel param XML to generate launch script for post-launched vm under misc/acrn-config/xmls/config-xmls/$(BOARD)/ folder.
	library		: The folder stores shared software modules or libs for acrn-config offline tool.