Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1777124imm; Thu, 24 May 2018 00:19:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqOfTh3w2qXcyc8zsB5pdAiuTAPOka9eo61jP5eUmBk7lOyKfMByBuQIcYfHv5RCr4OPif1 X-Received: by 2002:a62:2197:: with SMTP id o23-v6mr6105344pfj.202.1527146377370; Thu, 24 May 2018 00:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527146377; cv=none; d=google.com; s=arc-20160816; b=ervirjgyiTdAm7Y3ma+VxIo/C/gAoXCvhDxQVOJXg/DGqIKammgQf9LZ0VCcxsRzWF 7nJ/Ob6FD5J/j1+hkJjCbjlUfRsgaNqhxngvfJqOpeJfEucBXi5QAp0vwsCgG9FZiPCb Z+c4XUdi4vuYWtVuJLovlkNoVIKGy2tq6m+Js/ntUocbuSxLryC024VbJnb1qShdP5e5 knTDLvu5TVHo5+fZxrl1p/qdEGiTVR01NwVAA6f3843j4WJ4OVCUB9AnJ7sVxbIuf7eE 7d3NxU5a0Cqmec6oXGruzHJT8552NH49oA0dQbN0le5bd7K4d3S/kCSO5wSF75cNQkqr GWLg== 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=OktxCX5oZ8azeDKvNlpBJKFTlgyAW1PfkZhuF2fg5H0=; b=qGyIqsHRNo+AXHp0YkcekrqMJ9d7bg9ZGNdNTch3Gi8uDQ8CMnRq027R/1eyY/nMaP tBIv6Xo6eFULX1AWozgtyX+V7/srJan5HHvGCsL0iQwdo488CQ1ddFbFy7Kiz0GAnGOM RmXV49EPDsEtHoJWsn6IaCqmHFb7l51RWb2rgDa4TiI9BTfqtz1sF1iouWSHREF6lQnB L60gpWNG/tIvfQlxCAJH9k0mpm4Gr8OWu4utDDeqrozntjPavGLOLsmrUdlXftJl4DQT KqNh/OQfxnwsCFgN6SrNl0V8V2y02evS8fqQlwxDdcn1NhjW72+YHzM+/xRftWTDnIRD knwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dgRzRhpA; 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 y5-v6si12483841pgs.181.2018.05.24.00.19.22; Thu, 24 May 2018 00:19:37 -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=dgRzRhpA; 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 S965037AbeEXHSF (ORCPT + 99 others); Thu, 24 May 2018 03:18:05 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51494 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964871AbeEXHSE (ORCPT ); Thu, 24 May 2018 03:18:04 -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=OktxCX5oZ8azeDKvNlpBJKFTlgyAW1PfkZhuF2fg5H0=; b=dgRzRhpAcV2x4tEgXvSE3+M7d UYchk0OOzhzapC0qBZPT79DSUyLXJXUy9KGcf6osUvSagjbsmIfJFRbZbiRfS8yvnID0pc5mBAQzB CEBdmI98i6AIm5CObndvajAOKPYq781wyGrGc+plvqpG7YG5GS17cnAS2sOb6gu5pz3wpRFFrtdFY Mpepdxu4VluyGWEsQZ7N1HfzDrog5UU28Qp7/JsB9pFbMALzI3L51ZyG6S2BkKq7uWG624q4E/7xX GFU5ucIjK5Dun9wuUWMhEwXNsv6pGbD0y8Zz9g2Slcg+kVtH9HHO7Tq2LAIU8kCPRrNnZt4WFOWoV Yyt7o+i8Q==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLkVc-0002jG-1G; Thu, 24 May 2018 07:18:00 +0000 Date: Thu, 24 May 2018 00:17:59 -0700 From: Christoph Hellwig To: Benjamin Herrenschmidt Cc: "Michael S. Tsirkin" , 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, hch@infradead.org Subject: Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices Message-ID: <20180524071759.GA624@infradead.org> References: <20180522063317.20956-1-khandual@linux.vnet.ibm.com> <20180523213703-mutt-send-email-mst@kernel.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 Thu, May 24, 2018 at 08:27:04AM +1000, Benjamin Herrenschmidt wrote: > - First qemu doesn't know that the guest will switch to "secure mode" > in advance. There is no difference between a normal and a secure > partition until the partition does the magic UV call to "enter secure > mode" and qemu doesn't see any of it. So who can set the flag here ? > > - Second, when using VIRTIO_F_IOMMU_PLATFORM, we also make qemu (or > vhost) go through the emulated MMIO for every access to the guest, > which adds additional overhead. Also this whole scheme is simply the wrong way around. No driver should opt out of the DMA API in general. For legacy reasons we might have to opt out of the dma API for some virtio cases due to qemu bugs, but this should never have been the default, but a quirk for the affected versions. We need to fix this now and make the dma ops bypass the quirk instead of the default, which will also solve the power issue.