Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2286198imm; Sun, 5 Aug 2018 00:34:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcSo2i9p4OfUasy5AOx18mEqOjLuFVbwFEISpDf8mia0x5nCZDeJT30SjApDSTa60Jm8i0Z X-Received: by 2002:a62:34c4:: with SMTP id b187-v6mr11824384pfa.15.1533454450352; Sun, 05 Aug 2018 00:34:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533454450; cv=none; d=google.com; s=arc-20160816; b=JCqiKwJSPU8pICI9DifpAxca8KKRONmn2BLE2K5CVGgEm+S9+jwQF5f8isvKx0etNN E/YnPxrnniyJAV6FNr0uGI5DV9F1yf/vvITiyMyMTATPK0VfFcR7LDCXZyz9xn14EnBR /LVkAK9eKIS7jqzGjBncN6tlpk7hHo+LPLaUbKO7sN4uuipDtBNR3Fo2ldYA3AWePf3A 0LwAG5HdLChmIflD5M02ak8X8wsPqQapqg0Qs6xTm2t9Zq+mhPTSROe2HBwfIocpxBhy 8v0NYtIZIro0jUteVK1ReqgIRkFqbFW05YPWYSqFkoVIw2oYHnGioof9R78rjToB3UmC 3atQ== 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=cNw/bKY0gGFoxKOa/lesQrQ8CdWQZhAvmvIVzpFNoJE=; b=Qx3Tc6i6h4ceTITGx7TzPjfNCN1LHfgvAH7BR7PEodvFZriolnu22s/t8xKt4VZUPA 0oYihM1kjSeqSJfdbb9JDuRVTvrqCiISMrjc1qpeUoL83FKRUkyaMMDjgMWJLT4+hWxz OaHIm0zciBNydaX2C8gFI43ce5AiETD33xFq9y2miyWU7cG7gJro2g6/NOh0YdtLrK78 S9XSttYSoPE0OIBWajDM4EpLs1W5uj+ZnZ3hTu0b3e+cEGjdjwTWApoB7OnCSYDJq10b Vo0wQgaBdjuSfynFxZRg51zTcm9f88Uu+MgMbozBkuFUJhoaIRBDWUcvv+5zbphRqVfp LOsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=lZeolvhp; 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 1-v6si7428455plr.148.2018.08.05.00.33.32; Sun, 05 Aug 2018 00:34:10 -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=lZeolvhp; 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 S1726330AbeHEJdN (ORCPT + 99 others); Sun, 5 Aug 2018 05:33:13 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:52330 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726110AbeHEJdN (ORCPT ); Sun, 5 Aug 2018 05:33:13 -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=cNw/bKY0gGFoxKOa/lesQrQ8CdWQZhAvmvIVzpFNoJE=; b=lZeolvhpRJCRag7GhKX0/KIRA 725688s0WCA0Q+YLeHf0KfZJO2ukLODxIW7yUIFvylwjrPB/2ejJPunNY0YihVdUIf12CwuaVVagU yyEFpxf0nCE4BeLq0c7J35VC+4YVj4A8TxZ+ZqWFnxWChQd9yI9Fx3PViGw1UW6pLXRksQW1WNBkW FkopJHlukJfaJsVgzr8W0vIshbHjGMCLGtBirjbbWFooduo5aqKwNkeHUJlcNHOvvkpRqB1GppF1J humDjniMIGoIrxe/tUfQYt9GlDWuLVufz+MPkGiePLdjzM/owUM7pVAs5cjadgJqJ4Nz6/lUt2baH Z8NyKe8ig==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmDTn-0007Yn-1y; Sun, 05 Aug 2018 07:29:31 +0000 Date: Sun, 5 Aug 2018 00:29:30 -0700 From: Christoph Hellwig To: Benjamin Herrenschmidt Cc: Christoph Hellwig , "Michael S. Tsirkin" , Will Deacon , Anshuman Khandual , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, aik@ozlabs.ru, robh@kernel.org, joe@perches.com, elfring@users.sourceforge.net, david@gibson.dropbear.id.au, jasowang@redhat.com, mpe@ellerman.id.au, linuxram@us.ibm.com, haren@linux.vnet.ibm.com, paulus@samba.org, srikar@linux.vnet.ibm.com, robin.murphy@arm.com, jean-philippe.brucker@arm.com, marc.zyngier@arm.com Subject: Re: [RFC 0/4] Virtio uses DMA API for all devices Message-ID: <20180805072930.GB23288@infradead.org> References: <20180802200646-mutt-send-email-mst@kernel.org> <20180802225738-mutt-send-email-mst@kernel.org> <20180803070507.GA1344@infradead.org> <20180803160246.GA13794@infradead.org> <22310f58605169fe9de83abf78b59f593ff7fbb7.camel@kernel.crashing.org> <20180804082120.GB4421@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Sun, Aug 05, 2018 at 11:10:15AM +1000, Benjamin Herrenschmidt wrote: > - One you have rejected, which is to have a way for "no-iommu" virtio > (which still doesn't use an iommu on the qemu side and doesn't need > to), to be forced to use some custom DMA ops on the VM side. > > - One, which sadly has more overhead and will require modifying more > pieces of the puzzle, which is to make qemu uses an emulated iommu. > Once we make qemu do that, we can then layer swiotlb on top of the > emulated iommu on the guest side, and pass that as dma_ops to virtio. Or number three: have a a virtio feature bit that tells the VM to use whatever dma ops the platform thinks are appropinquate for the bus it pretends to be on. Then set a dma-range that is limited to your secure memory range (if you really need it to be runtime enabled only after a device reset that rescans) and use the normal dma mapping code to bounce buffer.