From: "Egger, Christoph" <chegger@amazon.de>
To: Jan Beulich <JBeulich@suse.com>,
Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
Cc: jinsong.liu@intel.com, boris.ostrovsky@oracle.com,
suravee.suthikulpanit@amd.com, xen-devel@lists.xen.org
Subject: Re: [PATCH 2/2 V2] mcheck, vmce: Allow vmce_amd_* functions to handle AMD thresolding MSRs
Date: Wed, 12 Feb 2014 10:36:26 +0100 [thread overview]
Message-ID: <52FB409A.3010506@amazon.de> (raw)
In-Reply-To: <52F35EE60200007800119A84@nat28.tlf.novell.com>
On 06.02.14 10:07, Jan Beulich wrote:
>>>> On 05.02.14 at 21:41, Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
> wrote:
>> On 1/28/2014 5:24 AM, Jan Beulich wrote:
>>>>>> On 27.01.14 at 23:44, Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
>> wrote:
>>>> --- a/xen/arch/x86/cpu/mcheck/vmce.c
>>>> +++ b/xen/arch/x86/cpu/mcheck/vmce.c
>>>> @@ -107,7 +107,7 @@ static int bank_mce_rdmsr(const struct vcpu *v, uint32_t
>> msr, uint64_t *val)
>>>>
>>>> *val = 0;
>>>>
>>>> - switch ( msr & (MSR_IA32_MC0_CTL | 3) )
>>>> + switch ( msr & (MSR_IA32_MC0_CTL | (0x3 << 30) | 0x13))
>>> As one of the other reviewers already said - 0xC0000000 would
>>> be better recognizable here.
>>>
>>> As to the 3 -> 0x13 change - I don't think this is conceptually
>>> correct. While at present we emulate only 2 banks, this had
>>> been different in the past and may become different again.
>>> Hence introducing a dis-contiguity after bank 3 is undesirable.
>>
>> IMHO, including the '0x13' is necessary. The reason is that 0x413,
>> 0xc0000408 and 0xc0000409
>> together form the set of MC4 thresholding registers. Not including 0x13
>> in the mask would mean
>> that accesses to 0x413 alone would not be handled. (which would be
>> confusing if someone new
>> were to look into the mce codebase)
>
> No - bit 4 is part of what forms the bank number. Hence it must
> be masked out in the switch() expression.
I prefer to see a comment in the code that makes this clear.
Christoph
next prev parent reply other threads:[~2014-02-12 9:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-27 22:44 [PATCH 0/2 V2] Fix AMD threshold register definitions and activate vmce_amd_* functions Aravind Gopalakrishnan
2014-01-27 22:44 ` [PATCH 1/2 V2] hvm, svm: Update AMD Thresholding MSR definitions Aravind Gopalakrishnan
2014-01-28 11:17 ` Jan Beulich
2014-02-05 20:41 ` Aravind Gopalakrishnan
2014-01-27 22:44 ` [PATCH 2/2 V2] mcheck, vmce: Allow vmce_amd_* functions to handle AMD thresolding MSRs Aravind Gopalakrishnan
2014-01-28 11:24 ` Jan Beulich
2014-02-05 20:41 ` Aravind Gopalakrishnan
2014-02-06 9:07 ` Jan Beulich
2014-02-12 9:36 ` Egger, Christoph [this message]
2014-02-12 23:43 ` Aravind Gopalakrishnan
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=52FB409A.3010506@amazon.de \
--to=chegger@amazon.de \
--cc=JBeulich@suse.com \
--cc=aravind.gopalakrishnan@amd.com \
--cc=boris.ostrovsky@oracle.com \
--cc=jinsong.liu@intel.com \
--cc=suravee.suthikulpanit@amd.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 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.