From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>, Jan Beulich <JBeulich@suse.com>,
Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 5/6] x86/msr: Clean up the MSR_APIC_BASE constants
Date: Wed, 27 Jun 2018 15:50:53 +0100 [thread overview]
Message-ID: <c7eb1227-73c4-33c8-d0de-c9976f7a7c28@citrix.com> (raw)
In-Reply-To: <0057416a-734b-ba46-f8a4-eca18b534227@citrix.com>
On 27/06/18 14:35, Andrew Cooper wrote:
> On 27/06/18 14:32, Roger Pau Monné wrote:
>> On Tue, Jun 26, 2018 at 02:18:17PM +0100, Andrew Cooper wrote:
>>> We currently have MSR_IA32_APICBASE and MSR_IA32_APICBASE_MSR which are
>>> synonymous from a naming point of view, but refer to very different
>>> things.
>>>
>>> Cleave out the handling of MSR_APIC_BASE (0x1b), and rename
>>> MSR_IA32_APICBASE_BASE to APIC_BASE_ADDR_MASK to better describe its
>>> purpose.
>>>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
>>
>>> diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
>>> index ffa5a69..aa677e0 100644
>>> --- a/xen/arch/x86/apic.c
>>> +++ b/xen/arch/x86/apic.c
>>> @@ -1446,23 +1448,21 @@ void __init record_boot_APIC_mode(void)
>>> apic_mode_to_str(apic_boot_mode));
>>> }
>>>
>>> -/* Look at the bits in MSR_IA32_APICBASE and work out which
>>> - * APIC mode we are in */
>>> +/* Look at the bits in MSR_APIC_BASE and work out which APIC mode we are in */
>>> enum apic_mode current_local_apic_mode(void)
>>> {
>>> u64 msr_contents;
>>>
>>> - rdmsrl(MSR_IA32_APICBASE, msr_contents);
>>> + rdmsrl(MSR_APIC_BASE, msr_contents);
>>>
>>> /* Reading EXTD bit from the MSR is only valid if CPUID
>>> * says so, else reserved */
>>> - if ( boot_cpu_has(X86_FEATURE_X2APIC)
>>> - && (msr_contents & MSR_IA32_APICBASE_EXTD) )
>>> + if ( boot_cpu_has(X86_FEATURE_X2APIC) && (msr_contents & APIC_BASE_EXTD) )
>> While there you could change it to cpu_has_x2apic.
> So I can. Thanks,
Actually, this code is some of my earliest contributions to Xen, and my
current self is really regretting the lack of review of my older self's
code.
Both comments are false and the check isn't necessary. I've fixed all
this up and added a comment to the commit message.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-06-27 14:50 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-26 13:18 [PATCH 0/6] x86/msr: Introductory MSR cleanup Andrew Cooper
2018-06-26 13:18 ` [PATCH 1/6] x86/msr: Clean up the MSR_EFER constants Andrew Cooper
2018-06-26 15:33 ` Wei Liu
2018-06-27 10:39 ` Roger Pau Monné
2018-06-27 10:44 ` Andrew Cooper
2018-06-28 13:00 ` Jan Beulich
2018-06-28 13:36 ` Andrew Cooper
2018-06-28 13:56 ` Jan Beulich
2018-09-07 14:47 ` Andrew Cooper
2018-09-07 15:09 ` Jan Beulich
2018-06-26 13:18 ` [PATCH 2/6] x86/msr: Cleanup of misc constants Andrew Cooper
2018-06-26 15:43 ` Wei Liu
2018-06-27 10:48 ` Roger Pau Monné
2018-06-26 13:18 ` [PATCH 3/6] x86/msr: Clean up the MSR_{PLATFORM_INFO, MISC_FEATURES_ENABLES} constants Andrew Cooper
2018-06-26 16:31 ` Wei Liu
2018-06-27 11:08 ` Roger Pau Monné
2018-06-28 13:04 ` Jan Beulich
2018-06-26 13:18 ` [PATCH 4/6] x86/msr: Clean up the MSR_FEATURE_CONTROL constants Andrew Cooper
2018-06-26 17:59 ` Andrew Cooper
2018-06-27 9:05 ` Jan Beulich
2018-06-27 11:08 ` Wei Liu
2018-06-27 11:21 ` Roger Pau Monné
2018-06-28 13:11 ` Jan Beulich
2018-07-02 5:56 ` Tian, Kevin
2018-06-26 13:18 ` [PATCH 5/6] x86/msr: Clean up the MSR_APIC_BASE constants Andrew Cooper
2018-06-27 13:26 ` Wei Liu
2018-06-27 13:32 ` Roger Pau Monné
2018-06-27 13:35 ` Andrew Cooper
2018-06-27 14:50 ` Andrew Cooper [this message]
2018-06-26 13:18 ` [PATCH 6/6] x86/msr: Clean up the x2APIC MSR constants Andrew Cooper
2018-06-27 13:26 ` Wei Liu
2018-06-27 13:50 ` Roger Pau Monné
2018-06-27 14:15 ` Andrew Cooper
2018-06-28 13:18 ` Jan Beulich
2018-06-26 18:22 ` [PATCH 7/6] x86/msr: Introduce msr_{set, clear}_bits() helpers Andrew Cooper
2018-06-27 13:35 ` Wei Liu
2018-06-27 14:17 ` Roger Pau Monné
2018-06-27 14:27 ` Andrew Cooper
2018-06-28 13:26 ` Jan Beulich
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=c7eb1227-73c4-33c8-d0de-c9976f7a7c28@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=wei.liu2@citrix.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).