Re: [PATCH v1 18/31] x86/resctrl: Allow resctrl_arch_mon_event_config_write() to return an error

James Morse
2024-06-14T13:58:00Z

Hi Reinette,

On 09/04/2024 04:23, Reinette Chatre wrote:
> On 3/21/2024 9:50 AM, James Morse wrote:
>> resctrl_arch_mon_event_config_write() writes a bitmap of events provided
>> by user-space into the configuration register for the monitors.
>>
>> This assumes that all architectures support all the features each bit
>> corresponds to.
>>
>> MPAM can filter monitors based on read, write, or both, but there are
>> many more options in the existing bitmap. To allow this interface to
>> work for machines with MPAM, allow the architecture helper to return
>> an error if an incompatible bitmap is set.
>>
>> When valid values are provided, there is no change in behaviour. If
>> an invalid value is provided, currently it is silently ignored, but
>> last_cmd_status is updated. After this change, the parser will stop
>> at the first invalid value and return an error to user-space. This
>> matches the way changes to the schemata file are made.
>>
>
> Is this needed? With move of mbm_cfg_mask to rdt_resource I expect
> MPAM would use it to set what the valid values are. With that done,
> when user space provides a value, mon_config_write() compares user
> provided value against mbm_cfg_mask and will already return early
> (before attempting to write to hardware) with error
> if value is not supported. This seems to accomplish the goal of this
> patch?

Aha, this is done in mon_config_write(), not mbm_config_write_domain(). I'd missed that.
I'll drop this patch.

Thanks!

James