]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cxl: Define a SPA->CXL HPA root decoder callback for XOR Math
authorAlison Schofield <alison.schofield@intel.com>
Mon, 4 Aug 2025 08:00:10 +0000 (01:00 -0700)
committerDave Jiang <dave.jiang@intel.com>
Tue, 12 Aug 2025 23:02:00 +0000 (16:02 -0700)
commitb83ee9614a3ec196111f0ae54335b99700f78b45
tree26b191bc267acc93c2fb047a36286a1fe3a67229
parent524b2b76f365fb90a7f894ac17261ea760464e2c
cxl: Define a SPA->CXL HPA root decoder callback for XOR Math

When DPA->SPA translation was introduced, it included a helper that
applied the XOR maps to do the CXL HPA -> SPA translation for XOR
region interleaves. In preparation for adding SPA->DPA address
translation, introduce the reverse callback.

The root decoder callback is defined generically and not all usages
may be self inverting like this XOR function. Add another root decoder
callback that is the spa_to_hpa function.

Update the existing cxl_xor_hpa_to_spa() with a name that reflects
what it does without directionality: cxl_apply_xor_maps(), a generic
parameter: addr replaces hpa, and code comments stating that the
function supports the translation in either direction.

Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/79d9d72230c599cae94d7221781ead6392ae6d3f.1754290144.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/acpi.c
drivers/cxl/cxl.h