From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 1/3] KVM: Emulation MSI-X mask bits for assigned devices Date: Thu, 30 Sep 2010 13:25:17 -0300 Message-ID: <20100930162517.GB29881@amt.cnet> References: <1285667052-24907-1-git-send-email-sheng@linux.intel.com> <1285667052-24907-2-git-send-email-sheng@linux.intel.com> <20100928133600.GG14385@redhat.com> <201009290917.14843.sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Michael S. Tsirkin" , Avi Kivity , kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:2231 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756746Ab0I3Qpk (ORCPT ); Thu, 30 Sep 2010 12:45:40 -0400 Content-Disposition: inline In-Reply-To: <201009290917.14843.sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Sep 29, 2010 at 09:17:14AM +0800, Sheng Yang wrote: > > > + else { > > > + enable_irq(irq); > > > + if (assigned_dev->guest_msix_entries[index].flags & > > > + KVM_ASSIGNED_MSIX_PENDING) > > > + schedule_work(&assigned_dev->interrupt_work); > > > + } > > > > Hmm, won't this lose interrupts which were sent while bit was pending? > > It is also pretty heavy if as you say guests touch the mask a lot. > > I think we must keep the interrupt disabled, just set a bit > > and delay interrupt injection until vector is unmasked > > or deleted. The interface to do this will need more thought: > > e.g. how can userspace clear this bit then? > > I think it's fine. Because we didn't modify pending bit here, and the interrupt > handler would schedule an work to check it regardless of if the IRQ is disable. By > this meaning, no interrupt would be lose. AFAICS unmasking the host irq will trigger pending message. If thats correct, it should be fine.