From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755299AbbJ1CPr (ORCPT ); Tue, 27 Oct 2015 22:15:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:51986 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754754AbbJ1CPo (ORCPT ); Tue, 27 Oct 2015 22:15:44 -0400 Date: Wed, 28 Oct 2015 11:15:30 +0900 From: Joerg Roedel To: Andy Lutomirski Cc: linux-kernel@vger.kernel.org, Christian Borntraeger , Cornelia Huck , Sebastian Ott , Paolo Bonzini , Christoph Hellwig , benh@kernel.crashing.org, KVM , dwmw2@infradead.org, Martin Schwidefsky , linux-s390 , Andy Lutomirski Subject: Re: [PATCH 3/3] virtio_pci: Use the DMA API Message-ID: <20151028021530.GC18467@suse.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2015 at 06:17:10PM -0700, Andy Lutomirski wrote: > From: Andy Lutomirski > > This fixes virtio-pci on platforms and busses that have IOMMUs. This > will break the experimental QEMU Q35 IOMMU support until QEMU is > fixed. In exchange, it fixes physical virtio hardware as well as > virtio-pci running under Xen. > > We should clean up the virtqueue API to do its own allocation and > teach virtqueue_get_avail and virtqueue_get_used to return DMA > addresses directly. > > Signed-off-by: Andy Lutomirski > --- > drivers/virtio/virtio_pci_common.h | 3 ++- > drivers/virtio/virtio_pci_legacy.c | 19 +++++++++++++++---- > drivers/virtio/virtio_pci_modern.c | 34 ++++++++++++++++++++++++---------- > 3 files changed, 41 insertions(+), 15 deletions(-) Same here, you need to call the dma_sync* functions when passing data from/to the virtio-device. I think a good test for that is to boot a virtio kvm-guest with swiotlb=force and see if it still works. Joerg