summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Richter <rrichter@amd.com>2026-01-14 17:48:27 +0100
committerDave Jiang <dave.jiang@intel.com>2026-02-04 09:17:31 -0700
commita2e794895089c1356b7687e8df1fa7d224d40bb6 (patch)
treeac52326d76d43a0daa807529410de8ce53327db2
parentaf74daf91652f15b82560bb93850d2ec8bbfa976 (diff)
cxl/atl: Lock decoders that need address translation
The current kernel implementation does not support endpoint setup with Normalized Addressing. It only translates an endpoint's DPA to the SPA range of the host bridge. Therefore, the endpoint address range cannot be determined, making a non-auto setup impossible. If a decoder requires address translation, reprogramming should be disabled and the decoder locked. The BIOS, however, provides all the necessary address translation data, which the kernel can use to reconfigure endpoint decoders with normalized addresses. Locking the decoders in the BIOS would prevent a capable kernel (or other operating systems) from shutting down auto-generated regions and managing resources dynamically. Reviewed-by: Gregory Price <gourry@gourry.net> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Tested-by: Gregory Price <gourry@gourry.net> Signed-off-by: Robert Richter <rrichter@amd.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com>> --- Link: https://patch.msgid.link/20260114164837.1076338-12-rrichter@amd.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
-rw-r--r--drivers/cxl/core/atl.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/cxl/core/atl.c b/drivers/cxl/core/atl.c
index c36984686fb0..09d0ea1792d9 100644
--- a/drivers/cxl/core/atl.c
+++ b/drivers/cxl/core/atl.c
@@ -154,6 +154,24 @@ static int cxl_prm_setup_root(struct cxl_root *cxl_root, void *data)
return -ENXIO;
}
+ /*
+ * The current kernel implementation does not support endpoint
+ * setup with Normalized Addressing. It only translates an
+ * endpoint's DPA to the SPA range of the host bridge.
+ * Therefore, the endpoint address range cannot be determined,
+ * making a non-auto setup impossible. If a decoder requires
+ * address translation, reprogramming should be disabled and
+ * the decoder locked.
+ *
+ * The BIOS, however, provides all the necessary address
+ * translation data, which the kernel can use to reconfigure
+ * endpoint decoders with normalized addresses. Locking the
+ * decoders in the BIOS would prevent a capable kernel (or
+ * other operating systems) from shutting down auto-generated
+ * regions and managing resources dynamically.
+ */
+ cxld->flags |= CXL_DECODER_F_LOCK;
+
ctx->hpa_range = hpa_range;
ctx->interleave_ways = ways;
ctx->interleave_granularity = gran;