linux-stable/arch
David Kaplan 6a190e7ca4 x86/cpu: Fix check for RDPKRU in __show_regs()
commit b53c6bd5d2 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>
2024-05-02 16:29:27 +02:00
..
alpha rtc: Add support for configuring the UIP timeout for RTC reads 2024-01-31 16:17:01 -08:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:29:23 +02:00
arm ARM: dts: microchip: at91-sama7g5ek: Replace regulator-suspend-voltage with the valid property 2024-05-02 16:29:23 +02:00
arm64 arm64: dts: rockchip: regulator for sd needs to be always on for BPI-R2Pro 2024-05-02 16:29:23 +02:00
csky work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:12:28 +01:00
hexagon hexagon: vmlinux.lds.S: handle attributes section 2024-04-03 15:19:48 +02:00
ia64 ia64/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:46 +02:00
loongarch LoongArch: Define the __io_aw() hook as mmiowb() 2024-04-03 15:19:38 +02:00
m68k m68k: Fix invalid .section syntax 2023-09-13 09:42:21 +02:00
microblaze mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
mips MIPS: Clear Cause.BD in instruction_pointer_set 2024-03-26 18:20:24 -04:00
nios2 mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
openrisc mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
parisc parisc: Strip upper 32 bit of sum in csum_ipv6_magic for 64-bit builds 2024-04-03 15:19:28 +02:00
powerpc powerpc: xor_vmx: Add '-mhard-float' to CFLAGS 2024-04-03 15:19:31 +02:00
riscv riscv: process: Fix kernel gp leakage 2024-04-10 16:28:33 +02:00
s390 s390/entry: align system call table on 8 bytes 2024-04-10 16:28:33 +02:00
sh sh: bios: Revive earlyprintk support 2023-11-20 11:52:07 +01:00
sparc sparc32: Fix parport build with sparc32 2024-04-03 15:19:33 +02:00
um um: Fix adding '-no-pie' for clang 2024-02-23 09:12:38 +01:00
x86 x86/cpu: Fix check for RDPKRU in __show_regs() 2024-05-02 16:29:27 +02:00
xtensa work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:12:28 +01:00
.gitignore
Kconfig scs: add CONFIG_MMU dependency for vfree_atomic() 2024-02-23 09:12:32 +01:00