linux_dsm_epyc7002/arch/x86
Borislav Petkov 548a0973fe x86/mce: Defer processing of early errors
[ Upstream commit 3bff147b187d5dfccfca1ee231b0761a89f1eff5 ]

When a fatal machine check results in a system reset, Linux does not
clear the error(s) from machine check bank(s) - hardware preserves the
machine check banks across a warm reset.

During initialization of the kernel after the reboot, Linux reads, logs,
and clears all machine check banks.

But there is a problem. In:

  5de97c9f6d ("x86/mce: Factor out and deprecate the /dev/mcelog driver")

the call to mce_register_decode_chain() moved later in the boot
sequence. This means that /dev/mcelog doesn't see those early error
logs.

This was partially fixed by:

  cd9c57cad3 ("x86/MCE: Dump MCE to dmesg if no consumers")

which made sure that the logs were not lost completely by printing
to the console. But parsing console logs is error prone. Users of
/dev/mcelog should expect to find any early errors logged to standard
places.

Add a new flag MCP_QUEUE_LOG to machine_check_poll() to be used in early
machine check initialization to indicate that any errors found should
just be queued to genpool. When mcheck_late_init() is called it will
call mce_schedule_work() to actually log and flush any errors queued in
the genpool.

 [ Based on an original patch, commit message by and completely
   productized by Tony Luck. ]

Fixes: 5de97c9f6d ("x86/mce: Factor out and deprecate the /dev/mcelog driver")
Reported-by: Sumanth Kamatala <skamatala@juniper.net>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210824003129.GA1642753@agluck-desk2.amr.corp.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-05 19:10:21 +02:00
..
boot init: add dsm gpl source 2024-07-05 18:00:04 +02:00
configs * A defconfig fix, from Daniel Díaz. 2020-09-20 15:06:43 -07:00
crypto crypto: x86/curve25519 - fix cpu feature checking logic in mod_exit 2021-07-14 16:56:06 +02:00
entry init: add dsm gpl source 2024-07-05 18:00:04 +02:00
events x86/events/amd/iommu: Fix invalid Perf result due to IOMMU PMC power-gating 2024-07-05 19:06:47 +02:00
hyperv x86/hyperv: Fix kexec panic/hang issues 2021-01-27 11:54:57 +01:00
ia32 x86: remove address space overrides using set_fs() 2020-09-08 22:21:36 -04:00
include x86/mce: Defer processing of early errors 2024-07-05 19:10:21 +02:00
kernel x86/mce: Defer processing of early errors 2024-07-05 19:10:21 +02:00
kvm KVM: X86: Fix warning caused by stale emulation context 2024-07-05 18:55:30 +02:00
lib x86/msr: Fix wr/rdmsr_safe_regs_on_cpu() prototypes 2021-05-22 11:40:51 +02:00
math-emu treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mm init: add dsm gpl source 2024-07-05 18:00:04 +02:00
net init: add dsm gpl source 2024-07-05 18:00:04 +02:00
oprofile
pci PCI: Add AMD RS690 quirk to enable 64-bit DMA 2021-06-30 08:47:23 -04:00
platform x86/efi: Remove EFI PGD build time checks 2021-02-17 11:02:24 +01:00
power PM: hibernate: x86: Use crc32 instead of md5 for hibernation e820 integrity check 2021-05-14 09:50:21 +02:00
purgatory treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
ras treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
realmode x86/head/64: Don't call verify_cpu() on starting APs 2020-09-09 11:33:20 +02:00
tools x86/tools: Fix objdump version check again 2024-07-05 18:54:39 +02:00
um arch/um: partially revert the conversion to __section() macro 2020-10-26 15:39:37 -07:00
video
xen x86/xen: Fix noinstr fail in exc_xen_unknown_trap() 2021-06-30 08:47:18 -04:00
.gitignore
Kbuild
Kconfig x86/platform/uv: Fix !KEXEC build failure 2021-05-14 09:50:20 +02:00
Kconfig.assembler
Kconfig.cpu treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Kconfig.debug x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}() 2020-10-06 11:18:04 +02:00
Makefile x86/build: Propagate $(CLANG_FLAGS) to $(REALMODE_FLAGS) 2021-05-11 14:47:18 +02:00
Makefile_32.cpu
Makefile.um