diff options
author | Tim Deegan <Tim.Deegan@citrix.com> | 2011-06-06 13:46:48 +0100 |
---|---|---|
committer | Tim Deegan <Tim.Deegan@citrix.com> | 2011-06-06 13:46:48 +0100 |
commit | 89c9f78710434be622c7616f58b46e4e55145b46 (patch) | |
tree | 9fba0b8fe43dd22c9f4241bed7c84a6b1526dfbf /tools/libxc/xc_cpuid_x86.c | |
parent | 95fad62ad62d48a2dec069c06aa026b5c8e71a5b (diff) | |
download | xen-89c9f78710434be622c7616f58b46e4e55145b46.tar.gz xen-89c9f78710434be622c7616f58b46e4e55145b46.tar.bz2 xen-89c9f78710434be622c7616f58b46e4e55145b46.zip |
x86/hvm: add SMEP support to HVM guest
Intel new CPU supports SMEP (Supervisor Mode Execution Protection). SMEP
prevents software operating with CPL < 3 (supervisor mode) from fetching
instructions from any linear address with a valid translation for which the U/S
flag (bit 2) is 1 in every paging-structure entry controlling the translation
for the linear address.
This patch adds SMEP support to HVM guest.
Signed-off-by: Yang Wei <wei.y.yang@intel.com>
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Li Xin <xin.li@intel.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Diffstat (limited to 'tools/libxc/xc_cpuid_x86.c')
-rw-r--r-- | tools/libxc/xc_cpuid_x86.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c index ef23358754..aae6882653 100644 --- a/tools/libxc/xc_cpuid_x86.c +++ b/tools/libxc/xc_cpuid_x86.c @@ -352,6 +352,14 @@ static void xc_cpuid_hvm_policy( clear_bit(X86_FEATURE_PAE, regs[3]); break; + case 0x00000007: /* Intel-defined CPU features */ + if ( input[1] == 0 ) { + regs[1] &= bitmaskof(X86_FEATURE_SMEP); + } else + regs[1] = 0; + regs[0] = regs[2] = regs[3] = 0; + break; + case 0x0000000d: xc_cpuid_config_xsave(xch, domid, xfeature_mask, input, regs); break; |