ACPI / APEI: Only use queued estatus entry during in_nmi_queue_one_entry()
authorJames Morse <james.morse@arm.com>
Tue, 29 Jan 2019 18:48:56 +0000 (18:48 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Feb 2019 22:10:46 +0000 (23:10 +0100)
commitd9f608dc156487b55cb17c2ec591b06e53a6de64
tree331916d7834f21e539d6308f9737b5319cceedf4
parente00a6e3392cb623b7ac4d61c5e1c1234b4520cad
ACPI / APEI: Only use queued estatus entry during in_nmi_queue_one_entry()

Each struct ghes has an worst-case sized buffer for storing the
estatus. If an error is being processed by ghes_proc() in process
context this buffer will be in use. If the error source then triggers
an NMI-like notification, the same buffer will be used by
in_nmi_queue_one_entry() to stage the estatus data, before
__process_error() copys it into a queued estatus entry.

Merge __process_error()s work into in_nmi_queue_one_entry() so that
the queued estatus entry is used from the beginning. Use the new
ghes_peek_estatus() to know how much memory to allocate from
the ghes_estatus_pool before reading the records.

Reported-by: Borislav Petkov <bp@suse.de>
Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Borislav Petkov <bp@suse.de>
Change since v6:
 * Added a comment explaining the 'ack-error, then goto no_work'.
 * Added missing esatus-clearing, which is necessary after reading the GAS,
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/apei/ghes.c