Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3678376imm; Mon, 4 Jun 2018 07:36:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJFjKk/2uJjA9rvEKY3e1/a1oMzuqQazCuKKrLq7R6OnqKCVweupZVR4yoivKUhttV7LJF3 X-Received: by 2002:a17:902:1002:: with SMTP id b2-v6mr21892707pla.344.1528122972293; Mon, 04 Jun 2018 07:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528122972; cv=none; d=google.com; s=arc-20160816; b=ssNOZxFR5Jv99X4GJJUWnwb1zJh0syy3AXkIS2jP7htxP9nlqgONpfIvpYN/tDortX 2a2BCPJ8HmTM2PHhsGklD0RRjSibkYEuaoqEeQBL3BF6lYyJaeR5a5dxFny4jKGbTiFk ihZAGXwomaiEuGomd5w9MSW2aX4u8Kk/ozkNGVCeBVQy86JcWKEcXqou2/JvhvxEz65y ilOVUZ/Qk1dSbhqWNTykbNRXTSOVQK/BQ/3pI+eBdzUhjdu8AurnWPoHv80tASaXJuZo 8QFwk4hwDdGPwjwlKvy0f/ree/xjEPrKoP+mM+T1wu4Si7kAWzilqbgb838XTQJmLsVV Mssw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=LRq5I8p0ghSzQfdSy9q41RBfV3oq3XbBfgmj04uHRW8=; b=DdFMISE8ey+C+mySE72qI2QK2RF22Uq9+0CcznDD7JM0dszlu3d+ZzinA6ZBrC0x4Q trPs2Dg2OzPNC5G+9WySmq3mzqrHnMgdBeBw/gq/zfNvwj3HECK7sIUs4n9O8OJzn2GR IjzaiZD7KoKEEGg+uDnoyWoWJ4wbLzwj2q4dG1E6vM+8f7CRl3O9sCFBdQpX0DV+7X7h YhK1vqJtRbcycPf5pA6bXplvqpysOSHLFYK7tx9qfxyn+wNE7ht7WgC7WFvo1vHQm/KM OozPxDQ5v9qJiXJ41N3F/xUfdg9iD5OOqeM3qEcl6BSFfxNHs31dyl0enaUfItqKQgkd DKfg== ARC-Authentication-Results: i=1; mx.google.com; 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 e129-v6si47606424pfa.217.2018.06.04.07.35.58; Mon, 04 Jun 2018 07:36:12 -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; 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 S1753531AbeFDOdz (ORCPT + 99 others); Mon, 4 Jun 2018 10:33:55 -0400 Received: from gate.crashing.org ([63.228.1.57]:59991 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751473AbeFDOdy (ORCPT ); Mon, 4 Jun 2018 10:33:54 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w54DEacm029739; Mon, 4 Jun 2018 08:14:37 -0500 Message-ID: Subject: Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices From: Benjamin Herrenschmidt To: Christoph Hellwig , "Michael S. Tsirkin" Cc: 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 Date: Mon, 04 Jun 2018 23:14:36 +1000 In-Reply-To: <20180604125530.GA16378@infradead.org> References: <20180522063317.20956-1-khandual@linux.vnet.ibm.com> <20180523213703-mutt-send-email-mst@kernel.org> <20180604153558-mutt-send-email-mst@kernel.org> <20180604125530.GA16378@infradead.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1 (3.28.1-2.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2018-06-04 at 05:55 -0700, Christoph Hellwig wrote: > On Mon, Jun 04, 2018 at 03:43:09PM +0300, Michael S. Tsirkin wrote: > > Another is that given the basic functionality is in there, optimizations > > can possibly wait until per-device quirks in DMA API are supported. > > We have had per-device dma_ops for quite a while. I've asked Ansuman to start with a patch that converts virtio to use DMA ops always, along with an init quirk to hookup "direct" ops when the IOMMU flag isn't set. This will at least remove that horrid duplication of code path we have in there. Then we can just involve the arch in that init quirk so we can chose an alternate set of ops when running a secure VM. This is completely orthogonal to whether an iommu exist qemu side or not, and should be entirely solved on the Linux side. Cheers, Ben.