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 437C5CDB465 for ; Mon, 16 Oct 2023 10:09:10 +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=jNt5F9HJ5FxvqpWermUpuv99RC2LzCnONEBvT5WL2wI=; b=LUWk4/5fHiDxIg 6QJDWrAVTTB2JN1W9l1aAkdTBG0sQSvpssG8jZA5Uh30R5fhQpD9VZ3OZFZCPWdtcD/6or95mAW4j EHkfjRV4+vggwl91wq4c2nDNy3nvNjkKCQMpvO1VtEtveSOrXgp5TNb0IJak0Flbo1TVJ1TuaCq/N Yd4dfMhspibzoxHffXEqQkmktSJ9UVOCrFljyG7TpUACtB9VCGgAESQsAvR3delHpMgeeCrLcSms/ gQOTFcdTCliPQha4qNmiz5FEvlGshKxLlIugecov7mYZWXa7TzxWyry0hBGhMBnp3AjFDIJ2VfLoR y/gZf23+s5wIPbuAtu2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qsKWg-0096MJ-1n; Mon, 16 Oct 2023 10:08:42 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qsKWd-0096LF-2J for linux-arm-kernel@lists.infradead.org; Mon, 16 Oct 2023 10:08:41 +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 F11431FB; Mon, 16 Oct 2023 03:09:12 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.68.174]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BAF093F762; Mon, 16 Oct 2023 03:08:29 -0700 (PDT) Date: Mon, 16 Oct 2023 11:08:19 +0100 From: Mark Rutland To: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org, ardb@kernel.org, bertrand.marquis@arm.com, boris.ostrovsky@oracle.com, broonie@kernel.org, daniel.lezcano@linaro.org, james.morse@arm.com, jgross@suse.com, kristina.martsenko@arm.com, maz@kernel.org, oliver.upton@linux.dev, pcc@google.com, sstabellini@kernel.org, suzuki.poulose@arm.com, tglx@linutronix.de, vladimir.murzin@arm.com, will@kernel.org Subject: Re: [PATCH v3 33/38] arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_1742098 Message-ID: References: <20231010103139.3113421-1-mark.rutland@arm.com> <20231010103139.3113421-34-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231016_030839_822488_5ADD0E93 X-CRM114-Status: GOOD ( 22.13 ) 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 Fri, Oct 13, 2023 at 07:04:57PM +0100, Catalin Marinas wrote: > On Fri, Oct 13, 2023 at 11:53:53AM +0100, Mark Rutland wrote: > > On Tue, Oct 10, 2023 at 11:31:34AM +0100, Mark Rutland wrote: > > > static void elf_hwcap_fixup(void) > > > { > > > -#ifdef CONFIG_ARM64_ERRATUM_1742098 > > > - if (cpus_have_const_cap(ARM64_WORKAROUND_1742098)) > > > + if (cpus_have_cap(ARM64_WORKAROUND_1742098)) > > > compat_elf_hwcap2 &= ~COMPAT_HWCAP2_AES; > > > -#endif /* ARM64_ERRATUM_1742098 */ > > > } > > > > The kbuild test robot pointed out that this is broken for CONFIG_COMPAT=n, > > since compat_elf_hwcap2 is only defined when CONFIG_COMPAT=y. As > > CONFIG_ARM64_ERRATUM_1742098 depends on CONFIG_COMPAT, this worked prior to this patch. > > > > I've changed that locally to: > > > > | static void elf_hwcap_fixup(void) > > | { > > | #ifdef CONFIG_COMPAT > > | if (cpus_have_cap(ARM64_WORKAROUND_1742098)) > > | compat_elf_hwcap2 &= ~COMPAT_HWCAP2_AES; > > | #endif /* CONFIG_COMPAT */ > > | } > > > > ... since the ifdeffery is protecting the use of 'compat_elf_hwcap2', and the > > cpucap is now elided by virtue of cpucap_is_possible(). > > > > Catalin, aside from the minor fixup above, are you happy to pick this for v6.7? > > > > I can post a v4 with that change (and the commit message updated accordingly). > > I can pick it up and fold the above in. I've just spotted another ifdeffery issue (leading to cpu_enable_fpsimd() not bdeing defined in some configs), so I'll send a v4 with both issues fixed. > Not sure what you want to update the commit message to (just mention the need > for #ifdef CONFIG_COMPAT?) I was thinknig to replace the last paragraph of the commit message with: | This patch replaces the use of cpus_have_const_cap() with | cpus_have_cap(), which will only generate the bitmap test and avoid | generating an alternative sequence, resulting in slightly simpler annd | smaller code being generated. For consistenct with other cpucaps, the | ARM64_WORKAROUND_1742098 cpucap is added to cpucap_is_possible() so that | code can be elided when this is not possible. However, as we only define | compat_elf_hwcap2 when CONFIG_COMPAT=y, some ifdeffery is still required | within user_feature_fixup() to avoid build errors when CONFIG_COMPAT=n. As above, I'll send a v4 with that folded in. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel