Skip to content

Commit

Permalink
hv: vmcs: trap CR4.SMAP/SMEP/PKE setting
Browse files Browse the repository at this point in the history
FuSa requires setting CR4.SMAP/SMEP/PKE will invalidate the TLB. However,
setting CR4.SMAP will invalidate the TLB on native while not in non-root mode.
To make sure this, we will trap CR4.SMAP/SMEP/PKE setting to invalidate the TLB
in root mode.

Tracked-On: #2561
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
  • Loading branch information
lifeix authored and acrnsi committed May 30, 2019
1 parent a738968 commit f2c53a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hypervisor/arch/x86/guest/virtual_cr.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
CR0_NE | CR0_ET | CR0_TS | CR0_EM | CR0_MP | CR0_PE)

/* CR4 bits hv want to trap to track status change */
#define CR4_TRAP_MASK (CR4_PSE | CR4_PAE | CR4_VMXE | CR4_PCIDE)
#define CR4_TRAP_MASK (CR4_PSE | CR4_PAE | CR4_VMXE | CR4_PCIDE | CR4_SMEP | CR4_SMAP | CR4_PKE)
#define CR4_RESERVED_MASK ~(CR4_VME | CR4_PVI | CR4_TSD | CR4_DE | CR4_PSE | \
CR4_PAE | CR4_MCE | CR4_PGE | CR4_PCE | \
CR4_OSFXSR | CR4_PCIDE | CR4_OSXSAVE | \
Expand Down

0 comments on commit f2c53a9

Please sign in to comment.