Merge tag 'x86_microcode_for_v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-rpi.git] / arch / x86 / kernel / cpu / microcode / amd.c
index b103d5e..56471f7 100644 (file)
@@ -440,7 +440,13 @@ apply_microcode_early_amd(u32 cpuid_1_eax, void *ucode, size_t size, bool save_p
                return ret;
 
        native_rdmsr(MSR_AMD64_PATCH_LEVEL, rev, dummy);
-       if (rev >= mc->hdr.patch_id)
+
+       /*
+        * Allow application of the same revision to pick up SMT-specific
+        * changes even if the revision of the other SMT thread is already
+        * up-to-date.
+        */
+       if (rev > mc->hdr.patch_id)
                return ret;
 
        if (!__apply_microcode_amd(mc)) {
@@ -528,8 +534,12 @@ void load_ucode_amd_ap(unsigned int cpuid_1_eax)
 
        native_rdmsr(MSR_AMD64_PATCH_LEVEL, rev, dummy);
 
-       /* Check whether we have saved a new patch already: */
-       if (*new_rev && rev < mc->hdr.patch_id) {
+       /*
+        * Check whether a new patch has been saved already. Also, allow application of
+        * the same revision in order to pick up SMT-thread-specific configuration even
+        * if the sibling SMT thread already has an up-to-date revision.
+        */
+       if (*new_rev && rev <= mc->hdr.patch_id) {
                if (!__apply_microcode_amd(mc)) {
                        *new_rev = mc->hdr.patch_id;
                        return;