From patchwork Tue May 25 14:00:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 102213 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4PE59pC019298 for ; Tue, 25 May 2010 14:05:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933090Ab0EYOE7 (ORCPT ); Tue, 25 May 2010 10:04:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4628 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932693Ab0EYOE7 (ORCPT ); Tue, 25 May 2010 10:04:59 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4PE4w8r005322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 25 May 2010 10:04:58 -0400 Received: from redhat.com (dhcp-0-94.tlv.redhat.com [10.35.0.94]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o4PE4u37015304; Tue, 25 May 2010 10:04:57 -0400 Date: Tue, 25 May 2010 17:00:43 +0300 From: "Michael S. Tsirkin" To: kvm@vger.kernel.org, amit.shah@redhat.com, quintela@redhat.com, kraxel@redhat.com Subject: [PATCH] vhost-net: fix reversed logic in mask notifiers Message-ID: <20100525140043.GA19688@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 25 May 2010 14:05:10 +0000 (UTC) diff --git a/hw/msix.c b/hw/msix.c index 8f9a621..1398680 100644 --- a/hw/msix.c +++ b/hw/msix.c @@ -617,6 +617,7 @@ int msix_set_mask_notifier(PCIDevice *dev, unsigned vector, void *opaque) assert(opaque); assert(!dev->msix_mask_notifier_opaque[vector]); + /* Unmask the new notifier unless vector is masked. */ if (msix_is_masked(dev, vector)) { return 0; } @@ -638,12 +639,13 @@ int msix_unset_mask_notifier(PCIDevice *dev, unsigned vector) assert(dev->msix_mask_notifier); assert(dev->msix_mask_notifier_opaque[vector]); + /* Mask the old notifier unless it is already masked. */ if (msix_is_masked(dev, vector)) { return 0; } r = dev->msix_mask_notifier(dev, vector, dev->msix_mask_notifier_opaque[vector], - msix_is_masked(dev, vector)); + !msix_is_masked(dev, vector)); if (r < 0) { return r; }