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]
Date: Thu, 2 May 2024 17:21:26 +0100
From: Dave Martin <Dave.Martin@....com>
To: Babu Moger <babu.moger@....com>
Cc: corbet@....net, fenghua.yu@...el.com, reinette.chatre@...el.com,
	tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
	dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
	paulmck@...nel.org, rdunlap@...radead.org, tj@...nel.org,
	peterz@...radead.org, yanjiewtw@...il.com, kim.phillips@....com,
	lukas.bulwahn@...il.com, seanjc@...gle.com, jmattson@...gle.com,
	leitao@...ian.org, jpoimboe@...nel.org, rick.p.edgecombe@...el.com,
	kirill.shutemov@...ux.intel.com, jithu.joseph@...el.com,
	kai.huang@...el.com, kan.liang@...ux.intel.com,
	daniel.sneddon@...ux.intel.com, pbonzini@...hat.com,
	sandipan.das@....com, ilpo.jarvinen@...ux.intel.com,
	peternewman@...gle.com, maciej.wieczor-retman@...el.com,
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
	eranian@...gle.com, james.morse@....com
Subject: Re: [RFC PATCH v3 17/17] x86/resctrl: Introduce interface to modify
 assignment states of the groups

On Thu, Mar 28, 2024 at 08:06:50PM -0500, Babu Moger wrote:
> Introduce rdtgroup_mbm_assign_control_write to assign mbm events.
> Assignment state can be updated by writing to this interface.
> Assignment states are applied on all the domains. Assignment on one
> domain applied on all the domains. User can pass one valid domain and
> assignment will be updated on all the available domains.
> 
> Format is similar to the list format with addition of op-code for the
> assignment operation.
> 
>  * Default CTRL_MON group:
>          "//<domain_id><op-code><assignment_flags>"
> 
>  * Non-default CTRL_MON group:
>          "<CTRL_MON group>//<domain_id><op-code><assignment_flags>"
> 
>  * Child MON group of default CTRL_MON group:
>          "/<MON group>/<domain_id><op-code><assignment_flags>"
> 
>  * Child MON group of non-default CTRL_MON group:
>          "<CTRL_MON group>/<MON group>/<domain_id><op-code><assignment_flags>"
> 
> Op-code can be one of the following:
> 
>  = Update the assignment to match the flags
>  + Assign a new state
>  - Unassign a new state
>  _ Unassign all the states
> 
> Signed-off-by: Babu Moger <babu.moger@....com>
> ---
> 
> v3: New patch.
>     Addresses the feedback to provide the global assignment interface.
>     https://lore.kernel.org/lkml/c73f444b-83a1-4e9a-95d3-54c5165ee782@intel.com/
> ---
>  Documentation/arch/x86/resctrl.rst     |  71 ++++++++
>  arch/x86/kernel/cpu/resctrl/rdtgroup.c | 236 ++++++++++++++++++++++++-
>  2 files changed, 306 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst
> index 2d96565501ab..64ec70637c66 100644
> --- a/Documentation/arch/x86/resctrl.rst
> +++ b/Documentation/arch/x86/resctrl.rst
> @@ -328,6 +328,77 @@ with the following files:
>  	 None of events are assigned on this mon group. This is a child
>  	 monitor group of the non default control mon group.
>  
> +	Assignment state can be updated by writing to this interface.
> +
> +	NOTE: Assignment on one domain applied on all the domains. User can
> +	pass one valid domain and assignment will be updated on all the
> +	available domains.
> +
> +	Format is similar to the list format with addition of op-code for the
> +	assignment operation.
> +
> +        * Default CTRL_MON group:
> +                "//<domain_id><op-code><assignment_flags>"
> +
> +        * Non-default CTRL_MON group:
> +                "<CTRL_MON group>//<domain_id><op-code><assignment_flags>"
> +
> +        * Child MON group of default CTRL_MON group:
> +                "/<MON group>/<domain_id><op-code><assignment_flags>"
> +
> +        * Child MON group of non-default CTRL_MON group:
> +                "<CTRL_MON group>/<MON group>/<domain_id><op-code><assignment_flags>"

The final bullet seems to cover everything, if we allow <CTRL_MON group>
and <MON group> to be independently empty strings to indicate the
default control and/or monitoring group respectively.

Would that be simpler than treating this as four separate cases?

Also, will this go wrong if someone creates a resctrl group with '\n'
(i.e., a newline character) in the name?

> +
> +	Op-code can be one of the following:
> +	::
> +
> +	 = Update the assignment to match the flags
> +	 + Assign a new state
> +	 - Unassign a new state
> +	 _ Unassign all the states

I can't remember whether I already asked this, but is "_" really
needed here?

Wouldn't it be the case that

	//*_

would mean just the same thing as

	//*=_

..?  (assuming the "*" = "all domains" convention already discussed)

Maybe I'm missing something here.

[...]

Cheers
---Dave

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ