acrn-hypervisor/hypervisor/arch/x86
Alexander Merritt f8f9a2d55e HV: refactor device_to_dmaru
On server platforms, DMAR DRHD device scope entries may contain PCI
bridges.

Bridges in the DRHD device scope indicate this IOMMU translates for all
devices on the hierarchy below that bridge.

ACRN is unaware of bridge types in the device scope, and adds these
directly to its internal representation of a DRHD. When looking up a BDF
within these DRHD entries, device_to_dmaru assumes all entries are
Endpoints, comparing BDF to BDF. Thus device to DMAR unit fails, because
it treats a bridge as an Endpoint type.

This change leverages prior patches by converting a BDF to the
associated device DRHD index, and uses that index to obtain the correct
DRHD state.

Handling a bridge in other ways may require maintaining a bus list for
each, or replacing each bridge in the dev scope with a set of all device
BDFs underneath it. Server platforms can have hundreds of PCI devices,
thus making the device scope artificially large is unwieldy.

v3->v2
        Fixed MISRA-c deviations

v2->v1
	Added code comments for possible reasons why pci_lookup_drhd_for_pbdf
	returns -1U

Tracked-On: #4134
Signed-off-by: Alexander Merritt <alex.merritt@intel.com>
2019-12-10 09:52:17 +08:00
..
boot hv:remove some unnecessary includes 2019-05-07 09:10:13 +08:00
configs HV: clean up DMAR MACROs for sample platform acpi info 2019-12-10 09:52:17 +08:00
guest hv: ept: disable execute right on large pages 2019-11-18 13:40:24 +08:00
lib hv: move 3 files to lib & arch folder 2019-06-14 14:22:51 +08:00
seed HV: fix violations touched type conversion 2019-07-11 09:16:09 +08:00
cat.c Fix the first problem: CPUID(EAX = 10H, ECX = ResID=1 or 2).EAX Bits 04 - 00: Length of the capacity bit mask for the corresponding ResID using minus-one notation 2019-09-19 08:44:45 +08:00
cpu_caps.c hv:fixed compilation error in Ubuntu 2019-09-26 14:03:51 +08:00
cpu_state_tbl.c HV: add board specific cpu state table to support Px Cx 2019-07-29 20:25:16 +08:00
cpu.c HV: initialize IOMMU before PCI device discovery 2019-12-10 09:52:17 +08:00
e820.c hv: cleanup some hva/hpa conversion code 2019-03-15 09:03:14 +08:00
gdt.c hv:cleanup header files for arch folder 2019-02-22 13:14:36 +08:00
idt.S move idt.S and idt.h out of boot component 2018-12-12 09:07:43 +08:00
init.c hv: sched: decouple idle stuff from schedule module 2019-10-23 12:47:08 +08:00
ioapic.c HV: fix violations touched type conversion 2019-07-11 09:16:09 +08:00
irq.c hv: fix Violations touched ACRN Coding Guidelines 2019-08-15 09:47:11 +08:00
Kconfig HV: link CONFIG_MAX_IOMMU_NUM and MAX_DRHDS to DRHD_COUNT 2019-12-10 09:52:17 +08:00
lapic.c hv: fix some potential array overflow risk 2019-07-12 09:41:15 +08:00
mmu.c hv:change function parameter for invept 2019-09-05 16:32:30 +08:00
notify.c hv: fix some potential array overflow risk 2019-07-12 09:41:15 +08:00
page.c hv: ept: apply MCE on page size change mitigation conditionally 2019-11-18 13:40:24 +08:00
pagetable.c hv: ept: disable execute right on large pages 2019-11-18 13:40:24 +08:00
pm.c hv: save/restore TSC in host's suspend/resume path 2019-09-19 13:50:50 +08:00
sched.S hv: sched: rename schedule related structs and vars 2019-10-16 10:25:53 +08:00
security.c hv: config: add an option to disable mce on psc workaround 2019-11-18 13:40:24 +08:00
sgx.c hv: sgx: add basic support to init sgx resource for vm 2019-05-29 11:24:13 +08:00
timer.c softirq: disable interrupt when modify timer_list 2019-08-01 15:45:02 +08:00
trampoline.c hv: delay enabling SMEP/SMAP until the end of PCPU initialization 2019-06-10 11:35:15 +08:00
vmx.c hv:fix "no prototype for non-static function" 2019-07-09 10:36:03 +08:00
vtd.c HV: refactor device_to_dmaru 2019-12-10 09:52:17 +08:00
wakeup.S hv: pm: correct the function name 2019-09-11 17:30:24 +08:00