All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>, Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86/faulting: Use formal defines instead of opencoded bits
Date: Tue, 25 Feb 2014 11:23:42 +0000	[thread overview]
Message-ID: <530C7D3E.4040301@citrix.com> (raw)
In-Reply-To: <530C8AD8020000780011F20D@nat28.tlf.novell.com>

On 25/02/14 11:21, Jan Beulich wrote:
>>>> On 25.02.14 at 12:02, Andrew Cooper <andrew.cooper3@citrix.com> 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

  reply	other threads:[~2014-02-25 11:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25 11:02 [PATCH] x86/faulting: Use formal defines instead of opencoded bits Andrew Cooper
2014-02-25 11:21 ` Jan Beulich
2014-02-25 11:23   ` Andrew Cooper [this message]
2014-02-25 11:34     ` Jan Beulich
2014-02-25 11:39       ` [PATCH v2] " Andrew Cooper
2014-02-25 18:01         ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=530C7D3E.4040301@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.