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 DFDA9C4345F for ; Mon, 22 Apr 2024 09:40: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=/z7+5IOFIZi5/U5LAf9sSTHTqW3sauYPy7puLSYN0Ds=; b=gVe7O8EscxUl6f PUXNLfMDmTlMpCbUGzNiCVvvwt84h0Ntem4lbr5609xkNTuw3R+6DRZBRXvoISy0BNFRW5ZIg++S1 L5orIdUfSxJJ1shGPbC4UUzRhQh9poDHtEvnBZ5s2iG40w9tP1AVnJa119S5WLlldPrx2ZwzLL63k j1FbqZO5HlVTtE1PrBe76tT3pWRQl7qC0xzIHSSf+5tYeBLn8sN9YGz3FIiVdysvKt5vX9W8qSv5I Ri/soqaDA13hmvALjP1PIv+P8yuPnHiHtHNS+jtkeKh7+sKwhGPYvbSHntC5yh4gIuIFjOvt8Nrni NWiuXS3Gmd+6JVy6FUIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ryqAJ-0000000CxB4-1aJu; Mon, 22 Apr 2024 09:40:47 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ryqA9-0000000Cx4t-3uvj for linux-arm-kernel@lists.infradead.org; Mon, 22 Apr 2024 09:40:39 +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 6B349339; Mon, 22 Apr 2024 02:41:05 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.21.63]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 757843F64C; Mon, 22 Apr 2024 02:40:35 -0700 (PDT) Date: Mon, 22 Apr 2024 10:40:32 +0100 From: Mark Rutland To: Arnd Bergmann Cc: Naresh Kamboju , open list , Linux ARM , lkft-triage@lists.linaro.org, Linux Regressions , Anders Roxell , Marc Zyngier , joey.gouly@arm.com, Oliver Upton Subject: Re: gcc-8: arm64/kvm/pauth.: Error: unknown architectural extension `pauth' Message-ID: References: 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-20240422_024038_207742_E05E7A51 X-CRM114-Status: GOOD ( 14.09 ) 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, Apr 22, 2024 at 11:25:25AM +0200, Arnd Bergmann wrote: > On Mon, Apr 22, 2024, at 11:13, Mark Rutland wrote: > > On Mon, Apr 22, 2024 at 02:04:43PM +0530, Naresh Kamboju wrote: > > Given the minimum supported toolchain comes with an assembler that doesn't > > necessarily support ARMv8.3, I reckon we'll either have to make NV pauth > > support depend upon AS_HAS_ARMV8_3, or manually assemble the PACGA instruction. > > > > I suspect the latter is the better option. > > The .config linked from the report shows > > CONFIG_AS_VERSION=23101 > CONFIG_ARM64_PTR_AUTH_KERNEL=y > CONFIG_AS_HAS_ARMV8_3=y > > So it gets detected as supporting ARMv8.3. Is this the wrong > conditional to check, or does it get misdetected for an unsupported > assembler? I suspect that means the 'pauth' arch extension was added after armv8.3 support, and the assembler supports `-march=armv8.3-a` but does not support `.arch_extension pauth`. So for this code, it'd be wrong to check for AS_HAS_ARMV8_3, unless we used `.march armv8.3-a`, but even then that'd still mean configurations where we couldn't support this code. I reckon manually assembing the PACGA is the best thing to do; that sidesteps the need for either `.arch_extension pauth` or `.march armv8.3-a`, and aligns with what we do for CONFIG_ARM64_PTR_AUTH=y generally. Elsewhere in the kernel where we check for CONFIG_AS_HAS_ARMV8_3, we rely on ARM64_ASM_PREAMBLE containing `.arch armv8.3-a` or a later version that implies the presence of ARMv8.3-A instructions, and so pauth usage elsewhere is fine. Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel