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:   Tue, 26 Mar 2019 07:13:15 +0100
From:   Christophe Leroy <christophe.leroy@....fr>
To:     Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>
Cc:     linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/7] powerpc/setup: define cpu_pvr at all time



Le 22/03/2019 à 09:08, Christophe Leroy a écrit :
> To avoid ifdefs, define cpu_pvr at all time.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@....fr>

This patch introduces a sparse warning.

I guess we can skip it for now and rework more deeply the use of cpu_pvr 
versus SPRN_PVR which is re-read in many places in the code.

Christophe

> ---
>   arch/powerpc/kernel/setup-common.c | 12 +++++-------
>   1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
> index a90e8367ccde..a4ed9301e815 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -190,9 +190,7 @@ void machine_halt(void)
>   	machine_hang();
>   }
>   
> -#ifdef CONFIG_SMP
>   DEFINE_PER_CPU(unsigned int, cpu_pvr);
> -#endif
>   
>   static void show_cpuinfo_summary(struct seq_file *m)
>   {
> @@ -234,11 +232,11 @@ static int show_cpuinfo(struct seq_file *m, void *v)
>   	unsigned short maj;
>   	unsigned short min;
>   
> -#ifdef CONFIG_SMP
> -	pvr = per_cpu(cpu_pvr, cpu_id);
> -#else
> -	pvr = mfspr(SPRN_PVR);
> -#endif
> +	if (IS_ENABLED(CONFIG_SMP))
> +		pvr = per_cpu(cpu_pvr, cpu_id);
> +	else
> +		pvr = mfspr(SPRN_PVR);
> +
>   	maj = (pvr >> 8) & 0xFF;
>   	min = pvr & 0xFF;
>   
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ