From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] KVM: Fix race between APIC TMR and IRR Date: Tue, 29 Dec 2009 20:09:39 -0200 Message-ID: <20091229220939.GA17127@amt.cnet> References: <1262083336-5491-1-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:33270 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752170AbZL2WKS (ORCPT ); Tue, 29 Dec 2009 17:10:18 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBTMAHVq018259 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 29 Dec 2009 17:10:17 -0500 Content-Disposition: inline In-Reply-To: <1262083336-5491-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Dec 29, 2009 at 12:42:16PM +0200, Avi Kivity wrote: > When we queue an interrupt to the local apic, we set the IRR before the TMR. > The vcpu can pick up the IRR and inject the interrupt before setting the TMR, > and perhaps even EOI it, causing incorrect behaviour. > > The race is really insignificant since it can only occur on the first > interrupt (usually following interrupts will not change TMR), but it's better > closed than open. The EOI handler clears TMR, so AFAICS it can occur not only on the first interrupt. Applied, thanks.