Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933102AbcDSQAu (ORCPT ); Tue, 19 Apr 2016 12:00:50 -0400 Received: from mail-oi0-f45.google.com ([209.85.218.45]:36002 "EHLO mail-oi0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932858AbcDSQAs (ORCPT ); Tue, 19 Apr 2016 12:00:48 -0400 MIME-Version: 1.0 In-Reply-To: <20160419103815-mutt-send-email-mst@redhat.com> References: <1460979793-6621-1-git-send-email-mst@redhat.com> <1460980717.12793.43.camel@infradead.org> <20160418160731-mutt-send-email-mst@redhat.com> <1460988232.22654.7.camel@infradead.org> <20160418170534-mutt-send-email-mst@redhat.com> <1460992923.3765.8.camel@infradead.org> <20160418182320-mutt-send-email-mst@redhat.com> <1460994701.3765.23.camel@infradead.org> <20160418190203-mutt-send-email-mst@redhat.com> <1461004173.3765.73.camel@infradead.org> <20160419103815-mutt-send-email-mst@redhat.com> From: Andy Lutomirski Date: Tue, 19 Apr 2016 09:00:27 -0700 Message-ID: Subject: Re: [PATCH RFC] fixup! virtio: convert to use DMA api To: "Michael S. Tsirkin" Cc: Cornelia Huck , Christian Borntraeger , "qemu-devel@nongnu.org Developers" , David Woodhouse , Wei Liu , Alex Williamson , peterx@redhat.com, Stefan Hajnoczi , Linux Virtualization , qemu-block@nongnu.org, Kevin Wolf , Amit Shah , "linux-kernel@vger.kernel.org" , Jason Wang , Paolo Bonzini , kvm list Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1081 Lines: 26 On Apr 19, 2016 2:13 AM, "Michael S. Tsirkin" wrote: > > > I guess you are right in that we should split this part out. > What I wanted is really the combination > PASSTHROUGH && !PLATFORM so that we can say "ok we don't > need to guess, this device actually bypasses the IOMMU". What happens when you use a device like this on Xen or with a similar software translation layer? I think that a "please bypass IOMMU" feature would be better in the PCI, IOMMU, or platform code. For Xen, virtio would still want to use the DMA API, just without translating at the DMAR or hardware level. Doing it in virtio is awkward, because virtio is involved at the device level and the driver level, but the translation might be entirely in between. I think a nicer long-term approach would be to have a way to ask the guest to set up a full 1:1 mapping for performance, but to still handle the case where the guest refuses to do so or where there's more than one translation layer involved. But I agree that this part shouldn't delay the other part of your series. --Andy