hv: mmu: remove get_mem_range_info in init_paging

We used get_mem_range_info to get the top memory address and then use this address
as the high 64 bits max memory address. This assumes the platform must have high
memory space.

This patch calculates the high 64 bits max memory address according the e820 tables
and removes the assumption "The platform must have high memory space" by map the
low RAM region and high RAM region separately.

Tracked-On: #5830
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Li Fei1
2021-04-12 11:04:53 +08:00
committed by wenlingz
parent 6137347411
commit ad15053304
3 changed files with 25 additions and 34 deletions

View File

@@ -40,7 +40,8 @@
#define MEM_1M (MEM_1K * 1024U)
#define MEM_2M (MEM_1M * 2U)
#define MEM_1G (MEM_1M * 1024U)
#define MEM_2G (1024UL * 1024UL * 1024UL * 2UL)
#define MEM_2G (MEM_1G * 2UL)
#define MEM_4G (MEM_1G * 4UL)
#ifndef ASSEMBLER

View File

@@ -31,6 +31,8 @@
#define PAGE_CACHE_UC_MINUS PAGE_PCD
#define PAGE_CACHE_UC (PAGE_PCD | PAGE_PWT)
#define PAGE_ATTR_USER (PAGE_PRESENT | PAGE_RW | PAGE_USER | PAGE_NX)
/**
* @defgroup ept_mem_access_right EPT Memory Access Right
*