mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
x86/pv: Handle the Intel-specific MSR_MISC_ENABLE correctly
This MSR doesn't exist on AMD hardware, and switching away from the safe
functions in the common MSR path was an erroneous change.
Partially revert the change.
This is XSA-333.
Fixes: 4fdc932b3c ("x86/Intel: drop another 32-bit leftover")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wl@xen.org>
This commit is contained in:
1 parent
68a8aa5d72
commit
e71301ecd5
1 file changed
+4
-2
@@ -959,7 +959,8 @@ static int read_msr(unsigned int reg, uint64_t *val,
|
||||
return X86EMUL_OKAY;
|
||||
|
||||
case MSR_IA32_MISC_ENABLE:
|
||||
rdmsrl(reg, *val);
|
||||
if ( rdmsr_safe(reg, *val) )
|
||||
break;
|
||||
*val = guest_misc_enable(*val);
|
||||
return X86EMUL_OKAY;
|
||||
|
||||
@@ -1102,7 +1103,8 @@ static int write_msr(unsigned int reg, uint64_t val,
|
||||
break;
|
||||
|
||||
case MSR_IA32_MISC_ENABLE:
|
||||
rdmsrl(reg, temp);
|
||||
if ( rdmsr_safe(reg, temp) )
|
||||
break;
|
||||
if ( val != guest_misc_enable(temp) )
|
||||
goto invalid;
|
||||
return X86EMUL_OKAY;
|
||||
|
||||