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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <be17b788-dda1-4671-a037-6d79d383fdc4@intel.com>
Date: Tue, 27 Feb 2024 14:05:05 -0800
From: Reinette Chatre <reinette.chatre@...el.com>
To: Tony Luck <tony.luck@...el.com>, Borislav Petkov <bp@...en8.de>, "James
 Morse" <james.morse@....com>
CC: Thomas Gleixner <tglx@...utronix.de>, <x86@...nel.org>,
	<linux-kernel@...r.kernel.org>, "Yu, Fenghua" <fenghua.yu@...el.com>, "Ingo
 Molnar" <mingo@...hat.com>, 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>
Subject: Re: [PATCH v3 1/2] x86/resctrl: Pass domain to target CPU

Hi Tony,

On 2/22/2024 10:50 AM, Tony Luck wrote:
> reset_all_ctrls() and resctrl_arch_update_domains() use on_each_cpu_mask()
> to call rdt_ctrl_update() on potentially one CPU from each domain.
> 
> But this means rdt_ctrl_update() needs to figure out which domain to apply
> changes to. Doing so requires a search of all domains in a resource,
> which can only be done safely if cpus_lock is held. Both callers do
> hold this lock, but there isn't a way for a function called on another
> CPU via IPI to verify this.
> 
> Commit c0d848fcb09d ("x86/resctrl: Remove lockdep annotation that triggers
> false positive") removed the incorrect assertions.
> 
> Adding the target domain to the msr_param structure, and calling
> for each domain separately using smp_call_function_single() means
> that rdt_ctrl_update() doesn't need to search for the domain.  Thus
> get_domain_from_cpu() can safely assert that the cpus_lock is held since
> the remaining callers do not use IPI.

Please stick to the imperative tone. Something like (please feel free to
improve):

	Add the target domain to the msr_param structure and call
	rdt_ctrl_update() for each domain separately using
	smp_call_function_single(). This means that rdt_ctrl_update()
	doesn't need to search for the domain and get_domain_from_cpu()
	can safely assert that the cpus_lock is held since
	the remaining callers do not use IPI.


..

> @@ -463,6 +457,8 @@ static int domain_setup_ctrlval(struct rdt_resource *r, struct rdt_domain *d)
>  	hw_dom->ctrl_val = dc;
>  	setup_default_ctrlval(r, dc);
>  
> +	m.res = r;

This belongs in the next patch.

> +	m.dom = d;
>  	m.low = 0;
>  	m.high = hw_res->num_closid;
>  	hw_res->msr_update(d, &m, r);

The rest looks good to me and I think it is a good improvement.
Thank you very much.

Reinette


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ