mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
x86emul: in_longmode() should not ignore ->read_msr() errors
All present hook implementations succeed for EFER, but we shouldn't really build on this being the case. Suggested-by: George Dunlap <george.dunlap@citrix.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Release-acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
1 parent
0af1b466c4
commit
122dd9575c
1 file changed
+2
-2
@@ -1296,10 +1296,10 @@ in_longmode(
|
||||
{
|
||||
uint64_t efer;
|
||||
|
||||
if (ops->read_msr == NULL)
|
||||
if ( !ops->read_msr ||
|
||||
unlikely(ops->read_msr(MSR_EFER, &efer, ctxt) != X86EMUL_OKAY) )
|
||||
return -1;
|
||||
|
||||
ops->read_msr(MSR_EFER, &efer, ctxt);
|
||||
return !!(efer & EFER_LMA);
|
||||
}
|
||||
|
||||
|
||||