Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3810482imm; Mon, 4 Jun 2018 09:35:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKId2ZWr7yWJjloCdQScLNzWesz+JrGe3StS0Ewo3ZSt+k5FqPOMIPaWKg84ntqZInSHI4uk X-Received: by 2002:aa7:8345:: with SMTP id z5-v6mr14280317pfm.251.1528130142634; Mon, 04 Jun 2018 09:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528130142; cv=none; d=google.com; s=arc-20160816; b=g6PkeuH57lnXusWQKGrCUm4iltZFST3pL7fcvz4J2O4U3DbZRpAsi/b5xCus6y3nIg GiZSsj4xMDfOnBMziPqa9RAh4JH0TjtY0sDVbs2z+FNTKeozWedn/hkU7ddBNi9MRT+9 PCzGmC9hscClwkGTYcKRF/FGwpXuVCYKkO5PA+YOT1olO+0QIGfq1nX0vbGo4UlpKwo4 TK7DGPOPdcK1qEBU4EduKvuGz9aQmN7HIVYEQfKDcQbBaZZ+UfSwNTKFVvs0zoci0uS+ KmveBpD7oe6nATk0msKMNEojmRkL4uav659qQmQD6UPDTnNLso9iDHMH6M++rDQBm/Yz 4/wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=7OcmVpTKKDaWFRPbhGdjD9m/svROftj2h13oZZq1xAg=; b=O8wm6NHDQfWNOn/djhbMK3GNpLh/6VUKS7cU9F/+3j9Rirgsdj43KxGkPOvzzDtR8D tkZUczPuH6+b0CYfmI/jeRASx3loGtUSQRcUpUsMb0BbWgratmIp87Hjtx6SaykWz2UE 4EzKk+QJ57DuNsyco0Fhrjj53IfkLY9CX44tnrBYHDp8rDGCXKqvG9bkceZFXqqSSV1+ 6YbiuV+vXzf5gTQsJWfMNyz1ABs1JuYgdwy4Zsn7Is4VTCywK/+FyYNjIUEWh08R+BBB b/GbSyH+L4s4WSM5OUprG2+Vj1D1yhJXDzT5tVydBILfDd+2ACD/LvBxLbwuNCltCIAE KThw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f29-v6si2610215pgn.21.2018.06.04.09.35.27; Mon, 04 Jun 2018 09:35:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751533AbeFDQeX (ORCPT + 99 others); Mon, 4 Jun 2018 12:34:23 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59556 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751233AbeFDQeV (ORCPT ); Mon, 4 Jun 2018 12:34:21 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8046B401EF0F; Mon, 4 Jun 2018 16:34:20 +0000 (UTC) Received: from redhat.com (ovpn-120-211.rdu2.redhat.com [10.10.120.211]) by smtp.corp.redhat.com (Postfix) with SMTP id B91962023452; Mon, 4 Jun 2018 16:34:19 +0000 (UTC) Date: Mon, 4 Jun 2018 19:34:19 +0300 From: "Michael S. Tsirkin" To: Benjamin Herrenschmidt Cc: Christoph Hellwig , 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 Subject: Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices Message-ID: <20180604193310-mutt-send-email-mst@kernel.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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 04 Jun 2018 16:34:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 04 Jun 2018 16:34:20 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 04, 2018 at 11:14:36PM +1000, Benjamin Herrenschmidt wrote: > 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. Sounds good to me. -- MST