Jan Beulich
2009-Jul-30 15:00 UTC
[Xen-devel] [PATCH] i386: fix full-value calculation of wrmsr handling for pv guests
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@novell.com> --- 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@lists.xensource.com http://lists.xensource.com/xen-devel