acrn-hypervisor/hypervisor
Sainath Grandhi 4ea35c1b79 HV: reimplement PCI device discovery
Major changes:

1. Correct handling of device multi-function capability

We only check function zero for this feature. If it has it, we continue
looking at all remaining functions, ignoring those with invalid vendors.
The PCI spec says we are not to probe beyond function zero if it does
not exist or indicates it is not a multi-function device.

2a. Walk *ALL* buses in the PCI space, however,
Before walking the PCI hierarchy, post-processed ACPI DMAR info is parsed
and a map is created between all device-scopes across all DRHDs and the
corresponding IOMMU index.

This map is used at the time of walking the PCI hierarchy. If a BDF that
ACRN is currently working on, is found in the above-mentioned map, the
BDF device is mapped to the corresponding DRHD in the map.
If the BDF were a bridge type, realized with "Header Type" in config space,
the BDF device along with all its downstream devices are mapped to the
corresponding DRHD in the map.

To avoid walking previously visited buses, we maintain a bitmap that
stores which bus is walked when we handle Bridge type devices.

Once ACPI information is included into ACRN about the PCI-Express Root
Complexes / PCI Host Bridges, we can avoid the final loop which probes
all remainder buses, and instead jump to the next Host Bridge bus.

From prior patches, init_pdev returns the pdev structure it created to
the caller. This allows us to complete initialization by updating its
drhd_idx to the correct DRHD.

v3->v2
        Removed the dependency on vt-d module for iterating DRHD units
        Instead, walks thru the plat_dmar_info.
        Re-worked the logic to call init_pci_hierarchy just once.
        Renamed try_init_pci_pdev to pci_init_pdev
        Fixed MISRA-C deviations

v2->v1
	Removed multiple returns from skip_device
	Renamed skip_device to pci_is_skip_device_needed
	Renamed try_add_pci_device to try_init_pci_pdev

Tracked-On: #4134
Signed-off-by: Alexander Merritt <alex.merritt@intel.com>
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2019-12-10 09:52:17 +08:00
..
acpi_parser HV: move dmar info definition to board.c 2019-12-10 09:52:17 +08:00
arch/x86 HV: refactor device_to_dmaru 2019-12-10 09:52:17 +08:00
boot HV: move dmar info definition to board.c 2019-12-10 09:52:17 +08:00
bsp/ld hv: dmar_parse: remove dynamic memory allocation 2019-05-10 11:33:37 +08:00
common hv: sched: add kick_thread to support notification 2019-10-25 13:00:21 +08:00
debug hv: sched: use get_running_vcpu to replace per_cpu vcpu with cpu sharing 2019-10-23 12:47:08 +08:00
dm hv[v2]: remove registration of default port IO and MMIO handlers 2019-10-24 13:21:19 +08:00
hw HV: reimplement PCI device discovery 2019-12-10 09:52:17 +08:00
include HV: reimplement PCI device discovery 2019-12-10 09:52:17 +08:00
lib hv:tiny cleanup 2019-09-05 09:58:47 +08:00
pre_build hv:merge static_checks.c 2019-05-14 09:16:33 +08:00
release hv: uart: enable early boot uart 2019-07-26 09:10:06 +08:00
scenarios hv: Update industry scenarios configuration 2019-10-25 15:23:16 +08:00
scripts dm: Add licenses to the scripts. 2019-11-11 15:32:16 +08:00
Kconfig HV: config: add Kconfig and defconfigs for sbl & uefi 2018-06-08 17:21:13 +08:00
MAINTAINERS update home page information 2018-05-15 17:19:39 +08:00
Makefile HV: move dmar info definition to board.c 2019-12-10 09:52:17 +08:00
README.rst doc: fix utf-8 punctuation, branding, spelling 2019-03-14 09:13:58 -07:00

ACRN Hypervisor
###############

The open source `Project ACRN`_ defines a device hypervisor reference stack and
an architecture for running multiple software subsystems, managed securely, on
a consolidated system by means of a virtual machine manager. It also defines a
reference framework implementation for virtual device emulation, called the
"ACRN Device Model".

The ACRN Hypervisor is a Type 1 reference hypervisor stack, running directly on
the bare-metal hardware, and is suitable for a variety of IoT and embedded
device solutions. The ACRN hypervisor addresses the gap that currently exists
between datacenter hypervisors, and hard partitioning hypervisors. The ACRN
hypervisor architecture partitions the system into different functional
domains, with carefully selected guest OS sharing optimizations for IoT and
embedded devices.

You can find out more about Project ACRN on the `Project ACRN documentation`_
website.

.. _`Project ACRN`: https://projectacrn.org
.. _`ACRN Hypervisor`: https://github.com/projectacrn/acrn-hypervisor
.. _`Project ACRN documentation`: https://projectacrn.github.io/