All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
Cc: jinsong.liu@intel.com, chegger@amazon.de,
	suravee.suthikulpanit@amd.com, xen-devel@lists.xen.org
Subject: Re: [PATCH 2/2] mcheck, vmce: Allow vmce_amd_* functions to handle AMD thresolding MSRs
Date: Mon, 27 Jan 2014 14:17:46 -0500	[thread overview]
Message-ID: <52E6B0DA.8070708@oracle.com> (raw)
In-Reply-To: <1205617825-10042-3-git-send-email-aravind.gopalakrishnan@amd.com>

On 03/15/2008 05:50 PM, Aravind Gopalakrishnan wrote:
> vmce_amd_[rd|wr]msr functions can handle accesses to AMD thresholding
> registers. But due to this statement here:
> switch ( msr & (MSR_IA32_MC0_CTL | 3) )
> we are wrongly masking off top two bits and bit 4 which meant the
> register accesses never made it to vmce_amd_* functions.
>
> We correct this problem by modifying the mask in this patch to allow
> AMD thresholding registers to fall to 'default' case which in turn
> allows vmce_amd_* functions to handle access to the registers.
>
> Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
> Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
>   xen/arch/x86/cpu/mcheck/vmce.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c
> index f6c35db..cb4fd12 100644
> --- 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))

Which MSRs are going to be handled in the non-default cases? 
MSR0000_040[0:3] and MSRC000_040[0:3]? The first four already have 
explicit cases and I think it would be more readable if you explicitly 
created case statements for the latter four and had a simple 'switch(msr)'.

In fact, do MSRC000_040[0:3] even exist?

(You may also want to adjust your clock --- your emails are being sent 
from distant past ;-) )

-boris



>       {
>       case MSR_IA32_MC0_CTL:
>           /* stick all 1's to MCi_CTL */
> @@ -210,7 +210,7 @@ static int bank_mce_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
>       int ret = 1;
>       unsigned int bank = (msr - MSR_IA32_MC0_CTL) / 4;
>   
> -    switch ( msr & (MSR_IA32_MC0_CTL | 3) )
> +    switch ( msr & (MSR_IA32_MC0_CTL | (0x3 << 30) | 0x13))
>       {
>       case MSR_IA32_MC0_CTL:
>           /*

  reply	other threads:[~2014-01-27 19:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-15 21:50 [PATCH 0/2] Fix AMD threshold register definitions and activate vmce_amd_* functions Aravind Gopalakrishnan
2008-03-15 21:50 ` [PATCH 1/2] hvm, svm: Update AMD Thresholding MSR definitions Aravind Gopalakrishnan
2014-01-28  9:13   ` Egger, Christoph
2014-01-28 10:27   ` George Dunlap
2008-03-15 21:50 ` [PATCH 2/2] mcheck, vmce: Allow vmce_amd_* functions to handle AMD thresolding MSRs Aravind Gopalakrishnan
2014-01-27 19:17   ` Boris Ostrovsky [this message]
2014-01-27 22:46     ` Aravind Gopalakrishnan
2014-01-27 23:29       ` Boris Ostrovsky
2014-01-28  9:09   ` Egger, Christoph
2014-02-03 22:48 ` [PATCH 0/2] Fix AMD threshold register definitions and activate vmce_amd_* functions Matt Wilson

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=52E6B0DA.8070708@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=aravind.gopalakrishnan@amd.com \
    --cc=chegger@amazon.de \
    --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.