]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Jun 2026 13:43:31 +0000 (19:13 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Jun 2026 13:43:31 +0000 (19:13 +0530)
added patches:
x86-cpu-amd-call-the-spectral-chicken-in-the-zen2-init-function.patch
x86-cpu-amd-move-the-zen3-btc_no-detection-to-the-zen3-init-function.patch
x86-cpu-amd-rename-init_amd_zn-to-init_amd_zen_common.patch

queue-6.6/series
queue-6.6/x86-cpu-amd-call-the-spectral-chicken-in-the-zen2-init-function.patch [new file with mode: 0644]
queue-6.6/x86-cpu-amd-move-the-zen3-btc_no-detection-to-the-zen3-init-function.patch [new file with mode: 0644]
queue-6.6/x86-cpu-amd-rename-init_amd_zn-to-init_amd_zen_common.patch [new file with mode: 0644]

index d5d48a92651a0408b7a15e91a219845784714fe3..14e780165b1070f14188e32a5d48a85f0a85b7fe 100644 (file)
@@ -447,3 +447,6 @@ arm64-errata-mitigate-tlbi-errata-on-microsoft-azure-cobalt-100-cpu.patch
 mptcp-add-addr-always-drop-other-suboptions.patch
 mptcp-fix-missing-wakeups-in-edge-scenarios.patch
 revert-selftest-ptp-update-ptp-selftest-to-exercise-the-gettimex-options.patch
+x86-cpu-amd-move-the-zen3-btc_no-detection-to-the-zen3-init-function.patch
+x86-cpu-amd-call-the-spectral-chicken-in-the-zen2-init-function.patch
+x86-cpu-amd-rename-init_amd_zn-to-init_amd_zen_common.patch
diff --git a/queue-6.6/x86-cpu-amd-call-the-spectral-chicken-in-the-zen2-init-function.patch b/queue-6.6/x86-cpu-amd-call-the-spectral-chicken-in-the-zen2-init-function.patch
new file mode 100644 (file)
index 0000000..c439a34
--- /dev/null
@@ -0,0 +1,50 @@
+From cfbf4f992bfce1fa9f2f347a79cbbea0368e7971 Mon Sep 17 00:00:00 2001
+From: "Borislav Petkov (AMD)" <bp@alien8.de>
+Date: Wed, 1 Nov 2023 11:20:01 +0100
+Subject: x86/CPU/AMD: Call the spectral chicken in the Zen2 init function
+
+From: Borislav Petkov (AMD) <bp@alien8.de>
+
+commit cfbf4f992bfce1fa9f2f347a79cbbea0368e7971 upstream.
+
+No functional change.
+
+Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
+Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>
+Link: http://lore.kernel.org/r/20231120104152.13740-6-bp@alien8.de
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/kernel/cpu/amd.c |    7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/arch/x86/kernel/cpu/amd.c
++++ b/arch/x86/kernel/cpu/amd.c
+@@ -1060,10 +1060,8 @@ void init_spectral_chicken(struct cpuinf
+        *
+        * This suppresses speculation from the middle of a basic block, i.e. it
+        * suppresses non-branch predictions.
+-       *
+-       * We use STIBP as a heuristic to filter out Zen2 from the rest of F17H
+        */
+-      if (!cpu_has(c, X86_FEATURE_HYPERVISOR) && cpu_has(c, X86_FEATURE_AMD_STIBP)) {
++      if (!cpu_has(c, X86_FEATURE_HYPERVISOR)) {
+               if (!rdmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, &value)) {
+                       value |= MSR_ZEN2_SPECTRAL_CHICKEN_BIT;
+                       wrmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, value);
+@@ -1149,6 +1147,7 @@ static void zen2_zenbleed_check(struct c
+ static void init_amd_zen2(struct cpuinfo_x86 *c)
+ {
++      init_spectral_chicken(c);
+       fix_erratum_1386(c);
+       zen2_zenbleed_check(c);
+@@ -1213,7 +1212,7 @@ static void init_amd(struct cpuinfo_x86
+       case 0x12: init_amd_ln(c); break;
+       case 0x15: init_amd_bd(c); break;
+       case 0x16: init_amd_jg(c); break;
+-      case 0x17: init_spectral_chicken(c);
++      case 0x17:
+                  fallthrough;
+       case 0x19: init_amd_zn(c); break;
+       }
diff --git a/queue-6.6/x86-cpu-amd-move-the-zen3-btc_no-detection-to-the-zen3-init-function.patch b/queue-6.6/x86-cpu-amd-move-the-zen3-btc_no-detection-to-the-zen3-init-function.patch
new file mode 100644 (file)
index 0000000..08d1e08
--- /dev/null
@@ -0,0 +1,52 @@
+From affc66cb96f865b3763a8e18add52e133d864f04 Mon Sep 17 00:00:00 2001
+From: "Borislav Petkov (AMD)" <bp@alien8.de>
+Date: Wed, 1 Nov 2023 11:28:31 +0100
+Subject: x86/CPU/AMD: Move the Zen3 BTC_NO detection to the Zen3 init function
+
+From: Borislav Petkov (AMD) <bp@alien8.de>
+
+commit affc66cb96f865b3763a8e18add52e133d864f04 upstream.
+
+No functional changes.
+
+Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
+Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>
+Link: http://lore.kernel.org/r/20231120104152.13740-4-bp@alien8.de
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/kernel/cpu/amd.c |   17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+--- a/arch/x86/kernel/cpu/amd.c
++++ b/arch/x86/kernel/cpu/amd.c
+@@ -1090,14 +1090,6 @@ static void init_amd_zen1(struct cpuinfo
+               /* Erratum 1076: CPB feature bit not being set in CPUID. */
+               if (!cpu_has(c, X86_FEATURE_CPB))
+                       set_cpu_cap(c, X86_FEATURE_CPB);
+-
+-              /*
+-               * Zen3 (Fam19 model < 0x10) parts are not susceptible to
+-               * Branch Type Confusion, but predate the allocation of the
+-               * BTC_NO bit.
+-               */
+-              if (c->x86 == 0x19 && !cpu_has(c, X86_FEATURE_BTC_NO))
+-                      set_cpu_cap(c, X86_FEATURE_BTC_NO);
+       }
+       pr_notice_once("AMD Zen1 DIV0 bug detected. Disable SMT for full protection.\n");
+@@ -1173,6 +1165,15 @@ static void init_amd_zen2(struct cpuinfo
+ static void init_amd_zen3(struct cpuinfo_x86 *c)
+ {
++      if (!cpu_has(c, X86_FEATURE_HYPERVISOR)) {
++              /*
++               * Zen3 (Fam19 model < 0x10) parts are not susceptible to
++               * Branch Type Confusion, but predate the allocation of the
++               * BTC_NO bit.
++               */
++              if (!cpu_has(c, X86_FEATURE_BTC_NO))
++                      set_cpu_cap(c, X86_FEATURE_BTC_NO);
++      }
+ }
+ static void init_amd_zen4(struct cpuinfo_x86 *c)
diff --git a/queue-6.6/x86-cpu-amd-rename-init_amd_zn-to-init_amd_zen_common.patch b/queue-6.6/x86-cpu-amd-rename-init_amd_zn-to-init_amd_zen_common.patch
new file mode 100644 (file)
index 0000000..162f578
--- /dev/null
@@ -0,0 +1,78 @@
+From 7c81ad8e8bc28a1847e87c5afe1bae6bffb2f73e Mon Sep 17 00:00:00 2001
+From: "Borislav Petkov (AMD)" <bp@alien8.de>
+Date: Wed, 1 Nov 2023 12:34:29 +0100
+Subject: x86/CPU/AMD: Rename init_amd_zn() to init_amd_zen_common()
+
+From: Borislav Petkov (AMD) <bp@alien8.de>
+
+commit 7c81ad8e8bc28a1847e87c5afe1bae6bffb2f73e upstream.
+
+Call it from all Zen init functions.
+
+Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
+Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>
+Link: http://lore.kernel.org/r/20231120104152.13740-7-bp@alien8.de
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/kernel/cpu/amd.c |   11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+--- a/arch/x86/kernel/cpu/amd.c
++++ b/arch/x86/kernel/cpu/amd.c
+@@ -1070,7 +1070,7 @@ void init_spectral_chicken(struct cpuinf
+ #endif
+ }
+-static void init_amd_zn(struct cpuinfo_x86 *c)
++static void init_amd_zen_common(void)
+ {
+       setup_force_cpu_cap(X86_FEATURE_ZEN);
+ #ifdef CONFIG_NUMA
+@@ -1080,6 +1080,7 @@ static void init_amd_zn(struct cpuinfo_x
+ static void init_amd_zen1(struct cpuinfo_x86 *c)
+ {
++      init_amd_zen_common();
+       fix_erratum_1386(c);
+       /* Fix up CPUID bits, but only if not virtualised. */
+@@ -1143,10 +1144,12 @@ static void zen2_zenbleed_check(struct c
+       } else {
+               msr_clear_bit(MSR_AMD64_DE_CFG, MSR_AMD64_DE_CFG_ZEN2_FP_BACKUP_FIX_BIT);
+       }
++
+ }
+ static void init_amd_zen2(struct cpuinfo_x86 *c)
+ {
++      init_amd_zen_common();
+       init_spectral_chicken(c);
+       fix_erratum_1386(c);
+       zen2_zenbleed_check(c);
+@@ -1164,6 +1167,8 @@ static void init_amd_zen2(struct cpuinfo
+ static void init_amd_zen3(struct cpuinfo_x86 *c)
+ {
++      init_amd_zen_common();
++
+       if (!cpu_has(c, X86_FEATURE_HYPERVISOR)) {
+               /*
+                * Zen3 (Fam19 model < 0x10) parts are not susceptible to
+@@ -1177,6 +1182,7 @@ static void init_amd_zen3(struct cpuinfo
+ static void init_amd_zen4(struct cpuinfo_x86 *c)
+ {
++      init_amd_zen_common();
+ }
+ static void init_amd(struct cpuinfo_x86 *c)
+@@ -1212,9 +1218,6 @@ static void init_amd(struct cpuinfo_x86
+       case 0x12: init_amd_ln(c); break;
+       case 0x15: init_amd_bd(c); break;
+       case 0x16: init_amd_jg(c); break;
+-      case 0x17:
+-                 fallthrough;
+-      case 0x19: init_amd_zn(c); break;
+       }
+       if (boot_cpu_has(X86_FEATURE_ZEN1))