From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86/faulting: Use formal defines instead of opencoded bits Date: Tue, 25 Feb 2014 11:23:42 +0000 Message-ID: <530C7D3E.4040301@citrix.com> References: <1393326137-29397-1-git-send-email-andrew.cooper3@citrix.com> <530C8AD8020000780011F20D@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <530C8AD8020000780011F20D@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Keir Fraser , Xen-devel List-Id: xen-devel@lists.xenproject.org On 25/02/14 11:21, Jan Beulich wrote: >>>> On 25.02.14 at 12:02, Andrew Cooper wrote: >> --- 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 & PLATFORM_INFO_CPUID_FAULTING); > Indentation (a single hard tab ought to come first at least). > >> --- 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 _PLATFORM_INFO_CPUID_FAULTING 31 >> +#define PLATFORM_INFO_CPUID_FAULTING (1ULL << _PLATFORM_INFO_CPUID_FAULTING) >> + >> #define MSR_INTEL_MISC_FEATURES_ENABLES 0x00000140 >> +#define _MISC_FEATURES_CPUID_FAULTING 0 >> +#define MISC_FEATURES_CPUID_FAULTING (1ULL << _MISC_FEATURES_CPUID_FAULTING) > I wonder whether, from a name space pov, it wouldn't be better > if these new constants had at least MSR_ as additional prefix. Both > are rather generic without... > > Jan > How about MSR_INTEL_ to match their MSR number names? ~Andrew