mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-13 11:33:58 +00:00
hv: vpci: add PCI BAR re-program address check
In theory, guest could re-program PCI BAR address to any address. However, ACRN hypervisor only support [0, top_address_space) EPT memory mapping. So we need to check whether the PCI BAR re-program address is within this scope. Tracked-On: #3475 Signed-off-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -18,6 +18,18 @@
|
||||
|
||||
#define ACRN_DBG_EPT 6U
|
||||
|
||||
bool ept_is_mr_valid(const struct acrn_vm *vm, uint64_t base, uint64_t size)
|
||||
{
|
||||
bool valid = true;
|
||||
uint64_t end = base + size;
|
||||
uint64_t top_address_space = vm->arch_vm.ept_mem_ops.info->ept.top_address_space;
|
||||
if ((end <= base) || (end > top_address_space)) {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
void destroy_ept(struct acrn_vm *vm)
|
||||
{
|
||||
/* Destroy secure world */
|
||||
|
||||
Reference in New Issue
Block a user