Received: by 10.192.165.156 with SMTP id m28csp2613966imm; Sun, 15 Apr 2018 05:13:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/oJP5Ad4c6nQNOIjH1K/u0UDAEyCrwx3vV7ulISOf9lplMWBUwXO/piqiTLazTMQnOrUoN X-Received: by 2002:a17:902:8606:: with SMTP id f6-v6mr11830355plo.258.1523794403114; Sun, 15 Apr 2018 05:13:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523794403; cv=none; d=google.com; s=arc-20160816; b=Gx6BgpdE/cHZwX7kDENuXQwP71ncUB/1k7p4dAEoMdk3uOefy9lSvuPuJsmyroAfRG 2nxX7zNi8sZYGvPCV9DONZwDYyz07KIZ6BTV0f1Ks+GdYpqV5VIbC4GuM7CMSAJi14cI yzfDceOMHbASq7aSBH7P6SqiZeakDsT3/D/lCCrM4vwpHTANhIYQpwRFNI6HQ/4a9M2M rNyRI9X0wy0BIhkqfilGOMNMYHVeNVhD5g2+cQiGgZDOaL26r03txaXFXSdcHdg3YpWN /51vod9DvA71gs0+vG3ednwZwQHoXtCovAQyyviDZ8jqEnEnLQWL1ZFelrjTLxXaY0Go IcwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=JoUuUs3Gq+/Yd/BfVBvmq5fDL1okmS0QWmtgvjgRJWI=; b=01k6EHzaNR21eu/PlztH3/aGIkf46zP4CYcqZW6HXXXaRVL3oN7E5FRpjypTdumVqj uxGYHq35Hv4BQf7s/9etx0wZhgY0eLEmru9Z56qId7tyWqJxCztunPmStKV8FBgWTaO4 L/1bwiF3tQ1vLw2L1K7YQPZXW6xOtmYVFKMZtDdAtWzKupmVCrwnb0wysoicovGTSYWd TC6luKEwLx2h5D6ZiyrM2SDI3PVDOyjautWhzyZ0ZKDEh8jZn9Iel0PKk0anOt9h13ug kNNZUfYnfrkTcT0SQcHjMg5RNfNPDohoMMGC3rlR0xYEv8Cf/080aKkdq0qNdlQgq9d3 LhbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=A3Kb+aZf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c30si4192895pgn.56.2018.04.15.05.13.08; Sun, 15 Apr 2018 05:13:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=A3Kb+aZf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752399AbeDOMMD (ORCPT + 99 others); Sun, 15 Apr 2018 08:12:03 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:36282 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbeDOMMC (ORCPT ); Sun, 15 Apr 2018 08:12:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JoUuUs3Gq+/Yd/BfVBvmq5fDL1okmS0QWmtgvjgRJWI=; b=A3Kb+aZfQejJ4gCN++46sGNOJ O1wJn+yARSlXgaxcqRwGDH6GtzMxB06gahw5rB9KR5f+uonNzxj1TnhcYYFdW3q3nU4z9ZeGleIHl ia3UkLJFgFtwAEjDV24HYJx0GkW1+ysaBePaxOY7rd2e9d+h6lzWb6kRCNBm/vGAXePGwC0mn1z34 H3LDUPVWDCUV+/6iPlDfmaPbbtNhetOaABoA17V0tJaOTXBq0fHuiee1hg4V7PivphV3UCAVi+QcV Rb5/zXW/KhYf/3K/johcXMUHLCfDlalIVq9i6BqyH12EMIK5SUUDVWOq4M9f0OYcZTp3Xb9+LyJ87 o0BVV0wbw==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7gVh-0006Ew-QE; Sun, 15 Apr 2018 12:11:57 +0000 Date: Sun, 15 Apr 2018 05:11:57 -0700 From: Christoph Hellwig To: Benjamin Herrenschmidt Cc: Christoph Hellwig , Anshuman Khandual , "Michael S. Tsirkin" , robh@kernel.org, aik@ozlabs.ru, jasowang@redhat.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, joe@perches.com, david@gibson.dropbear.id.au, linuxppc-dev@lists.ozlabs.org, elfring@users.sourceforge.net Subject: Re: [RFC] virtio: Use DMA MAP API for devices without an IOMMU Message-ID: <20180415121157.GA17726@infradead.org> References: <20180405105631.9514-1-khandual@linux.vnet.ibm.com> <3e1b113b-79ca-b700-5be9-10c66d74aabe@linux.vnet.ibm.com> <20180405175326-mutt-send-email-mst@kernel.org> <1522940983.21446.205.camel@kernel.crashing.org> <20180405213042-mutt-send-email-mst@kernel.org> <1522963113.21446.211.camel@kernel.crashing.org> <70cb433f-a8f7-5199-3c96-a760c7624804@linux.vnet.ibm.com> <20180406071634.GA31108@infradead.org> <1523003838.21446.238.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523003838.21446.238.camel@kernel.crashing.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 06, 2018 at 06:37:18PM +1000, Benjamin Herrenschmidt wrote: > > > implemented as DMA API which the virtio core understands. There is no > > > need for an IOMMU to be involved for the device representation in this > > > case IMHO. > > > > This whole virtio translation issue is a mess. I think we need to > > switch it to the dma API, and then quirk the legacy case to always > > use the direct mapping inside the dma API. > > Fine with using a dma API always on the Linux side, but we do want to > special case virtio still at the arch and qemu side to have a "direct > mapping" mode. Not sure how (special flags on PCI devices) to avoid > actually going through an emulated IOMMU on the qemu side, because that > slows things down, esp. with vhost. > > IE, we can't I think just treat it the same as a physical device. We should have treated it like a physical device from the start, but that device has unfortunately sailed. But yes, we'll need a per-device quirk that says 'don't attach an iommu'.