From patchwork Mon Jan 11 17:20: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: 42637 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 71F4CB7BC3 for ; Tue, 12 Jan 2010 04:33:47 +1100 (EST) Received: from localhost ([127.0.0.1]:48715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUO9A-0000qP-Fq for incoming@patchwork.ozlabs.org; Mon, 11 Jan 2010 12:33:44 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUNzV-0004Sw-Qq for qemu-devel@nongnu.org; Mon, 11 Jan 2010 12:23:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUNzR-0004Oi-2S for qemu-devel@nongnu.org; Mon, 11 Jan 2010 12:23:45 -0500 Received: from [199.232.76.173] (port=34449 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUNzQ-0004OX-SY for qemu-devel@nongnu.org; Mon, 11 Jan 2010 12:23:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54236) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NUNzQ-0000UX-8c for qemu-devel@nongnu.org; Mon, 11 Jan 2010 12:23:40 -0500 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 o0BHNcwk024998 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 11 Jan 2010 12:23:38 -0500 Received: from redhat.com (vpn2-11-60.ams2.redhat.com [10.36.11.60]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o0BHNaVU024998; Mon, 11 Jan 2010 12:23:37 -0500 Date: Mon, 11 Jan 2010 19:20:43 +0200 From: "Michael S. Tsirkin" To: Anthony Liguori , qemu-devel@nongnu.org Message-ID: <20100111172043.GG11936@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH-RFC 06/13] s390-virtio: fill in irqfd support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Don't know how to make queuefd work: probably need support for binding hypercalls to eventfd in kvm? Again, just a demonstration, probably not for commit, because s390 does not have vector support. Signed-off-by: Michael S. Tsirkin --- hw/s390-virtio-bus.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c index 980e7eb..b663972 100644 --- a/hw/s390-virtio-bus.c +++ b/hw/s390-virtio-bus.c @@ -315,11 +315,27 @@ static unsigned virtio_s390_get_features(void *opaque) return dev->host_features; } +static void virtio_s390_irqfd_read(void *opaque) +{ + VirtQueue *vq = opaque; + virtio_irq(vq->vdev, vq); +} + +static int virtio_s390_irqfd(void * opaque, int n, int fd, bool assign) +{ + VirtIOS390Device *dev = opaque; + VirtQueue *vq = &dev->vdev->vq[n]; + + qemu_set_fd_handler(fd, assign ? virtio_s390_irqfd_read : NULL, NULL, vq); + return 0; +} + /**************** S390 Virtio Bus Device Descriptions *******************/ static const VirtIOBindings virtio_s390_bindings = { .notify = virtio_s390_notify, .get_features = virtio_s390_get_features, + .set_irqfd = virtio_s390_irqfd, }; static VirtIOS390DeviceInfo s390_virtio_net = {