]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cxl: Introduce callback for HPA address ranges translation
authorRobert Richter <rrichter@amd.com>
Wed, 14 Jan 2026 16:48:24 +0000 (17:48 +0100)
committerDave Jiang <dave.jiang@intel.com>
Tue, 3 Feb 2026 17:52:58 +0000 (10:52 -0700)
commita31af41115b0f7021a86f5439cb8720b93314f91
treecc402ebd7d2b1ba6ef6c42d96ce52654d8c70d80
parentd01149bbe76d81d360ed24853d5247fcaad873e4
cxl: Introduce callback for HPA address ranges translation

Introduce a callback to translate an endpoint's HPA range to the
address range of the root port which is the System Physical Address
(SPA) range used by a region. The callback can be set if a platform
needs to handle address translation.

The callback is attached to the root port. An endpoint's root port can
easily be determined in the PCI hierarchy without any CXL specific
knowledge. This allows the early use of address translation for CXL
enumeration. Address translation is esp. needed for the detection of
the root decoders. Thus, the callback is embedded in struct
cxl_root_ops instead of struct cxl_rd_ops.

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Tested-by: Gregory Price <gourry@gourry.net>
Signed-off-by: Robert Richter <rrichter@amd.com>
Link: https://patch.msgid.link/20260114164837.1076338-9-rrichter@amd.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/region.c
drivers/cxl/cxl.h