From patchwork Fri Oct 30 12:17:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 7526791 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 07092BEEA4 for ; Fri, 30 Oct 2015 12:18:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34F39207B6 for ; Fri, 30 Oct 2015 12:18:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08D1A207B0 for ; Fri, 30 Oct 2015 12:18:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031101AbbJ3MSB (ORCPT ); Fri, 30 Oct 2015 08:18:01 -0400 Received: from e06smtp08.uk.ibm.com ([195.75.94.104]:57221 "EHLO e06smtp08.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031011AbbJ3MSA (ORCPT ); Fri, 30 Oct 2015 08:18:00 -0400 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Oct 2015 12:17:58 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp08.uk.ibm.com (192.168.101.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 30 Oct 2015 12:17:55 -0000 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: cornelia.huck@de.ibm.com X-IBM-RcptTo: kvm@vger.kernel.org;linux-s390@vger.kernel.org Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id D2D0F219004D; Fri, 30 Oct 2015 12:17:51 +0000 (GMT) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t9UCHtqk54853638; Fri, 30 Oct 2015 12:17:55 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t9UCHnUe028427; Fri, 30 Oct 2015 06:17:54 -0600 Received: from gondolin (dyn-9-152-224-100.boeblingen.de.ibm.com [9.152.224.100]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t9UCHmt5028267; Fri, 30 Oct 2015 06:17:48 -0600 Date: Fri, 30 Oct 2015 13:17:46 +0100 From: Cornelia Huck To: Christian Borntraeger Cc: Andy Lutomirski , Sebastian Ott , Paolo Bonzini , Christoph Hellwig , benh@kernel.crashing.org, KVM , dwmw2@infradead.org, Joerg Roedel , Martin Schwidefsky , linux-s390 Subject: Re: [PATCH 4/4] s390/virtio: use noop dma ops Message-ID: <20151030131746.49f6b129.cornelia.huck@de.ibm.com> In-Reply-To: <1445986131-239566-5-git-send-email-borntraeger@de.ibm.com> References: <1445986131-239566-1-git-send-email-borntraeger@de.ibm.com> <1445986131-239566-5-git-send-email-borntraeger@de.ibm.com> Organization: IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz =?UTF-8?B?R2VzY2jDpGZ0c2bDvGhydW5nOg==?= Dirk Wittkopp Sitz der Gesellschaft: =?UTF-8?B?QsO2Ymxpbmdlbg==?= Registergericht: Amtsgericht Stuttgart, HRB 243294 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15103012-0033-0000-0000-000004A1AE72 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 27 Oct 2015 23:48:51 +0100 Christian Borntraeger wrote: > With all infrastructure in place, lets provide dma_ops for virtio > devices on s390. > > Signed-off-by: Christian Borntraeger > --- > drivers/s390/virtio/kvm_virtio.c | 2 ++ > drivers/s390/virtio/virtio_ccw.c | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/drivers/s390/virtio/kvm_virtio.c b/drivers/s390/virtio/kvm_virtio.c > index 53fb975..05adaa9 100644 > --- a/drivers/s390/virtio/kvm_virtio.c > +++ b/drivers/s390/virtio/kvm_virtio.c > @@ -13,6 +13,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -318,6 +319,7 @@ static void add_kvm_device(struct kvm_device_desc *d, unsigned int offset) > return; > } > > + kdev->vdev.dev.archdata.dma_ops = &dma_noop_ops; This provides dma_ops for the vdev, while Andy's virtio code looks for dma_ops in the vdev's parent (in the ccw and pci cases, the proxy device; in this case, it would be our root device). With applied (and the endianness fix in the virtio code), I can boot a s390-virtio guest as well. > kdev->vdev.dev.parent = kvm_root; > kdev->vdev.id.device = d->type; > kdev->vdev.config = &kvm_vq_configspace_ops; --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/s390/virtio/kvm_virtio.c b/drivers/s390/virtio/kvm_virtio.c index 05adaa9..5f79c52 100644 --- a/drivers/s390/virtio/kvm_virtio.c +++ b/drivers/s390/virtio/kvm_virtio.c @@ -319,7 +319,6 @@ static void add_kvm_device(struct kvm_device_desc *d, unsigned int offset) return; } - kdev->vdev.dev.archdata.dma_ops = &dma_noop_ops; kdev->vdev.dev.parent = kvm_root; kdev->vdev.id.device = d->type; kdev->vdev.config = &kvm_vq_configspace_ops; @@ -473,6 +472,7 @@ static int __init kvm_devices_init(void) vmem_remove_mapping(total_memory_size, PAGE_SIZE); return rc; } + kvm_root->archdata.dma_ops = &dma_noop_ops; INIT_WORK(&hotplug_work, hotplug_devices);