[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a72tf67l.fsf@vitty.brq.redhat.com>
Date: Thu, 30 Apr 2020 15:34:06 +0200
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: Wanpeng Li <kernellwp@...il.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Haiwei Li <lihaiwei@...cent.com>
Subject: Re: [PATCH v4 2/7] KVM: X86: Enable fastpath when APICv is enabled
Wanpeng Li <kernellwp@...il.com> writes:
> From: Wanpeng Li <wanpengli@...cent.com>
>
> We can't observe benefit from single target IPI fastpath when APICv is
> disabled, let's just enable IPI and Timer fastpath when APICv is enabled
> for now.
>
> Tested-by: Haiwei Li <lihaiwei@...cent.com>
> Cc: Haiwei Li <lihaiwei@...cent.com>
> Signed-off-by: Wanpeng Li <wanpengli@...cent.com>
> ---
> arch/x86/kvm/svm/svm.c | 2 +-
> arch/x86/kvm/vmx/vmx.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 8f8fc65..1e7220e 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -3344,7 +3344,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu)
>
> static enum exit_fastpath_completion svm_exit_handlers_fastpath(struct kvm_vcpu *vcpu)
> {
> - if (!is_guest_mode(vcpu) &&
> + if (!is_guest_mode(vcpu) && vcpu->arch.apicv_active &&
> to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_MSR &&
> to_svm(vcpu)->vmcb->control.exit_info_1)
> return handle_fastpath_set_msr_irqoff(vcpu);
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index 9b5adb4..f207004 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -6585,7 +6585,7 @@ void vmx_update_host_rsp(struct vcpu_vmx *vmx, unsigned long host_rsp)
>
> static enum exit_fastpath_completion vmx_exit_handlers_fastpath(struct kvm_vcpu *vcpu)
> {
> - if (!is_guest_mode(vcpu)) {
> + if (!is_guest_mode(vcpu) && vcpu->arch.apicv_active) {
> switch (to_vmx(vcpu)->exit_reason) {
> case EXIT_REASON_MSR_WRITE:
> return handle_fastpath_set_msr_irqoff(vcpu);
I think that apicv_active checks are specific to APIC MSRs but
handle_fastpath_set_msr_irqoff() can handle any other MSR as well. I'd
suggest to move the check inside handle_fastpath_set_msr_irqoff().
Also, enabling Hyper-V SynIC leads to disabling apicv. It it still
pointless to keep fastpath enabled?
--
Vitaly
Powered by blists - more mailing lists