Re: RE: RE: [PATCH 1/2] x86/resctrl, Documentation: Keep mbm_assign_mode "default" on boot
Babu Moger <[email protected]>
| Newsgroups | org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
Hi Tony,
On 7/28/26 15:24, Luck, Tony wrote:
>>> 1) Does it start over from zero?
>>> Seems a sane option.
>>> 2) Or does the monitor group see whatever the counter was at
>>> when being used by some other group?
>>> Seems less sane.
>>
>> As per this code, it should start over from 0.
>>
>> } else if (ret == -EINVAL) {
>> am = get_arch_mbm_state(hw_dom, rmid, eventid);
>> if (am)
>> am->prev_msr = 0;
>> }
>
> Nope. If you want the value reported to the user to start over from zero,
> then prev_msr should be set to the current value of the counter. That
> would make the next read start from zero.
>
When an RMID is reallocated, the hardware detects the state transition
and the first read returns "Unavailable". At that point, the counter is
reset and begins counting again from 0. This is the expected behavior on
AMD systems. Therefore, setting prev_msr to 0 is the correct behavior.
Thanks
Babu