hv: mmu: refine delete page table mapping

Merge mmu_modify with mmu_del to mmu_modify_or_del(..., type).
While type is MR_MODIFY, the actual action is doing mmu_modify; while
type is MR_DEL, the actual action is doing mmu_del.

Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Li, Fei1
2018-07-22 16:09:21 +08:00
committed by lijinxia
parent 34c6862a28
commit 236bb10e4d
6 changed files with 77 additions and 50 deletions

View File

@@ -593,10 +593,10 @@ void init_paging(void)
for (i = 0U; i < e820_entries; i++) {
entry = &e820[i];
if (entry->type == E820_TYPE_RAM) {
mmu_modify((uint64_t *)mmu_pml4_addr,
mmu_modify_or_del((uint64_t *)mmu_pml4_addr,
entry->baseaddr, entry->length,
PAGE_CACHE_WB, PAGE_CACHE_MASK,
PTT_HOST);
PTT_HOST, MR_MODIFY);
}
}
@@ -604,8 +604,9 @@ void init_paging(void)
* to supervisor-mode for hypervisor owned memroy.
*/
hv_hpa = get_hv_image_base();
mmu_modify((uint64_t *)mmu_pml4_addr, hv_hpa, CONFIG_RAM_SIZE,
PAGE_CACHE_WB, PAGE_CACHE_MASK | PAGE_USER, PTT_HOST);
mmu_modify_or_del((uint64_t *)mmu_pml4_addr, hv_hpa, CONFIG_RAM_SIZE,
PAGE_CACHE_WB, PAGE_CACHE_MASK | PAGE_USER,
PTT_HOST, MR_MODIFY);
/* Enable paging */
enable_paging(HVA2HPA(mmu_pml4_addr));