From patchwork Tue Jan 7 11:32:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13928752 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64E86E77197 for ; Tue, 7 Jan 2025 11:44:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BppzZqICDIuXzcoVaHw/k3QGylTLzE7ExLc+N8DKJB4=; b=P8jqU+JSu6RXgrqrxKwSbrel7U ViTYy1VaThXTtN08sjoQJjfxQPYXEIPZ9AkRBUnBx5KEeEI8l7kF5o4Obhb5vzQfkxUNJMwqxFtEt e24+cfNrFDi0ygtOtjm33Xm66C4hZqBRz627fUIGFfNAfpL6qImoFgL+DcPdCsWKqCRRvaAMQpzte YB0KKaD2220Z1ejiHmwnwZsze8Qn0Sn3dsiP4G3kxFRVYfNSk9BEJuHzHm3gxPtMPjL/MKRUSvzPa zGKdAzhd3MPAP7t4iMHzD1aNBD9VCT4HqlOwJIWK/WzCwi78qgfVCD/wOG9rZykO5AUDkWCFkD9tq 4M1GDjnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tV80F-00000004c2g-1Gen; Tue, 07 Jan 2025 11:44:07 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tV7rP-00000004ZvE-1IIY for linux-arm-kernel@lists.infradead.org; Tue, 07 Jan 2025 11:35:03 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4361c705434so111342895e9.3 for ; Tue, 07 Jan 2025 03:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736249698; x=1736854498; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BppzZqICDIuXzcoVaHw/k3QGylTLzE7ExLc+N8DKJB4=; b=O5RcuZq53lS/SlTHmsn/ttLHJqFhdVsctTYuSdlcLtrQApr6piq357TD/KiVktWkW3 SU7Ayprc+TMsGjo6bBzSyfcv8vbr+YAyrfw7sPsVPck9MXJ8FbamxQ05RhzEonb3Gfms ynGmpfnMLDtIXYJ5JDZYlHKX7W/RFu5NWWdEwgiiYPeZXonSP7qc4ikQWTU0Yj3L4sNX Wr9FjjPUG6RqJiSvbnxUPWebywXta9NGiW66Uun4sfockClI+kaLWdM3thFfd522I/m+ bl4Cj7TGBOz3QbjEKWVJpHpf+ZZ1fOtYLMikJxCYlNhgKXSaH0p1xDEBxP3eC7AWxEB4 5iXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736249698; x=1736854498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BppzZqICDIuXzcoVaHw/k3QGylTLzE7ExLc+N8DKJB4=; b=em7fqKWn8dQUY3mqaFJXoOHDy77GPHG9b45PH9mW3zYoqn0zmWkO6DeO/yogv5iLxo WFR76B+eEi4EbLS00K3Xc0fqo5NraxfYniR3O12FosrS5cuaZogVr/R/S+gT4nv7Jn26 up5RbLRfLvNZAJRPb8cKSKkSpurKTMpmjmQwW3/rcspAbsWsvpnQylt83gewVxn3JxGF HHLcYpJ4RcpNCCpNrC/a+U2tOCx26cwfJDPt6SLJ2rKDpreI8bbxPkt2yhqvlt3McTJK BKWA/8J6A8dUrGwyMz8GLrPMdrTKfWTa4T39Jm+UXtLjfDPa8RwC6v5msztV4C1z7xdF 66qA== X-Forwarded-Encrypted: i=1; AJvYcCXO+F4fvl1s4JJODcPBvs0h1K9HqDqBXPzoCFPOv7vCPHsiIKTh43mLQOduTgx1yw/S2CRH9s+1mGLOq9Qr+7KE@lists.infradead.org X-Gm-Message-State: AOJu0YyFeUCPi46dtDgq3iWDOs5p2fqWrV4CYcsvDZdyTHYtY/nnf7BD 9YbmWaRCfBJaGE7RlbngotYx9S2bfzS1EIxrcNMftel4z5zX6vqWOhb1NyyU9Hk= X-Gm-Gg: ASbGnct+hdJ7mcmERJCRjSidDaQo3Ge41Ulp48hJDNVQfh4oh2Ts9OszYKM4g0dV6iL 3MjIkRy5KwLOk5k3z+u9Uhaa4pzBoHncC451iEvUJLBPy2LLrhVKKzu70LtQ477B1Byb7I4gcBj 36YJu8tYiiuRV62RFmSsZuClxk93zgalnyiRA1M6zJQu4Ln0LY6Tr3UPvlemxMRuw/br1yhJhfe GQeGdlqofjy2MF0Sr+PqL+SeFNMDgzM/GZeeMHwh5wQ+RDMjU5KYw7U X-Google-Smtp-Source: AGHT+IHbbqMsVouH91OdV8KnMQ8MWBA16k416qmoq9omp3TMxv8sl0fEiUNFYol+SJHdemxMmyVdqA== X-Received: by 2002:a5d:47c9:0:b0:38a:615c:8223 with SMTP id ffacd0b85a97d-38a615c82bemr20141492f8f.10.1736249697667; Tue, 07 Jan 2025 03:34:57 -0800 (PST) Received: from pop-os.. ([145.224.66.180]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c89e1acsm50299218f8f.68.2025.01.07.03.34.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 03:34:57 -0800 (PST) From: James Clark To: maz@kernel.org, kvmarm@lists.linux.dev, oliver.upton@linux.dev, suzuki.poulose@arm.com, coresight@lists.linaro.org Cc: James Clark , Mark Brown , James Clark , Joey Gouly , Zenghui Yu , Catalin Marinas , Will Deacon , Mike Leach , Alexander Shishkin , Mark Rutland , Shiqi Liu , James Morse , Anshuman Khandual , Fuad Tabba , "Rob Herring (Arm)" , Raghavendra Rao Ananta , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v10 06/10] arm64/sysreg/tools: Move TRFCR definitions to sysreg Date: Tue, 7 Jan 2025 11:32:43 +0000 Message-Id: <20250107113252.260631-7-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250107113252.260631-1-james.clark@linaro.org> References: <20250107113252.260631-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250107_033459_348153_2BAC9224 X-CRM114-Status: GOOD ( 14.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: James Clark Convert TRFCR to automatic generation. 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. Also add TRFCR_EL12 which will start to be used in a later commit. Unfortunately, to avoid breaking the Perf build with duplicate definition errors, the tools copy of the sysreg.h header needs to be updated at the same time rather than the usual second commit. This is because the generated version of sysreg (arch/arm64/include/generated/asm/sysreg-defs.h), is currently shared and tools/ does not have its own copy. Reviewed-by: Mark Brown Signed-off-by: James Clark Signed-off-by: James Clark --- arch/arm64/include/asm/sysreg.h | 12 --------- arch/arm64/tools/sysreg | 36 +++++++++++++++++++++++++++ tools/arch/arm64/include/asm/sysreg.h | 12 --------- 3 files changed, 36 insertions(+), 24 deletions(-) diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index b8303a83c0bf..808f65818b91 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -283,8 +283,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) @@ -519,7 +517,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_VNCR_EL2 sys_reg(3, 4, 2, 2, 0) #define SYS_HAFGRTR_EL2 sys_reg(3, 4, 3, 1, 6) #define SYS_SPSR_EL2 sys_reg(3, 4, 4, 0, 0) @@ -983,15 +980,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 4ba167089e2a..ef8a06e180b3 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -1997,6 +1997,22 @@ Sysreg CPACR_EL1 3 0 1 0 2 Fields CPACR_ELx EndSysreg +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 SMPRI_EL1 3 0 1 2 4 Res0 63:4 Field 3:0 PRIORITY @@ -2546,6 +2562,22 @@ Field 1 ICIALLU Field 0 ICIALLUIS EndSysreg +Sysreg TRFCR_EL2 3 4 1 2 1 +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 +EndSysreg + + Sysreg HDFGRTR_EL2 3 4 3 1 4 Field 63 PMBIDR_EL1 Field 62 nPMSNEVFR_EL1 @@ -2956,6 +2988,10 @@ Sysreg ZCR_EL12 3 5 1 2 0 Fields ZCR_ELx EndSysreg +Sysreg TRFCR_EL12 3 5 1 2 1 +Fields TRFCR_ELx +EndSysreg + Sysreg SMCR_EL12 3 5 1 2 6 Fields SMCR_ELx EndSysreg diff --git a/tools/arch/arm64/include/asm/sysreg.h b/tools/arch/arm64/include/asm/sysreg.h index 345e81e0d2b3..150416682e2c 100644 --- a/tools/arch/arm64/include/asm/sysreg.h +++ b/tools/arch/arm64/include/asm/sysreg.h @@ -283,8 +283,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) @@ -519,7 +517,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_VNCR_EL2 sys_reg(3, 4, 2, 2, 0) #define SYS_HAFGRTR_EL2 sys_reg(3, 4, 3, 1, 6) #define SYS_SPSR_EL2 sys_reg(3, 4, 4, 0, 0) @@ -983,15 +980,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)