cxl/region: Provide region info to the cxl_poison trace event
authorAlison Schofield <alison.schofield@intel.com>
Tue, 18 Apr 2023 17:39:07 +0000 (10:39 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sun, 23 Apr 2023 18:46:06 +0000 (11:46 -0700)
commitf0832a58639691af575fa28ffaeb657c51f3ca06
treec65835aaa444e052ccd27077e3096548e864d0ee
parent7ff6ad1075885fdc71f6fea94b95109a582dec29
cxl/region: Provide region info to the cxl_poison trace event

User space may need to know which region, if any, maps the poison
address(es) logged in a cxl_poison trace event. Since the mapping
of DPAs (device physical addresses) to a region can change, the
kernel must provide this information at the time the poison list
is read. The event informs user space that at event <timestamp>
this <region> mapped to this <DPA>, which is poisoned.

The cxl_poison trace event is already wired up to log the region
name and uuid if it receives param 'struct cxl_region'.

In order to provide that cxl_region, add another method for gathering
poison - by committed endpoint decoder mappings. This method is only
available with CONFIG_CXL_REGION and is only used if a region actually
maps the memdev where poison is being read. After the region driver
reads the poison list for all the mapped resources, poison is read for
any remaining unmapped resources.

The default method remains: read the poison by memdev resource.

Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/438b01ccaa70592539e8eda4eb2b1d617ba03160.1681838292.git.alison.schofield@intel.com
Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/core.h
drivers/cxl/core/memdev.c
drivers/cxl/core/region.c