Re: [PATCH 2/2] RAS/AMD/{ATL,FMPM}: Get masked address

Borislav Petkov
2025-04-07T13:24:26Z

On Tue, Apr 01, 2025 at 08:49:01PM +0000, Yazen Ghannam wrote:
> +u64 amd_atl_masked_addr(u64 addr)
> +{
> + /*
> + * Row retirement is done on MI300 systems, and some bits are 'don't care'
> + * for comparing addresses with unique physical rows.
> + * This includes all column bits and the row[13] bit.
> + */
> + if (df_cfg.rev == DF4p5 && df_cfg.flags.heterogeneous)
> + return addr & ~(MI300_UMC_MCA_ROW13 | MI300_UMC_MCA_COL);
> +
> + return addr;
> +}
> +EXPORT_SYMBOL_GPL(amd_atl_masked_addr);

Uff, an exported silly helper.

Make that static inline and stick into a header so that compiler can inline
and optimize.

And that header should be drivers/ras/amd/atl/internal.h

Also, the helper should be called "atl_mask_address()" or so as all our
functions have verbs in imperative tone.

> diff --git a/include/linux/ras.h b/include/linux/ras.h
> index a64182bc72ad..e822275bed6a 100644
> --- a/include/linux/ras.h
> +++ b/include/linux/ras.h

Internal helpers go into the internal header, not here.

Thx.

--
Regards/Gruss,
Boris.