Commit 6169ddf8 authored by Borislav Petkov's avatar Borislav Petkov

GHES: Panic right after detection

The moment we log an error of panic severity, there's no need to noodle
through the ghes_nmi list anymore. So panic instead right then and
there.
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
parent e10be03f
...@@ -837,9 +837,8 @@ static void __ghes_panic(struct ghes *ghes) ...@@ -837,9 +837,8 @@ static void __ghes_panic(struct ghes *ghes)
static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
{ {
struct ghes *ghes, *ghes_global = NULL; struct ghes *ghes;
int sev, sev_global = -1; int sev, ret = NMI_DONE;
int ret = NMI_DONE;
raw_spin_lock(&ghes_nmi_lock); raw_spin_lock(&ghes_nmi_lock);
list_for_each_entry_rcu(ghes, &ghes_nmi, list) { list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
...@@ -847,20 +846,17 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) ...@@ -847,20 +846,17 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
ghes_clear_estatus(ghes); ghes_clear_estatus(ghes);
continue; continue;
} }
sev = ghes_severity(ghes->estatus->error_severity); sev = ghes_severity(ghes->estatus->error_severity);
if (sev > sev_global) { if (sev >= GHES_SEV_PANIC)
sev_global = sev; __ghes_panic(ghes);
ghes_global = ghes;
}
ret = NMI_HANDLED; ret = NMI_HANDLED;
} }
if (ret == NMI_DONE) if (ret == NMI_DONE)
goto out; goto out;
if (sev_global >= GHES_SEV_PANIC)
__ghes_panic(ghes_global);
list_for_each_entry_rcu(ghes, &ghes_nmi, list) { list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
if (!(ghes->flags & GHES_TO_CLEAR)) if (!(ghes->flags & GHES_TO_CLEAR))
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment