Skip to content

Commit 334c5ae

Browse files
lifeixacrnsi
authored andcommitted
hv: ept: correct EPT mapping gpa check
The previous will not check the EPT gpa correctly. This patch try to fix this. Tracked-On: #2291 Signed-off-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
1 parent aee9f3c commit 334c5ae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hypervisor/common/hypercall.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,9 +655,10 @@ static int32_t set_vm_memory_region(struct acrn_vm *vm,
655655
ret = -EINVAL;
656656
} else {
657657
gpa_end = region->gpa + region->size;
658-
if (gpa_end > vm->arch_vm.ept_mem_ops.info->ept.top_address_space) {
658+
if (gpa_end > target_vm->arch_vm.ept_mem_ops.info->ept.top_address_space) {
659659
pr_err("%s, invalid gpa: 0x%llx, size: 0x%llx, top_address_space: 0x%llx", __func__,
660-
region->gpa, region->size, vm->arch_vm.ept_mem_ops.info->ept.top_address_space);
660+
region->gpa, region->size,
661+
target_vm->arch_vm.ept_mem_ops.info->ept.top_address_space);
661662
ret = 0;
662663
} else {
663664
dev_dbg(ACRN_DBG_HYCALL,

0 commit comments

Comments
 (0)