Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
BACKPORT: ACPI / APEI: Remove silent flag from ghes_read_estatus()
Browse files Browse the repository at this point in the history
Subsequent patches will split up ghes_read_estatus(), at which
point passing around the 'silent' flag gets annoying. This is to
suppress prink() messages, which prior to commit 42a0bb3f7138
("printk/nmi: generic solution for safe printk in NMI"), were
unsafe in NMI context.

This is no longer necessary, remove the flag. printk() messages
are batched in a per-cpu buffer and printed via irq-work, or a call
back from panic().

This patch is needed because Quicksilver firmware-first error handling
uses the SDEI notification type for communication between trusted
firmware and the OS. This adds needed NMI and SDEI functionality so
that the SDEI path in the kernel through APEI acts as an NMI and is
properly wired up to the APEI interfaces.

Backported from: torvalds/linux@93066e9

Signed-off-by: James Morse <[email protected]>
Reviewed-by: Borislav Petkov <[email protected]>
Signed-off-by: Tyler Baicar <[email protected]>
  • Loading branch information
James Morse authored and tphan-ampere committed Apr 21, 2020
1 parent d2e5e81 commit 460f959
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions drivers/acpi/apei/ghes.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len,
}
}

static int ghes_read_estatus(struct ghes *ghes, int silent)
static int ghes_read_estatus(struct ghes *ghes)
{
struct acpi_hest_generic *g = ghes->generic;
u64 buf_paddr;
Expand All @@ -333,8 +333,7 @@ static int ghes_read_estatus(struct ghes *ghes, int silent)

rc = apei_read(&buf_paddr, &g->error_status_address);
if (rc) {
if (!silent && printk_ratelimit())
pr_warning(FW_WARN GHES_PFX
pr_warn_ratelimited(FW_WARN GHES_PFX
"Failed to read error status block address for hardware error source: %d.\n",
g->header.source_id);
return -EIO;
Expand Down Expand Up @@ -366,9 +365,9 @@ static int ghes_read_estatus(struct ghes *ghes, int silent)
rc = 0;

err_read_block:
if (rc && !silent && printk_ratelimit())
pr_warning(FW_WARN GHES_PFX
"Failed to read error status block!\n");
if (rc)
pr_warn_ratelimited(FW_WARN GHES_PFX
"Failed to read error status block!\n");
return rc;
}

Expand Down Expand Up @@ -702,7 +701,7 @@ static int ghes_proc(struct ghes *ghes)
{
int rc;

rc = ghes_read_estatus(ghes, 0);
rc = ghes_read_estatus(ghes);
if (rc)
goto out;

Expand Down Expand Up @@ -939,7 +938,7 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
return ret;

list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
if (ghes_read_estatus(ghes, 1)) {
if (ghes_read_estatus(ghes)) {
ghes_clear_estatus(ghes);
continue;
} else {
Expand Down

0 comments on commit 460f959

Please sign in to comment.