]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
KVM: arm64: Enable SVE support for nVHE
authorDaniel Kiss <daniel.kiss@arm.com>
Thu, 11 Mar 2021 19:23:07 +0000 (19:23 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 18 Mar 2021 14:23:19 +0000 (14:23 +0000)
Now that KVM is equipped to deal with SVE on nVHE, remove the code
preventing it from being used as well as the bits of documentation
that were mentioning the incompatibility.

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Daniel Kiss <daniel.kiss@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/Kconfig
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/reset.c

index 1f212b47a48a1033d1799c946f0bb0b9dca96fd2..2690543799fb4335681b4953b44bad59426a7e42 100644 (file)
@@ -1686,7 +1686,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
@@ -1715,12 +1714,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 e59b16008868ab0cf43729c5c6846b0f7be23e95..08f500b2551aaa48913d90a0a0a35bd37bd49d69 100644 (file)
@@ -694,19 +694,6 @@ static inline void kvm_init_host_cpu_context(struct kvm_cpu_context *cpu_ctxt)
        ctxt_sys_reg(cpu_ctxt, MPIDR_EL1) = read_cpuid_mpidr();
 }
 
-static inline bool kvm_arch_requires_vhe(void)
-{
-       /*
-        * The Arm architecture specifies that implementation of SVE
-        * requires VHE also to be implemented.  The KVM code for arm64
-        * relies on this when SVE is present:
-        */
-       if (system_supports_sve())
-               return true;
-
-       return false;
-}
-
 void kvm_arm_vcpu_ptrauth_trap(struct kvm_vcpu *vcpu);
 
 static inline void kvm_arch_hardware_unsetup(void) {}
index fc4c95dd2d26172cf6ae4a9bd7d401bed5a7b6be..ef92b7d32ebd70c3d564d397990ff4cf1d285abb 100644 (file)
@@ -1889,11 +1889,6 @@ int kvm_arch_init(void *opaque)
 
        in_hyp_mode = is_kernel_in_hyp_mode();
 
-       if (!in_hyp_mode && kvm_arch_requires_vhe()) {
-               kvm_pr_unimpl("CPU unsupported in non-VHE mode, not initializing\n");
-               return -ENODEV;
-       }
-
        if (cpus_have_final_cap(ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE) ||
            cpus_have_final_cap(ARM64_WORKAROUND_1508412))
                kvm_info("Guests without required CPU erratum workarounds can deadlock system!\n" \
index 47f3f035f3eac5aaf9b4d590e25ebbff7eb8dd95..f08b1e7ebf68a2a0ffd24bf86106caa8db59db56 100644 (file)
@@ -74,10 +74,6 @@ static int kvm_vcpu_enable_sve(struct kvm_vcpu *vcpu)
        if (!system_supports_sve())
                return -EINVAL;
 
-       /* Verify that KVM startup enforced this when SVE was detected: */
-       if (WARN_ON(!has_vhe()))
-               return -EINVAL;
-
        vcpu->arch.sve_max_vl = kvm_sve_max_vl;
 
        /*