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: <CAAhV-H59NVPiBoLX0Ok61tDQZA-=jphK7ZYsW8i2OTzURGFq9w@mail.gmail.com>
Date:   Thu, 23 Jun 2022 17:22:33 +0800
From:   Huacai Chen <chenhuacai@...nel.org>
To:     Tiezhu Yang <yangtiezhu@...ngson.cn>
Cc:     WANG Xuerui <kernel@...0n.name>,
        Xuefeng Li <lixuefeng@...ngson.cn>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] LoongArch: Fix wrong fpu version

Hi, Tiezhu,

On Sat, Jun 18, 2022 at 12:50 PM Tiezhu Yang <yangtiezhu@...ngson.cn> wrote:
>
> According to the configuration information accessible by the CPUCFG
> instruction in LoongArch Reference Manual [1], FP_ver is stored in
> bit [5: 3] of CPUCFG2, the current code to get fpu version is wrong,
> use CPUCFG2_FPVERS to fix it.
>
> [1] https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
>
> Fixes: 628c3bb40e9a ("LoongArch: Add boot and setup routines")
> Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
> ---
>  arch/loongarch/kernel/cpu-probe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/loongarch/kernel/cpu-probe.c b/arch/loongarch/kernel/cpu-probe.c
> index 6c87ea3..529ab8f4 100644
> --- a/arch/loongarch/kernel/cpu-probe.c
> +++ b/arch/loongarch/kernel/cpu-probe.c
> @@ -263,7 +263,7 @@ void cpu_probe(void)
>
>         c->cputype      = CPU_UNKNOWN;
>         c->processor_id = read_cpucfg(LOONGARCH_CPUCFG0);
> -       c->fpu_vers     = (read_cpucfg(LOONGARCH_CPUCFG2) >> 3) & 0x3;
> +       c->fpu_vers     = (read_cpucfg(LOONGARCH_CPUCFG2) & CPUCFG2_FPVERS) >> 3;
Looks good to me, thanks.

Huacai
>
>         c->fpu_csr0     = FPU_CSR_RN;
>         c->fpu_mask     = FPU_CSR_RSVD;
> --
> 2.1.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ