Re: [PATCH v2 0/5] Address translation for HDM decoding
From: Robert Richter
Date: Thu Jul 11 2024 - 15:03:26 EST
Alison,
On 10.07.24 17:02:46, Alison Schofield wrote:
> This HPA->SPA work needs to be done for addresses reported directly by
> devices, ie DPAs in poison and other events - right?
we need it to translate the base address of the HDM decoder cap
registers or the range registers to an HPA when accessing it.
> For the XOR case, we discover the need for HPA->SPA while parsing the
> CFMWS and add a cxl_hpa_to_spa_fn to the struct cxl_root_decoder. Later,
As some platforms allow an even more fine grained HPA/SPA mapping that
may devide a memory domain in separate SPA ranges we might just want
to move it directly into struct cxl_decoder so that endpoints or
switches can use it too.
> when the driver wants to translate a DPA (to include in a TRACE_EVENT)
> it uses that 'extra mile' HPA->SPA function.
>
> See Patch 2 in this series:
> https://lore.kernel.org/cover.1719980933.git.alison.schofield@xxxxxxxxx/T/#m9206e1f872ef252dbb54ce7f0365f0b267179fda
>
> It seems the Zen4 extra mile is a simple offset from the base calc.
> Do you think a zen4 hpa->spa function will fit in with what I've done?
Thanks for the pointer, I will take look into the details here and try
to reuse most of that infrastructure.
>
> FWIW I took this code for a spin through cxl-test on it's own and combined
> w the xor address tranlation patch set and no collisions, all humming along
> nicely (for non-zen config).
Thanks,
-Robert