Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753380AbcD0Ocp (ORCPT ); Wed, 27 Apr 2016 10:32:45 -0400 Received: from mail-oi0-f46.google.com ([209.85.218.46]:35246 "EHLO mail-oi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752665AbcD0OcE (ORCPT ); Wed, 27 Apr 2016 10:32:04 -0400 MIME-Version: 1.0 In-Reply-To: <20160427142331.GH17926@8bytes.org> References: <1461245745-6710-1-git-send-email-mst@redhat.com> <20160421135416.GE11775@citrix.com> <1461759501.118304.149.camel@infradead.org> <20160427153345-mutt-send-email-mst@redhat.com> <20160427142331.GH17926@8bytes.org> From: Andy Lutomirski Date: Wed, 27 Apr 2016 07:31:43 -0700 Message-ID: Subject: Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api To: Joerg Roedel Cc: "Michael S. Tsirkin" , David Woodhouse , Kevin Wolf , Wei Liu , Andy Lutomirski , qemu-block@nongnu.org, Christian Borntraeger , Jason Wang , Stefano Stabellini , "qemu-devel@nongnu.org Developers" , peterx@redhat.com, "linux-kernel@vger.kernel.org" , Amit Shah , iommu@lists.linux-foundation.org, Stefan Hajnoczi , kvm list , Cornelia Huck , Paolo Bonzini , Linux Virtualization , Anthony PERARD 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: 1020 Lines: 25 On Wed, Apr 27, 2016 at 7:23 AM, Joerg Roedel wrote: > On Wed, Apr 27, 2016 at 04:37:04PM +0300, Michael S. Tsirkin wrote: >> One correction: it's a feature of the device in the system. >> There could be a mix of devices bypassing and not >> bypassing the IOMMU. > > No, it really is not. A device can't chose to bypass the IOMMU. But the > IOMMU can chose to let the device bypass. So any fix here belongs > into the platform/iommu code too and not into some driver. > >> Sounds good. And a way to detect appropriate devices could >> be by looking at the feature flag, perhaps? > > Again, no! The way to detect that is to look into the iommu description > structures provided by the firmware. They provide everything necessary > to tell the iommu code which devices are not translated. > Except on PPC and SPARC. As far as I know, those are the only problematic platforms. Is it too late to *disable* QEMU's q35-iommu thingy until it can be fixed to report correct data in the DMAR tables? --Andy