mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-18 19:57:31 +00:00
hv: ept: move EPT PML4 table allocation to create_vm
Signed-off-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
1815a1bb01
commit
38e2e45d83
@ -495,10 +495,6 @@ int ept_mmap(struct vm *vm, uint64_t hpa,
|
||||
|
||||
/* Setup memory map parameters */
|
||||
map_params.page_table_type = PTT_EPT;
|
||||
if (vm->arch_vm.nworld_eptp == NULL) {
|
||||
vm->arch_vm.nworld_eptp = alloc_paging_struct();
|
||||
vm->arch_vm.m2p = alloc_paging_struct();
|
||||
}
|
||||
map_params.pml4_base = vm->arch_vm.nworld_eptp;
|
||||
map_params.pml4_inverted = vm->arch_vm.m2p;
|
||||
|
||||
|
@ -110,6 +110,15 @@ int create_vm(struct vm_description *vm_desc, struct vm **rtn_vm)
|
||||
|
||||
/* gpa_lowtop are used for system start up */
|
||||
vm->hw.gpa_lowtop = 0UL;
|
||||
|
||||
vm->arch_vm.nworld_eptp = alloc_paging_struct();
|
||||
vm->arch_vm.m2p = alloc_paging_struct();
|
||||
if ((vm->arch_vm.nworld_eptp == NULL) ||
|
||||
(vm->arch_vm.m2p == NULL)) {
|
||||
pr_fatal("%s, alloc memory for EPTP failed\n", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Only for SOS: Configure VM software information */
|
||||
/* For UOS: This VM software information is configure in DM */
|
||||
if (is_vm0(vm)) {
|
||||
|
Loading…
Reference in New Issue
Block a user