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 D3D53C4332F for ; Fri, 9 Dec 2022 19:09:58 +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:Date:Cc:To:MIME-Version:Message-Id: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4KZRAUoE4Tf+T4U8P9HZS3LOMhz5SzLWJLnXdc475i4=; b=4VTusSnQ/xrVul a9oJSHUa7aYWoTxrh+Re5wJGJO4u5dnKWmcmrhWhsbgeTPklB3x6d97VxnRXXYIKTHMA4hJeMzRdC BJIPn4mdMjypDCeuzKs1qh+naYIBIktpXQLRnslKwml+Z0Hkwj6IIMFt+exCuxF0W5Axvnp6r9V9p 57Tcopn+0IMBWNr1OEtBc47Yrr+EovHyGp/0MgbuBQ2B2+HExwZuQqWAHOblmPECiwDioxvEmaK9u EikwR/2Lw+zugLoFOam1ZD8FndHHb4GjCo9dVoXcEwqwHmGy1fpga3wUb9fFMdiEy6zt+fr1TwYcX G5V0K2QzhJwIgf9FKduQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3ik1-00AbK1-G2; Fri, 09 Dec 2022 19:09:01 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3ijn-00Ab7R-8G for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 19:08:48 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4E35262303; Fri, 9 Dec 2022 19:08:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CF8FC433EF; Fri, 9 Dec 2022 19:08:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670612921; bh=eXVzYBRn8v9olSVQUE77nXbnTLCikNGj4VdijwQkDn0=; h=From:Subject:To:Cc:Date:From; b=bSefUYfrw2vZYX2sTD7HguXR6wDr+TD13UdK+w0kVIc4CiggQEPPuxFnZYiE2D98K 1w/lIT5wIWElrKZXideOkk505eaRfeAlfnSEA90BjkhnbdVHSZ6X+XtOFYGX1qVzUU YCpqwEOD11Ndu6JXNr7IDciY+FpaBWaclAjcmaSPlg8WA5hHbO/LMRc9CZextjj4A5 TVeM1CJ4/0zzgSss35AR0BIJLlMe/v8Rk6hZ4vYRK1LH6Of37333QPFe7Ho35KKjqD 4dFRxV7SAlyv7+2lozzqLSe/9ELGR1j0NmdWJBagNrm2Vlyu8vGacFY9fU5AKAp6FR s1aExEJjb7YDQ== From: Mark Brown Subject: [PATCH v2 0/7] arm64/cpufeature: Make use of sysreg helpers for hwcaps Message-Id: <20221207-arm64-sysreg-helpers-v2-0-19f0e63dbb36@kernel.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIANeGk2MC/4WNQQ6CMBAAv2J6dk1bGhBP/sNwaHGhDdiSXYMSw t8tfMDjTDKZVTBSQBa30yoI58AhxQz6fBKtt7FHCM/MQkutlZYVWHqVBnhhwh48jhMSQ1kVpjTa VZ2rRU6dZQRHNrZ+jz+Jhl1PhF34HrdHk9kHfidajvmsdvvnMyuQoEzdWVXIq9XFfUCKOF4S9aL Ztu0H3C2madAAAAA= To: Catalin Marinas , Will Deacon , Catalin Marinas , Will Deacon Cc: Suzuki K Poulose , James Morse , Mark Rutland , linux-arm-kernel@lists.infradead.org, Suzuki K Poulose , James Morse , Mark Rutland , linux-arm-kernel@lists.infradead.org, Mark Brown X-Mailer: b4 0.11.0-dev-94046 X-Developer-Signature: v=1; a=openpgp-sha256; l=3080; i=broonie@kernel.org; h=from:subject:message-id; bh=eXVzYBRn8v9olSVQUE77nXbnTLCikNGj4VdijwQkDn0=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjk4exmp2itDO78Lyqe1id3kwwDgWS+Bt8oWKv4z/w TWVz84SJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY5OHsQAKCRAk1otyXVSH0P3WB/ 9Qu7kpVw+Nr4o/HIWVna6DLgWeKkVqiaa/4WAa61H5VyCwqdQpdI+S32S5PldnGCGC42kAxcvxu511 h6neSmTDuMjSC9Y0H09KT2iMW9xrR5lBwx85d7X1cyO/D0V9RgSYuPzjpxk7xHcFbqO1yAJl17WOq1 ElJ21tL+UhO4C0iMML1ZzanaBuJAEIdmPuaAxznafGdApiyVjhc3VdY/DjnN+gLc1lAeaQnjRtEXN9 uZP6d/uRiZVbDuW4j7qAaz8Akki7/kKFWqNuf3DOIetX+1Q8ovxEvnhP0yf6Be4A9VFRYvDzG5pDw2 SKam5pqgswdaRb4q6jSteO1Tx1izo3 X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Date: Fri, 9 Dec 2022 19:08:40 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_110847_400884_79A6E687 X-CRM114-Status: GOOD ( 16.82 ) 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 Now that all the ID registers we use have been converted to automatic register generation we can start to make use of the regular definitions we have for the registers and their bitfields to make the hwcap tables easier to write and review. This series does that, updating the macros used to generate the hwcaps to provide what should be clearer and less error prone specifications for the hwcaps. We move from specifying like this: HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_EL1_BT_SHIFT, 4, FTR_UNSIGNED, ID_AA64PFR1_EL1_BT_IMP, CAP_HWCAP, KERNEL_HWCAP_BTI), to this: HWCAP_CAP(ID_AA64PFR1_EL1, BT, IMP, CAP_HWCAP, KERNEL_HWCAP_BTI), which is shorter due to having less duplicate information and makes it much harder to make an error like specifying the wrong field width or an invalid enumeration value since everything must be a constant defined for the sysreg and names are only typed once. I'm posting it now in the hope of getting some review before v6.2-rc1 comes around, changing this will cause dependency issues for any series adding new features so if we're going to do it it's probably helpful to get it merged relatively early. There is no difference in the .rodata generated before and after these changes other than the single byte changed from 0 to 1 which is expected due to the first patch fixing the declared sign for ID_AA64PFR0_EL1.DIT. While doing this I found some errors which I have previously posted, I've rolled those fixes into this series for simplicity. v2: - Also add an explicit UnsignedEnum and don't generate sign defines for unannotated enums. - Annotate the unsigned enums that we use. - Rename the new defines from _SIGN to _SIGNED. - Commit message rewording and thinko fixes. - Link to v1: https://lore.kernel.org/r/20221207-arm64-sysreg-helpers-v1-0-149fa1308a23@kernel.org To: Catalin Marinas To: Will Deacon Cc: Suzuki K Poulose Cc: James Morse Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Mark Brown --- Mark Brown (7): arm64/cpufeature: Fix field sign for DIT hwcap detection arm64/sysreg: Fix errors in 32 bit enumeration values arm64/sysreg: Allow enumerations to be declared as signed or unsigned arm64/sysreg: Annotate signed enumerations we use arm64/sysreg: Initial unsigned annotations for ID registers arm64/cpufeature: Always use symbolic name for feature value in hwcaps arm64/cpufeature: Use helper macros to specify hwcaps arch/arm64/kernel/cpufeature.c | 181 ++++++++++--------- arch/arm64/tools/gen-sysreg.awk | 29 ++++ arch/arm64/tools/sysreg | 374 ++++++++++++++++++++-------------------- 3 files changed, 303 insertions(+), 281 deletions(-) --- base-commit: 5f4c374760b031f06c69c2fdad1b0e981a1ad42f change-id: 20221207-arm64-sysreg-helpers-6734642b7fb9 Best regards, -- Mark Brown _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel