Currently driver only trace cxl events, poison injection on cxl memdev is silent. OS needs to be notified then it could handle poison range in time. Per CXL spec, the device error event could be signaled through FW-First and OS-First methods.
This draft patchset adds poison event handler in OS-First method: - qemu: - CXL device report POISON event to OS by MSI by sending GMER after injecting a poison record - CXL driver a. read the POISON event through GMER; b. get POISON list; c. translate DPA to HPA; d. construct a mce instance, then call mce_log() to queue this mce instance; This patchset includes 2 patches for qemu, 5 patches for cxl driver. Shiyang Ruan (5): cxl/core: correct length of DPA field masks cxl/core: introduce cxl_memdev_dpa_to_hpa() cxl/core: introduce cxl_mem_report_poison() cxl/core: add report option for cxl_mem_get_poison() cxl/core: add poison injection event handler arch/x86/kernel/cpu/mce/core.c | 1 + drivers/cxl/core/mbox.c | 82 +++++++++++++++++++++++++++------- drivers/cxl/core/memdev.c | 16 ++++++- drivers/cxl/core/region.c | 8 ++-- drivers/cxl/core/trace.h | 6 +-- drivers/cxl/cxlmem.h | 11 ++--- drivers/cxl/pci.c | 4 +- 7 files changed, 97 insertions(+), 31 deletions(-) -- 2.34.1