HV: init_paging() wrongly calcuate the size of hypervisor

when relocation is enabled, the calcuation of HV size in init_paging
routine is not right. As a result, it doesn't enable NX bit for many
pages which don't belong to hypervisor text section.

Tracked-On: #2349
Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
Reviewed-by: Zide Chen <zide.chen@intel.com>
This commit is contained in:
Chaohong guo 2019-01-17 13:56:22 +08:00 committed by Eddie Dong
parent 9feab4cf29
commit 41dd38baf2

View File

@ -290,7 +290,7 @@ void init_paging(void)
CONFIG_HV_RAM_SIZE + (((hv_hpa & (PDE_SIZE - 1UL)) != 0UL) ? PDE_SIZE : 0UL),
PAGE_CACHE_WB, PAGE_CACHE_MASK | PAGE_USER, &ppt_mem_ops, MR_MODIFY);
size = ((uint64_t)&ld_text_end - CONFIG_HV_RAM_START);
size = ((uint64_t)&ld_text_end - hv_hpa);
text_end = hv_hpa + size;
/*
* remove 'NX' bit for pages that contain hv code section, as by default XD bit is set for