summaryrefslogtreecommitdiff
path: root/include/linux/cxl-event.h
diff options
context:
space:
mode:
authorAlison Schofield <alison.schofield@intel.com>2024-04-30 10:28:06 -0700
committerDave Jiang <dave.jiang@intel.com>2024-04-30 12:24:44 -0700
commit6aec00139d3a83e2394d4bcb0084e872b4036e8f (patch)
tree86a0e0c7aad0a64ce9efd90b608b3bbf524428af /include/linux/cxl-event.h
parent86954ff5032d9d60a5458334001ab3ae3b2c45e8 (diff)
downloadlwn-6aec00139d3a83e2394d4bcb0084e872b4036e8f.tar.gz
lwn-6aec00139d3a83e2394d4bcb0084e872b4036e8f.zip
cxl/core: Add region info to cxl_general_media and cxl_dram events
User space may need to know which region, if any, maps the DPAs (device physical addresses) reported in a cxl_general_media or cxl_dram event. Since the mapping can change, the kernel provides this information at the time the event occurs. This informs user space that at event <timestamp> this <region> mapped this <DPA> to this <HPA>. Add the same region info that is included in the cxl_poison trace event: the DPA->HPA translation, region name, and region uuid. The new fields are inserted in the trace event and no existing fields are modified. If the DPA is not mapped, user will see: hpa=ULLONG_MAX, region="", and uuid=0 This work must be protected by dpa_rwsem & region_rwsem since it is looking up region mappings. Signed-off-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/dd8d708b7a7ebfb64a27020a5eb338091336b34d.1714496730.git.alison.schofield@intel.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Diffstat (limited to 'include/linux/cxl-event.h')
-rw-r--r--include/linux/cxl-event.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/cxl-event.h b/include/linux/cxl-event.h
index 03fa6d50d46f..5342755777cc 100644
--- a/include/linux/cxl-event.h
+++ b/include/linux/cxl-event.h
@@ -91,11 +91,21 @@ struct cxl_event_mem_module {
u8 reserved[0x3d];
} __packed;
+/*
+ * General Media or DRAM Event Common Fields
+ * - provides common access to phys_addr
+ */
+struct cxl_event_common {
+ struct cxl_event_record_hdr hdr;
+ __le64 phys_addr;
+} __packed;
+
union cxl_event {
struct cxl_event_generic generic;
struct cxl_event_gen_media gen_media;
struct cxl_event_dram dram;
struct cxl_event_mem_module mem_module;
+ struct cxl_event_common common;
} __packed;
/*