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] [day] [month] [year] [list]
Message-ID:
 <AS8PR04MB8642344F9CA6D423D068E46C87CB2@AS8PR04MB8642.eurprd04.prod.outlook.com>
Date: Wed, 5 Mar 2025 10:29:30 +0000
From: Jacky Bai <ping.bai@....com>
To: Sudeep Holla <sudeep.holla@....com>, Yuanjie Yang
	<quic_yuanjiey@...cinc.com>
CC: "lpieralisi@...nel.org" <lpieralisi@...nel.org>, "rafael@...nel.org"
	<rafael@...nel.org>, "daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
	"james.morse@....com" <james.morse@....com>, "d-gole@...com" <d-gole@...com>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "imx@...ts.linux.dev" <imx@...ts.linux.dev>,
	"khilman@...libre.com" <khilman@...libre.com>, "quic_tingweiz@...cinc.com"
	<quic_tingweiz@...cinc.com>
Subject: RE: [PATCH v2] cpuidle: psci: Init cpuidle only for present CPUs

> Subject: Re: [PATCH v2] cpuidle: psci: Init cpuidle only for present CPUs
> 
> Hi Jacky,
> 
> I wasn't Cc-ed on the original patch.
> 
> I was searching to provide feedback but couldn't find one.
> 
> On Wed, Mar 05, 2025 at 02:31:57PM +0800, Yuanjie Yang wrote:
> > On Wed, Nov 20, 2024 at 06:37:49PM +0800, Jacky Bai wrote:
> > > With 'nosmp' or 'maxcpus=0' boot command line parameters, the
> > > 'cpu_present_mask' may not be the same as 'cpu_possible_mask'.
> > >
> > > In current psci cpuidle driver init, for_each_possible_cpu() is used
> > > to init the cpuidle for each possible CPU. but in drivers/base/cpu.c
> > > ->cpu_dev_register_generic(),
> > > for_each_present_cpu() is used to register cpu device for present
> > > CPUs.
> > >
> > > When boot system with 'nosmp' or 'maxcpus=0', the cpuidle driver
> > > init failed due to no valid CPU device sysfs node for non-boot CPUs.
> > >
> > > [ 0.182993] Failed to register cpuidle device for cpu1
> > >
> > > Use for_each_present_cpu() to register cpuidle only for present
> > > CPUs.
> > >
> 
> Can you reword it something like
> "
> 
> for_each_possible_cpu() is currently used to initialize cpuidle in the PSCI
> cpuidle driver.
> 
> However, in cpu_dev_register_generic(), for_each_present_cpu() is used to
> register CPU devices which means the CPU devices are only registered for
> present CPUs and not all possible CPUs.
> 
> With nosmp or maxcpus=0, only the boot CPU is present, leading to the
> failure:
> 
>   |  Failed to register cpuidle device for cpu1
> 
> Change for_each_possible_cpu() to for_each_present_cpu() in the PSCI
> cpuidle driver to ensure it only registers cpuidle devices for CPUs that are
> actually present.
> 
> "
> 
> With that, you can add:
> 
> Reviewed-by: Sudeep Holla <sudeep.holla@....com>
> 
> Please cc Ulf Hansson <ulf.hansson@...aro.org> as well. Either him or Rafael
> can then pick up the patch.
> 

Sorry, I should Cc you in the list. Thank you for your suggestion, I will resolve it in v3.

BR

> --
> Regards,
> Sudeep

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ