From patchwork Tue Jul 11 09:20:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 118360 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp353239vqm; Tue, 11 Jul 2023 02:38:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlFtWYctvBdbs8EbfayouDNjQ7kjsq3vyVeOiwRSzX8Sja3ZQtREmItaxRCVXAtsQ6nhVneK X-Received: by 2002:a17:902:9346:b0:1b9:cf52:2bcf with SMTP id g6-20020a170902934600b001b9cf522bcfmr8603148plp.0.1689068295966; Tue, 11 Jul 2023 02:38:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689068295; cv=none; d=google.com; s=arc-20160816; b=fYCnOY2QgKWcM7XTZ0OcaMzn1Sp3tDGbRr3gMFU7/pqqLPdLp/KmVqefTl0ugAED0W +UsnOl6J0V7790uqs4P1PHzIigGYJPtLrvbIaLTv9jB5K5HLysOBeOUCQNo0aGLaYO+7 scbE541/i//UvcI025umYxVEcA1KF68G1Z34we7tEQruQYLC6twRe+ZibKizlBvsjEO8 LYYhwWORBVUWQVVtzlNzLS6+prT01x9MJ+HxPTQ7T3gwRoEvCSw2U0x+ppYltXniO9cb BmB58HR0Q6Xe/8Lp+AwziXLfMH11faGh3tLs4O20zmKjTauPjlFD42D/3vSXUX1sCCDv /PCQ== 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 :message-id:date:subject:cc:to:from; bh=6nl7sXLMoEUOzJmGLt99kcx188b2tdax/PGO6SEPh1o=; fh=U8K3qHs+T8uVvB/AIq8BBm0skH4usQEfR8seXp8jemM=; b=VauCjlp0RSYl+vwKE8UjOOgYJAaJiFsuRhvhBZz3js7/IHzN1eebxGT3q9OeK2RwNB 5YZdGoFYVOjfhnWtsX75HJgJ33aV/K9RRbm8QOUSRHpgCaTmjmQwMwT1rxf8y9Sv2usJ nZL4UULH4Dssw1DUbXGHndE+jcDqHdbWdVvHnAK16B6jm+iqK5mqKZT7son2yI4+xV5L AxYwAx/MS+GbZQ5ypB1M/cY2hk0t0cU/IPgID5vFVJP7gKVQb24zvPqIrzlsqchKX6wF uNu2e1RMGC/zS5+5IPasZZqIw6qdikj1sl8l8t2tjyqj2zRdGL85lYvFLYns11tjvHaV lM4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ij13-20020a170902ab4d00b001b7e63cfa10si1257727plb.623.2023.07.11.02.38.03; Tue, 11 Jul 2023 02:38:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232224AbjGKJZe (ORCPT + 99 others); Tue, 11 Jul 2023 05:25:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231618AbjGKJZE (ORCPT ); Tue, 11 Jul 2023 05:25:04 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8EA111AC for ; Tue, 11 Jul 2023 02:21:02 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7897B2B; Tue, 11 Jul 2023 02:21:44 -0700 (PDT) Received: from a077893.arm.com (unknown [10.163.47.87]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 61B123F67D; Tue, 11 Jul 2023 02:21:00 -0700 (PDT) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Cc: Anshuman Khandual , Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org Subject: [PATCH] arm64/mm: Directly use ID_AA64MMFR2_EL1_VARange_MASK Date: Tue, 11 Jul 2023 14:50:55 +0530 Message-Id: <20230711092055.245756-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771116477651088805 X-GMAIL-MSGID: 1771116477651088805 Tools generated register fields have in place mask macros which can be used directly instead of shifting the older right end sided masks. Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- This applies on v6.5-rc1 arch/arm64/kernel/head.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 757a0de07f91..7b236994f0e1 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -113,7 +113,7 @@ SYM_CODE_START(primary_entry) */ #if VA_BITS > 48 mrs_s x0, SYS_ID_AA64MMFR2_EL1 - tst x0, #0xf << ID_AA64MMFR2_EL1_VARange_SHIFT + tst x0, ID_AA64MMFR2_EL1_VARange_MASK mov x0, #VA_BITS mov x25, #VA_BITS_MIN csel x25, x25, x0, eq @@ -756,7 +756,7 @@ SYM_FUNC_START(__cpu_secondary_check52bitva) b.ne 2f mrs_s x0, SYS_ID_AA64MMFR2_EL1 - and x0, x0, #(0xf << ID_AA64MMFR2_EL1_VARange_SHIFT) + and x0, x0, ID_AA64MMFR2_EL1_VARange_MASK cbnz x0, 2f update_early_cpu_boot_status \