]> asedeno.scripts.mit.edu Git - linux.git/commit
ACPI / APEI: Don't store CPER records physical address in struct ghes
authorJames Morse <james.morse@arm.com>
Tue, 29 Jan 2019 18:48:42 +0000 (18:48 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Feb 2019 22:10:45 +0000 (23:10 +0100)
commiteeb2555779471abdbcc6289a52dc54ce513feaf2
treee2754b4d4c6709020b2c5a1d1d2f77dabeeec91b
parentfb7be08f1a091ec243780bfdad4bf0c492057808
ACPI / APEI: Don't store CPER records physical address in struct ghes

When CPER records are found the address of the records is stashed
in the struct ghes. Once the records have been processed, this
address is overwritten with zero so that it won't be processed
again without being re-populated by firmware.

This goes wrong if a struct ghes can be processed concurrently,
as can happen at probe time when an NMI occurs. If the NMI arrives
on another CPU, the probing CPU may call ghes_clear_estatus() on the
records before the handler had finished with them.
Even on the same CPU, once the interrupted handler is resumed, it
will call ghes_clear_estatus() on the NMIs records, this memory may
have already been re-used by firmware.

Avoid this stashing by letting the caller hold the address. A
later patch will do away with the use of ghes->flags in the
read/clear code too.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/apei/ghes.c
include/acpi/ghes.h