Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp101523iof; Sun, 5 Jun 2022 22:24:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnOxQJoTsjmwlpARWpXf38wGQe+udFbyPPYXHYaHyTd8nlXU/nRf5ZxWZsRf+aWcX3jRIp X-Received: by 2002:a65:6e05:0:b0:3da:eb74:ef9c with SMTP id bd5-20020a656e05000000b003daeb74ef9cmr20001118pgb.563.1654493092813; Sun, 05 Jun 2022 22:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654493092; cv=none; d=google.com; s=arc-20160816; b=XyqDCO60zdQzloCM1wcWmu37J+AU+GNbyDCuldmEczgaZSnjLQt/oQtwcAext2MIoF +EDnWpaCrtAMlOpWpAoPUEfD7Wwrp9judd0pWydg3W1Vlo2ahXBnzD2CnZItbElyvo5T OTcRaR6fzBrwigtvOklHmj0zMStoAqI/xeAQOd8VrUcAwutCPQfnAhezRuuS/1ttf+ZK x14ktbyn9X8x6XAT8mNYQXT6qxQrwnIvJkFpni5NE7cB043Gz9xQyu3Hbi4WUyZjhyKL Rx20TiAXgebMRKdja7ANUEO/2cvcaItTSXR7yu3tj3sxTLRHa66I2tbDSZRpexaNU6Pa uaHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=Y85O8Dk7VWQXXoJvprtQ8Dh0VDIc6G4b2piXzVambvs=; b=a7jjHGAxqPpv1wIAZeqg6JG03LfveOyTGX2AbYU42Xzd3R2aJ8MafP60pUxqwUf8op tzzUrS+hNkyTfruI6iKF0QN1rzuMeZycbT97SunGG3pUc3ldAIt5V0JObn6+oE0Lstd3 W5farwJHc8pCLtOT+oe9PFDFxjuuxxCKkyMl8YuvkHW1ZwpXLCGSx+lk/CdLDIRdnfHo WCHYwCvptds5EZVi4naMX+2Bt8FznGhpOxDLNOIy7+LjoF+2r1OWOqM8zmq/AvufjIjf Wpo4r/ATpCYW3N1xgbxNN2LeoTeuP/Q6+5nNH2kCvGnF5jI73vWv1NJytk/pByW3dXmA NIsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (expired) header.i=@flygoat.com header.s=fm2; dkim=neutral (expired) header.i=@messagingengine.com header.s=fm1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i37-20020a635865000000b003fcf0962aa4si14386065pgm.336.2022.06.05.22.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:24:52 -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=neutral (expired) header.i=@flygoat.com header.s=fm2; dkim=neutral (expired) header.i=@messagingengine.com header.s=fm1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E77671B6FEE; Sun, 5 Jun 2022 21:26:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241778AbiFDMlH (ORCPT + 99 others); Sat, 4 Jun 2022 08:41:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241004AbiFDMlG (ORCPT ); Sat, 4 Jun 2022 08:41:06 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7879E31536; Sat, 4 Jun 2022 05:41:05 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 7BA6132003AC; Sat, 4 Jun 2022 08:41:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 04 Jun 2022 08:41:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1654346464; x=1654432864; bh=Y8 5O8Dk7VWQXXoJvprtQ8Dh0VDIc6G4b2piXzVambvs=; b=QsI1Pc5GL0ftpGmkVM 4cS9+b1ukcVX5MX7Jw7pL29q/OOiJ3z41W9nxz6+Pu/yUCbbP0KqtMpTXSpoDSHw Qc6SGVEctoGDGdQ5493R9q6GV2LS3/uKv6NKUYMV2zuDSLp+oVeV9NaThNARsEnA c75eXmyYat1viqX7nukAL66Hjm8D0/ncwmE/lMZEpYOSfRTrKx40NzCfkFUBsMQa xxEYMRslEwcTQ4qPlB2HtrOOkUJlV6chebdkoGdToj8yjB2DdDO/5Z+1j/oFgdpH ax2lnYVKUJg+7WFf92QUTgndBotS9/tgP6onjvYHWXyZWBJuiNSUzvw1W58irngr YIbQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1654346464; x=1654432864; bh=Y85O8Dk7VWQXX oJvprtQ8Dh0VDIc6G4b2piXzVambvs=; b=mrXA7BVV28fhRcI3UqKMl2/FKYrDw LXmD5R8KfzOORUWGEH9xPeHMdJTBYTPPS0YJqAZrw1Ur5alOs7ehGgfIdN+c/KPw W4Nss5nJ9b1ZE0uCp+MQ7+WjAJ8hPwqVpOEoI4BpjuaSxdaqPSETUznGIXdJpLfK Ay8Hu7YvJkeCTJ/DGOZreUUwUI4nf3e0Ky6CO2SPqI4ccpNH+butX+jS7mUzXEfZ UAvHgMiUhsIerfwKlKswhzZJIlL179TUPMFBo9a34VHVxBrqQ0MiMP11hbLkAFB7 BSkWRIIRcZndMSvMglbIxkSoXYtGC7/sruuDXUBQdeS5gcEF7xS7guNyg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleekgdehgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhgggfestdekre dtredttdenucfhrhhomheplfhirgiguhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhg sehflhihghhorghtrdgtohhmqeenucggtffrrghtthgvrhhnpeefledufeehgedvuedvvd egkefgvddttedtleeiiefhgeetudegkefhvdfhjeeftdenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihgh horghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 4 Jun 2022 08:41:01 -0400 (EDT) From: Jiaxun Yang To: chenhuacai@kernel.org Cc: kernel@xen0n.name, maz@kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Jiaxun Yang Subject: [PATCH for-5.19 2/2] loongarch: Mask out higher bits for get_csr_cpuid Date: Sat, 4 Jun 2022 13:40:52 +0100 Message-Id: <20220604124052.1550-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220604124052.1550-1-jiaxun.yang@flygoat.com> References: <20220604124052.1550-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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. 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