Skip to content

Commit

Permalink
GHES: Panic right after detection
Browse files Browse the repository at this point in the history
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: Borislav Petkov <bp@suse.de>
  • Loading branch information
suryasaimadhu committed Apr 27, 2015
1 parent e10be03 commit 6169ddf
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions drivers/acpi/apei/ghes.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,30 +837,26 @@ static void __ghes_panic(struct ghes *ghes)

static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
{
struct ghes *ghes, *ghes_global = NULL;
int sev, sev_global = -1;
int ret = NMI_DONE;
struct ghes *ghes;
int sev, ret = NMI_DONE;

raw_spin_lock(&ghes_nmi_lock);
list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
if (ghes_read_estatus(ghes, 1)) {
ghes_clear_estatus(ghes);
continue;
}

sev = ghes_severity(ghes->estatus->error_severity);
if (sev > sev_global) {
sev_global = sev;
ghes_global = ghes;
}
if (sev >= GHES_SEV_PANIC)
__ghes_panic(ghes);

ret = NMI_HANDLED;
}

if (ret == NMI_DONE)
goto out;

if (sev_global >= GHES_SEV_PANIC)
__ghes_panic(ghes_global);

list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
if (!(ghes->flags & GHES_TO_CLEAR))
continue;
Expand Down

0 comments on commit 6169ddf

Please sign in to comment.