Re: [PATCH v2 05/15] cxl/region: Calculate and store the SPA range of an endpoint
From: Gregory Price
Date: Thu Feb 20 2025 - 13:42:18 EST
On Tue, Feb 18, 2025 at 02:23:46PM +0100, Robert Richter wrote:
> To find the correct region and root port of an endpoint of a system
> needing address translation, the endpoint's HPA range must be
> translated to each of the parent port address ranges up to the root
> decoder.
>
> Calculate the SPA range using the newly introduced callback function
> port->to_hpa() that translates the decoder's HPA range to its parent
> port's HPA range of the next outer memory domain. Introduce the helper
> function cxl_port_calc_hpa() for this to calculate address ranges
> using the low-level port->to_hpa() callbacks. Determine the root port
> SPA range by iterating all the ports up to the root. Store the
> endpoint's SPA range for later use.
>
> Signed-off-by: Robert Richter <rrichter@xxxxxxx>
>
> + /*
> + * Address translation is only supported for auto-discovery of
> + * decoders. There is no need to support address translation
> + * here. That is, do not recalculate ctx.hpa_range here.
> + */
Can we at least add why translation is not supported / needed? Just
saying "there is no need" doesn't help devs after us understand the code.
With that change:
Reviewed-by: Gregory Price <gourry@xxxxxxxxxx>