From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted Date: Fri, 31 Jul 2015 09:57:22 +0200 Message-ID: <55BB2A62.5090302@redhat.com> References: <1438177055-26764-1-git-send-email-pbonzini@redhat.com> <1438177055-26764-2-git-send-email-pbonzini@redhat.com> <20150731024942.GB31082@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "alex.williamson@redhat.com" , "srutherford@intel.com" To: Steve Rutherford , "Zhang, Yang Z" Return-path: In-Reply-To: <20150731024942.GB31082@google.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 31/07/2015 04:49, Steve Rutherford wrote: > Oh... Yeah. That's a damn good point, given that the interrupt can be > injected from another thread while one is in that guest vcpu. > > Easiest time to update the TMR should be on guest entry through > vcpu_scan_ioapic, as before. > > The best way to go is probably to ditch the new per vcpu EOI exit > bitmap, and just update/use the TMR. There's no reason to duplicate > that data in the representation of the apic (I suspect that the > duplication was inspired by my mistaken notion of the TMR). The > IOAPIC exit check can use the TMR instead. > > Based upon my reading of the SDM, the only reason that the eoi exit > bitmaps are not the exact same as the TMR is that it is possible to > have virtual-interrupt delivery enabled /without/ an apic access page > (Note: V-ID => EOI exit bitmap enabled). > > Yang, do you happen to know if that is the case? > > [Note: Just looked back at the old code for updating the EOI exit > bitmaps, which for some reason was configured to trigger EOI exits > for all IOAPIC interrupts, not just level-triggered IOAPIC > interrupts. Which is weird, and I believe totally unecessary.] The RTC interrupt needs to trigger an EOI exit with the in-kernel IOAPIC, in order to detect coalesced interrupts. This is necessary to avoid severe time drift in Windows guest. Paolo