Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3325938rwo; Fri, 4 Aug 2023 03:10:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGF2HMVklAt4iXvdpY57PwCRLduSNEUdPIZ9mCslhW4bD2VSmS4EF6KwU6BjtUSoAtrGbpf X-Received: by 2002:a05:6a21:6d84:b0:136:f3ef:4ff with SMTP id wl4-20020a056a216d8400b00136f3ef04ffmr1649555pzb.50.1691143831510; Fri, 04 Aug 2023 03:10:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691143831; cv=none; d=google.com; s=arc-20160816; b=bFFZyDJbjakOSuJ3gGXsCuHxNGmLQmW1Z23tnuE2JNS8qK7fN2K6gXUOMLfW+dd3/O Had39/jkAIJEZyGn3NObjyD06yWxNSH+OcrVadSiBGTd75WHmVguj9+u79vrPz/1VlkT 1u7sr1VobVeanAg+DMUIZeQEW9ch5+Gj76udh/v3NVopRP+aQyrNle4Iq6Ckl3edwFxD 9WCnA+nBB2ZxM+Yo31XWuGG8TG1oAmGz/XF+RI70NOEDtBPz9AFfWf1fXmPI/btOGc0P Vn92yPJX99XQEuUHIukymu5yBMJh4hdFs3ln3bUNJV4+y8xYUIjc0Z5pkZb2Ff4VTspg voPA== 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=mmTJWVvttAifhTryTyo2wsDjIPDK4Lj8gAF15mY4pQ0=; fh=gzsRWniEvpnkgBxPOCIR2xEnGyeSwAL3OQIatOENPCw=; b=L4AI2XbvQ7zNG/0hsfGlrwaXdEDwbfcoeLvEknWAnucRUHN4WLwt7helTes2++rYdg RK2TYXDbWbnB5GoKim4CMvgLXdKZiwEGaR85jjhelE/WxM9eeuBT4E3d1ZiEKJUioTbc Ttj8iaMeiQ3bfypIijdHRQ18+QVK18w67IxA+7JfPCvWESMDqXZ+v5Ts4LDrjLPAtjUR eQ6bl9fvPWhwAwBBX+TXs0mXahQAclF6vWw2g8uDdxhUfyC/powMdYuEiXRrk6F7O5ou NY+/ss9cXx3KBA0/wmjDHqr+wXfxuXhzOvh9IxQw6fHlPtgY4dEDKu1lV1mQ1Tgr/7Q0 di7g== 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 cj5-20020a056a00298500b00687978513d0si1462054pfb.352.2023.08.04.03.10.19; Fri, 04 Aug 2023 03:10:31 -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 S229450AbjHDI6b (ORCPT + 99 others); Fri, 4 Aug 2023 04:58:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230085AbjHDI6A (ORCPT ); Fri, 4 Aug 2023 04:58:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E9A8C49DA for ; Fri, 4 Aug 2023 01:53:35 -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 E90921007; Fri, 4 Aug 2023 01:53:24 -0700 (PDT) Received: from e127643.arm.com (unknown [10.57.3.154]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3C4D23F6C4; Fri, 4 Aug 2023 01:52:39 -0700 (PDT) From: James Clark To: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: James Clark , Catalin Marinas , Will Deacon , Suzuki K Poulose , Mike Leach , Leo Yan , Alexander Shishkin , Mark Brown , James Morse , Kristina Martsenko , Anshuman Khandual , Rob Herring , Jintack Lim , Joey Gouly , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] arm64/sysreg: Move TRFCR definitions to sysreg Date: Fri, 4 Aug 2023 09:52:16 +0100 Message-Id: <20230804085219.260790-2-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230804085219.260790-1-james.clark@arm.com> References: <20230804085219.260790-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 TRFCR_EL2_CX needs to become TRFCR_ELx_CX to avoid unnecessary duplication and make the SysregFields block re-usable. Signed-off-by: James Clark --- arch/arm64/include/asm/sysreg.h | 12 ---------- arch/arm64/tools/sysreg | 22 +++++++++++++++++++ .../coresight/coresight-etm4x-core.c | 2 +- 3 files changed, 23 insertions(+), 13 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..fe1f824977d9 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -2495,3 +2495,25 @@ Field 5 F Field 4 P Field 3:0 Align EndSysreg + +SysregFields TRFCR_ELx +Res0 63:7 +UnsignedEnum 6:5 TS + 0b0001 VIRTUAL + 0b0010 GUEST_PHYSICAL + 0b0011 PHYSICAL +EndEnum +Res0 4 +Field 3 CX +Res0 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_ELx +EndSysreg diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index 703b6fcbb6a5..257e5c1a4b52 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -1145,7 +1145,7 @@ static void cpu_detect_trace_filtering(struct etmv4_drvdata *drvdata) /* If we are running at EL2, allow tracing the CONTEXTIDR_EL2. */ if (is_kernel_in_hyp_mode()) - trfcr |= TRFCR_EL2_CX; + trfcr |= TRFCR_ELx_CX; drvdata->trfcr = trfcr; } -- 2.34.1