Message ID | 1588055009-12677-6-git-send-email-wanpengli@tencent.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM: VMX: Tscdeadline timer emulation fastpath | expand |
On 28/04/20 08:23, Wanpeng Li wrote: > - if (exit_fastpath == EXIT_FASTPATH_REENTER_GUEST && > - kvm_vcpu_exit_request(vcpu)) > - exit_fastpath = EXIT_FASTPATH_NOP; > + if (exit_fastpath == EXIT_FASTPATH_REENTER_GUEST) { > + if (!kvm_vcpu_exit_request(vcpu)) > + vmx_sync_pir_to_irr(vcpu); > + else > + exit_fastpath = EXIT_FASTPATH_NOP; > + } This part should be in patch 3; not a big deal, I can reorganize that myself. Paolo
On Thu, 30 Apr 2020 at 21:32, Paolo Bonzini <pbonzini@redhat.com> wrote: > > On 28/04/20 08:23, Wanpeng Li wrote: > > - if (exit_fastpath == EXIT_FASTPATH_REENTER_GUEST && > > - kvm_vcpu_exit_request(vcpu)) > > - exit_fastpath = EXIT_FASTPATH_NOP; > > + if (exit_fastpath == EXIT_FASTPATH_REENTER_GUEST) { > > + if (!kvm_vcpu_exit_request(vcpu)) > > + vmx_sync_pir_to_irr(vcpu); > > + else > > + exit_fastpath = EXIT_FASTPATH_NOP; > > + } > > This part should be in patch 3; not a big deal, I can reorganize that > myself. Great, thanks. Wanpeng
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 24cadf4..ce19b0e 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -3909,7 +3909,8 @@ static int vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector) if (pi_test_and_set_on(&vmx->pi_desc)) return 0; - if (!kvm_vcpu_trigger_posted_interrupt(vcpu, false)) + if (vcpu != kvm_get_running_vcpu() && + !kvm_vcpu_trigger_posted_interrupt(vcpu, false)) kvm_vcpu_kick(vcpu); return 0; @@ -6777,9 +6778,12 @@ static fastpath_t vmx_vcpu_run(struct kvm_vcpu *vcpu) vmx_complete_interrupts(vmx); exit_fastpath = vmx_exit_handlers_fastpath(vcpu); - if (exit_fastpath == EXIT_FASTPATH_REENTER_GUEST && - kvm_vcpu_exit_request(vcpu)) - exit_fastpath = EXIT_FASTPATH_NOP; + if (exit_fastpath == EXIT_FASTPATH_REENTER_GUEST) { + if (!kvm_vcpu_exit_request(vcpu)) + vmx_sync_pir_to_irr(vcpu); + else + exit_fastpath = EXIT_FASTPATH_NOP; + } return exit_fastpath; } diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 33e1eee..2482f3c 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -4644,6 +4644,7 @@ struct kvm_vcpu *kvm_get_running_vcpu(void) return vcpu; } +EXPORT_SYMBOL_GPL(kvm_get_running_vcpu); /** * kvm_get_running_vcpus - get the per-CPU array of currently running vcpus.