aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-29 13:15:53 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-29 13:15:53 +0200
commit7e78cf3d5fbcb29e56efc1c78f990240bd902a61 (patch)
tree86767d2bf4a7c6e36c2a13c6753ba8ef47f9ac23
parent97373ae32d46a563276632f7eddd8e31ca03e966 (diff)
downloadstable-queue-7e78cf3d5fbcb29e56efc1c78f990240bd902a61.tar.gz
6.8-stable patches
added patches: x86-cpu-amd-add-models-0x10-0x1f-to-the-zen5-range.patch x86-cpu-fix-check-for-rdpkru-in-__show_regs.patch
-rw-r--r--queue-6.8/series2
-rw-r--r--queue-6.8/x86-cpu-amd-add-models-0x10-0x1f-to-the-zen5-range.patch32
-rw-r--r--queue-6.8/x86-cpu-fix-check-for-rdpkru-in-__show_regs.patch42
3 files changed, 76 insertions, 0 deletions
diff --git a/queue-6.8/series b/queue-6.8/series
index 8134a8df9c..37e62271ef 100644
--- a/queue-6.8/series
+++ b/queue-6.8/series
@@ -129,3 +129,5 @@ drm-amdgpu-fix-visible-vram-handling-during-faults.patch
selftests-seccomp-user_notification_addfd-check-nextfd-is-available.patch
selftests-seccomp-change-the-syscall-used-in-kill_thread-test.patch
selftests-seccomp-handle-einval-on-unshare-clone_newpid.patch
+x86-cpu-amd-add-models-0x10-0x1f-to-the-zen5-range.patch
+x86-cpu-fix-check-for-rdpkru-in-__show_regs.patch
diff --git a/queue-6.8/x86-cpu-amd-add-models-0x10-0x1f-to-the-zen5-range.patch b/queue-6.8/x86-cpu-amd-add-models-0x10-0x1f-to-the-zen5-range.patch
new file mode 100644
index 0000000000..8f0c773389
--- /dev/null
+++ b/queue-6.8/x86-cpu-amd-add-models-0x10-0x1f-to-the-zen5-range.patch
@@ -0,0 +1,32 @@
+From 2718a7fdf292b2dcb49c856fa8a6a955ebbbc45f Mon Sep 17 00:00:00 2001
+From: Wenkuan Wang <Wenkuan.Wang@amd.com>
+Date: Wed, 10 Apr 2024 11:53:08 +0800
+Subject: x86/CPU/AMD: Add models 0x10-0x1f to the Zen5 range
+
+From: Wenkuan Wang <Wenkuan.Wang@amd.com>
+
+commit 2718a7fdf292b2dcb49c856fa8a6a955ebbbc45f upstream.
+
+Add some more Zen5 models.
+
+Fixes: 3e4147f33f8b ("x86/CPU/AMD: Add X86_FEATURE_ZEN5")
+Signed-off-by: Wenkuan Wang <Wenkuan.Wang@amd.com>
+Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
+Link: https://lore.kernel.org/r/20240423144111.1362-1-bp@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/kernel/cpu/amd.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/arch/x86/kernel/cpu/amd.c
++++ b/arch/x86/kernel/cpu/amd.c
+@@ -572,8 +572,7 @@ static void bsp_init_amd(struct cpuinfo_
+
+ case 0x1a:
+ switch (c->x86_model) {
+- case 0x00 ... 0x0f:
+- case 0x20 ... 0x2f:
++ case 0x00 ... 0x2f:
+ case 0x40 ... 0x4f:
+ case 0x70 ... 0x7f:
+ setup_force_cpu_cap(X86_FEATURE_ZEN5);
diff --git a/queue-6.8/x86-cpu-fix-check-for-rdpkru-in-__show_regs.patch b/queue-6.8/x86-cpu-fix-check-for-rdpkru-in-__show_regs.patch
new file mode 100644
index 0000000000..88b15ae799
--- /dev/null
+++ b/queue-6.8/x86-cpu-fix-check-for-rdpkru-in-__show_regs.patch
@@ -0,0 +1,42 @@
+From b53c6bd5d271d023857174b8fd3e32f98ae51372 Mon Sep 17 00:00:00 2001
+From: David Kaplan <david.kaplan@amd.com>
+Date: Sun, 21 Apr 2024 21:17:28 +0200
+Subject: x86/cpu: Fix check for RDPKRU in __show_regs()
+
+From: David Kaplan <david.kaplan@amd.com>
+
+commit b53c6bd5d271d023857174b8fd3e32f98ae51372 upstream.
+
+cpu_feature_enabled(X86_FEATURE_OSPKE) does not necessarily reflect
+whether CR4.PKE is set on the CPU. In particular, they may differ on
+non-BSP CPUs before setup_pku() is executed. In this scenario, RDPKRU
+will #UD causing the system to hang.
+
+Fix by checking CR4 for PKE enablement which is always correct for the
+current CPU.
+
+The scenario happens by inserting a WARN* before setup_pku() in
+identiy_cpu() or some other diagnostic which would lead to calling
+__show_regs().
+
+ [ bp: Massage commit message. ]
+
+Signed-off-by: David Kaplan <david.kaplan@amd.com>
+Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
+Link: https://lore.kernel.org/r/20240421191728.32239-1-bp@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/kernel/process_64.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/process_64.c
++++ b/arch/x86/kernel/process_64.c
+@@ -138,7 +138,7 @@ void __show_regs(struct pt_regs *regs, e
+ log_lvl, d3, d6, d7);
+ }
+
+- if (cpu_feature_enabled(X86_FEATURE_OSPKE))
++ if (cr4 & X86_CR4_PKE)
+ printk("%sPKRU: %08x\n", log_lvl, read_pkru());
+ }
+