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]
Date:   Wed, 21 Sep 2022 08:20:06 +1000
From:   Stephen Rothwell <sfr@...b.auug.org.au>
To:     Yury Norov <yury.norov@...il.com>
Cc:     linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
        Michael Ellerman <mpe@...erman.id.au>,
        Nicholas Piggin <npiggin@...il.com>,
        Christophe Leroy <christophe.leroy@...roup.eu>,
        Alexey Kardashevskiy <aik@...abs.ru>,
        Alan Modra <amodra@....ibm.com>, Daniel Axtens <dja@...ens.net>
Subject: Re: [PATCH] powerpc/64: don't refer nr_cpu_ids in asm code when
 it's undefined

Hi Yury,

On Tue, 20 Sep 2022 08:29:35 -0700 Yury Norov <yury.norov@...il.com> wrote:
>

> diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
> index cf2c08902c05..7cb97881635e 100644
> --- a/arch/powerpc/kernel/head_64.S
> +++ b/arch/powerpc/kernel/head_64.S
> @@ -400,7 +400,11 @@ generic_secondary_common_init:
>  #else
>  	LOAD_REG_ADDR(r8, paca_ptrs)	/* Load paca_ptrs pointe	 */
>  	ld	r8,0(r8)		/* Get base vaddr of array	 */
> +#if (NR_CPUS == 1) || defined(CONFIG_FORCE_NR_CPUS)
> +	LOAD_REG_IMMEDIATE(r7, NR_CPUS)
> +#else
>  	LOAD_REG_ADDR(r7, nr_cpu_ids)	/* Load nr_cpu_ids address       */
> +#endif
>  	lwz	r7,0(r7)		/* also the max paca allocated 	 */
>  	li	r5,0			/* logical cpu id                */
>  1:
> -- 
> 2.34.1
> 

I don't know PPC assembly very well, but should the #endif be one line
lower so that the constant is not dereferenced in the non-#else case? 

-- 
Cheers,
Stephen Rothwell

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ