[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YzU0KyTx2SPRadTm@gao-cwp>
Date: Thu, 29 Sep 2022 13:59:07 +0800
From: Chao Gao <chao.gao@...el.com>
To: <kvm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<jon@...anix.com>, <kevin.tian@...el.com>, <seanjc@...gle.com>
CC: Paolo Bonzini <pbonzini@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH v3] KVM: x86/vmx: Suppress posted interrupt notification
when CPU is in host
On Wed, Sep 28, 2022 at 07:16:03PM +0800, Chao Gao wrote:
>@@ -10538,6 +10547,17 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
>
> vcpu->mode = OUTSIDE_GUEST_MODE;
> smp_wmb();
>+ /*
>+ * Suppress notification when CPU is OUTSIDE_GUEST_MODE to avoid
>+ * wasting time on handling interrupts. A notification to host/kvm
>+ * just indicates some interrupts are posted for a vCPU. Since KVM
>+ * always syncs pending interrupts in PIR to vAPIC IRR before guest
>+ * entry (in ->sync_pir_to_irr()), notification isn't needed.
>+ *
>+ * Do this even if apicv is disabled for simplicity.
>+ */
>+ if (kvm_lapic_enabled(vcpu))
>+ static_call_cond(kvm_x86_pi_suppress_notification)(vcpu, true);
I missed the other kvm's setting vcpu->mode to OUTSIDE_GUEST_MODE in
this function (a few lines above). Will fix it in v4.
>
> /*
> * Sync xfd before calling handle_exit_irqoff() which may
>
>base-commit: 372d07084593dc7a399bf9bee815711b1fb1bcf2
>--
>2.25.1
>
Powered by blists - more mailing lists