Re: [RFC PATCH 2/4] PCI/CXL: Populate and insert/remove pdev->coh_resource[]
From: Bowman, Terry
Date: Thu Oct 22 2026 - 16:27:01 EST
On 10/20/2026 3:41 AM, Ankit Agrawal wrote:
>>> +
>>> + *res = DEFINE_RES_NAMED_DESC(config->hpa_range.start,
>>> + range_len(&config->hpa_range),
>>> + "CXL coherent memory",
>>> + IORESOURCE_MEM, IORES_DESC_NONE);
>>> +
>>
>> On platforms using Normalized Addressing the Endpoint decoders contain DPA ranges. This
>> patch will then record DPA ranges as a result. Translating this requires call to prm_cxl_dpa_spa() ?
>> The challenge is the PRM in drivers/cxl/core/atl.c may not be initialized this early.
>>
>
> Yeah, good point. On the platforms that I used, the HDM are precommitted
> and have HPA. But I agree, the snapshot must not silently record a DPA.
>
> Is there an existing way to tell at this point that the endpoint decoder is
> DPA-based? If yes, I intend to fail close with coh_resource[] left unpopulated
> Or would you prefer populating lazily until translations are available?
>
Hi Ankit,
For an example, normalized decoding is detected in core/atl.c:cxl_prm_setup_root(). Of course
this runs much later after cxl_core is loaded. Normalized decoder targets have the following at
the Endpoint HDM target entries:
(hpa_range.start == cxled->dpa_res->start)
-Terry
>
>>> + conflict = insert_resource_conflict(&iomem_resource, res);
>>> + if (conflict) {
>>> + pci_warn(pdev,