Re: [PATCH v4 07/39] x86/resctrl: Add max_bw to struct resctrl_membw

From: Reinette Chatre
Date: Wed Aug 14 2024 - 00:00:46 EST


Hi James,

On 8/2/24 10:28 AM, James Morse wrote:
__rdt_get_mem_config_amd() and __get_mem_config_intel() both use
the default_ctrl property as a maximum value. This is because the
MBA schema works differently between these platforms. Doing this
complicates determining whether the default_ctrl property belongs
to the arch code, or can be derived from the schema format.

Add a max_bw property for AMD platforms to specify their maximum

"for AMD platforms" -> "for x86 platforms"?

MBA bandwidth. This isn't needed for other schema formats.

This will allow the default_ctrl to be generated from the schema
properties when it is needed.

Signed-off-by: James Morse <james.morse@xxxxxxx>
Tested-by: Carl Worth <carl@xxxxxxxxxxxxxxxxxxxxxx> # arm64

...

@@ -108,8 +108,9 @@ static int parse_bw(struct rdt_parse_data *data, struct resctrl_schema *s,
*/
static bool cbm_validate(char *buf, u32 *data, struct rdt_resource *r)
{
- unsigned long first_bit, zero_bit, val;
+ u32 supported_bits = BIT_MASK(r->cache.cbm_len + 1) - 1;

hmmm ... should this be:
u32 supported_bits = BIT_MASK(r->cache.cbm_len) - 1;

Reinette