Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp685383imm; Wed, 13 Jun 2018 06:52:04 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIYiI8JHQplLmixAZX4pwI7eiJFy4Ivbx3k2vviRcnovN/RTMjfpG8LakVDKDnDaadWMHqD X-Received: by 2002:a63:7b4e:: with SMTP id k14-v6mr4207936pgn.261.1528897924753; Wed, 13 Jun 2018 06:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528897924; cv=none; d=google.com; s=arc-20160816; b=fGGfRTwQB8pnvl6CEHVj+HcQdfBXxc5ZwmjwVubtmfh8ihq5UQdFHugiijQSqbGJHu QE2I4fONAG536Rl4i80Em+jtQXX7jYiJF9p0TIrAnxUH5fG/C5OLtYkG3B+By++S97BB XqdnXQmvJbOvVKXwQbQTDrqZtY51Fk29R3oBzmaTwRceGmFHO9gZEaJu9vlYWHvfHKR0 yPyijPOzQiI1OBV4Yw5pyJadraSjTrLr24vq1GRGWH7BhJ/HgWcrt/OUwXWIuMawulKA lCEnIi5UZq7PAqKmvwwUXjTztSmIkABroremDGu/47lZ2uns0CdrscmNyCSeernRoTJQ LTPQ== 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=kFzd+ylY4QNCBRN5AGCuJ92OuHLk4agrkTCYr8IVRMM=; b=biW9Z4DBPHYB33dLkOuuwXhsYqX6YBLASDkug/h+3Ck9KdchV8ue+WiRTzrMoBDCfe rqCJUInLG/Nlw1GltY09mHK9tC0uWROkNuzRoYqYuIems2XaAj5VGuawe5EFo63doUrY 5VhrXAUOQQOoSZMf4SV355YucocQO//y8WKws3bRqP2tkljG3vxXZ90hbMnSoNB1ffxD SncExoYoSd7ZRdWKLLt/CqXuUsMn+xen3Kwcw0ZgyGEJVQaAAvuVD4UPv1m9JoCDQv67 Do5sriuwDl/tjo1XaaCw71WUxX08WJINkL6mUjBOrtwc9FiDpKPbV5zVUF9bXUuwPV9K HcXQ== 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 a5-v6si2324875pgq.669.2018.06.13.06.51.49; Wed, 13 Jun 2018 06:52:04 -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 S935736AbeFMNtn (ORCPT + 99 others); Wed, 13 Jun 2018 09:49:43 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33108 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935515AbeFMNtm (ORCPT ); Wed, 13 Jun 2018 09:49:42 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE24587A80; Wed, 13 Jun 2018 13:49:41 +0000 (UTC) Received: from redhat.com (ovpn-122-133.rdu2.redhat.com [10.10.122.133]) by smtp.corp.redhat.com (Postfix) with SMTP id 09AD510FD2A5; Wed, 13 Jun 2018 13:49:39 +0000 (UTC) Date: Wed, 13 Jun 2018 16:49:39 +0300 From: "Michael S. Tsirkin" To: Christoph Hellwig Cc: Anshuman Khandual , Ram Pai , robh@kernel.org, aik@ozlabs.ru, jasowang@redhat.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, joe@perches.com, linuxppc-dev@lists.ozlabs.org, elfring@users.sourceforge.net, david@gibson.dropbear.id.au, cohuck@redhat.com, pawel.moll@arm.com, Tom Lendacky , "Rustad, Mark D" Subject: Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices Message-ID: <20180613161806-mutt-send-email-mst@kernel.org> References: <20180522063317.20956-1-khandual@linux.vnet.ibm.com> <20180523213703-mutt-send-email-mst@kernel.org> <20180524072104.GD6139@ram.oc3035372033.ibm.com> <0c508eb2-08df-3f76-c260-90cf7137af80@linux.vnet.ibm.com> <20180531204320-mutt-send-email-mst@kernel.org> <20180607052306.GA1532@infradead.org> <20180607185234-mutt-send-email-mst@kernel.org> <20180608063655.GA32080@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180608063655.GA32080@infradead.org> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 13 Jun 2018 13:49:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 13 Jun 2018 13:49:42 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 Thu, Jun 07, 2018 at 11:36:55PM -0700, Christoph Hellwig wrote: > > This seems to be what was being asked for in this thread, > > with comments claiming IOMMU flag adds too much overhead. > > Right now it means implementing a virtual iommu, which I agree is > way too much overhead. Well not really. The flag in question will have a desired effect without a virtual iommu. > > SEV guys report that they just set the iommu flag and then it all works. > > I guess if there's translation we can think of this as a kind of iommu. > > Maybe we should rename PLATFORM_IOMMU to PLARTFORM_TRANSLATION? > > VIRTIO_F_BEHAVES_LIKE_A_REAL_PCI_DEVICE_DONT_TRY_TO_OUTSMART_ME > > as said it's not just translations, it is cache coherence as well. Well it's only for DMA. So maybe PLATFORM_DMA. I suspect people will then come and complain that they do *not* want cache coherence tricks because virtio is running on a CPU, but we'll see. > > And apparently some people complain that just setting that flag makes > > qemu check translation on each access with an unacceptable performance > > overhead. Forcing same behaviour for everyone on general principles > > even without the flag is unlikely to make them happy. > > That sounds like a qemu implementation bug. If qemu knowns that > guest physiscall == guest dma space there is no need to check. Possibly. Or it's possible it's all just theoretical, no one posted any numbers. -- MST