Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2142411lqt; Mon, 22 Apr 2024 02:40:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV0EJWtG/abYipMUSCw2uF1+OxUSJSUjhIu1CWbV2/VSb3Y5cbTjuj3z76ZjbiYwuOMl92zTdsp9Hvl2wfGqVwG80s+zich8uPEn4EKDQ== X-Google-Smtp-Source: AGHT+IFNcTVXoggIFTEoSMyapXX8YgNeoAHUJH4LX9Vhut9BlwpQhDuw8yI8sY8H94IjAtaaaD/v X-Received: by 2002:a05:6a20:9708:b0:1ad:3d93:b71e with SMTP id hr8-20020a056a20970800b001ad3d93b71emr588746pzc.59.1713778854164; Mon, 22 Apr 2024 02:40:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713778854; cv=pass; d=google.com; s=arc-20160816; b=fU7teYoEodkf8tvv3bB5SNk5epW2FV99UWMJKrSfE+1ClPzkwng1vIuCpljuGsUWMa 5+JkR/oFpc5SAOPCRHY6YwKJ77Bo2QSlzsm5LwvRssAinTmHiqGLqRZ6wQ7/Mu/D57yy BkDhAWDPfwpvSvh3aOlCKqquWNRlwH7bMQJ/k1yu4I5NgikuH6REt+QVsuaTDSewFV4R 1IKfsBXGVeq+cKD/76yK/xVlqgUgdHuwD8UQh4UHokLUZr2bPMeSI1sRXdKH7s0TgT3A uvrkhFlIkPujBbC7P2XU4OltsEHEn91/kqnhMHNVcIkCHVq9ZM5h6zHfT0P4MbzkKXVJ nMbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=uPUCX8ndKMt3orIgvUzio4MpsdSb+eSY8IncPVP5qhk=; fh=HgJrnoceSczjNEgeD61XkAAKsTkCQopmcTwiUwIegxU=; b=gqdaf8by/q8AuBj35uhNup+UpbcUZzENIRslXAabd3wPOARoB7PcCmkkf1rk2pJ/Ka Gba2qXcjL3kU27GYH0NQAZLhSkaXELjLzFR+5Lo2vSCefNHnCDv3rl7eVJpZ143OU7Jo 3YYfGm30elxIC7WroMDRjdM1Q7qIHsuUux3LjrgxodEV0SyDXVMgqD5RYlwBDm+77Flq ZaSGr5z368fBQO/XeXWR2wyAAyfcLUje/yP94sEvuVmEiT9Pts7navfaeJzy47ZelfP7 RbjoLMLEnyZLRbJr4Qjl8bMLdygJoHRnYbOxtf9YerF3nvgYFK7MbL7GGnYjlZjYqEeI /jzg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-153102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153102-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p37-20020a056a000a2500b006ed0e21b0a0si7797558pfh.309.2024.04.22.02.40.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 02:40:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153102-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; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-153102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153102-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 C70E4282511 for ; Mon, 22 Apr 2024 09:40:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C8E313BC39; Mon, 22 Apr 2024 09:40:39 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9633D502B3 for ; Mon, 22 Apr 2024 09:40:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713778839; cv=none; b=hhYIhmYY2+dXX9EkT1tVIiwWEtkyRSsX8usa+L6hkEtmbyjn9HqhDEufh+UKKKUrh8bE1WzR0lYzgc3QHOAnskE5na/P4l5gy70uHhDf7jjsR6to8Af+PTAegafte7oAjVA+BVKvODFIRBXzJNuNjPLgq6LFfYwoOUZezzzOaJc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713778839; c=relaxed/simple; bh=/WR48W7qWg4v2Qz+/XQ/bjd0aFfImG9Km5LpCV+Dy6U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=d8OzS3IDcREjOR1z4BsLvhd78KPMTdQjmRCT+nfNjC0qFZXHiLOIjwmlo6k06YhgDSOMqmRAhziuExKJJi5wCU9dGjZCPBi4ElRWYKKzGoN8GTtTgqm3sV0GYxgqeyshLNuf/XD3TvOL/tNl6usHwTBK7/i3vroLIN6kHRBTCmo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.