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: <fe6d8592-7b54-4017-80f0-cc37dd2a0ba5@arm.com>
Date: Thu, 24 Apr 2025 18:08:06 +0100
From: James Morse <james.morse@....com>
To: "Luck, Tony" <tony.luck@...el.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
 Reinette Chatre <reinette.chatre@...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>,
 Dave Martin <dave.martin@....com>, Koba Ko <kobak@...dia.com>,
 Shanker Donthineni <sdonthineni@...dia.com>, fenghuay@...dia.com
Subject: Re: [PATCH v8 16/21] x86/resctrl: Always initialise rid field in
 rdt_resources_all[]

Hi Tony,

On 15/04/2025 20:08, Luck, Tony wrote:
> On Fri, Apr 11, 2025 at 04:42:24PM +0000, James Morse wrote:
>> x86 has an array, rdt_resources_all[], of all possible resources.
>> The for-each-resource walkers depend on the rid field of all
>> resources being initialised.
>>
>> If the array ever grows due to another architecture adding a resource
>> type that is not defined on x86, the for-each-resources walkers will
>> loop forever.

> This feels a bit weird. Having rdt_resources_all[] be a "swiss cheese"
> array full of holes where other architectures defined events that aren't
> supported by x86.

Today, there are none of those for x86. The MPAM driver has to do this, but so far the
array is small. I agree if the array becomes large, and no architecture implements
everything then some other structure would be better.


> But it does work, so it can go in like this. But someday I may revisit
> some experimental patches I did a while back that:
> 1) Split the rdt_resource structure into separate "ctrl" and "mon"
> pieces.
> 2) Replaced this array with a pair of lists, one each for enabled
> ctrl and mon resources.
> 3) Changed the resource walkers to use list_for_each*() macros.

Sounds good - this matches what the schema list has become.
The only oddity is the newly proposed "resctrl_online_domains_exist()" that would
sanity-check a resctrl_exit() call - but I don't see a problem walking one list after the
other there.


Thanks,

James

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ