x86, microcode: Don't initialize microcode code on paravirt
[firefly-linux-kernel-4.4.55.git] / arch / x86 / kernel / cpu / microcode / core.c
index dd9d6190b08dfae5fdaee714ab5f556040af516e..ebd232d7de4db26e5b84f9f57a887586fd166ba0 100644 (file)
@@ -465,6 +465,14 @@ static void mc_bp_resume(void)
 
        if (uci->valid && uci->mc)
                microcode_ops->apply_microcode(cpu);
+       else if (!uci->mc)
+               /*
+                * We might resume and not have applied late microcode but still
+                * have a newer patch stashed from the early loader. We don't
+                * have it in uci->mc so we have to load it the same way we're
+                * applying patches early on the APs.
+                */
+               load_ucode_ap();
 }
 
 static struct syscore_ops mc_syscore_ops = {
@@ -549,7 +557,7 @@ static int __init microcode_init(void)
        struct cpuinfo_x86 *c = &cpu_data(0);
        int error;
 
-       if (dis_ucode_ldr)
+       if (paravirt_enabled() || dis_ucode_ldr)
                return 0;
 
        if (c->x86_vendor == X86_VENDOR_INTEL)