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 251B1C433F5 for ; Wed, 2 Mar 2022 10:13:45 +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:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ET+wJginf2QcrXzFp50FuM/yTlUhRgGU5r/QrrPyWb4=; b=Rsx0ZgnILa9/Za GwSi79tJxOtD+aDd3EvGHoR2WgOpGg98Th1ZagMAvDh30d2fAArQVtocIp0upYCSvW5uYRESuVfCN qNZbdfATbSIx8+YOflbWIn/+QaS3yZxVHZicotg65YxGRaT3g3B003FIMpzMme+bCwvFYm8Zqk8cZ mjDlBcznsFc/r0ZXFdhKal2LGGeSSyt1m0etZRXVQQ83tBehALZ2d/hspaPtBzuvv/1IUSs8StRvO WPFORHdH9xOceCGtYVkEO8xQDIxS2wKDMCnXNoO6rAq87n2+HENIUUJPYhHA/nVCdJvqr3NYr+fy1 lYH9751uuv1CX3A6DKmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPLy0-002Fec-3j; Wed, 02 Mar 2022 10:12:20 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPLxv-002Fd3-Rm for linux-arm-kernel@lists.infradead.org; Wed, 02 Mar 2022 10:12:17 +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 sin.source.kernel.org (Postfix) with ESMTPS id 18609CE203B; Wed, 2 Mar 2022 10:12:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7053DC004E1; Wed, 2 Mar 2022 10:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646215932; bh=YgKpF4zSy+yYaEilN43vPrN5rclu1UHyi5Y9gnBFE8E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TeHrU+45hm5q3HE2xLt/GAkAOddSLQu2ejzHIHZwTP3ybt8a8XnQ/pMjJuMHb5S5L /h1Y8693i0olESxPuI4AeFxFiCmLWBKJVgRUG8b+oQdYU3PfP3SxPnz/XXIumAgnPt MP6lexq4KapzOWdGKbFRCp48gsxkWJkxDXBVfD58tU3eHDPfIHRAtUl+GxxDMJCvdH i79lwvOKfV0P7jqe1/JHdc/pYfjUoaMC3gCqtJOIUzrga1OjKzjOFM1yeOT62rOxKZ 9Y3KXBXW7UxBsWLHti+VJBKshUnmIZE9BhqMLnUacPJafKDRBphtwM4FD5RGheYS5q ZXYF03hpVfUeg== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nPLxq-00Bdty-9L; Wed, 02 Mar 2022 10:12:10 +0000 Date: Wed, 02 Mar 2022 10:12:09 +0000 Message-ID: <878rts3bpi.wl-maz@kernel.org> From: Marc Zyngier To: Qian Cai Cc: Mark Brown , Catalin Marinas , Will Deacon , Shuah Khan , "Shuah\ Khan" , Basant Kumar Dwivedi , Luis Machado , Szabolcs Nagy , , , Alan Hayward , , "Salil\ Akerkar" Subject: Re: [PATCH v11 03/40] arm64: cpufeature: Always specify and use a field width for capabilities In-Reply-To: References: <20220207152109.197566-1-broonie@kernel.org> <20220207152109.197566-4-broonie@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: quic_qiancai@quicinc.com, broonie@kernel.org, catalin.marinas@arm.com, will@kernel.org, skhan@linuxfoundation.org, shuah@kernel.org, Basant.KumarDwivedi@arm.com, luis.machado@arm.com, szabolcs.nagy@arm.com, linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, alan.hayward@arm.com, kvmarm@lists.cs.columbia.edu, Salil.Akerkar@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220302_021216_275036_09159039 X-CRM114-Status: GOOD ( 23.27 ) 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 Tue, 01 Mar 2022 22:56:41 +0000, Qian Cai wrote: > > On Mon, Feb 07, 2022 at 03:20:32PM +0000, Mark Brown wrote: > > Since all the fields in the main ID registers are 4 bits wide we have up > > until now not bothered specifying the width in the code. Since we now > > wish to use this mechanism to enumerate features from the floating point > > feature registers which do not follow this pattern add a width to the > > table. This means updating all the existing table entries but makes it > > less likely that we run into issues in future due to implicitly assuming > > a 4 bit width. > > > > Signed-off-by: Mark Brown > > Do we leave this one alone on purpose? > > .desc = "GIC system register CPU interface", > .capability = ARM64_HAS_SYSREG_GIC_CPUIF, > .type = ARM64_CPUCAP_STRICT_BOOT_CPU_FEATURE, > .matches = has_useable_gicv3_cpuif, > .sys_reg = SYS_ID_AA64PFR0_EL1, > .field_pos = ID_AA64PFR0_GIC_SHIFT, > .sign = FTR_UNSIGNED, > .min_field_value = 1, > > Since width == 0, it will generate an undefined behavior. I don't think that's on purpose, and we should definitely address this. Maybe we should have a warning if we spot an occurrence of .width being 0. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel