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 941CCCCA480 for ; Thu, 7 Jul 2022 11:53: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-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-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pK20vCLcu4p2Wj5ZkI4orhYFg3jUbD+PC3w8YwFt3jo=; b=nsGEkx3g2lHZ2iXrX/kCmKXumZ DgfSO3lkwCtLaODEAasBek3pU9DwKJOIqyUstt/44yeYdYB9PyQsC5OyQZd0wREaKifFtcHRStkoN GYporD2BTPnkxXH3VipDUZsIXnGsGIEretCc35wyDDbmXb7e5nI/8beYYiZOkX/OzAjrDPdATrbyv b+v5t2RRqdxrq1xFDWlIcGGY73EaWs5x3sNwszM7Foq9rAUYgEMowhfdasOFKTpvF25JFVfELWxBe shKhWlI+yTOpmYqDD0jRUUWo8IcbqfqjSzeq0QXNe1Xy00xjHoCAzIbszmtBSgjDoOny7or2EpTzA suNq5whw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9Q3s-00FulM-IN; Thu, 07 Jul 2022 11:52:48 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9Q3p-00Fuiw-Ai for linux-arm-kernel@lists.infradead.org; Thu, 07 Jul 2022 11:52:46 +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 ams.source.kernel.org (Postfix) with ESMTPS id 29257B82139; Thu, 7 Jul 2022 11:52:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EE38C3411E; Thu, 7 Jul 2022 11:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657194761; bh=QYs8eXMfbdKfCuDG86ugHBbjuxH11waDt+H/RZHhqOU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aUeIWwaj88fCs0MBNoiCKpxKwrBTHIvKiwGqA5sXUThhmOMUzwDoOQ3N09uAv9gJ3 w8s+qrZCE/l9JpymRD4LBm4aulcy0B6oTV+cm4+BlpG+BqTx2z3+CuIlzd1iuSnpPs RmguJo8jstyvoBSkcRjVFubrKlXc122STZ9h54xI7h9tfcnJa0+IGqN0Ox/CPLhjcw reuHLXs0HKC7m2PsGERzFfussbMC0HbaJ4sFzjJ0oCqBsUrfetyUz3KwkTX/8xBOoP Zjlcs7Jnt2q+Vq7Zt/MQu6kCF/6ZyHzdVxovEup4OcknQt2uqk+YV9lLFWDhMSnJ50 MYi+cW0YnOPNA== Date: Thu, 7 Jul 2022 12:52:37 +0100 From: Mark Brown To: Catalin Marinas Cc: Will Deacon , Suzuki K Poulose , Szabolcs Nagy , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5 2/3] arm64/cpufeature: Store elf_hwcaps as a bitmap rather than unsigned long Message-ID: References: <20220707103632.12745-1-broonie@kernel.org> <20220707103632.12745-3-broonie@kernel.org> MIME-Version: 1.0 In-Reply-To: X-Cookie: Tell me what to think!!! X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220707_045245_563123_35DEB4EA X-CRM114-Status: GOOD ( 18.32 ) 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: multipart/mixed; boundary="===============5746320839134639752==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5746320839134639752== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d4jok1U5zY85Gvwu" Content-Disposition: inline --d4jok1U5zY85Gvwu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jul 07, 2022 at 12:37:58PM +0100, Catalin Marinas wrote: > On Thu, Jul 07, 2022 at 11:36:31AM +0100, Mark Brown wrote: > > -#define MAX_CPU_FEATURES 64 > > +#define MAX_CPU_FEATURES 128 > Should this be (32 + 64)? I guess it's easier as you did since we have > 128 bits in total, only that we reserved the top 32 in ELF_HWCAP. We need to have the full 64 bits allocated for AT_HWCAP storage even if nothing uses the top 32 so that we can return the elements in the array, otherwise we need logic for fishing variably sized silces of bits out of the bitmap which seems more trouble than it's worth. > > unsigned long cpu_get_elf_hwcap2(void) > > { > > - return upper_32_bits(elf_hwcap); > > + return elf_hwcap[1]; > > } > This is fine on the assumption that DECLARE_BITMAP is always an array of > longs. I couldn't see any documentation on this but at least the > set_bit() etc. API only works on 'long *' pointers. If someone changes DECLARE_BITMAP() they're going to have to be very, very careful. --d4jok1U5zY85Gvwu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmLGyQQACgkQJNaLcl1U h9DlTwf+Np02j0thZQKYrS7lxJxmn8z9N/vHR4Vj6VTMzoCG+p1D4QVVJ+gZjfoA VtjSa0XNP2cxhDWtyrrEz77rngdGg0bwcpF9YsBxAdO8/wLHNRZe3ZZpIJMXME3r PmKiW0fr49bt/yY1HHgh0NdJ1EZR1/AVlETx9aY+o4UQnFEFp6R6O9o9e/vYASdO IFiSnWIhMk3NjKA6/jYNhkK1lwPf6LGcoBS7aSSUa2YDWOFMZmR+5MfDkSZS2uoe bGHanVPehqq3WmzhIPmmqrJJARlZLJetYTX3zN0SmHfifDZRyP3uopcREeT2sbXw IK730YW+EZoaTshkrSE6mQO+1WBezA== =uqJj -----END PGP SIGNATURE----- --d4jok1U5zY85Gvwu-- --===============5746320839134639752== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============5746320839134639752==--