WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] Fix error in rdmsr_safe

To: Kathy Hadley <Kathy.Hadley@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Fix error in rdmsr_safe
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Thu, 24 Jun 2010 21:42:59 +0100
Cc:
Delivery-date: Thu, 24 Jun 2010 13:44:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <D3E384327F5C6D48AADCEA84160B7D73014DA540@xxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcsT2XqQupoOdM6FSA29HU7OOWqmaAABFpKA
Thread-topic: [Xen-devel] [PATCH] Fix error in rdmsr_safe
User-agent: Microsoft-Entourage/12.24.0.100205
On 24/06/2010 21:11, "Kathy Hadley" <Kathy.Hadley@xxxxxxxxxxxxxxx> wrote:

> This patch fixes a error in rdmsr_safe (in xen/include/asm-x86/msr.h), which
> was introduced in changeset 21600.  The order of the ³val1² and ³val2²
> operands was switched, and the typecast of val2 needs to be enclosed in
> parentheses (so that it is typecast to a uint64_t before the left shift 32
> bits).  This addresses the following error seen during DomU start-up:

The parentheses aren't needed, but the val1 and val2 switcharound is indeed
correct. Thanks for the patch. I don't know why only you saw this; it's
probably something to do with the particular machine you test on.

 -- Keir

> (XEN) traps.c:2301:d2 Domain attempted WRMSR c0000080 from 0x0000080000000000
> to 0x0000080000000800.

> Regards,
>   Kathy Hadley
>   DornerWorks, Ltd.
>  
>  
> diff -rupN a/xen/include/asm-x86/msr.h b/xen/include/asm-x86/msr.h
> --- a/xen/include/asm-x86/msr.h     2010-06-17 13:27:29.000000000 -0400
> +++ b/xen/include/asm-x86/msr.h     2010-06-24 15:49:36.000000000 -0400
> @@ -49,7 +49,7 @@ static inline void wrmsrl(unsigned int m
>         ".previous\n" \
>          : "=a" (val1), "=d" (val2), "=&r" (_rc) \
>          : "c" (msr), "2" (0), "i" (-EFAULT)); \
> -    val = val2 | ((uint64_t)val1 << 32); \
> +    val = val1 | (((uint64_t)val2) << 32); \
>      _rc; })
>  
>  /* wrmsr with exception handling */
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>