* [PATCH] KVM: arm64: Enforce dependency on an ARMv8.4-aware toolchain
@ 2024-08-07 11:51 Marc Zyngier
2024-08-07 12:03 ` Arnd Bergmann
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Marc Zyngier @ 2024-08-07 11:51 UTC (permalink / raw)
To: kvmarm, kvm, linux-arm-kernel
Cc: James Morse, Suzuki K Poulose, Oliver Upton, Zenghui Yu,
Viresh Kumar, Arnd Bergmann
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 <viresh.kumar@linaro.org>
Suggested-by: Arnd Bergmann <arnd@linaro.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
arch/arm64/kvm/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
index 58f09370d17e..8304eb342be9 100644
--- a/arch/arm64/kvm/Kconfig
+++ b/arch/arm64/kvm/Kconfig
@@ -19,6 +19,7 @@ if VIRTUALIZATION
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
--
2.39.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] KVM: arm64: Enforce dependency on an ARMv8.4-aware toolchain
2024-08-07 11:51 [PATCH] KVM: arm64: Enforce dependency on an ARMv8.4-aware toolchain Marc Zyngier
@ 2024-08-07 12:03 ` Arnd Bergmann
2024-08-07 13:36 ` Marc Zyngier
2024-08-08 7:20 ` Viresh Kumar
2024-08-08 17:06 ` Oliver Upton
2 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2024-08-07 12:03 UTC (permalink / raw)
To: Marc Zyngier
Cc: kvmarm, kvm, linux-arm-kernel, James Morse, Suzuki K Poulose,
Oliver Upton, Zenghui Yu, Viresh Kumar
On Wed, 7 Aug 2024 at 13:51, Marc Zyngier <maz@kernel.org> 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 <viresh.kumar@linaro.org>
> Suggested-by: Arnd Bergmann <arnd@linaro.org>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
> 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.
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.
Arnd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] KVM: arm64: Enforce dependency on an ARMv8.4-aware toolchain
2024-08-07 12:03 ` Arnd Bergmann
@ 2024-08-07 13:36 ` Marc Zyngier
0 siblings, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2024-08-07 13:36 UTC (permalink / raw)
To: Arnd Bergmann
Cc: kvmarm, kvm, linux-arm-kernel, James Morse, Suzuki K Poulose,
Oliver Upton, Zenghui Yu, Viresh Kumar
On Wed, 07 Aug 2024 13:03:28 +0100,
Arnd Bergmann <arnd@linaro.org> wrote:
>
> On Wed, 7 Aug 2024 at 13:51, Marc Zyngier <maz@kernel.org> 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 <viresh.kumar@linaro.org>
> > Suggested-by: Arnd Bergmann <arnd@linaro.org>
> > Signed-off-by: Marc Zyngier <maz@kernel.org>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] KVM: arm64: Enforce dependency on an ARMv8.4-aware toolchain
2024-08-07 11:51 [PATCH] KVM: arm64: Enforce dependency on an ARMv8.4-aware toolchain Marc Zyngier
2024-08-07 12:03 ` Arnd Bergmann
@ 2024-08-08 7:20 ` Viresh Kumar
2024-08-08 17:06 ` Oliver Upton
2 siblings, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2024-08-08 7:20 UTC (permalink / raw)
To: Marc Zyngier
Cc: kvmarm, kvm, linux-arm-kernel, James Morse, Suzuki K Poulose,
Oliver Upton, Zenghui Yu, Arnd Bergmann
On 07-08-24, 12: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 <viresh.kumar@linaro.org>
> Suggested-by: Arnd Bergmann <arnd@linaro.org>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> ---
> arch/arm64/kvm/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
> index 58f09370d17e..8304eb342be9 100644
> --- a/arch/arm64/kvm/Kconfig
> +++ b/arch/arm64/kvm/Kconfig
> @@ -19,6 +19,7 @@ if VIRTUALIZATION
>
> 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
Tested-by: Viresh Kumar <viresh.kumar@linaro.org>
(Build only).
--
viresh
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] KVM: arm64: Enforce dependency on an ARMv8.4-aware toolchain
2024-08-07 11:51 [PATCH] KVM: arm64: Enforce dependency on an ARMv8.4-aware toolchain Marc Zyngier
2024-08-07 12:03 ` Arnd Bergmann
2024-08-08 7:20 ` Viresh Kumar
@ 2024-08-08 17:06 ` Oliver Upton
2 siblings, 0 replies; 5+ messages in thread
From: Oliver Upton @ 2024-08-08 17:06 UTC (permalink / raw)
To: kvmarm, kvm, Marc Zyngier, linux-arm-kernel
Cc: Oliver Upton, Viresh Kumar, Suzuki K Poulose, Arnd Bergmann,
James Morse, Zenghui Yu
On Wed, 7 Aug 2024 12:51:44 +0100, 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.
>
> [...]
Applied to kvmarm/fixes, thanks!
[1/1] KVM: arm64: Enforce dependency on an ARMv8.4-aware toolchain
https://git.kernel.org/kvmarm/kvmarm/c/10f2ad032def
--
Best,
Oliver
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-08-08 17:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07 11:51 [PATCH] KVM: arm64: Enforce dependency on an ARMv8.4-aware toolchain Marc Zyngier
2024-08-07 12:03 ` Arnd Bergmann
2024-08-07 13:36 ` Marc Zyngier
2024-08-08 7:20 ` Viresh Kumar
2024-08-08 17:06 ` Oliver Upton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).