hv: initialize host IA32_PAT MSR

Currently ACRN assumes firmware setup IA32_PAT correctly.  This patch
explicitly initializes host IA32_PAT MSR according to ISDM Table 11-12.
Memory Type Setting of PAT Entries Following a Power-up or Reset.

ACRN creates host page tables based on PAT0 (WB) and PAT3 (UC).

Tracked-On: #6289
Signed-off-by: Zide Chen <zide.chen@intel.com>
This commit is contained in:
Zide Chen 2021-07-05 19:21:21 -07:00 committed by wenlingz
parent c456f41567
commit 7cde4a8d40

View File

@ -155,6 +155,9 @@ void enable_paging(void)
{
uint64_t tmp64 = 0UL;
/* Initialize IA32_PAT according to ISDM 11.12.4 Programming the PAT */
msr_write(MSR_IA32_PAT, PAT_POWER_ON_VALUE);
/*
* Enable MSR IA32_EFER.NXE bit,to prevent
* instruction fetching from pages with XD bit set.