hv: mmu: add static paging table allocation for hypervisor

Add static paging table allocation API for hypervisor.
Note: must configure PLATFORM_RAM_SIZE and PLATFORM_MMIO_SIZE exactly as the platform.

Rename RAM_START/RAM_SIZE to HV_RAM_START/HV_RAM_SIZE for HV.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1
2018-10-29 23:28:32 +08:00
committed by lijinxia
parent 74a5eec3a7
commit dc9d18a868
12 changed files with 163 additions and 39 deletions

View File

@@ -383,7 +383,7 @@ static int32_t local_set_vm_memory_region(struct vm *vm,
if (((hpa <= base_paddr) &&
((hpa + region->size) > base_paddr)) ||
((hpa >= base_paddr) &&
(hpa < (base_paddr + CONFIG_RAM_SIZE)))) {
(hpa < (base_paddr + CONFIG_HV_RAM_SIZE)))) {
pr_err("%s: overlap the HV memory region.", __func__);
return -EFAULT;
}
@@ -515,7 +515,7 @@ static int32_t write_protect_page(struct vm *vm,const struct wp_data *wp)
base_paddr = get_hv_image_base();
if (((hpa <= base_paddr) && (hpa + CPU_PAGE_SIZE > base_paddr)) ||
((hpa >= base_paddr) &&
(hpa < base_paddr + CONFIG_RAM_SIZE))) {
(hpa < base_paddr + CONFIG_HV_RAM_SIZE))) {
pr_err("%s: overlap the HV memory region.", __func__);
return -EINVAL;
}