Re: [RFC] mpam,x86,fs/resctrl: Generic schema description Proof of Concept

From: Ben Horgan

Date: Thu Jul 02 2026 - 10:27:36 EST


Hi Chenyu,

On 6/26/26 16:46, Chen, Yu C wrote:
> Hi Reinette,
>
> On 6/11/2026 11:45 PM, Reinette Chatre wrote:
>> Hi Chenyu,
>>
>> On 6/10/26 8:26 PM, Chen, Yu C wrote:
>>> On 6/10/2026 11:59 PM, Reinette Chatre wrote:
>>> [ ... ]
>>>
>>>>
>>>> -  This implies that all current and future ERDT capable systems
>>>> will keep
>>>>      supporting MSR access with the legacy "percentage based
>>>> control". Is this
>>>>      accurate? What will behavior be on an ERDT system that does not
>>>> support
>>>>      MSR access with the percentage-based control?
>>>
>>> Would it make sense to encourage users to switch to MMIO-based access
>>> if the
>>> platform replaces MSR interfaces with MMIO-based ones? One issue with
>>> emulating
>>> MSR-based access is that there may not be a strict 1:1 mapping
>>> between the MSR
>>> range and the MMIO range. Additionally, I am unsure whether both are
>>> strictly
>>> linearly scalable, so it could be challenging to create a proper
>>> mapping for
>>> msr_value_emulated = map(mmio_value) IIUC.
>>
>> resctrl needs to continue to offer the MB percentage based control to
>> not break any
>> existing tools that may take a while to transition to the new control
>> interface.
>>
>> I believe all architectures will encourage their users to use the
>> finer grained
>> controls while I also expect users and their tools would gradually
>> switch by themselves
>> to benefit from the improved capabilities.
>>
>
> The following are current thoughts on how Control B can emulate Control A.
> May I know if this direction is acceptable?
>
> The main idea is that, Legacy MBA controller delegates to region-aware MBA
> controller via a pointer, with its hw_update function converting
> percentages
> to the target's value range.
>
> struct resctrl_hw_ctrl {
>     struct resctrl_ctrl  r_ctrl;
>     unsigned int         msr_base;
>     void                 (*hw_update)(struct hw_param *m);
>     /* points to the backing controller */
>     struct resctrl_ctrl  *r_ctrl_emul;  <-- newly added
> };

What's the reason for this being in the architecture specific code? I
would expect that the resctrl core code would need to know about any
emulation even if the exact emulation is architecture specific?

Thanks,

Ben

>
> On boot, region-aware controllers shall be created first, followed by the
> legacy MBA controller. When ERDT is enabled for legacy MBA, hw_update is
> assigned to mba_emul_update() instead of mba_wrmsr_intel(). Meanwhile,
> r_ctrl_emul points to the MAX controller of region0.
>
> In mba_emul_update(), the legacy MSR value is scaled to the range of
> region0
> MAX controller by referencing r_ctrl_emul->membw.max_bw and r_ctr_emul-
>>membw.min_bw.
> This maps the original input range [1, 100] to a new range [1, L], where
> L <= 255.
>
> This emulation logic can also be extended to other controllers.
>
> thanks,
> Chenyu
>
>
>