Re: [PATCH v7 29/49] x86/resctrl: Move get_config_index() to a header

Fenghua Yu
2025-03-06T22:00:37Z

On 2/28/25 11:58, James Morse wrote:
> get_config_index() is used by the architecture specific code to map a
> CLOSID+type pair to an index in the configuration arrays.
>
> MPAM needs to do this too to preserve the ABI to user-space, there is
> no reason to do it differently.
>
> Move the helper to a header file to allow all architectures that either
> use or emulate CDP to use the same pattern of CLOSID values. Moving
> this to a header file means it must be marked inline, which matches
> the existing compiler choice for this static function.
>
> Co-developed-by: Dave Martin <Dave.Martin@arm.com>
> Signed-off-by: Dave Martin <Dave.Martin@arm.com>
> Signed-off-by: James Morse <james.morse@arm.com>
> Tested-by: Carl Worth <carl@os.amperecomputing.com> # arm64
> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
> Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Fenghua Yu <fenghuay@nvidia.com>

Thanks.

-Fenghua