Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[sfrench/cifs-2.6.git] / arch / arm64 / include / asm / kvm_host.h
index 063886be25ad2579fc0cbda510d394a8a19117f8..7732d0ba4e603210fedb645011488ce5ef31a99e 100644 (file)
@@ -422,7 +422,7 @@ static inline void __cpu_init_hyp_mode(phys_addr_t pgd_ptr,
        }
 }
 
-static inline bool kvm_arch_check_sve_has_vhe(void)
+static inline bool kvm_arch_requires_vhe(void)
 {
        /*
         * The Arm architecture specifies that implementation of SVE
@@ -430,9 +430,13 @@ static inline bool kvm_arch_check_sve_has_vhe(void)
         * relies on this when SVE is present:
         */
        if (system_supports_sve())
-               return has_vhe();
-       else
                return true;
+
+       /* Some implementations have defects that confine them to VHE */
+       if (cpus_have_cap(ARM64_WORKAROUND_1165522))
+               return true;
+
+       return false;
 }
 
 static inline void kvm_arch_hardware_unsetup(void) {}