[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] libxc: Expose the MPX cpuid flag to guest
commit a4c2bd9f9eb7c0414303298db366f42bc28771f9 Author: Liang Li <liang.z.li@xxxxxxxxx> AuthorDate: Mon Jan 11 16:52:10 2016 +0800 Commit: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> CommitDate: Tue Mar 1 18:02:10 2016 +0000 libxc: Expose the MPX cpuid flag to guest If hardware support memory protect externsion, expose this feature to guest by default. Users don't have to use a 'cpuid= ' option in config file to turn it on. Signed-off-by: Liang Li <liang.z.li@xxxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- tools/libxc/xc_cpufeature.h | 1 + tools/libxc/xc_cpuid_x86.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/tools/libxc/xc_cpufeature.h b/tools/libxc/xc_cpufeature.h index 866cf0b..01dbeec 100644 --- a/tools/libxc/xc_cpufeature.h +++ b/tools/libxc/xc_cpufeature.h @@ -137,6 +137,7 @@ #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_MPX 14 /* Memory Protection Extensions */ #define X86_FEATURE_RDSEED 18 /* RDSEED instruction */ #define X86_FEATURE_ADX 19 /* ADCX, ADOX instructions */ #define X86_FEATURE_SMAP 20 /* Supervisor Mode Access Protection */ diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c index 5408dd0..733add4 100644 --- a/tools/libxc/xc_cpuid_x86.c +++ b/tools/libxc/xc_cpuid_x86.c @@ -423,6 +423,8 @@ static void xc_cpuid_hvm_policy(xc_interface *xch, bitmaskof(X86_FEATURE_ERMS) | bitmaskof(X86_FEATURE_INVPCID) | bitmaskof(X86_FEATURE_RTM) | + ((info->xfeature_mask != 0) ? + bitmaskof(X86_FEATURE_MPX) : 0) | bitmaskof(X86_FEATURE_RDSEED) | bitmaskof(X86_FEATURE_ADX) | bitmaskof(X86_FEATURE_SMAP) | @@ -543,6 +545,7 @@ static void xc_cpuid_pv_policy(xc_interface *xch, case 0x00000007: if ( input[1] == 0 ) + { regs[1] &= (bitmaskof(X86_FEATURE_BMI1) | bitmaskof(X86_FEATURE_HLE) | bitmaskof(X86_FEATURE_AVX2) | @@ -552,6 +555,9 @@ static void xc_cpuid_pv_policy(xc_interface *xch, bitmaskof(X86_FEATURE_RDSEED) | bitmaskof(X86_FEATURE_ADX) | bitmaskof(X86_FEATURE_FSGSBASE)); + if ( info->xfeature_mask == 0 ) + clear_bit(X86_FEATURE_MPX, regs[1]); + } else regs[1] = 0; regs[0] = regs[2] = regs[3] = 0; -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |