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 EBED7C433F5 for ; Tue, 25 Jan 2022 05:06:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Bkt0iEuusgJbt7B2tde5qjMe+Za7HBuwDl9N/OtHFVE=; b=GCv2ZK1yWheK5PIGyvtWtfnsM9 Haxt8/RrhWB7hUTs5c6Gy1ODQZoDbc7Rjee1pjevf8L4q7HvZY9hmXmdtZzR8TIOiHqcHPAgzWgeZ 24nX2ZKDYrj+fLl2WxDSH2vZM9jq9k6LoqKruWsYjAkWvcfN8bAEEwHxTtHomM+pMB+f3uiWTpzMq MOSO641jVhgDigVytsfjxiN1f6ZotnRrx3J+BRbqENVqxSf17TReTpTZvWSwPBw8MeOVT2kXhOBeD NTYsaBZxb63SZdy8FDEESIDsyK0G0b7cncZftLXNL/aSjSz1bai1LsNkUXVqkl7AcS4OZMQm91GH/ h8vJxwZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCE0P-006Sps-Ra; Tue, 25 Jan 2022 05:04:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCE0L-006Sp9-La for linux-arm-kernel@lists.infradead.org; Tue, 25 Jan 2022 05:04:31 +0000 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 5A0441FB; Mon, 24 Jan 2022 21:04:22 -0800 (PST) Received: from [10.163.42.113] (unknown [10.163.42.113]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0AC593F7D8; Mon, 24 Jan 2022 21:04:17 -0800 (PST) Subject: Re: [RFC V1 02/11] arm64/perf: Add register definitions for BRBE To: Marc Zyngier Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Mark Rutland , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-perf-users@vger.kernel.org References: <1642998653-21377-1-git-send-email-anshuman.khandual@arm.com> <1642998653-21377-3-git-send-email-anshuman.khandual@arm.com> <877dap8c0o.wl-maz@kernel.org> From: Anshuman Khandual Message-ID: <165b3f65-c92e-75e3-9485-548e1c862ec4@arm.com> Date: Tue, 25 Jan 2022 10:34:22 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <877dap8c0o.wl-maz@kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220124_210429_789834_8DBAE332 X-CRM114-Status: GOOD ( 17.90 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 1/24/22 7:35 PM, Marc Zyngier wrote: > On Mon, 24 Jan 2022 04:30:44 +0000, > Anshuman Khandual wrote: >> >> This adds BRBE related register definitions and various other related field >> macros there in. These will be used subsequently in a BRBE driver which is >> being added later on. >> >> Cc: Catalin Marinas >> Cc: Will Deacon >> Cc: Marc Zyngier >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: Anshuman Khandual >> --- >> arch/arm64/include/asm/sysreg.h | 216 ++++++++++++++++++++++++++++++++ >> 1 file changed, 216 insertions(+) >> >> diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h >> index 898bee0004ae..d8fd7e806a47 100644 >> --- a/arch/arm64/include/asm/sysreg.h >> +++ b/arch/arm64/include/asm/sysreg.h >> @@ -141,6 +141,218 @@ >> #define SYS_DBGDTRTX_EL0 sys_reg(2, 3, 0, 5, 0) >> #define SYS_DBGVCR32_EL2 sys_reg(2, 4, 0, 7, 0) >> >> +/* >> + * BRBINF_EL1 Encoding: [2, 1, 8, CRm, op2] >> + * >> + * derived as = c{N<3:0>} = (N<4>x4 + 0) >> + */ >> +#define SYS_BRBINF0_EL1 sys_reg(2, 1, 8, 0, 0) >> +#define SYS_BRBINF1_EL1 sys_reg(2, 1, 8, 1, 0) >> +#define SYS_BRBINF2_EL1 sys_reg(2, 1, 8, 2, 0) >> +#define SYS_BRBINF3_EL1 sys_reg(2, 1, 8, 3, 0) >> +#define SYS_BRBINF4_EL1 sys_reg(2, 1, 8, 4, 0) >> +#define SYS_BRBINF5_EL1 sys_reg(2, 1, 8, 5, 0) >> +#define SYS_BRBINF6_EL1 sys_reg(2, 1, 8, 6, 0) >> +#define SYS_BRBINF7_EL1 sys_reg(2, 1, 8, 7, 0) >> +#define SYS_BRBINF8_EL1 sys_reg(2, 1, 8, 8, 0) >> +#define SYS_BRBINF9_EL1 sys_reg(2, 1, 8, 9, 0) > > [snip] > > Since the architecture gives you the formula to build these, why do > you enumerate each and every register encoding? I'd rather see > something like: > > #define __SYS_BRBINFO(n) sys_reg(2, 1, 8, ((n) & 0xf), (((n) & 0x10)) >> 2) > #define SYS_BRBINF0_EL1 __SYS_BRBINFO(0) > [...] > > and something similar for all the new registers that come in packs of > 32... We already have similar things for AMU, PMU, GIC and co. Sure, above method seems like a better idea indeed. I will create these constructs for BRBINF, BRBSRC and BRBTGT based registers set. > > Thanks, > > M. > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel