From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7088CB664; Wed, 7 Aug 2024 13:36:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723037811; cv=none; b=JfUaH/jM4jDbSr/9YPc1H1tuvpkQrU8sDU0tvjgzJwvHEbAreWPrEnjFKCndxsexTgIxm+MOfIcuzzg/JFoUwZ0eNMn1ZuKj/7Vgd6Q80IVnldSmNWPBuvkmj2KNnWN+wTdaoMPAHD8Ak0bH2EAxh2yLWUvxsQ0yAgVgDaC0Lfg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723037811; c=relaxed/simple; bh=cJ8/vW0xVevY81Gwdh1aeGnupi+13YFObO9AG1Q+dRI=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=jXersHqA5RUem+55jprsHFpjhIr6tqtUcA5UJOiMALBYbVi197VzyE8cnlucQdDYKVoiIbpHkPhfLQOjTZgNradn0BPWiYuliSqG/uBv080xfEx11QAthMeCA+w35APY3olbJ7FbuI6MGvpnljm93XJBLj5LJ8lnqVWXLEYbb5c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tXxV4sXo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tXxV4sXo" 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) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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.