Re: [RFC PATCH 2/4] PCI/CXL: Populate and insert/remove pdev->coh_resource[]
From: Ankit Agrawal
Date: Sat Oct 24 2026 - 03:51:47 EST
>>>> +
>>>> + *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)
Thanks Terry for the suggestion. Should we be using
CXL_DECODER_F_NORMALIZED_ADDRESSING (set in the cxl_prm_setup_root)
instead of the hpa_range.start == cxled->dpa_res->start check?
>-Terry