Skip to content

Commit a2e7948

Browse files
Robert Richterdavejiang
authored andcommitted
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>
1 parent af74daf commit a2e7948

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

drivers/cxl/core/atl.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,24 @@ static int cxl_prm_setup_root(struct cxl_root *cxl_root, void *data)
154154
return -ENXIO;
155155
}
156156

157+
/*
158+
* The current kernel implementation does not support endpoint
159+
* setup with Normalized Addressing. It only translates an
160+
* endpoint's DPA to the SPA range of the host bridge.
161+
* Therefore, the endpoint address range cannot be determined,
162+
* making a non-auto setup impossible. If a decoder requires
163+
* address translation, reprogramming should be disabled and
164+
* the decoder locked.
165+
*
166+
* The BIOS, however, provides all the necessary address
167+
* translation data, which the kernel can use to reconfigure
168+
* endpoint decoders with normalized addresses. Locking the
169+
* decoders in the BIOS would prevent a capable kernel (or
170+
* other operating systems) from shutting down auto-generated
171+
* regions and managing resources dynamically.
172+
*/
173+
cxld->flags |= CXL_DECODER_F_LOCK;
174+
157175
ctx->hpa_range = hpa_range;
158176
ctx->interleave_ways = ways;
159177
ctx->interleave_granularity = gran;

0 commit comments

Comments
 (0)