From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCHv5 5/5] kvm: host side for eoi optimization Date: Thu, 31 May 2012 17:52:20 +0300 Message-ID: <20120531145219.GA20290@redhat.com> References: <20120531095710.GM2311@redhat.com> <20120531101111.GA15836@redhat.com> <20120531101513.GO2311@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: x86@kernel.org, kvm@vger.kernel.org, Ingo Molnar , "H. Peter Anvin" , Avi Kivity , Marcelo Tosatti , Linus Torvalds , linux-kernel@vger.kernel.org, Thomas Gleixner To: Gleb Natapov Return-path: Content-Disposition: inline In-Reply-To: <20120531101513.GO2311@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Thu, May 31, 2012 at 01:15:13PM +0300, Gleb Natapov wrote: > > > > + /* Cache not set: safe but we don't bother. */ > > > > + unlikely(apic->isr_cache == -1) || > > > > + /* Need EOI to update ioapic. */ > > > > + unlikely(kvm_ioapic_handles_vector(vcpu->kvm, apic->isr_cache))) > > > > + return; > > > > + > > > > + pv_eoi_set_pending(apic->vcpu); > > > > +} > > > > + > > > apic_sync_pv_eoi_to_guest() is not paired with > > > apic_sync_pv_eoi_from_guest() if event injection is canceled. > > > You can enter guest with stale pv_eoi bit. > > > > Never. The pv_eoi bit is cleared on each exit. > There will be no exit since there will be no entry. Search for > "goto out" after kvm_lapic_sync_to_vapic(). I think you've found a bug, thanks a bunch. I have fixed it but the x86 guys asked me not to post more patches until merge window closes :( So I'll sit on a fix for several days.