Re: [PATCH v6 13/42] x86/resctrl: Move resctrl types to a separate header

From: James Morse
Date: Fri Feb 28 2025 - 14:51:33 EST


Hi Reinette,

On 19/02/2025 23:29, Reinette Chatre wrote:
> On 2/7/25 10:17 AM, James Morse wrote:
>> When resctrl is fully factored into core and per-arch code, each arch
>> will need to use some resctrl common definitions in order to define its
>> own specializations and helpers. Following conventional practice, it
>> would be desirable to put the dependent arch definitions in an
>> <asm/resctrl.h> header that is included by the common <linux/resctrl.h>
>> header. However, this can make it awkward to avoid a circular
>> dependency between <linux/resctrl.h> and the arch header.
>>
>> To avoid such dependencies, move the affected common types and
>> constants into a new header that does not need to depend on
>> <linux/resctrl.h> or on the arch headers.
>>
>> The same logic applies to the monitor-configuration defines, move these
>> too.
>>
>> Some kind of enumeration for events is needed between the filesystem
>> and architecture code. Take the x86 definition as its convenient for
>> x86.
>>
>> The definition of enum resctrl_event_id is needed to allow the
>> architecture code to define resctrl_arch_mon_ctx_alloc() and
>> resctrl_arch_mon_ctx_free().
>>
>> The definition of enum resctrl_res_level is needed to allow the
>> architecture code to define resctrl_arch_set_cdp_enabled() and
>> resctrl_arch_get_cdp_enabled().
>>
>> The bits for mbm_local_bytes_config et al are ABI, and must be the same
>> on all architectures. These are documented in
>> Documentation/arch/x86/resctrl.rst
>>
>> The maintainers entry for these headers was missed when resctrl.h was
>> created. Add a wildcard entry to match both resctrl.h and
>> resctrl_types.h.

>> diff --git a/include/linux/resctrl_types.h b/include/linux/resctrl_types.h
>> new file mode 100644
>> index 000000000000..51c51a1aabfb
>> --- /dev/null
>> +++ b/include/linux/resctrl_types.h
>> @@ -0,0 +1,54 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +/*
>> + * Copyright (C) 2024 Arm Ltd.
>
> Please note year.

I've changed it.


[...]

> Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>


Thanks!

James