Merge tag 'f2fs-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk...
[sfrench/cifs-2.6.git] / arch / arm64 / include / asm / kvm_hyp.h
index 23aca66767f9d5518e0f426201dd3fd4f4955272..a80a7ef573252a048401a20789683eb507ace060 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <linux/compiler.h>
 #include <linux/kvm_host.h>
+#include <asm/alternative.h>
 #include <asm/sysreg.h>
 
 #define __hyp_text __section(.hyp.text) notrace
@@ -163,6 +164,13 @@ static __always_inline void __hyp_text __load_guest_stage2(struct kvm *kvm)
 {
        write_sysreg(kvm->arch.vtcr, vtcr_el2);
        write_sysreg(kvm->arch.vttbr, vttbr_el2);
+
+       /*
+        * ARM erratum 1165522 requires the actual execution of the above
+        * before we can switch to the EL1/EL0 translation regime used by
+        * the guest.
+        */
+       asm(ALTERNATIVE("nop", "isb", ARM64_WORKAROUND_1165522));
 }
 
 #endif /* __ARM64_KVM_HYP_H__ */