From: Liu Jinsong Date: Thu, 13 Feb 2014 13:05:01 +0000 (+0800) Subject: libxc: X86: expose RDSEED, ADX, and PREFETCHW to pv/hvm X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5252 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=62060f3227733d40f3fe663349bc936107ffbdec;p=xen.git libxc: X86: expose RDSEED, ADX, and PREFETCHW to pv/hvm Intel recently released some new features, including RDSEED, ADX, and PREFETCHW. This patch exposes these new features to pv and hvm. Signed-off-by: Xudong Hao Signed-off-by: Liu Jinsong Acked-by: Ian Campbell --- diff --git a/tools/libxc/xc_cpufeature.h b/tools/libxc/xc_cpufeature.h index c464e3a84b..09b2c82a3c 100644 --- a/tools/libxc/xc_cpufeature.h +++ b/tools/libxc/xc_cpufeature.h @@ -137,5 +137,8 @@ #define X86_FEATURE_ERMS 9 /* Enhanced REP MOVSB/STOSB */ #define X86_FEATURE_INVPCID 10 /* Invalidate Process Context ID */ #define X86_FEATURE_RTM 11 /* Restricted Transactional Memory */ +#define X86_FEATURE_RDSEED 18 /* RDSEED instruction */ +#define X86_FEATURE_ADX 19 /* ADCX, ADOX instructions */ + #endif /* __LIBXC_CPUFEATURE_H */ diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c index bbbf9b80eb..92640393c0 100644 --- a/tools/libxc/xc_cpuid_x86.c +++ b/tools/libxc/xc_cpuid_x86.c @@ -197,6 +197,7 @@ static void intel_xc_cpuid_policy( /* Only a few features are advertised in Intel's 0x80000001. */ regs[2] &= (is_64bit ? bitmaskof(X86_FEATURE_LAHF_LM) : 0) | + bitmaskof(X86_FEATURE_3DNOWPREFETCH) | bitmaskof(X86_FEATURE_ABM); regs[3] &= ((is_pae ? bitmaskof(X86_FEATURE_NX) : 0) | (is_64bit ? bitmaskof(X86_FEATURE_LM) : 0) | @@ -371,6 +372,8 @@ static void xc_cpuid_hvm_policy( bitmaskof(X86_FEATURE_ERMS) | bitmaskof(X86_FEATURE_INVPCID) | bitmaskof(X86_FEATURE_RTM) | + bitmaskof(X86_FEATURE_RDSEED) | + bitmaskof(X86_FEATURE_ADX) | bitmaskof(X86_FEATURE_FSGSBASE)); } else regs[1] = 0; @@ -502,6 +505,8 @@ static void xc_cpuid_pv_policy( bitmaskof(X86_FEATURE_BMI2) | bitmaskof(X86_FEATURE_ERMS) | bitmaskof(X86_FEATURE_RTM) | + bitmaskof(X86_FEATURE_RDSEED) | + bitmaskof(X86_FEATURE_ADX) | bitmaskof(X86_FEATURE_FSGSBASE)); else regs[1] = 0;