* [PATCH] EDAC, i7core, sb, pnd2, skx: Fix error event severity
@ 2020-07-07 19:43 Tony Luck
2020-08-18 13:45 ` Borislav Petkov
0 siblings, 1 reply; 2+ messages in thread
From: Tony Luck @ 2020-07-07 19:43 UTC (permalink / raw)
To: Tony Luck
Cc: Gabriele Paoloni, Borislav Petkov, Qiuxu Zhuo, Aristeu Rozanski,
Mauro Carvalho Chehab, linux-edac
IA32_MCG_STATUS.RIPV indicates whether the return RIP value pushed onto
the stack as part of machine check delivery is valid or not.
Various drivers copied a code fragment that uses the RIPV bit to
determine the severity of the error as either HW_EVENT_ERR_UNCORRECTED
or HW_EVENT_ERR_FATAL, but this check is reversed (marking errors where
RIPV is set as "FATAL").
Reverse the tests so that the error is marked fatal when RIPV is not set.
Reported-by: Gabriele Paoloni <gabriele.paoloni@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
drivers/edac/i7core_edac.c | 4 ++--
drivers/edac/pnd2_edac.c | 2 +-
drivers/edac/sb_edac.c | 4 ++--
drivers/edac/skx_common.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 5860ca41185c..2acd9f9284a2 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1710,9 +1710,9 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci,
if (uncorrected_error) {
core_err_cnt = 1;
if (ripv)
- tp_event = HW_EVENT_ERR_FATAL;
- else
tp_event = HW_EVENT_ERR_UNCORRECTED;
+ else
+ tp_event = HW_EVENT_ERR_FATAL;
} else {
tp_event = HW_EVENT_ERR_CORRECTED;
}
diff --git a/drivers/edac/pnd2_edac.c b/drivers/edac/pnd2_edac.c
index fd363746f5b0..b8fc4b84fd86 100644
--- a/drivers/edac/pnd2_edac.c
+++ b/drivers/edac/pnd2_edac.c
@@ -1155,7 +1155,7 @@ static void pnd2_mce_output_error(struct mem_ctl_info *mci, const struct mce *m,
u32 optypenum = GET_BITFIELD(m->status, 4, 6);
int rc;
- tp_event = uc_err ? (ripv ? HW_EVENT_ERR_FATAL : HW_EVENT_ERR_UNCORRECTED) :
+ tp_event = uc_err ? (ripv ? HW_EVENT_ERR_UNCORRECTED : HW_EVENT_ERR_FATAL) :
HW_EVENT_ERR_CORRECTED;
/*
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index d414698ca324..c5ab634cb6a4 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -2982,9 +2982,9 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,
if (uncorrected_error) {
core_err_cnt = 1;
if (ripv) {
- tp_event = HW_EVENT_ERR_FATAL;
- } else {
tp_event = HW_EVENT_ERR_UNCORRECTED;
+ } else {
+ tp_event = HW_EVENT_ERR_FATAL;
}
} else {
tp_event = HW_EVENT_ERR_CORRECTED;
diff --git a/drivers/edac/skx_common.c b/drivers/edac/skx_common.c
index 6d8d6dc626bf..2b4ce8e5ac2f 100644
--- a/drivers/edac/skx_common.c
+++ b/drivers/edac/skx_common.c
@@ -493,9 +493,9 @@ static void skx_mce_output_error(struct mem_ctl_info *mci,
if (uncorrected_error) {
core_err_cnt = 1;
if (ripv) {
- tp_event = HW_EVENT_ERR_FATAL;
- } else {
tp_event = HW_EVENT_ERR_UNCORRECTED;
+ } else {
+ tp_event = HW_EVENT_ERR_FATAL;
}
} else {
tp_event = HW_EVENT_ERR_CORRECTED;
--
2.21.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] EDAC, i7core, sb, pnd2, skx: Fix error event severity
2020-07-07 19:43 [PATCH] EDAC, i7core, sb, pnd2, skx: Fix error event severity Tony Luck
@ 2020-08-18 13:45 ` Borislav Petkov
0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2020-08-18 13:45 UTC (permalink / raw)
To: Tony Luck
Cc: Gabriele Paoloni, Qiuxu Zhuo, Aristeu Rozanski,
Mauro Carvalho Chehab, linux-edac
On Tue, Jul 07, 2020 at 12:43:24PM -0700, Tony Luck wrote:
> IA32_MCG_STATUS.RIPV indicates whether the return RIP value pushed onto
> the stack as part of machine check delivery is valid or not.
>
> Various drivers copied a code fragment that uses the RIPV bit to
> determine the severity of the error as either HW_EVENT_ERR_UNCORRECTED
> or HW_EVENT_ERR_FATAL, but this check is reversed (marking errors where
> RIPV is set as "FATAL").
>
> Reverse the tests so that the error is marked fatal when RIPV is not set.
>
> Reported-by: Gabriele Paoloni <gabriele.paoloni@intel.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
> drivers/edac/i7core_edac.c | 4 ++--
> drivers/edac/pnd2_edac.c | 2 +-
> drivers/edac/sb_edac.c | 4 ++--
> drivers/edac/skx_common.c | 4 ++--
> 4 files changed, 7 insertions(+), 7 deletions(-)
Queued on edac-urgent, will send to Linus next week.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-18 13:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07 19:43 [PATCH] EDAC, i7core, sb, pnd2, skx: Fix error event severity Tony Luck
2020-08-18 13:45 ` Borislav Petkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).