acpi/ghes: Process CXL Component Events
authorIra Weiny <ira.weiny@intel.com>
Thu, 21 Dec 2023 00:17:34 +0000 (16:17 -0800)
committerDan Williams <dan.j.williams@intel.com>
Tue, 9 Jan 2024 23:41:23 +0000 (15:41 -0800)
commit671a794c33c6e048ca5cedd5ad6af44d52d5d7e5
tree816febc7c9bea829769288c2dbb067579520c1d6
parentf9c683386f5bc0364615138ce2b14be50848dbcf
acpi/ghes: Process CXL Component Events

BIOS can configure memory devices as firmware first.  This will send CXL
events to the firmware instead of the OS.  The firmware can then send
these events to the OS via UEFI.

UEFI v2.10 section N.2.14 defines a Common Platform Error Record (CPER)
format for CXL Component Events.  The format is mostly the same as the
CXL Common Event Record Format.  The difference is the use of a GUID in
the Section Type rather than a UUID as part of the event itself.

Add GHES support to detect CXL CPER records and call a registered
callback with the event.

A notifier chain was considered for the callback but the complexity did
not justify the use case as only the CXL subsystem requires this event.
Enforce that only one callback can be registered at any time.

Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20231220-cxl-cper-v5-7-1bb8a4ca2c7a@intel.com
[djbw: fixup checkpatch errors]
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/acpi/apei/ghes.c
include/linux/cxl-event.h