Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
xen.8005
5ac63737-x86-disable-XPTI-when-RDCL_NO.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5ac63737-x86-disable-XPTI-when-RDCL_NO.patch of Package xen.8005
# Commit bee0732d2066691d8204e418d10110930ee4d4f8 # Date 2018-04-05 15:48:23 +0100 # Author Jan Beulich <JBeulich@suse.com> # Committer Andrew Cooper <andrew.cooper3@citrix.com> x86: disable XPTI when RDCL_NO Use the respective ARCH_CAPABILITIES MSR bit, but don't expose the MSR to guests yet. Signed-off-by: Jan Beulich <jbeulich@suse.com> Tested-by: Juergen Gross <jgross@suse.com> Reviewed-by: Juergen Gross <jgross@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Wei Liu <wei.liu2@citrix.com> --- a/tools/libxl/libxl_cpuid.c +++ b/tools/libxl/libxl_cpuid.c @@ -155,6 +155,7 @@ int libxl_cpuid_parse_config(libxl_cpuid {"fpu", 0x00000001, NA, CPUID_REG_EDX, 0, 1}, {"ibrsb", 0x00000007, 0, CPUID_REG_EDX, 26, 1}, {"stibp", 0x00000007, 0, CPUID_REG_EDX, 27, 1}, + {"arch-caps", 0x00000007, 0, CPUID_REG_EDX, 29, 1}, {"topoext", 0x80000001, NA, CPUID_REG_ECX, 22, 1}, {"tbm", 0x80000001, NA, CPUID_REG_ECX, 21, 1}, {"nodeid", 0x80000001, NA, CPUID_REG_ECX, 19, 1}, --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -946,7 +946,16 @@ void __init smp_prepare_cpus(unsigned in stack_base[0] = stack_start; if ( opt_xpti < 0 ) - opt_xpti = boot_cpu_data.x86_vendor != X86_VENDOR_AMD; + { + uint64_t caps = 0; + + if ( boot_cpu_data.x86_vendor == X86_VENDOR_AMD ) + caps = ARCH_CAPABILITIES_RDCL_NO; + else if ( boot_cpu_has(X86_FEATURE_ARCH_CAPS) ) + rdmsrl(MSR_ARCH_CAPABILITIES, caps); + + opt_xpti = !(caps & ARCH_CAPABILITIES_RDCL_NO); + } rc = setup_cpu_root_pgt(0); if ( rc ) --- a/xen/include/asm-x86/cpufeature.h +++ b/xen/include/asm-x86/cpufeature.h @@ -160,6 +160,7 @@ /* Intel-defined CPU features, CPUID level 0x00000007:0.edx, word 9 */ #define X86_FEATURE_IBRSB (9*32+26) /* IBRS and IBPB support (used by Intel) */ #define X86_FEATURE_STIBP (9*32+27) /* STIBP */ +#define X86_FEATURE_ARCH_CAPS (9*32+29) /* IA32_ARCH_CAPABILITIES MSR */ #define cpu_has(c, bit) test_bit(bit, (c)->x86_capability) #define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability) --- a/xen/include/asm-x86/msr-index.h +++ b/xen/include/asm-x86/msr-index.h @@ -40,6 +40,8 @@ #define PRED_CMD_IBPB (_AC(1, ULL) << 0) #define MSR_ARCH_CAPABILITIES 0x0000010a +#define ARCH_CAPABILITIES_RDCL_NO (_AC(1, ULL) << 0) +#define ARCH_CAPABILITIES_IBRS_ALL (_AC(1, ULL) << 1) /* Intel MSRs. Some also available on other CPUs */ #define MSR_IA32_PERFCTR0 0x000000c1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor