mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-08 04:09:11 +00:00
hugetlb: add ept map memseg support
adding API vm_map_memseg_vma() which using ioctl IC_SET_MEMSEG call into VHM for futher mem(ept) mapping, based on user vma information. Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Xu, Anthony <anthony.xu@intel.com>
This commit is contained in:
@@ -487,6 +487,18 @@ int hugetlb_setup_memory(struct vmctx *ctx)
|
||||
}
|
||||
printf("total_size 0x%lx\n\n", total_size);
|
||||
|
||||
/* map ept for lowmem*/
|
||||
if (vm_map_memseg_vma(ctx, ctx->lowmem, 0,
|
||||
(uint64_t)ctx->baseaddr, PROT_ALL) < 0)
|
||||
goto err;
|
||||
|
||||
/* map ept for highmem*/
|
||||
if (ctx->highmem > 0) {
|
||||
if (vm_map_memseg_vma(ctx, ctx->highmem, 4 * GB,
|
||||
(uint64_t)(ctx->baseaddr + 4 * GB), PROT_ALL) < 0)
|
||||
goto err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
|
Reference in New Issue
Block a user