i386: fix full-value calculation of wrmsr handling for pv guests
PATCH 1/1 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 <[email protected]>
xen/arch/x86/traps.c +4 -3
@@ -1678,7 +1678,8 @@ static int is_cpufreq_controller(structstatic 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? */