Re: [PATCH v2 3/5] cxl/acpi: Add platform flag for HPA address translation

From: Robert Richter
Date: Sat Jul 13 2024 - 03:42:12 EST


On 11.07.24 18:27:30, Dan Williams wrote:
> Robert Richter wrote:
> > Adding an early check to detect platform specifics to (later) enable
> > HPA address translation. The cxl_root structure is used to store that
> > information.
> >
> > Note: The platform check will be added later when enabling address
> > translation.
>
> It feels odd to have a flag at the root for this because the translation
> is at the host-bridge level, right?
>
> I was more thinking of a solution that does:
>
> spa = cxld_hpa_to_spa(cxld);
>
> ...and then internal to that the code walks the port hierarchy from it's
> host port to the host bridge. Then does something like
>
> hb->hpa_to_spa(hb, hpa)
>
> Where @hb is:
>
> struct cxl_hb {
> struct cxl_port port;
> u64 (*hpa_to_spa)(struct cxl_hb *, u64);
> }

Ok, will consider that for the rework.

-Robert