From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5134753E12 for ; Mon, 22 Apr 2024 09:14:07 +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=1713777249; cv=none; b=VQ1sxQmP3Jcx3UmjQRZ5GI6H5FhCgLjTVBN73xj/A+reS3xjJpronM059Wb4YXjiG+ai6rH9MfFCY4qt3kVkjK7pCGpghNbHLD18McJadTs9SXv0hUQcOvMhM3pc7iyRLI7UXp2Rm0ojCBi9jxf0qjNzKmUCIAdYGoyjI4jL9ZY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713777249; c=relaxed/simple; bh=bSB47jiEPbjn+2RJwxgCUv2A6TZ3BEAuszXFpzjGwdE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XqHJDSxWp5RXb2ep/q7894ubxLj6OqmO7m+xaDV6rHykdwMdnQzoodt86rrpSkQTnpnZIVqDmvG6yX5uCY4DettFp/zBmROIzfHk01oAUPohaaQ0godWOuN6Htbj9qb6CsKhBfrSe7X4pIoqfh8wWwLjZNdF3An/huZIgf2X6jU= 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 19D1F339; Mon, 22 Apr 2024 02:14:35 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.21.63]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EE2253F64C; Mon, 22 Apr 2024 02:14:04 -0700 (PDT) Date: Mon, 22 Apr 2024 10:13:59 +0100 From: Mark Rutland To: Naresh Kamboju Cc: open list , Linux ARM , lkft-triage@lists.linaro.org, Linux Regressions , Arnd Bergmann , 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 02:04:43PM +0530, Naresh Kamboju wrote: > The arm64 defconfig build failed with gcc-8 and passed with gcc-13. > > Reported-by: Linux Kernel Functional Testing > > Build log: > --- > /tmp/ccSUNNZy.s: Assembler messages: > /tmp/ccSUNNZy.s:3159: Error: unknown architectural extension `pauth' > make[5]: *** [scripts/Makefile.build:244: arch/arm64/kvm/pauth.o] Error 1 > > Steps to reproduce: > --- > # tuxmake --runtime podman --target-arch arm64 --toolchain gcc-8 > --kconfig defconfig I think the key thing here is GCC 8; the associated assembler won't necessarily have ARMv8.3-A support, since all the relevant bits got added around GCC 9. Looking at the commits, I think this is broken since its introduction in commit: 6ccc971ee2c61a1f ("KVM: arm64: nv: Add emulation for ERETAx instructions") ... where the pauth.c file only depends on ARM64_PTR_AUTH (which doesn't imply AS_HAS_ARMV8_3), but in the file we do: asm volatile(ARM64_ASM_PREAMBLE ".arch_extension pauth\n" "pacga %0, %1, %2" : "=r" (pac) : "r" (ptr), "r" (mod)); 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. Mark. > > Links: > - https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20240422/testrun/23551634/suite/build/test/gcc-8-defconfig/details/ > - https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20240422/testrun/23551634/suite/build/test/gcc-8-defconfig/log > - https://storage.tuxsuite.com/public/linaro/lkft/builds/2fRe0ZWWmise7cetIz0aXdnq4jJ/ > > -- > Linaro LKFT > https://lkft.linaro.org >