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>
{
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);
}