cxl/core: Add region info to cxl_general_media and cxl_dram events
authorAlison Schofield <alison.schofield@intel.com>
Tue, 30 Apr 2024 17:28:06 +0000 (10:28 -0700)
committerDave Jiang <dave.jiang@intel.com>
Tue, 30 Apr 2024 19:24:44 +0000 (12:24 -0700)
commit6aec00139d3a83e2394d4bcb0084e872b4036e8f
tree86a0e0c7aad0a64ce9efd90b608b3bbf524428af
parent86954ff5032d9d60a5458334001ab3ae3b2c45e8
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>
drivers/cxl/core/mbox.c
drivers/cxl/core/trace.h
include/linux/cxl-event.h