mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 16:57:20 +00:00
hv: mmio_dev: add mmio device pass through support
Add mmio device pass through support for pre-launched VM. When we pass through a MMIO device to pre-launched VM, we would remove its resource from the SOS. Now these resources only include the MMIO regions. Tracked-On: #5053 Acked-by: Eddie Dong <eddie.dong@intel.com> Signed-off-by: Li Fei1 <fei1.li@intel.com>
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <pci_dev.h>
|
||||
#include <vacpi.h>
|
||||
#include <platform_caps.h>
|
||||
#include <mmio_dev.h>
|
||||
|
||||
vm_sw_loader_t vm_sw_loader;
|
||||
|
||||
@@ -257,6 +258,10 @@ static void prepare_prelaunched_vm_memmap(struct acrn_vm *vm, const struct acrn_
|
||||
remaining_hpa_size = vm_config->memory.size_hpa2;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0U; i < MAX_MMIO_DEV_NUM; i++) {
|
||||
(void)assign_mmio_dev(vm, &vm_config->mmiodevs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -328,6 +333,10 @@ static void prepare_sos_vm_memmap(struct acrn_vm *vm)
|
||||
if (vm_config->load_order == PRE_LAUNCHED_VM) {
|
||||
ept_del_mr(vm, pml4_page, vm_config->memory.start_hpa, vm_config->memory.size);
|
||||
}
|
||||
|
||||
for (i = 0U; i < MAX_MMIO_DEV_NUM; i++) {
|
||||
(void)deassign_mmio_dev(vm, &vm_config->mmiodevs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/* unmap AP trampoline code for security
|
||||
|
Reference in New Issue
Block a user