Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbbGaH50 (ORCPT ); Fri, 31 Jul 2015 03:57:26 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:37367 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbbGaH5Z (ORCPT ); Fri, 31 Jul 2015 03:57:25 -0400 Subject: Re: [PATCH 1/2] KVM: x86: set TMR when the interrupt is accepted To: Steve Rutherford , "Zhang, Yang Z" References: <1438177055-26764-1-git-send-email-pbonzini@redhat.com> <1438177055-26764-2-git-send-email-pbonzini@redhat.com> <20150731024942.GB31082@google.com> Cc: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "alex.williamson@redhat.com" , "srutherford@intel.com" From: Paolo Bonzini Message-ID: <55BB2A62.5090302@redhat.com> Date: Fri, 31 Jul 2015 09:57:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150731024942.GB31082@google.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1611 Lines: 37 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/