Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions drivers/acpi/apei/ghes.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ static DEFINE_MUTEX(ghes_list_mutex);
static LIST_HEAD(ghes_devs);
static DEFINE_MUTEX(ghes_devs_mutex);

ATOMIC_NOTIFIER_HEAD(ghes_mem_err_chain);
EXPORT_SYMBOL_GPL(ghes_mem_err_chain);

/*
* Because the memory area used to transfer hardware error information
* from BIOS to Linux can be determined only in NMI, IRQ or timer
Expand Down Expand Up @@ -702,7 +705,13 @@ static bool ghes_do_proc(struct ghes *ghes,

if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
struct cper_sec_mem_err *mem_err = acpi_hest_get_payload(gdata);
struct ghes_mem_err mem;

mem.notify_type = ghes->generic->notify.type;
mem.severity = gdata->error_severity;
mem.mem_err = mem_err;

atomic_notifier_call_chain(&ghes_mem_err_chain, 0, &mem);
atomic_notifier_call_chain(&ghes_report_chain, sev, mem_err);

arch_apei_report_mem_error(sev, mem_err);
Expand Down
8 changes: 8 additions & 0 deletions include/acpi/ghes.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ int ghes_notify_sea(void);
static inline int ghes_notify_sea(void) { return -ENOENT; }
#endif

struct ghes_mem_err {
int notify_type;
int severity;
struct cper_sec_mem_err *mem_err;
};

extern struct atomic_notifier_head ghes_mem_err_chain;

struct notifier_block;
extern void ghes_register_report_chain(struct notifier_block *nb);
extern void ghes_unregister_report_chain(struct notifier_block *nb);
Expand Down
Loading