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 90FAFC07C79 for ; Mon, 22 Apr 2024 12:11:50 +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:Subject:Cc:To:From:Date:References: In-Reply-To:Message-Id:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eiwDQbISSQYcNh1GfsRBKiV4SoPyeSS4vK3N5RNzHb4=; b=bBFPfT/zBcuORu kQwF/Ke+d46SJ07dwbr/en45Ryv3VVqM/eHThMxaB57VTZxyX06kMaPnGrHcK8egGo4D/PeL8WrL8 L/5vmvYCcGgRUaPZbpC4YnzLMiq8GCt/+Fe6eR04Gz4RTdHT8okseK/0yr+WKZuuYFy7Cz3Qcuszi XRt5KKpq1rd0bPCtvIKmIV3j6ZHuyuelJn4LanVbikFD3Ew/rzn/pFrm/yiDN8bOqwrxenbfAbIEY 1iEDl26iLjrz63RYMAmKl6GCKKAl9jE1H1GfXRWapyMNpe2lA8CU/PfpIZuqqSTt+XOpBmdOFnEAV 6di6j2pjo21b37qYWIDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rysWF-0000000DStA-1muK; Mon, 22 Apr 2024 12:11:35 +0000 Received: from wfhigh5-smtp.messagingengine.com ([64.147.123.156]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rysWC-0000000DSsL-1GDK for linux-arm-kernel@lists.infradead.org; Mon, 22 Apr 2024 12:11:34 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id D477618000F4; Mon, 22 Apr 2024 08:11:26 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 22 Apr 2024 08:11:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1713787886; x=1713874286; bh=KRP2elrmum xH8cocnCA8ROfbtX6U7yx5lVj+wpAn/3U=; b=iRaGRCnfyLCk8nPe1wdbVCJHaJ AfoHsMJGRPizCPI7ebQcmNjfh0Zdm2mAEhc2GsOposVkn9UGMQYCMoLCCjV8JQmi CXH2t70iGdJTslbh/MEdXbbMpygD7vgAYotST7KP1rz/EV0P8kMtT6aiMkC7wGs/ igpQyEcoQOVu0XA1X/cN1LRqfezAsoylcxgy1G/p/NxnhaLhzwoLYg4V7ROMmSqB zKwjn0xIa3lFC+CNdfcBydjDSl+yD/i6B34B0KBVRFx5vDv8BghH5JR+5G5imKb7 4E3RaNf6GWpH7dPSVa2LnkreSNO8Iv9BZUhYGVBelUQoagQ+4ZpbQ3udtNbg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1713787886; x=1713874286; bh=KRP2elrmumxH8cocnCA8ROfbtX6U 7yx5lVj+wpAn/3U=; b=NctAszhT/BSUcWRrsLUXj9jx+ADe4Wveh+7L8/vLnk4u mDzYVuDcBGoZJ37mqcPm5OlOLn5A6+a3W5jZGDKOprWsuMFxUkfpO/bB19/A6AwX vS4gXbYztBEWVyiAS0ojUD1NOx031uvlr8AMHUYrZmX0sdSdaIRLE2GospL3aC/M azdrJQf4bAAQrmu1YnNDezEJOoRRa7MCRw3UyIb9oX6pXekTcfZs/V7Ty0gis4A7 uePT1ISot3KAoLKvFfZYZCyvX/fMd5fpx6UlZ8ZPHtOjSYwel48tqugQ/SKqS3xK 4NqoXwLUXRIRFP3bqUxs8Zj+t5oVk7sektctWuBp0A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudekledghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id DC779B6008D; Mon, 22 Apr 2024 08:11:25 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-379-gabd37849b7-fm-20240408.001-gabd37849 MIME-Version: 1.0 Message-Id: In-Reply-To: References: Date: Mon, 22 Apr 2024 14:11:05 +0200 From: "Arnd Bergmann" To: "Mark Rutland" 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' X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240422_051132_698213_903FE9C6 X-CRM114-Status: GOOD ( 18.65 ) 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:40, Mark Rutland wrote: > 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. I tested with the old binutils versions I have here and found that anything that supports v8.3 also understands pacga, but '.arch_extension pauth' only works in binutils-2.35 and higher, presumably because it started out as a v8.3+ feature but was later turned into an optional extension for all versions. Since there is a Kconfig check for armv8.3-a support already, I think it's safe to just drop the .arch_extension pauth. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel