From patchwork Wed Mar 27 15:41:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 231735 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 793EC2C007A for ; Thu, 28 Mar 2013 02:48:31 +1100 (EST) Received: from localhost ([::1]:42068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKsaR-0000Lb-NK for incoming@patchwork.ozlabs.org; Wed, 27 Mar 2013 11:48:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKsa1-0000EH-GT for qemu-devel@nongnu.org; Wed, 27 Mar 2013 11:48:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKsZn-00087P-HA for qemu-devel@nongnu.org; Wed, 27 Mar 2013 11:48:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKsTV-0005Tm-Q9 for qemu-devel@nongnu.org; Wed, 27 Mar 2013 11:41:17 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2RFfGOB005224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 Mar 2013 11:41:16 -0400 Received: from localhost (dhcp-64-106.muc.redhat.com [10.32.64.106]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2RFfFsa025623; Wed, 27 Mar 2013 11:41:15 -0400 From: Stefan Hajnoczi To: Date: Wed, 27 Mar 2013 16:41:12 +0100 Message-Id: <1364398872-3912-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id r2RFfGOB005224 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: =?UTF-8?q?=E5=BC=A0=E7=A3=8A=E5=BC=BA?= , Stefan Hajnoczi , "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH] virtio-pci: pass real with_irqfd to virtio_pci_set_guest_notifier() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org virtio_pci_set_guest_notifiers() checks whether irqfd can be used and whether MSI-X is enabled for the PCI adapter. But then it calls virtio_pci_set_guest_notifier() and passes kvm_msi_via_irqfd_enabled() instead of with_irqfd. When MSI-X is disabled but irqfd is allowed this means that guest_notifier has neither irqfd nor a virtio_queue_guest_notifier_read() handler. Therefore the guest cannot receive notifications. This issue is triggered by a Windows 7 Professional 64-bit guest with -device virtio-blk-pci,x-data-plane=on. The guest driver does not enable MSI-X and the guest gets stuck at the Windows boot screen since it does not receive notifications. Reported-by: 张磊强 (Leiqiang Zhang) Signed-off-by: Stefan Hajnoczi --- hw/virtio-pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 736a9bf..84ece51 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -798,8 +798,7 @@ static int virtio_pci_set_guest_notifiers(DeviceState *d, int nvqs, bool assign) break; } - r = virtio_pci_set_guest_notifier(d, n, assign, - kvm_msi_via_irqfd_enabled()); + r = virtio_pci_set_guest_notifier(d, n, assign, with_irqfd); if (r < 0) { goto assign_error; }