Skip to content

Commit 3626822

Browse files
konradwilkKAGA-KOKO
authored andcommitted
x86/spectre_v2: Don't check microcode versions when running under hypervisors
As: 1) It's known that hypervisors lie about the environment anyhow (host mismatch) 2) Even if the hypervisor (Xen, KVM, VMWare, etc) provided a valid "correct" value, it all gets to be very murky when migration happens (do you provide the "new" microcode of the machine?). And in reality the cloud vendors are the ones that should make sure that the microcode that is running is correct and we should just sing lalalala and trust them. Signed-off-by: Konrad Rzeszutek Wilk <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Cc: Wanpeng Li <[email protected]> Cc: kvm <[email protected]> Cc: Krčmář <[email protected]> Cc: Borislav Petkov <[email protected]> CC: "H. Peter Anvin" <[email protected]> CC: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 076ca27 commit 3626822

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/x86/kernel/cpu/intel.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ static bool bad_spectre_microcode(struct cpuinfo_x86 *c)
144144
{
145145
int i;
146146

147+
/*
148+
* We know that the hypervisor lie to us on the microcode version so
149+
* we may as well hope that it is running the correct version.
150+
*/
151+
if (cpu_has(c, X86_FEATURE_HYPERVISOR))
152+
return false;
153+
147154
for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) {
148155
if (c->x86_model == spectre_bad_microcodes[i].model &&
149156
c->x86_stepping == spectre_bad_microcodes[i].stepping)

0 commit comments

Comments
 (0)