hv: free ept memory enhancement

--add free_paging_struct api, used for free page tables
  it will clear memory before free.
--add HPA2HVA translation when free ept memory

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Mingqiang Chi
2018-04-03 09:30:15 +08:00
committed by Jack Ren
parent cf7fe07276
commit 5e3dca4c0c
3 changed files with 26 additions and 13 deletions

View File

@@ -512,6 +512,14 @@ void *alloc_paging_struct(void)
return ptr;
}
void free_paging_struct(void *ptr)
{
if (ptr) {
memset(ptr, 0, CPU_PAGE_SIZE);
free(ptr);
}
}
uint64_t config_page_table_attr(struct map_params *map_params, uint32_t flags)
{
int table_type = map_params->page_table_type;