Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp122455iof; Sun, 5 Jun 2022 23:02:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvYzW6hkk3AbalZkwapRAFoMdp+AVNBw46kQieyCXnZOq5fXikMuDS1EMxF6o2JP8Muu4w X-Received: by 2002:a17:902:d904:b0:163:dd91:87 with SMTP id c4-20020a170902d90400b00163dd910087mr22438218plz.34.1654495358414; Sun, 05 Jun 2022 23:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654495358; cv=none; d=google.com; s=arc-20160816; b=aEQ0f8cKceCBf1eJParowWXc/QBjmY3txzn3VPHCiEutoLNy8DhnbLKCwdOiLrTd7a c3n5orZYVA6jQqMcPhAwfGFuojV/3uLPvCL0NA82wfR74GTDebFaJ2jaZUa5b22qq89r qOhFcDRccE1qszg85BbmGdCxq7vGIg+fLZWZjrfwDp97m+/rfNotLbkE5EVFBQ7qKmH9 5zrZVMxzbaoTQ9zPy8oylTJbVvdDQPuh2P+IbvDpVN+Ffjm6DerhCCNrRGPi4gdwBdjR KdwiF5YZBYl144A9+nG2Dk0/zf/DWChTwUS3kvAyhD3AdtC539rg5sAFlhk1WZcsFull YrgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=T0TxN5mC+Y0mSs3bHfK7EHXXksbsppb4zChXgskbVo4=; b=WXnOI0bOu4TBpqWNuD1E8oFJzvZIngrYddpvJlv388WjTgaqvkvIzh1c7WhBgpddE/ 3TWXmDnzJbJcvH3eTsIAFv0NTUaSskuV8fxApzLsfuCZGs6HPawNR4JLHXmth36XI0t9 DcbtiHYLnpe3pOvCvr73e5NsAFPEttC6OmmF41zRW9m5OefsRSqEpy80pkf6HQo+WMPn ING269/QpSXNnUYECC7l0V+kZqzRvRgebkp1VuERdkL9KFzR73BGylc3YtNMYI5E3O6p 3RAYNkdNghtzdCbE97XmNfWnmE1wWo24/kRc5ZfZxhLcMgraQpRmwmhm2AmbyzfUW709 7RJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HzqQlSUx; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id jb4-20020a170903258400b00163e9cf7ce7si16463287plb.287.2022.06.05.23.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:02:38 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HzqQlSUx; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DE9389AE74; Sun, 5 Jun 2022 21:50:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347906AbiFDNMB (ORCPT + 99 others); Sat, 4 Jun 2022 09:12:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347023AbiFDNL6 (ORCPT ); Sat, 4 Jun 2022 09:11:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09CAB3AB; Sat, 4 Jun 2022 06:11:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A32A9B80171; Sat, 4 Jun 2022 13:11:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70099C36AE2; Sat, 4 Jun 2022 13:11:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654348314; bh=LigdOMTiHU3JDXFoM3FYPWJ+NL2sB0dXjxk5b2cv4K0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=HzqQlSUxQbpKcoQlGjyaiU7sKZUSmKiO7KqjdDFu7oUA8K0R+3hiuL6MMoUuuk8/F 0ThbEFLH80drR0uSZTltIbNjH3D9mLsiMK/Q9MKV74Ou4fhRDXi+ZAgR9H6TQiyL+o 4SUyW2lqg9yVLNnVsyX6wubN4qDopeabXx6cm60C14J6l7wlsJdh6657Xf8YUHAvjz CjrkaVAIPCczwRYosz0ARYCH6MRb3kUfexwcUxyC2vW7+E2R7Old3DlUMXaUh+/wvV 5C3SaueY1Ia2qGb9P0r/sJ50JFgq3XLIa/ZFUDYegOgaum0zopF6SvnbbqxxndXLQT 23v/fDIUeMqAQ== Received: by mail-il1-f174.google.com with SMTP id u2so8237885iln.2; Sat, 04 Jun 2022 06:11:54 -0700 (PDT) X-Gm-Message-State: AOAM533ZyP4STw7F0IpFIwkpAkwh1HuBL+S/NLjz70FBeXFm29w0tYyZ Xjr2V1JeBzv91X0hlQyXzLr8BlmtEzpnFekIRgk= X-Received: by 2002:a05:6e02:12b4:b0:2d3:a822:3a16 with SMTP id f20-20020a056e0212b400b002d3a8223a16mr8187552ilr.279.1654348313547; Sat, 04 Jun 2022 06:11:53 -0700 (PDT) MIME-Version: 1.0 References: <20220604124052.1550-1-jiaxun.yang@flygoat.com> <20220604124052.1550-2-jiaxun.yang@flygoat.com> In-Reply-To: <20220604124052.1550-2-jiaxun.yang@flygoat.com> From: Huacai Chen Date: Sat, 4 Jun 2022 21:11:34 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH for-5.19 2/2] loongarch: Mask out higher bits for get_csr_cpuid To: Jiaxun Yang Cc: WANG Xuerui , Marc Zyngier , LKML , "open list:MIPS" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Jiaxun, On Sat, Jun 4, 2022 at 8:41 PM Jiaxun Yang 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 > --- > 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 >