Skip to content

Commit

Permalink
GHES: Carve out the panic functionality
Browse files Browse the repository at this point in the history
... into another function for more clarity. No functionality change.

Signed-off-by: Borislav Petkov <bp@suse.de>
  • Loading branch information
suryasaimadhu committed Apr 27, 2015
1 parent 1156849 commit e10be03
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions drivers/acpi/apei/ghes.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,18 @@ static void __process_error(struct ghes *ghes)
#endif
}

static void __ghes_panic(struct ghes *ghes)
{
oops_begin();
ghes_print_queued_estatus();
__ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus);

/* reboot to log the error! */
if (panic_timeout == 0)
panic_timeout = ghes_panic_timeout;
panic("Fatal hardware error!");
}

static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
{
struct ghes *ghes, *ghes_global = NULL;
Expand All @@ -846,16 +858,8 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
if (ret == NMI_DONE)
goto out;

if (sev_global >= GHES_SEV_PANIC) {
oops_begin();
ghes_print_queued_estatus();
__ghes_print_estatus(KERN_EMERG, ghes_global->generic,
ghes_global->estatus);
/* reboot to log the error! */
if (panic_timeout == 0)
panic_timeout = ghes_panic_timeout;
panic("Fatal hardware error!");
}
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))
Expand Down

0 comments on commit e10be03

Please sign in to comment.