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 1400EC3DA7F for ; Wed, 7 Aug 2024 13:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EOsLXGk/T7E1VQFl/sdKYSD64TOQz6tg4tW5v+wD5iw=; b=vJ/0BEErl6y9aEbU/y2U/Nj0OA tswuhiGhWZkKuHV9zD8302qALPuKNe8n8pbXqE3jHs4q1NHmLSI4Cl2UJPgnNp8MD+yjNXREA2VAE 3JKzR9cVevTa4sWkBVsi1hhoeM7bn5onQPxHxpdKe1+Jzj8MlK73D0WXHyTtTe+bRDqqk9cqdbCeS trEjdYaLVwt0bKePiDx9a7AmhMdfhg+SKfOMDNKUoqoqH8i7+HIdWy/Dv7MtCd6En0f9s3TgoAiK7 Cpsy+3qbPFerZcfFBbEzRf/pgJ/Xfl1VCBW7LqBm9z5EXCB8jsIoptQHUOkTs/PB1oJXjCkPDum6m 0Hs+blww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbgr1-00000005AHB-0FKB; Wed, 07 Aug 2024 13:37:27 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbgqS-00000005A8N-0vBm for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2024 13:36:53 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 53122612C5; Wed, 7 Aug 2024 13:36:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05BF3C32782; Wed, 7 Aug 2024 13:36:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723037811; bh=cJ8/vW0xVevY81Gwdh1aeGnupi+13YFObO9AG1Q+dRI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tXxV4sXodND7tpDelncBVH8gdH+Q3r9bs+1shG7jImk21pJYPbBT106VmRN5oiQsG c0kKh9ajx4KVTG+S5F0hPgQOTLjZIYkWjIAqNnO5gqz1CvBwv2KKYCY5LyKzXWlPdg o9E9IVLnNz9NeuNNLBm2cthbn+NwX5AhsG8fkzoPRz7xwYAg70n39QTe90TAOeHtk9 nfaeDBMr+N1uWk8djXt4IFDzyU+MTL3+AVxLyJeEnv6rVUXKKiRKloMYs9Bdm+Covj Rbs2XzcMoyq4y4CaFV2kIQkM3kg04nuv326Bg4HLShAChl7614J+ia8N/P25jYZgVF D4KIEoAzbBPaw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sbgqN-001iiI-Ne; Wed, 07 Aug 2024 14:36:47 +0100 Date: Wed, 07 Aug 2024 14:36:47 +0100 Message-ID: <86a5ho315c.wl-maz@kernel.org> From: Marc Zyngier To: Arnd Bergmann Cc: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Viresh Kumar Subject: Re: [PATCH] KVM: arm64: Enforce dependency on an ARMv8.4-aware toolchain In-Reply-To: References: <20240807115144.3237260-1-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.3 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: arnd@linaro.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, viresh.kumar@linaro.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240807_063652_416267_55A8B311 X-CRM114-Status: GOOD ( 25.52 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 07 Aug 2024 13:03:28 +0100, Arnd Bergmann wrote: > > On Wed, 7 Aug 2024 at 13:51, Marc Zyngier wrote: > > > > With the NV support of TLBI-range operations, KVM makes use of > > instructions that are only supported by binutils versions >= 2.30. > > > > This breaks the build for very old toolchains. > > > > Make KVM support conditional on having ARMv8.4 support in the > > assembler, side-stepping the issue. > > > > Fixes: 5d476ca57d7d ("KVM: arm64: nv: Add handling of range-based TLBI operations") > > Reported-by: Viresh Kumar > > Suggested-by: Arnd Bergmann > > Signed-off-by: Marc Zyngier > > Acked-by: Arnd Bergmann Thanks for that. > > > menuconfig KVM > > bool "Kernel-based Virtual Machine (KVM) support" > > + depends on AS_HAS_ARMV8_4 > > select KVM_COMMON > > select KVM_GENERIC_HARDWARE_ENABLING > > select KVM_GENERIC_MMU_NOTIFIER > > I think this is good enough here, only slightly more limiting than > we strictly need. A slightly more fine-grained approach would > turn off VHE mode on old binutils but keep NVHE. That is still > inaccurate of course since VHE only depends on v8.2, so > I'm in favor of keeping the version you posted. nit: VHE is from ARMv8.1, though there isn't a large number of v8.1 implementations (Cavium/Broadcom TX2 is the best known one). Now, splitting VHE out would be pretty invasive. A marginally better approach would be to disable NV support for TLBI range instructions and make them UNDEF in the guest. But overall, I really hate the idea of playing a "dice and slice" game with KVM, just because the toolchain is from a time when I could still have long hair. It leads to all sort of issues with latent bugs that only show-up in some configs (cue the repeated issues with PMU emulation, which has generally been a disaster). I would only consider this if someone came up with a valid reason why they cannot move to a toolchain that has newer binutils (like the ones you provide on k.org). > For reference, even the gcc-5.5 toolchain I built for kernel.org > in 2019 came with recent enough binutils, and we are likely to > soon require gcc-8 or higher anyway. Definitely looking forward to this! Thanks, M. -- Without deviation from the norm, progress is not possible.