Advertisement
jintack

Untitled

Apr 26th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.94 KB | None | 0 0
  1. diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c
  2. index ecba058..1cbad86 100644
  3. --- a/arch/arm64/kvm/hyp/switch.c
  4. +++ b/arch/arm64/kvm/hyp/switch.c
  5. @@ -66,7 +66,9 @@ static void __hyp_text __deactivate_traps(struct kvm_vcpu *vcpu)
  6.  
  7.  static void __hyp_text __activate_vm(struct kvm_vcpu *vcpu)
  8.  {
  9. -       struct kvm *kvm = kern_hyp_va(vcpu->kvm);
  10. +       struct kvm *kvm;
  11. +       dsb(ishst);
  12. +       kvm = kern_hyp_va(vcpu->kvm);
  13.         u64 target_vttbr = kvm->arch.vttbr;
  14.  #ifndef CONFIG_EL1_HYP
  15.  #ifndef CONFIG_SUPPORT_EL1_HYP /* FIXME: what if a kernel uses both configs? */
  16. @@ -80,6 +82,14 @@ static void __hyp_text __activate_vm(struct kvm_vcpu *vcpu)
  17.  #else
  18.         write_s_sysreg(target_vttbr, S_VTTBR_EL2);
  19.  #endif
  20. +
  21. +       if ( target_vttbr ==  kvm->arch.svttbr) {
  22. +               isb();
  23. +               asm volatile("tlbi vmalls12e1is" : : );
  24. +               dsb(ish);
  25. +               isb();
  26. +       }
  27. +
  28.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement