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

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

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Fix error in rdmsr_safe
From: "Kathy Hadley" <Kathy.Hadley@xxxxxxxxxxxxxxx>
Date: Thu, 24 Jun 2010 16:11:49 -0400
Cc: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Thu, 24 Jun 2010 13:13:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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: AcsT2XqQupoOdM6FSA29HU7OOWqmaA==
Thread-topic: [Xen-devel] [PATCH] Fix error in rdmsr_safe

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:

 

(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 */

Attachment: rdmsr_safe.patch
Description: rdmsr_safe.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>