From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43287 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtFXb-00026x-NE for qemu-devel@nongnu.org; Wed, 08 Sep 2010 03:58:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtFXX-0004XM-Se for qemu-devel@nongnu.org; Wed, 08 Sep 2010 03:57:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32846) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtFXX-0004XB-Lp for qemu-devel@nongnu.org; Wed, 08 Sep 2010 03:57:55 -0400 Date: Wed, 8 Sep 2010 10:51:54 +0300 From: "Michael S. Tsirkin" Message-ID: <20100908075153.GB23051@redhat.com> References: <1d7d4f07f2fb76258de5cd1e1c5e147778988a71.1283759074.git.yamahata@valinux.co.jp> <20100906094416.GB13529@redhat.com> <20100908074327.GF28803@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100908074327.GF28803@valinux.co.jp> Subject: [Qemu-devel] Re: [PATCH 07/14] msi: implemented msi. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: skandasa@cisco.com, adhyas@gmail.com, etmartin@cisco.com, qemu-devel@nongnu.org, wexu2@cisco.com On Wed, Sep 08, 2010 at 04:43:27PM +0900, Isaku Yamahata wrote: > Thank you for through review. > > On Mon, Sep 06, 2010 at 12:44:16PM +0300, Michael S. Tsirkin wrote: > > > + uint32_t pending = > > > + pci_get_long(dev->config + msi_pending_reg(dev, is64bit)); > > > + uint8_t vector; > > > + > > > + /* deliver pending interrupts which are unmasked */ > > > + for (vector = 0; vector < nr_vector; ++vector) { > > > + if (msi_is_masked(dev, vector) || !msi_test_bit(pending, vector)) { > > > > I am confused. This is called after mask is updated, right? > > So msi_is_masked means vector was masked, not unmasked? > > I think the logic is reversed here. > > I suppose you were missing the following continue. > > > > > + continue; > ^^^^^^^^^ Here I see. You are right. The block is small enough to maybe make it worthwhile to revert the logic and avoid continue. It's up to you though, there's no bug here. > > > + } > > > + > > > + msi_clear_bit(&pending, vector); > > > + pci_set_long(dev->config + msi_pending_reg(dev, is64bit), pending); > > > + msi_notify(dev, vector); > > > + } > > > + } > > > +} > > > + > > > +uint8_t msi_nr_allocated_vector(const PCIDevice *dev) > > -- > yamahata