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] [day] [month] [year] [list]
Message-ID: <20220627163008.qnyx27arpxmihpya@bogus>
Date:   Mon, 27 Jun 2022 17:30:08 +0100
From:   Sudeep Holla <sudeep.holla@....com>
To:     Ionela Voinescu <ionela.voinescu@....com>
Cc:     linux-kernel@...r.kernel.org, Greg KH <gregkh@...uxfoundation.org>,
        Atish Patra <atishp@...shpatra.org>,
        Atish Patra <atishp@...osinc.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Qing Wang <wangqing@...o.com>,
        Rob Herring <robh+dt@...nel.org>,
        "Rafael J . Wysocki" <rafael@...nel.org>,
        Pierre Gondois <pierre.gondois@....com>,
        linux-arm-kernel@...ts.infradead.org,
        linux-riscv@...ts.infradead.org
Subject: Re: [PATCH v4 16/20] arch_topology: Drop unnecessary check for
 uninitialised package_id

On Mon, Jun 27, 2022 at 02:12:52PM +0100, Ionela Voinescu wrote:
> On Tuesday 21 Jun 2022 at 20:20:30 (+0100), Sudeep Holla wrote:
> > With the support of socket node parsing from the device tree and
> > assigning 0 as package_id in absence of socket nodes, there is no need
> > to check for invalid package_id. It is always initialised to 0 or values
> > from the device tree socket nodes.
> > 
> > Just drop that now redundant check for uninitialised package_id.
> > 
> > Signed-off-by: Sudeep Holla <sudeep.holla@....com>
> > ---
> >  drivers/base/arch_topology.c | 11 -----------
> >  1 file changed, 11 deletions(-)
> > 
> > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> > index 46fa1b70b02b..42448a5a9412 100644
> > --- a/drivers/base/arch_topology.c
> > +++ b/drivers/base/arch_topology.c
> > @@ -611,7 +611,6 @@ static int __init parse_dt_topology(void)
> >  {
> >  	struct device_node *cn, *map;
> >  	int ret = 0;
> > -	int cpu;
> >  
> >  	cn = of_find_node_by_path("/cpus");
> >  	if (!cn) {
> > @@ -633,16 +632,6 @@ static int __init parse_dt_topology(void)
> >  
> >  	topology_normalize_cpu_scale();
> >  
> > -	/*
> > -	 * Check that all cores are in the topology; the SMP code will
> > -	 * only mark cores described in the DT as possible.
> > -	 */
> > -	for_each_possible_cpu(cpu)
> > -		if (cpu_topology[cpu].package_id < 0) {
> > -			ret = -EINVAL;
> > -			break;
> > -		}
> > -
> 
> Maybe it would still be good to keep this for systems with potential
> errors in DT, where one forgets to add a core in cpu-map.
>

Though I would ideally prefer to catch such DT issues with schema, I know
we are no there yet. So I agree to retain this.

> For example, if I modify juno.dts as follows:
> 
> --- a/arch/arm64/boot/dts/arm/juno.dts
> +++ b/arch/arm64/boot/dts/arm/juno.dts
> @@ -51,12 +51,9 @@ core0 {
>                                         cpu = <&A53_0>;
>                                 };
>                                 core1 {
> -                                       cpu = <&A53_1>;
> -                               };
> -                               core2 {
>                                         cpu = <&A53_2>;
>                                 };
> -                               core3 {
> +                               core2 {
>                                         cpu = <&A53_3>;
>                                 };
>                         };
> 
> and miss a little core in cluster1, I would end up with an incomplete
> topology: core3 would have cluster_id as -1, while all other CPUs would
> have a valid value; also, core3 would have package_id = -1.
> 

Indeed. I didn't consider the case where DT would have issues when I dropped
this check. I will drop this patch. Thanks again.

-- 
Regards,
Sudeep

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ