]> www.infradead.org Git - users/hch/misc.git/commitdiff
cxl/trace: Subtract to find an hpa_alias0 in cxl_poison events
authorAlison Schofield <alison.schofield@intel.com>
Tue, 14 Oct 2025 21:38:49 +0000 (14:38 -0700)
committerDave Jiang <dave.jiang@intel.com>
Tue, 14 Oct 2025 21:48:14 +0000 (14:48 -0700)
Traces of cxl_poison events include an hpa_alias0 field if the poison
address is in a region configured with an ELC, Extended Linear Cache.

Since the ELC always comes first in the region, the calculation needs
to subtract the ELC size from the calculated HPA address.

Fixes: 8c520c5f1e76 ("cxl: Add extended linear cache address alias emission for cxl events")
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/trace.h

index a53ec4798b12fbf7aa6e66af0130ac656b38122f..a972e4ef1936869980c1b9e00c42fd6f8e48ce2e 100644 (file)
@@ -1068,7 +1068,7 @@ TRACE_EVENT(cxl_poison,
                        __entry->hpa = cxl_dpa_to_hpa(cxlr, cxlmd,
                                                      __entry->dpa);
                        if (__entry->hpa != ULLONG_MAX && cxlr->params.cache_size)
-                               __entry->hpa_alias0 = __entry->hpa +
+                               __entry->hpa_alias0 = __entry->hpa -
                                                      cxlr->params.cache_size;
                        else
                                __entry->hpa_alias0 = ULLONG_MAX;