lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0770f2db-2def-4cca-8e20-9bb864a46511@intel.com>
Date: Tue, 22 Jul 2025 07:56:27 -0700
From: Reinette Chatre <reinette.chatre@...el.com>
To: <babu.moger@....com>, <corbet@....net>, <tony.luck@...el.com>,
	<james.morse@....com>, <tglx@...utronix.de>, <mingo@...hat.com>,
	<bp@...en8.de>, <dave.hansen@...ux.intel.com>
CC: <Dave.Martin@....com>, <x86@...nel.org>, <hpa@...or.com>,
	<akpm@...ux-foundation.org>, <paulmck@...nel.org>, <rostedt@...dmis.org>,
	<Neeraj.Upadhyay@....com>, <david@...hat.com>, <arnd@...db.de>,
	<fvdl@...gle.com>, <seanjc@...gle.com>, <jpoimboe@...nel.org>,
	<pawan.kumar.gupta@...ux.intel.com>, <xin@...or.com>,
	<manali.shukla@....com>, <tao1.su@...ux.intel.com>, <sohil.mehta@...el.com>,
	<kai.huang@...el.com>, <xiaoyao.li@...el.com>, <peterz@...radead.org>,
	<xin3.li@...el.com>, <kan.liang@...ux.intel.com>,
	<mario.limonciello@....com>, <thomas.lendacky@....com>, <perry.yuan@....com>,
	<gautham.shenoy@....com>, <chang.seok.bae@...el.com>,
	<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<peternewman@...gle.com>, <eranian@...gle.com>
Subject: Re: [PATCH v15 21/34] x86/resctrl: Refactor resctrl_arch_rmid_read()

Hi Babu,

On 7/22/25 7:23 AM, Moger, Babu wrote:
> Hi Reinette,
> 
> 
> On 7/17/25 22:51, Reinette Chatre wrote:
>> Hi Babu,
>>
>> On 7/8/25 3:17 PM, Babu Moger wrote:
>>> resctrl_arch_rmid_read() modifies the value obtained from MSR_IA32_QM_CTR
>>> to account for overflow. This adjustment is common to both
>>
>> The portion factored out does not just handle MBM overflow counts but also
>> handles counter scaling for *all* events, including cache occupancy.
> 
> Yes. Got it. thanks
> 
>>
>>> resctrl_arch_rmid_read() and resctrl_arch_cntr_read().
>>>
>>> To prepare for the implementation of resctrl_arch_cntr_read(), refactor
>>> this logic into a new function called mbm_corrected_val().
>>
>> This thus cannot be made specific to MBM. More accurate may be
>> get_corrected_val().
> 
> Sure.
> 
> Rephrased the changelog.
> 
> x86/resctrl: Refactor resctrl_arch_rmid_read()
> 
> resctrl_arch_rmid_read() modifies the value obtained from MSR_IA32_QM_CTR

"modifies" -> "adjusts"?

> to account for the overflow for MBM events and apply counter scaling for
> all the events. This logic is common to both resctrl_arch_rmid_read() and
> resctrl_arch_cntr_read().

This may not be obvious since resctrl_arch_cntr_read() does not exist at this
point in the series. Perhaps just make it a bit higher level, for example:
"This logic is common to both reading an RMID and reading a hardware counter
directly."

> 
> To prepare for the implementation of resctrl_arch_cntr_read(), refactor
> this logic into a new function called get_corrected_val().

No need for "function" when using (). Could be :
"Refactor the hardware value adjustment logic into get_corrected_val() to
prepare for support of reading a hardware counter."?

Reinette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ