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:   Thu, 9 Apr 2020 12:43:28 +0800
From:   YunQiang Su <wzssyqa@...il.com>
To:     Tiezhu Yang <yangtiezhu@...ngson.cn>
Cc:     Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        linux-mips <linux-mips@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Xuefeng Li <lixuefeng@...ngson.cn>
Subject: Re: [PATCH] MIPS: Limit check_bugs32() under CONFIG_32BIT

Tiezhu Yang <yangtiezhu@...ngson.cn> 于2020年4月9日周四 上午11:10写道:
>
> There is no need to build and call check_bugs32() under CONFIG_64BIT,
> just limit it under CONFIG_32BIT.

Since 32bit is subset of 64bit, and due to the code, I think that the
initial purpose
of check_bugs32() is also willing to run even with CONFIG_64BIT.

For example, if we have a CPU which is 64bit, and work well on 64bit mode, while
has a bug only on 32bit mode, check_bugs32 should be used here.

Loongson's 3A 1000 is the example, I cannot support FP32 mode well.

>
> Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
> ---
>  arch/mips/include/asm/bugs.h | 4 +++-
>  arch/mips/kernel/cpu-probe.c | 2 ++
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/include/asm/bugs.h b/arch/mips/include/asm/bugs.h
> index d72dc6e..5f8d2bf 100644
> --- a/arch/mips/include/asm/bugs.h
> +++ b/arch/mips/include/asm/bugs.h
> @@ -35,7 +35,9 @@ static inline void check_bugs(void)
>         unsigned int cpu = smp_processor_id();
>
>         cpu_data[cpu].udelay_val = loops_per_jiffy;
> -       check_bugs32();
> +
> +       if (IS_ENABLED(CONFIG_32BIT))
> +               check_bugs32();
>
>         if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
>                 check_bugs64();
> diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
> index f21a230..85d7273 100644
> --- a/arch/mips/kernel/cpu-probe.c
> +++ b/arch/mips/kernel/cpu-probe.c
> @@ -461,6 +461,7 @@ static inline void cpu_set_mt_per_tc_perf(struct cpuinfo_mips *c)
>                 c->options |= MIPS_CPU_MT_PER_TC_PERF_COUNTERS;
>  }
>
> +#ifdef CONFIG_32BIT
>  static inline void check_errata(void)
>  {
>         struct cpuinfo_mips *c = &current_cpu_data;
> @@ -484,6 +485,7 @@ void __init check_bugs32(void)
>  {
>         check_errata();
>  }
> +#endif /* CONFIG_32BIT */
>
>  /*
>   * Probe whether cpu has config register by trying to play with
> --
> 2.1.0
>


-- 
YunQiang Su

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ