Advertisement
Guest User

Untitled

a guest
Mar 26th, 2020
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. @@ -5929,6 +6018,14 @@ static void svm_cpuid_update(struct kvm_vcpu *vcpu)
  2. return;
  3.  
  4. guest_cpuid_clear(vcpu, X86_FEATURE_X2APIC);
  5. +
  6. + /*
  7. + * Currently, AVIC does not work with nested virtualization.
  8. + * So, we disable AVIC when cpuid for SVM is set in the L1 guest.
  9. + */
  10. + if (nested && guest_cpuid_has(vcpu, X86_FEATURE_SVM))
  11. + kvm_request_apicv_update(vcpu->kvm, false,
  12. + APICV_INHIBIT_REASON_NESTED);
  13. }
  14.  
  15. #define F feature_bit
  16.  
  17. @@ -9219,10 +9267,11 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
  18. return r;
  19.  
  20. if (irqchip_in_kernel(vcpu->kvm)) {
  21. - vcpu->arch.apicv_active = kvm_x86_ops->get_enable_apicv(vcpu->kvm);
  22. r = kvm_create_lapic(vcpu, lapic_timer_advance_ns);
  23. if (r < 0)
  24. goto fail_mmu_destroy;
  25. + if (kvm_apicv_activated(vcpu->kvm))
  26. + vcpu->arch.apicv_active = true;
  27. } else
  28. static_key_slow_inc(&kvm_no_apic_vcpu);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement