Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2217915lqt; Mon, 22 Apr 2024 05:11:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXnrEjPMtO/zjMFUuy1+B/66KPNCuOltQeaFlRgcdoq8J+ppt44NY5J7m+X4OYSNj8YziKWxa/9X3BmgoZtNyMV2Uz4jxEq3Kg0UGEQPw== X-Google-Smtp-Source: AGHT+IGb69H+OQT2T4QKvyTsZk/T14K6SDkCL0IJpA/wXPsHqBN0lISK6H1oy72fBGVLn4VWdUNl X-Received: by 2002:a17:90a:c486:b0:2a8:30a6:be3c with SMTP id j6-20020a17090ac48600b002a830a6be3cmr7183535pjt.43.1713787896337; Mon, 22 Apr 2024 05:11:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713787896; cv=pass; d=google.com; s=arc-20160816; b=txY7n4VCELLsd/txwvpIIKLEk+9xRPA2d6AnyJIcxoh0hlJJxJv1fKzDFzcvKHHAgb nvWIAIYgrCiHTqZ8+c3KWT4L7T3zmeQ3hhMaMJIVyoK5MFqcjb2+yO1dOUtANEgiI0zK BwB7QaiCT00fZ4/11TdKtyeN4FyXg38x4Atn4lNG7ENE2wFEEF1gQURcSOrY/1ZnwgZ8 72dY9Qy3iijBLpFnPpGxNixyIjjiIudd9qqgOfRntyCeQotx0CsLmvK3qT7ToMOFc3U1 cCGk4O4iM3OGG1kxyMO/RCLVtoM2H7kGt8/ZaWzpKpCneuW78qdFUqMgRQubjyn8BTeL 7IBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=KRP2elrmumxH8cocnCA8ROfbtX6U7yx5lVj+wpAn/3U=; fh=aTnFZChT53njag6ZyirGKiRDtRiC5mGaKjBhoKUeV9Y=; b=v246dikdV1pwm5kUQER/J1Cx1dgoF2Lg5g6oARNpSJlelVZeY7d/yTroFhAkIdl5qm AfJsctuRkh+ojD9K/nsAHL5b3ozSqoxnOCdEdRGgQaXQzcywBAOlwEuxTrOfcv3APqiJ OpjAzOPKc9bj7ZLRzt5RYc476lVi3LIR4mmkqDzFTn2A9FBcduA27MQ60SfING17Gr76 RhHwUIVclJoQ5IiQ53u59hgLgqQ14K6QRue3+fEJ+EhFd5JZYeF8oITNrVUJo+Ba1pz8 zBVtb38BiyBWE7VZMnmGOkvJdRHaWeZZVhYcEN21XGErTN2VCuCCYy/xoMll7tXjiqJS nC1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=iRaGRCnf; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=NctAszhT; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-153322-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153322-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k2-20020a63ab42000000b005f0bc738b51si7820544pgp.619.2024.04.22.05.11.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 05:11:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153322-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=iRaGRCnf; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=NctAszhT; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-153322-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153322-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 89C3F285AD1 for ; Mon, 22 Apr 2024 12:11:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A32A146D7D; Mon, 22 Apr 2024 12:11:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="iRaGRCnf"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="NctAszhT" Received: from wfhigh5-smtp.messagingengine.com (wfhigh5-smtp.messagingengine.com [64.147.123.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BC87524A0 for ; Mon, 22 Apr 2024 12:11:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713787890; cv=none; b=YjQqbzF+o5D+syhQHih43b1nOjbNuvBPbG1qRovRZ1CE3wCyqzdISY4ivJGq6G7fJc6zyMDDqrzL5z4+GWyKVRordtI4P6xVPLoDTQdgqtpnfT5XYpY6mcFXI7yllqMYATRm6JUKCOD8beoHUUQFKz9atgncj62BLmE87/HaCL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713787890; c=relaxed/simple; bh=dC5ZHd6Ky5vV2tsL7oXY8FeusJcsi4Qa/hgIGs3LA54=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=YlN1YocqkeLGXSPxiJRevbngw6tzhHg3C4m0pkd7SZ77QY8idyP8R5ko6TzFwaUWa0XMH3IV1Hmb9vZ9DdEp+0M1TSJHbjTO+CxUQDKn0EXYLwyVYupYx8CrCxr/mhMh0pIc6b/tRKkzn3BaCuFYP5Uoc1sLVyaV631GLxpJArc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=iRaGRCnf; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=NctAszhT; arc=none smtp.client-ip=64.147.123.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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' Content-Type: text/plain 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