hv: trusty: reserve memory for trusty

The previous would reserve memory for trusty in SOS kernel. Howerer,
there would no available 16 MB continue memory any more after a long time.
This result in allocating memory for trusty failed. This patch will reserve
memory for trusty in ACRN hypervisor in which case the memory allocation
for trusty will never fail.

Tracked-On: #1942
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1
2018-11-28 22:21:15 +08:00
committed by wenlingz
parent 9bf7dd5ddc
commit bd1c0838d1
6 changed files with 40 additions and 14 deletions

View File

@@ -119,8 +119,7 @@ int32_t hcall_create_vm(struct acrn_vm *vm, uint64_t param)
}
(void)memset(&vm_desc, 0U, sizeof(vm_desc));
vm_desc.sworld_supported =
((cv.vm_flag & (SECURE_WORLD_ENABLED)) != 0U);
vm_desc.sworld_supported = ((cv.vm_flag & (SECURE_WORLD_ENABLED)) != 0U);
(void)memcpy_s(&vm_desc.GUID[0], 16U, &cv.GUID[0], 16U);
ret = create_vm(&vm_desc, &target_vm);
@@ -515,11 +514,10 @@ static int32_t set_vm_memory_region(struct acrn_vm *vm,
}
gpa_end = region->gpa + region->size;
if ((gpa_end > vm->arch_vm.ept_mem_ops.info->ept.top_address_space) &&
(region->gpa < TRUSTY_EPT_REBASE_GPA)) {
if (gpa_end > vm->arch_vm.ept_mem_ops.info->ept.top_address_space) {
pr_err("%s, invalid gpa: 0x%llx, size: 0x%llx, top_address_space: 0x%llx", __func__,
region->gpa, region->size, vm->arch_vm.ept_mem_ops.info->ept.top_address_space);
return -EINVAL;
return 0;
}
dev_dbg(ACRN_DBG_HYCALL,