Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3353478rdh; Thu, 28 Sep 2023 09:11:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDJ/aDn2nCl89itLmdfNfuJdtiT4NTInt2TCQCsVkdupZNlTuJ+72XA+9xAJnrWWLScEpV X-Received: by 2002:a17:90a:bb8d:b0:276:ae8f:2456 with SMTP id v13-20020a17090abb8d00b00276ae8f2456mr1549582pjr.3.1695917496964; Thu, 28 Sep 2023 09:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695917496; cv=none; d=google.com; s=arc-20160816; b=jUyjRjdZ3a3wuKWk6qGYIRL4MYe6vloLZRJWFMkfSWIx3yuLpX3xdBOUyrXaaGv341 E5nSPKJO2piDDBS8xCPGZ7daWiRDe2INF2tQP0W7E40eFjU/y8pDdbhzxR+WsE3Y5qnm 3LbXp/+BVIN5qqx3mWG+zkzfi8h+FzW0CVq1UlBWHZXvJ2dBcLGYiwSF7IajKj6+oQbI mN7KLBsuyYzYNZrUwG3mBROQxjo4wiWIxkgg5dZSm31Q1aoiMSQoGAgqZXZkYQ3DZ9Jm vZlBbslygVRzB4KOaOBpz/MqZ3xL6c3xxY0wGdp7C+ockE9fFKPjfWJ20Tp86beW+VBr lrQQ== 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; bh=Sz+T3131oxaJFGdZJDHH/8sXcdDkqRvAtWTXeH0IEYg=; fh=c22Vo8jmrolb3C2NHSTiTLszWLzURTk1MpvpruViKqw=; b=UD+bIjJUY8YOMUI8nUewdrPuYfxYo25SpeNaR+k/0X1Q1Qr8sCdpmDjYoRPYfb1OdK sNSFDQLPvw0YbpOqq3wQ02kWv8PLROkpA3/dKnAQVboQPE4iHdsmiNSMCYB6KRSeqxyj lrT++s0jF2kc+1uvdqZ660ci+Tc2BHItLWcHHtQrNfyugBHDnsGMqlC2Xa5AFSA0ginC hCE/ioHFSXwndXCphp0Splgo14iY54NPJHKz8m3zXUx7r8Zsc4GSH8zQbWQbw0p369z6 fam5sNkLVospbcyKmrrB/6PA32/QnQp+GJVL4Z2EC+uJDZDZS/axMYYpsfNqfpQT0uoo /XsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ge13-20020a17090b0e0d00b00276671731e3si21549441pjb.136.2023.09.28.09.11.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 09:11:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id C8CD78031AF9; Thu, 28 Sep 2023 08:17:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231537AbjI1PQe (ORCPT + 99 others); Thu, 28 Sep 2023 11:16:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231598AbjI1PQd (ORCPT ); Thu, 28 Sep 2023 11:16:33 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 08C15195 for ; Thu, 28 Sep 2023 08:16:30 -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 0CF081063; Thu, 28 Sep 2023 08:17:08 -0700 (PDT) Received: from e127643.arm.com (unknown [10.57.3.6]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E9B383F59C; Thu, 28 Sep 2023 08:16:26 -0700 (PDT) From: James Clark To: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, broonie@kernel.org, maz@kernel.org, suzuki.poulose@arm.com Cc: James Clark , Oliver Upton , James Morse , Zenghui Yu , Catalin Marinas , Will Deacon , Mike Leach , Leo Yan , Alexander Shishkin , Anshuman Khandual , Rob Herring , Jintack Lim , Joey Gouly , linux-kernel@vger.kernel.org Subject: [PATCH v1 1/5] arm64/sysreg: Move TRFCR definitions to sysreg Date: Thu, 28 Sep 2023 16:16:05 +0100 Message-Id: <20230928151611.3042443-2-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928151611.3042443-1-james.clark@arm.com> References: <20230928151611.3042443-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 28 Sep 2023 08:17:01 -0700 (PDT) Add separate definitions for ELx and EL2 as TRFCR_EL1 doesn't have CX. This also mirrors the previous definition so no code change is required. Reviewed-by: Mark Brown Signed-off-by: James Clark --- arch/arm64/include/asm/sysreg.h | 12 ----------- arch/arm64/tools/sysreg | 37 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index 38296579a4fd..068dd6abe273 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -278,8 +278,6 @@ #define SYS_RGSR_EL1 sys_reg(3, 0, 1, 0, 5) #define SYS_GCR_EL1 sys_reg(3, 0, 1, 0, 6) -#define SYS_TRFCR_EL1 sys_reg(3, 0, 1, 2, 1) - #define SYS_TCR_EL1 sys_reg(3, 0, 2, 0, 2) #define SYS_APIAKEYLO_EL1 sys_reg(3, 0, 2, 1, 0) @@ -496,7 +494,6 @@ #define SYS_VTTBR_EL2 sys_reg(3, 4, 2, 1, 0) #define SYS_VTCR_EL2 sys_reg(3, 4, 2, 1, 2) -#define SYS_TRFCR_EL2 sys_reg(3, 4, 1, 2, 1) #define SYS_HAFGRTR_EL2 sys_reg(3, 4, 3, 1, 6) #define SYS_SPSR_EL2 sys_reg(3, 4, 4, 0, 0) #define SYS_ELR_EL2 sys_reg(3, 4, 4, 0, 1) @@ -904,15 +901,6 @@ /* Safe value for MPIDR_EL1: Bit31:RES1, Bit30:U:0, Bit24:MT:0 */ #define SYS_MPIDR_SAFE_VAL (BIT(31)) -#define TRFCR_ELx_TS_SHIFT 5 -#define TRFCR_ELx_TS_MASK ((0x3UL) << TRFCR_ELx_TS_SHIFT) -#define TRFCR_ELx_TS_VIRTUAL ((0x1UL) << TRFCR_ELx_TS_SHIFT) -#define TRFCR_ELx_TS_GUEST_PHYSICAL ((0x2UL) << TRFCR_ELx_TS_SHIFT) -#define TRFCR_ELx_TS_PHYSICAL ((0x3UL) << TRFCR_ELx_TS_SHIFT) -#define TRFCR_EL2_CX BIT(3) -#define TRFCR_ELx_ExTRE BIT(1) -#define TRFCR_ELx_E0TRE BIT(0) - /* GIC Hypervisor interface registers */ /* ICH_MISR_EL2 bit definitions */ #define ICH_MISR_EOI (1 << 0) diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg index 2517ef7c21cf..992722c0c23b 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -2624,3 +2624,40 @@ Field 5 F Field 4 P Field 3:0 Align EndSysreg + +SysregFields TRFCR_EL2 +Res0 63:7 +UnsignedEnum 6:5 TS + 0b0000 USE_TRFCR_EL1_TS + 0b0001 VIRTUAL + 0b0010 GUEST_PHYSICAL + 0b0011 PHYSICAL +EndEnum +Res0 4 +Field 3 CX +Res0 2 +Field 1 E2TRE +Field 0 E0HTRE +EndSysregFields + +# TRFCR_EL1 doesn't have the CX bit so redefine it without CX instead of +# using a shared definition between TRFCR_EL2 and TRFCR_EL1 +SysregFields TRFCR_ELx +Res0 63:7 +UnsignedEnum 6:5 TS + 0b0001 VIRTUAL + 0b0010 GUEST_PHYSICAL + 0b0011 PHYSICAL +EndEnum +Res0 4:2 +Field 1 ExTRE +Field 0 E0TRE +EndSysregFields + +Sysreg TRFCR_EL1 3 0 1 2 1 +Fields TRFCR_ELx +EndSysreg + +Sysreg TRFCR_EL2 3 4 1 2 1 +Fields TRFCR_EL2 +EndSysreg -- 2.34.1