Skip to contentSkip to conversation

cxl/trace: Subtract to find an hpa_alias0 in cxl_poison events

PATCH Applied Alison Schofield 2 participants 3 messages Oct 14, 2025 CXL

lore
Share & tools
lore

Alison Schofield

author maintainer
#0 lore raw

PATCH 1/1 cxl/trace: Subtract to find an hpa_alias0 in cxl_poison events

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")
---
 drivers/cxl/core/trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core/trace.h +1 -1
index a53ec4798b12..a972e4ef1936 100644
@@ -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;

base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787

Signature · 1 line
2.37.3
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Alison Schofield

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")

Good catch

Quoted 18 lines
 drivers/cxl/core/trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core/trace.h +1 -1
index a53ec4798b12..a972e4ef1936 100644
@@ -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;

base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787

maintainer Applied
#2 lore raw
In reply to Alison Schofield
Quoted 8 lines · Alison Schofield

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")

applied to cxl/fixes

Quoted 19 lines
---
 drivers/cxl/core/trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core/trace.h +1 -1
index a53ec4798b12..a972e4ef1936 100644
@@ -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;

base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787