%cs.L may be set in a legacy mode segment, or clear in a compatibility mode
segment; it is not the correct way to check for long mode being active.
Both of these situations result in incorrect visibility of the SYSCALL feature
in CPUID, and by extension, incorrect behaviour in hvm_efer_valid().
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <JBeulich@suse.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
unsigned int *ecx, unsigned int *edx)
{
unsigned int input = *eax;
- struct segment_register cs;
struct vcpu *v = current;
hvm_cpuid(input, eax, ebx, ecx, edx);
{
case 0x80000001:
/* SYSCALL is visible iff running in long mode. */
- vmx_get_segment_register(v, x86_seg_cs, &cs);
- if ( cs.attr.fields.l )
+ if ( hvm_long_mode_enabled(v) )
*edx |= cpufeat_mask(X86_FEATURE_SYSCALL);
else
*edx &= ~(cpufeat_mask(X86_FEATURE_SYSCALL));