From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [patch 4/8] KVM: x86: replace hrtimer based timer emulation Date: Wed, 8 Jul 2009 13:47:12 -0300 Message-ID: <20090708164712.GB6867@amt.cnet> References: <20090706015511.923596553@localhost.localdomain> <20090706015812.786509491@localhost.localdomain> <20090708125819.GM28046@redhat.com> <20090708131721.GA3382@amt.cnet> <20090708162958.GS28046@redhat.com> <20090708163739.GA6867@amt.cnet> <20090708164057.GT28046@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx2.redhat.com ([66.187.237.31]:40430 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755962AbZGHQra (ORCPT ); Wed, 8 Jul 2009 12:47:30 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n68GlUvn001651 for ; Wed, 8 Jul 2009 12:47:30 -0400 Content-Disposition: inline In-Reply-To: <20090708164057.GT28046@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jul 08, 2009 at 07:40:57PM +0300, Gleb Natapov wrote: > On Wed, Jul 08, 2009 at 01:37:39PM -0300, Marcelo Tosatti wrote: > > On Wed, Jul 08, 2009 at 07:29:58PM +0300, Gleb Natapov wrote: > > > On Wed, Jul 08, 2009 at 10:17:21AM -0300, Marcelo Tosatti wrote: > > > > (but yes, bypassing the irq injection system its not a very beatiful > > > > shortcut, but its done in other places too eg i8254.c NMI injection via > > > > all cpus LINT0). > > > > > > > I've looked at this. Why do you say i8254.c NMI injection bypass the irq > > > injection system? It look to me like it uses usual way to send interrupt > > > to all cpus. > > > > It goes through apic_accept_irq so its somewhat fine. But it accesses > > the lapics of other vcpus locklessly (which does not happen via > > kvm_set_irq path due to irq_lock protection). > Ah, that the bug then. But otherwise it goes through usual interrupt > logic. Do you know why the lock is missing? Due to potential deadlock or > we just forget to lock? There is no lock to protect the lapics right, normally isr setting is lockless which is fine, but kvm_apic_local_deliver also reads a register. Hum, should be fine though.