Skip to content

Commit

Permalink
15878 Do not attempt to update CPU microcode on virtual hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus-it committed Aug 31, 2023
1 parent 09a282d commit 76b575d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 3 additions & 4 deletions usr/src/uts/intel/os/microcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,13 @@ ucode_check(cpu_t *cp)
}
}

if (ucode == NULL) {
cmn_err(CE_CONT,
"?ucode: unsupported processor\n");
if (ucode == NULL)
goto out;
}

#ifdef DEBUG
cmn_err(CE_CONT, "?ucode: selected %s\n",
ucode->us_name);
#endif
}
}

Expand Down
3 changes: 3 additions & 0 deletions usr/src/uts/intel/os/microcode_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ static uint_t ucode_eqtbl_amd_entries;
static bool
ucode_select_amd(cpu_t *cp)
{
if ((get_hwenv() & HW_VIRTUAL) != 0)
return (false);

return (cpuid_getvendor(cp) == X86_VENDOR_AMD);
}

Expand Down
3 changes: 3 additions & 0 deletions usr/src/uts/intel/os/microcode_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ static ucode_file_intel_t intel_ucodef;
static bool
ucode_select_intel(cpu_t *cp)
{
if ((get_hwenv() & HW_VIRTUAL) != 0)
return (false);

return (cpuid_getvendor(cp) == X86_VENDOR_Intel);
}

Expand Down

0 comments on commit 76b575d

Please sign in to comment.