[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2] x86/faulting: Use formal defines instead of opencoded bits
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> CC: Keir Fraser <keir@xxxxxxx> CC: Jan Beulich <JBeulich@xxxxxxxx> --- Changes in v2: * Use MSR_ prefix for names --- xen/arch/x86/cpu/intel.c | 7 ++++--- xen/include/asm-x86/msr-index.h | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c index 27fe762..9e02cf6 100644 --- a/xen/arch/x86/cpu/intel.c +++ b/xen/arch/x86/cpu/intel.c @@ -21,7 +21,8 @@ static unsigned int probe_intel_cpuid_faulting(void) { uint64_t x; - return !rdmsr_safe(MSR_INTEL_PLATFORM_INFO, x) && (x & (1u<<31)); + return !rdmsr_safe(MSR_INTEL_PLATFORM_INFO, x) && + (x & MSR_PLATFORM_INFO_CPUID_FAULTING); } static DEFINE_PER_CPU(bool_t, cpuid_faulting_enabled); @@ -34,9 +35,9 @@ void set_cpuid_faulting(bool_t enable) return; rdmsr(MSR_INTEL_MISC_FEATURES_ENABLES, lo, hi); - lo &= ~1; + lo &= ~MSR_MISC_FEATURES_CPUID_FAULTING; if (enable) - lo |= 1; + lo |= MSR_MISC_FEATURES_CPUID_FAULTING; wrmsr(MSR_INTEL_MISC_FEATURES_ENABLES, lo, hi); this_cpu(cpuid_faulting_enabled) = enable; diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h index 86b7d64..3269c43 100644 --- a/xen/include/asm-x86/msr-index.h +++ b/xen/include/asm-x86/msr-index.h @@ -486,7 +486,12 @@ /* Intel cpuid faulting MSRs */ #define MSR_INTEL_PLATFORM_INFO 0x000000ce +#define _MSR_PLATFORM_INFO_CPUID_FAULTING 31 +#define MSR_PLATFORM_INFO_CPUID_FAULTING (1ULL << _MSR_PLATFORM_INFO_CPUID_FAULTING) + #define MSR_INTEL_MISC_FEATURES_ENABLES 0x00000140 +#define _MSR_MISC_FEATURES_CPUID_FAULTING 0 +#define MSR_MISC_FEATURES_CPUID_FAULTING (1ULL << _MSR_MISC_FEATURES_CPUID_FAULTING) /* Geode defined MSRs */ #define MSR_GEODE_BUSCONT_CONF0 0x00001900 -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |