Skip to content

Commit b6cfddd

Browse files
committed
cxl: Adjust offset calculation for poison injection
The HPA to DPA translation for poison injection assumes that the base address starts from where the CXL region begins. When the extended linear cache is active, the offset can be within the DRAM region. Adjust the offset so that it correctly reflects the offset within the CXL region. [ dj: Add fixes tag from Alison ] Fixes: c3dd676 ("cxl/region: Add inject and clear poison by region offset") Link: https://patch.msgid.link/20251031173224.3537030-5-dave.jiang@intel.com Reviewed-by: Alison Schofield <alison.schofield@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent 7c3643f commit b6cfddd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/cxl/core/region.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3702,6 +3702,7 @@ static int cxl_region_debugfs_poison_inject(void *data, u64 offset)
37023702
if (validate_region_offset(cxlr, offset))
37033703
return -EINVAL;
37043704

3705+
offset -= cxlr->params.cache_size;
37053706
rc = region_offset_to_dpa_result(cxlr, offset, &result);
37063707
if (rc || !result.cxlmd || result.dpa == ULLONG_MAX) {
37073708
dev_dbg(&cxlr->dev,
@@ -3734,6 +3735,7 @@ static int cxl_region_debugfs_poison_clear(void *data, u64 offset)
37343735
if (validate_region_offset(cxlr, offset))
37353736
return -EINVAL;
37363737

3738+
offset -= cxlr->params.cache_size;
37373739
rc = region_offset_to_dpa_result(cxlr, offset, &result);
37383740
if (rc || !result.cxlmd || result.dpa == ULLONG_MAX) {
37393741
dev_dbg(&cxlr->dev,

0 commit comments

Comments
 (0)