arm64: Get rid of CONFIG_ARM64_VHE
authorMarc Zyngier <maz@kernel.org>
Thu, 8 Apr 2021 13:10:10 +0000 (14:10 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 8 Apr 2021 17:45:16 +0000 (18:45 +0100)
CONFIG_ARM64_VHE was introduced with ARMv8.1 (some 7 years ago),
and has been enabled by default for almost all that time.

Given that newer systems that are VHE capable are finally becoming
available, and that some systems are even incapable of not running VHE,
drop the configuration altogether.

Anyone willing to stick to non-VHE on VHE hardware for obscure
reasons should use the 'kvm-arm.mode=nvhe' command-line option.

Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20210408131010.1109027-4-maz@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Documentation/admin-guide/kernel-parameters.txt
arch/arm64/Kconfig
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/hyp-stub.S

index 0454572..18f8bb3 100644 (file)
                                   state is kept private from the host.
                                   Not valid if the kernel is running in EL2.
 
-                       Defaults to VHE/nVHE based on hardware support and
-                       the value of CONFIG_ARM64_VHE.
+                       Defaults to VHE/nVHE based on hardware support.
 
        kvm-arm.vgic_v3_group0_trap=
                        [KVM,ARM] Trap guest accesses to GICv3 group-0
index 5656e7a..e9fbb0b 100644 (file)
@@ -1416,19 +1416,6 @@ config ARM64_USE_LSE_ATOMICS
          built with binutils >= 2.25 in order for the new instructions
          to be used.
 
-config ARM64_VHE
-       bool "Enable support for Virtualization Host Extensions (VHE)"
-       default y
-       help
-         Virtualization Host Extensions (VHE) allow the kernel to run
-         directly at EL2 (instead of EL1) on processors that support
-         it. This leads to better performance for KVM, as they reduce
-         the cost of the world switch.
-
-         Selecting this option allows the VHE feature to be detected
-         at runtime, and does not affect processors that do not
-         implement this feature.
-
 endmenu
 
 menu "ARMv8.2 architectural features"
@@ -1684,7 +1671,6 @@ endmenu
 config ARM64_SVE
        bool "ARM Scalable Vector Extension support"
        default y
-       depends on !KVM || ARM64_VHE
        help
          The Scalable Vector Extension (SVE) is an extension to the AArch64
          execution state which complements and extends the SIMD functionality
@@ -1713,12 +1699,6 @@ config ARM64_SVE
          booting the kernel.  If unsure and you are not observing these
          symptoms, you should assume that it is safe to say Y.
 
-         CPUs that support SVE are architecturally required to support the
-         Virtualization Host Extensions (VHE), so the kernel makes no
-         provision for supporting SVE alongside KVM without VHE enabled.
-         Thus, you will need to enable CONFIG_ARM64_VHE if you want to support
-         KVM in the same kernel image.
-
 config ARM64_MODULE_PLTS
        bool "Use PLTs to allow module memory to spill over into vmalloc area"
        depends on MODULES
index 6de15de..fa6023a 100644 (file)
@@ -1623,7 +1623,6 @@ int get_cpu_with_amu_feat(void)
 }
 #endif
 
-#ifdef CONFIG_ARM64_VHE
 static bool runs_at_el2(const struct arm64_cpu_capabilities *entry, int __unused)
 {
        return is_kernel_in_hyp_mode();
@@ -1642,7 +1641,6 @@ static void cpu_copy_el2regs(const struct arm64_cpu_capabilities *__unused)
        if (!alternative_is_applied(ARM64_HAS_VIRT_HOST_EXTN))
                write_sysreg(read_sysreg(tpidr_el1), tpidr_el2);
 }
-#endif
 
 static void cpu_has_fwb(const struct arm64_cpu_capabilities *__unused)
 {
@@ -1845,7 +1843,6 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
                .matches = has_no_hw_prefetch,
        },
-#ifdef CONFIG_ARM64_VHE
        {
                .desc = "Virtualization Host Extensions",
                .capability = ARM64_HAS_VIRT_HOST_EXTN,
@@ -1853,7 +1850,6 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .matches = runs_at_el2,
                .cpu_enable = cpu_copy_el2regs,
        },
-#endif /* CONFIG_ARM64_VHE */
        {
                .desc = "32-bit EL0 Support",
                .capability = ARM64_HAS_32BIT_EL0,
index 9c9b4d8..74ad3db 100644 (file)
@@ -224,7 +224,6 @@ SYM_FUNC_END(__hyp_reset_vectors)
  * Entry point to switch to VHE if deemed capable
  */
 SYM_FUNC_START(switch_to_vhe)
-#ifdef CONFIG_ARM64_VHE
        // Need to have booted at EL2
        adr_l   x1, __boot_cpu_mode
        ldr     w0, [x1]
@@ -240,6 +239,5 @@ SYM_FUNC_START(switch_to_vhe)
        mov     x0, #HVC_VHE_RESTART
        hvc     #0
 1:
-#endif
        ret
 SYM_FUNC_END(switch_to_vhe)