Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1399930rdb; Mon, 4 Sep 2023 12:33:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQ5DpHgPsmtdHfsdjxRdGcC4KwpfSfOeGZxo+wrXfBMTBTnutqhuslippRwePApdD+pSGf X-Received: by 2002:a17:90b:3793:b0:269:3757:54bb with SMTP id mz19-20020a17090b379300b00269375754bbmr13676356pjb.11.1693856036610; Mon, 04 Sep 2023 12:33:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693856036; cv=none; d=google.com; s=arc-20160816; b=CbC0W8rBD1TEQlUheEw8ngygdcxIFie5n5mGP1avV1ooCPbikBm8Q3IoPSf5Akkb4f b826I3cTEZv5OUa+TSOBhIwsJ06tqYvudQ2szyxZU90YzT8dEC9Z7DGGkRYWwjuRNUJT zsEaKAxkGnLgfRPMC9h50jV/sPcA5GGrNviPuSvD0XR1YPJuYT1yfB7M/rtk/l72lPI2 62X9KpBiwD24QuFec88Z4t1ATVL8b6uum1Sy4anAutM0aL+OKzKxN+2e6aWNoK/36gUs JcPHsULUme1haOd89MWauNQ+NEwUUlNC7FtGbC4h3OYx2giQlMA5OQBHQnDZxaJ5dwHR h3VA== 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=rdp5hSYt1XfJNzdIsm1z9p+GyiYy3Rorrxz/fUWMD0U=; fh=CZ8D47g5ajU/lYMMT5yJI50pbG977oQ2Qy9mgmfgiEI=; b=ZC3PpzX2uzn718R7sx1A4J5SnkTKIzmaGm+LSM1NRohkr0EnYqYe3oL54QGBOV4AcC bSL00HD/J0gknoXPaO/ql31rm8TyWYtxqHO0B4KZ7mhzrccRlWicVomYkOxf1eaHQluf 2iwFc3hwccDxXApYPgc7G3Ak1XwgcMhuQvuWaGqiQGzPtstokWmzmxsD/o/VALZaP/vQ W8Z1XPfWvfmIqnqs01lbEPWD0XRKaCZ623fWr/tSegH8OMAtJbq4PyL2hyAQXjm+3bKi znrGpQFHPxkjc1lJ9WfGGJ2RUI7TQMmdsoSMk46OjVeVSlVrPDA+joUeXzGpz9VowxSw LwEQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r26-20020a638f5a000000b005641ddd0309si8077187pgn.599.2023.09.04.12.33.41; Mon, 04 Sep 2023 12:33:56 -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 S1351375AbjIDOH2 (ORCPT + 99 others); Mon, 4 Sep 2023 10:07:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241331AbjIDOH0 (ORCPT ); Mon, 4 Sep 2023 10:07:26 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F15A8C6 for ; Mon, 4 Sep 2023 07:07:22 -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 91D3A143D; Mon, 4 Sep 2023 07:08:00 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1A0A43F7F4; Mon, 4 Sep 2023 07:07:19 -0700 (PDT) From: James Clark To: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, broonie@kernel.org Cc: maz@kernel.org, James Clark , Catalin Marinas , Will Deacon , Suzuki K Poulose , Mike Leach , Leo Yan , Alexander Shishkin , James Morse , Kristina Martsenko , Anshuman Khandual , Rob Herring , Jintack Lim , Joey Gouly , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] arm64/sysreg: Move TRFCR definitions to sysreg Date: Mon, 4 Sep 2023 15:07:02 +0100 Message-Id: <20230904140705.1620708-2-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230904140705.1620708-1-james.clark@arm.com> References: <20230904140705.1620708-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 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. Signed-off-by: James Clark --- arch/arm64/include/asm/sysreg.h | 12 ----------- arch/arm64/tools/sysreg | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index b481935e9314..fc9a5a09fa04 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -171,8 +171,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) @@ -382,7 +380,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_HDFGRTR_EL2 sys_reg(3, 4, 3, 1, 4) #define SYS_HDFGWTR_EL2 sys_reg(3, 4, 3, 1, 5) #define SYS_HAFGRTR_EL2 sys_reg(3, 4, 3, 1, 6) @@ -640,15 +637,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 65866bf819c3..6ca7db69d6c9 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -2495,3 +2495,39 @@ Field 5 F Field 4 P Field 3:0 Align EndSysreg + +SysregFields TRFCR_EL2 +Res0 63:7 +UnsignedEnum 6:5 TS + 0b0001 VIRTUAL + 0b0010 GUEST_PHYSICAL + 0b0011 PHYSICAL +EndEnum +Res0 4 +Field 3 CX +Res0 2 +Field 1 E2TRE +Field 0 E0TRE +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