linux/arch/x86/kernel/cpu/mce
Yazen Ghannam ef3ad7f447 x86/MCE/AMD: Clear DFR errors found in THR handler
commit bc1b705b0e upstream.

AMD's MCA Thresholding feature counts errors of all severity levels, not
just correctable errors. If a deferred error causes the threshold limit
to be reached (it was the error that caused the overflow), then both a
deferred error interrupt and a thresholding interrupt will be triggered.

The order of the interrupts is not guaranteed. If the threshold
interrupt handler is executed first, then it will clear MCA_STATUS for
the error. It will not check or clear MCA_DESTAT which also holds a copy
of the deferred error. When the deferred error interrupt handler runs it
will not find an error in MCA_STATUS, but it will find the error in
MCA_DESTAT. This will cause two errors to be logged.

Check for deferred errors when handling a threshold interrupt. If a bank
contains a deferred error, then clear the bank's MCA_DESTAT register.

Define a new helper function to do the deferred error check and clearing
of MCA_DESTAT.

  [ bp: Simplify, convert comment to passive voice. ]

Fixes: 37d43acfd7 ("x86/mce/AMD: Redo error logging from APIC LVT interrupt handlers")
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220621155943.33623-1-yazen.ghannam@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-07 11:11:40 +01:00
..
amd.c x86/MCE/AMD: Clear DFR errors found in THR handler 2023-01-07 11:11:40 +01:00
apei.c x86/mce: Retrieve poison range from hardware 2022-08-29 09:33:42 +02:00
core.c libnvdimm for 5.19 2022-05-27 15:49:30 -07:00
dev-mcelog.c
genpool.c
inject.c x86/mce: Check whether writes to MCA_STATUS are getting ignored 2022-06-28 12:08:10 +02:00
intel.c x86/cpu: Merge Intel and AMD ppin_init() functions 2022-02-01 12:56:23 +01:00
internal.h x86/mce: Check whether writes to MCA_STATUS are getting ignored 2022-06-28 12:08:10 +02:00
Makefile
p5.c x86/mce: Get rid of machine_check_vector 2021-09-23 11:15:49 +02:00
severity.c x86/mce: Add messages for panic errors in AMD's MCE grading 2022-04-25 12:40:48 +02:00
threshold.c
winchip.c x86/mce: Get rid of machine_check_vector 2021-09-23 11:15:49 +02:00