[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86/faulting: Use formal defines instead of opencoded bits
commit ba8c2955681831dc1930a9f6595032b1c2ec288d Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> AuthorDate: Wed Feb 26 17:23:47 2014 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Wed Feb 26 17:23:47 2014 +0100 x86/faulting: Use formal defines instead of opencoded bits Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Acked-by: Keir Fraser <keir@xxxxxxx> --- 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 -- 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 |