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:
Jan Beulich committed 2016-11-23 15:27:47 +01:00
1 parent 0af1b466c4
commit 122dd9575c
1 file changed
+2 -2
+2 -2
View File
@@ -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);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.