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]
Message-ID: <CAAhV-H42rRE5w2qThfO3fEa8PZVfRQp-mzUqw8pWx1x2JYo9Pw@mail.gmail.com>
Date:   Sat, 4 Jun 2022 21:11:34 +0800
From:   Huacai Chen <chenhuacai@...nel.org>
To:     Jiaxun Yang <jiaxun.yang@...goat.com>
Cc:     WANG Xuerui <kernel@...0n.name>, Marc Zyngier <maz@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        "open list:MIPS" <linux-mips@...r.kernel.org>
Subject: Re: [PATCH for-5.19 2/2] loongarch: Mask out higher bits for get_csr_cpuid

Hi, Jiaxun,

On Sat, Jun 4, 2022 at 8:41 PM Jiaxun Yang <jiaxun.yang@...goat.com> wrote:
>
> Only low 9 bits of CPUID CSR represents coreid, higher bits
> are marked as reserved. In case Loongson may define higher
> bits in future, just mask them out for get_csr_cpuid.
I think we needn't to modify, until the high bits actually get defined. :)

Huacai

>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
> ---
>  arch/loongarch/include/asm/loongarch.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/loongarch/include/asm/loongarch.h b/arch/loongarch/include/asm/loongarch.h
> index 3ba4f7e87cd2..7f3933f747f9 100644
> --- a/arch/loongarch/include/asm/loongarch.h
> +++ b/arch/loongarch/include/asm/loongarch.h
> @@ -1200,7 +1200,7 @@ static inline u64 drdtime(void)
>
>  static inline unsigned int get_csr_cpuid(void)
>  {
> -       return csr_read32(LOONGARCH_CSR_CPUID);
> +       return csr_read32(LOONGARCH_CSR_CPUID) & CSR_CPUID_COREID;
>  }
>
>  static inline void csr_any_send(unsigned int addr, unsigned int data,
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ