hv: remove UNCACHED for pSRAM EPT memmap segment

We remove the UNCACHED bit for pSRAM EPT memmap segment,
otherwise access to pSRAM region may bypass pSRAM.

Tracked-On: #5330

Signed-off-by: Qian Wang <qian1.wang@intel.com>
Signed-off-by: Li Fei1 <fei1.li@intel.com>
This commit is contained in:
Qian Wang 2020-09-24 13:24:14 +08:00 committed by wenlingz
parent 0287b3c05a
commit 772ab3a95c

View File

@ -21,6 +21,7 @@
#include <ioapic.h> #include <ioapic.h>
#include <mmio_dev.h> #include <mmio_dev.h>
#include <ivshmem.h> #include <ivshmem.h>
#include <ptcm.h>
#define DBG_LEVEL_HYCALL 6U #define DBG_LEVEL_HYCALL 6U
@ -649,6 +650,11 @@ static int32_t add_vm_memory_region(struct acrn_vm *vm, struct acrn_vm *target_v
} else { } else {
prot |= EPT_UNCACHED; prot |= EPT_UNCACHED;
} }
#ifdef CONFIG_PTCM_ENABLED
if (hpa == PSRAM_BASE_HPA) {
prot |= EPT_WB;
}
#endif
/* create gpa to hpa EPT mapping */ /* create gpa to hpa EPT mapping */
ept_add_mr(target_vm, pml4_page, hpa, ept_add_mr(target_vm, pml4_page, hpa,
region->gpa, region->size, prot); region->gpa, region->size, prot);