const struct x86_cpu_id *m;
unsigned int rev;
- if ( boot_cpu_has(X86_FEATURE_HYPERVISOR) )
+ if ( cpu_has_hypervisor )
return;
m = x86_match_cpu(deadline_match);
1:
/* Interrogate CPU extended features via CPUID. */
+ mov $1, %eax
+ cpuid
+ mov %ecx, sym_fs(boot_cpu_data) + CPUINFO_FEATURE_OFFSET(X86_FEATURE_HYPERVISOR)
+
mov $0x80000000,%eax
cpuid
shld $16,%eax,%ecx
static void __init efi_arch_cpu(void)
{
uint32_t eax = cpuid_eax(0x80000000);
+ uint32_t *caps = boot_cpu_data.x86_capability;
+
+ caps[cpufeat_word(X86_FEATURE_HYPERVISOR)] = cpuid_ecx(1);
if ( (eax >> 16) == 0x8000 && eax > 0x80000000 )
{
- boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_SYSCALL)]
- = cpuid_edx(0x80000001);
+ caps[cpufeat_word(X86_FEATURE_SYSCALL)] = cpuid_edx(0x80000001);
if ( cpu_has_nx )
trampoline_efer |= EFER_NX;
void __init probe_hypervisor(void)
{
- if ( xen_guest )
- return;
-
- /* Too early to use cpu_has_hypervisor */
- if ( !(cpuid_ecx(1) & cpufeat_mask(X86_FEATURE_HYPERVISOR)) )
+ if ( xen_guest || !cpu_has_hypervisor )
return;
find_xen_leaves();
case 0x000506e0: /* errata SKL167 / SKW159 */
case 0x000806e0: /* erratum KBL??? */
case 0x000906e0: /* errata KBL??? / KBW114 / CFW103 */
- *array_size = (cpuid_eax(0) >= 7 &&
- !(cpuid_ecx(1) & cpufeat_mask(X86_FEATURE_HYPERVISOR)) &&
+ *array_size = (cpuid_eax(0) >= 7 && !cpu_has_hypervisor &&
(cpuid_count_ebx(7, 0) & cpufeat_mask(X86_FEATURE_HLE)));
return &hle_bad_page;
}