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] i386: fix full-value calculation of wrmsr handling f

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] i386: fix full-value calculation of wrmsr handling for pv guests
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Thu, 30 Jul 2009 16:00:54 +0100
Delivery-date: Thu, 30 Jul 2009 08:00:47 -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
The call to mce_wrmsr() as well as the wrmsr handling of
MSR_FAM10H_MMIO_CONF_BASE require that the full value written is being
looked at; the type of that value was 'unsigned long', however.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- 2009-07-10.orig/xen/arch/x86/traps.c        2009-07-15 12:07:19.000000000 
+0200
+++ 2009-07-10/xen/arch/x86/traps.c     2009-07-30 16:18:48.000000000 +0200
@@ -1678,7 +1678,8 @@ static int is_cpufreq_controller(struct 
 static int emulate_privileged_op(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
-    unsigned long *reg, eip = regs->eip, res;
+    unsigned long *reg, eip = regs->eip, value;
+    u64 res;
     u8 opcode, modrm_reg = 0, modrm_rm = 0, rep_prefix = 0, lock = 0, rex = 0;
     enum { lm_seg_none, lm_seg_fs, lm_seg_gs } lm_ovr = lm_seg_none;
     int rc;
@@ -2083,9 +2084,9 @@ static int emulate_privileged_op(struct 
         modrm_reg += ((opcode >> 3) & 7) + (lock << 3);
         modrm_rm  |= (opcode >> 0) & 7;
         reg = decode_register(modrm_rm, regs, 0);
-        if ( (res = do_get_debugreg(modrm_reg)) > (unsigned long)-256 )
+        if ( (value = do_get_debugreg(modrm_reg)) > (unsigned long)-256 )
             goto fail;
-        *reg = res;
+        *reg = value;
         break;
 
     case 0x22: /* MOV <reg>,CR? */




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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] i386: fix full-value calculation of wrmsr handling for pv guests, Jan Beulich <=