hv: add SMAP/SMEP check during guest page walking

According to SDM 4.6 Access Rights definition, if SMAP/SMEP
is enabled, more conditions are used to decide the access rights
like SMAP/SMEP, EFLAGS.AC, R/W bit in every paging-structure entry
for page walking.

This patch add the check to guest page walking function and inject
page fault accordingly.

Tracked-On: #1207
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Yin Fengwei
2018-08-24 16:02:27 +08:00
committed by lijinxia
parent d958d31e1b
commit 44a2d77c32
2 changed files with 77 additions and 10 deletions

View File

@@ -408,6 +408,7 @@ static inline uint64_t apic_access_offset(uint64_t qual)
#define RFLAGS_C (1U<<0)
#define RFLAGS_Z (1U<<6)
#define RFLAGS_AC (1U<<18)
/* CR0 bits hv want to trap to track status change */
#define CR0_TRAP_MASK (CR0_PE | CR0_PG | CR0_WP | CR0_CD | CR0_NW )