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: <ZhfwoXOlenwwH++O@e133380.arm.com>
Date: Thu, 11 Apr 2024 15:16:01 +0100
From: Dave Martin <Dave.Martin@....com>
To: Reinette Chatre <reinette.chatre@...el.com>
Cc: James Morse <james.morse@....com>, x86@...nel.org,
	linux-kernel@...r.kernel.org, Fenghua Yu <fenghua.yu@...el.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
	H Peter Anvin <hpa@...or.com>, Babu Moger <Babu.Moger@....com>,
	shameerali.kolothum.thodi@...wei.com,
	D Scott Phillips OS <scott@...amperecomputing.com>,
	carl@...amperecomputing.com, lcherian@...vell.com,
	bobo.shaobowang@...wei.com, tan.shaopeng@...itsu.com,
	baolin.wang@...ux.alibaba.com, Jamie Iles <quic_jiles@...cinc.com>,
	Xin Hao <xhao@...ux.alibaba.com>, peternewman@...gle.com,
	dfustini@...libre.com, amitsinght@...vell.com,
	David Hildenbrand <david@...hat.com>,
	Rex Nie <rex.nie@...uarmicro.com>
Subject: Re: [PATCH v1 13/31] x86/resctrl: Stop using the
 for_each_*_rdt_resource() walkers

On Mon, Apr 08, 2024 at 08:19:40PM -0700, Reinette Chatre wrote:
> Hi James,
> 
> On 3/21/2024 9:50 AM, James Morse wrote:
> > The for_each_*_rdt_resource() helpers walk the architectures array
> 
> architecture's ?

Noted.

> > of structures, using the resctrl visible part as an iterator. These
> > became over-complex when the structures were split into a
> > filesystem and architecture-specific struct. This approach avoided
> > the need to touch every call site.
> > 
> > Once the filesystem parts of resctrl are moved to /fs/, both the
> > architecture's resource array, and the definition of those structures
> > is no longer accessible. To support resctrl, each architecture would
> > have to provide equally complex macros.
> > 
> > Change the resctrl code that uses these to walk through the resource_level
> > enum and check the mon/alloc capable flags instead. Instances in core.c,
> > and resctrl_arch_reset_resources() remain part of x86's architecture
> > specific code.
> > 
> > Signed-off-by: James Morse <james.morse@....com>
> > ---
> >  arch/x86/kernel/cpu/resctrl/pseudo_lock.c |  7 +++++-
> >  arch/x86/kernel/cpu/resctrl/rdtgroup.c    | 30 +++++++++++++++++++----
> >  2 files changed, 31 insertions(+), 6 deletions(-)

[...]

> > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> > index e736e4d20f63..3f16e7854411 100644
> > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c

[...]

> > @@ -2205,8 +2211,12 @@ static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn)
> >  			goto out_destroy;
> >  	}
> >  
> > -	for_each_mon_capable_rdt_resource(r) {
> > -		fflags = r->fflags | RFTYPE_MON_INFO;
> > +	for (i = 0; i < RDT_NUM_RESOURCES; i++) {
> > +		r = resctrl_arch_get_resource(i);
> > +		if (!r->mon_capable)
> > +			continue;
> > +
> > +		fflags =  r->fflags | RFTYPE_MON_INFO;
> 
> Please check spacing.

[...]

> Reinette

Noted, thanks.


Cheers
---Dave

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ