From mboxrd@z Thu Jan 1 00:00:00 1970 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 0DCA4C7619A for ; Wed, 12 Apr 2023 09:05:57 +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:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=D/H1guthYx9gb4CYDzLzcfpd3ikqXVaoCtn3pjbKh2E=; b=SRAZS/fI/DPdyb 1PYL35REr1r7XRbnfH0Y3z034OzybWhk1eqwTlRWq31acLuAXkijfnvkaQNPaiiBqtaI8K2dYbwc3 QNNADP5siS5pXAHhfJIiBu56D8gSkr7mtmB+4xYN2jPxe/r/vz0B82AMMnvMXO5tohLTE6MVpDgBV waGeU63MKvsVkcDusNjO102aTFO9wl7K3pDV++WzYUnhOHpPYbE5zGEx6qXrWLGMi0fi0WF9KBXv5 nt6gap7KQZH7krM9036cNeJs/oufhdiwYUlUL00wjYHEP+c7pVjFm5YyrMeshQoWjrt/hu5YL7AQZ tWwe+Uzpq41w6FYlLC3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmWPQ-002Lh3-1U; Wed, 12 Apr 2023 09:04:56 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmWPO-002Lge-1V for linux-arm-kernel@lists.infradead.org; Wed, 12 Apr 2023 09:04:55 +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 E19A962A0D; Wed, 12 Apr 2023 09:04:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 451C8C433EF; Wed, 12 Apr 2023 09:04:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681290293; bh=zZZlNeCjDkasiEk+l/m8l9090JK0GVdmjnq3v9cYBb0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f6+EymLXJmlB2tmOulEOsDMnGozkR2Kd+tJU/h5acc4uS5QELcvMXummYzASM7k5q 0veeFs/SqOpmd2kTkY0oVU2d4f9mFMf4SNGmFsBDvZ1MXk15NUSUXtfAPndQ9QMz1h oH4xAT/K6e8cLPnGEoKJtoU0kJ14K+4Rk/ThqaNQxEFVeP1lU2GaujfGWQufKrBgsr ReWkhwiRQRPSgKvZCuAySaZmsEik2/Zcdy2QUDO9sdoXsBDaZJR26Pd25JBlPE54uH Pf/bN4AuWnkQwd8ioIn9YLUtKrn74ePw+d2K3fUMpUziVkjcPlPGIkhlpTTv16A4oh rzU23jhbe5r0Q== Date: Wed, 12 Apr 2023 10:04:48 +0100 From: Will Deacon To: Mark Brown Cc: Catalin Marinas , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] arm64/cpufeature: Use helper macro to specify ID register for capabilites Message-ID: <20230412090447.GA24799@willie-the-truck> References: <20230303-arm64-cpufeature-helpers-v1-0-b16cf36acaea@kernel.org> <20230303-arm64-cpufeature-helpers-v1-3-b16cf36acaea@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230303-arm64-cpufeature-helpers-v1-3-b16cf36acaea@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230412_020454_565849_B475ADBD X-CRM114-Status: GOOD ( 18.73 ) 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 Mon, Mar 06, 2023 at 10:20:25PM +0000, Mark Brown wrote: > When defining which value to look for in a system register field we > currently manually specify the register, field shift, width and sign and > the value to look for. This opens the potential for error with for example > the wrong field width or sign being specified, an enumeration value for > a different similarly named field or letting something be initialised to 0. > > Since we now generate defines for all the ID registers we now have named > constants for all of these things generated from the system register > description, meaning that we can generate initialisation for all the fields > used in matching from a minimal specification of register, field and match > value. This is both shorter and eliminates or makes build failures several > potential errors. > > No change in the generated binary. > > Signed-off-by: Mark Brown > --- > arch/arm64/kernel/cpufeature.c | 245 ++++++++--------------------------------- > 1 file changed, 44 insertions(+), 201 deletions(-) [...] > .desc = "WFx with timeout", > .capability = ARM64_HAS_WFXT, > .type = ARM64_CPUCAP_SYSTEM_FEATURE, > - .sys_reg = SYS_ID_AA64ISAR2_EL1, > - .sign = FTR_UNSIGNED, > - .field_pos = ID_AA64ISAR2_EL1_WFxT_SHIFT, > - .field_width = 4, > - .matches = has_cpuid_feature, > - .min_field_value = ID_AA64ISAR2_EL1_WFxT_IMP, > + ARM64_CPUID_FIELDS(ID_AA64ISAR2_EL1, WFxT, IMP) You drop the '.matches' field here. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel