linux-stable/arch
Yazen Ghannam 6eac396590 x86/MCE: Always save CS register on AMD Zen IF Poison errors
commit 4240e2ebe6 upstream.

The Instruction Fetch (IF) units on current AMD Zen-based systems do not
guarantee a synchronous #MC is delivered for poison consumption errors.
Therefore, MCG_STATUS[EIPV|RIPV] will not be set. However, the
microarchitecture does guarantee that the exception is delivered within
the same context. In other words, the exact rIP is not known, but the
context is known to not have changed.

There is no architecturally-defined method to determine this behavior.

The Code Segment (CS) register is always valid on such IF unit poison
errors regardless of the value of MCG_STATUS[EIPV|RIPV].

Add a quirk to save the CS register for poison consumption from the IF
unit banks.

This is needed to properly determine the context of the error.
Otherwise, the severity grading function will assume the context is
IN_KERNEL due to the m->cs value being 0 (the initialized value). This
leads to unnecessary kernel panics on data poison errors due to the
kernel believing the poison consumption occurred in kernel context.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230814200853.29258-1-yazen.ghannam@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-13 09:48:42 +02:00
..
alpha alpha: remove __init annotation from exported page_is_ram() 2023-08-16 18:32:31 +02:00
arc ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-07-19 16:36:19 +02:00
arm ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch() 2023-09-13 09:48:38 +02:00
arm64 arm64: csum: Fix OoB access in IP checksum code for negative lengths 2023-09-13 09:48:40 +02:00
csky csky: fix up lock_mm_and_find_vma() conversion 2023-07-01 13:12:41 +02:00
hexagon mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:12:39 +02:00
ia64 ia64/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:04:48 +02:00
loongarch LoongArch: mm: Add p?d_leaf() definitions 2023-09-13 09:48:39 +02:00
m68k m68k: Fix invalid .section syntax 2023-09-13 09:47:51 +02:00
microblaze mm: always expand the stack with the mmap write lock held 2023-07-01 13:12:40 +02:00
mips locking/arch: Avoid variable shadowing in local_try_cmpxchg() 2023-09-13 09:47:57 +02:00
nios2 mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:12:39 +02:00
openrisc openrisc: Union fpcsr and oldmask in sigcontext to unbreak userspace ABI 2023-07-23 13:53:45 +02:00
parisc parisc: Fix /proc/cpuinfo output for lscpu 2023-09-13 09:48:41 +02:00
powerpc powerpc/ftrace: Fix dropping weak symbols with older toolchains 2023-09-13 09:48:39 +02:00
riscv riscv: Mark KASAN tmp* page tables variables as static 2023-09-13 09:48:38 +02:00
s390 s390/paes: fix PKEY_TYPE_EP11_AES handling for secure keyblobs 2023-09-13 09:47:59 +02:00
sh sh/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:04:49 +02:00
sparc sparc/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:04:49 +02:00
um um: virt-pci: fix missing declaration warning 2023-09-13 09:48:36 +02:00
x86 x86/MCE: Always save CS register on AMD Zen IF Poison errors 2023-09-13 09:48:42 +02:00
xtensa xtensa: PMU: fix base address for the newer hardware 2023-09-13 09:48:39 +02:00
.gitignore
Kconfig init: Provide arch_cpu_finalize_init() 2023-08-08 20:04:47 +02:00