hv: mmu: make page table operation no fault

Page table operation would not fault except:
1. the hypervisor it out of memory to allcate a page for page table operation
2. there is a bug with page table operation in hypervisor or devicemodle
While we assue that these would not happened in our platform when release, so
there is no need to check whether there is a fault with page table operation. However,
for debug version, we would panic the hypervisor if we can't meet the conditions really.

Tracked-On: #1124
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1
2018-09-17 11:48:01 +08:00
committed by wenlingz
parent 1e084b08f2
commit cc89e52d5b
6 changed files with 74 additions and 136 deletions

View File

@@ -470,13 +470,14 @@ static int32_t local_set_vm_memory_region(struct vm *vm,
prot |= EPT_UNCACHED;
}
/* create gpa to hpa EPT mapping */
return ept_mr_add(target_vm, pml4_page, hpa,
ept_mr_add(target_vm, pml4_page, hpa,
region->gpa, region->size, prot);
} else {
return ept_mr_del(target_vm, pml4_page,
ept_mr_del(target_vm, pml4_page,
region->gpa, region->size);
}
return 0;
}
/**
@@ -571,8 +572,10 @@ static int32_t write_protect_page(struct vm *vm, struct wp_data *wp)
prot_set = (wp->set != 0U) ? 0UL : EPT_WR;
prot_clr = (wp->set != 0U) ? EPT_WR : 0UL;
return ept_mr_modify(vm, (uint64_t *)vm->arch_vm.nworld_eptp,
ept_mr_modify(vm, (uint64_t *)vm->arch_vm.nworld_eptp,
wp->gpa, CPU_PAGE_SIZE, prot_set, prot_clr);
return 0;
}
/**