Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3563468imm; Mon, 4 Jun 2018 05:51:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKHJQf9B2uJ8Jf7r7GGFbx6TMCoMkiqfKsRrUtIw1RFDpKYlIHyGOMK0AxlrbLc1eryXcuV X-Received: by 2002:a17:902:b81:: with SMTP id 1-v6mr10942225plr.321.1528116687161; Mon, 04 Jun 2018 05:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528116687; cv=none; d=google.com; s=arc-20160816; b=PTc1FWUKX4H0S+f6VhnTlW3f4uFOaLLfrOpDifbns01zGXoT0z/jcMstmLGtU/XpMl dpaGD7Q8MD2thR/3iQp71BWQ7POln+bYUZAOLSw3pC1jAwb8AMonrVQ13v3Diqj5kc+A XTkBHyjWC+Sul9qh23s0hxaCSqfSODo7aIWZpqgOXgvOmuNpjjQ73hWs8ebeqTeMARtI ftkSgh3UMaWl10HRwpoKj3p8SJS+SfZR5v8nRtJ3BJTr9vbIrcp9BAV0q11ONHPWdr1a T7bpTRiIYpqKS4ftk3EToZTetZReWo1vgz48teHlJYSGL9Ew52GlloK6kZ2/7mECqDV1 YJXA== 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=mXqk2VeZ/Yaii6iFuScg/S4yfI50Zc2TnVEQi2AxAk4=; b=qELkaDjCt1WoiZAjHObt0qjHHurwySfe9yU3m8Tp7Si+0EfcKtX8qfg59axtXvaw3t M2tDliqNNxzrvq20Q2GY+GoqoZPmX9GP83SBciwogwHJwT1x7CdqGaa5T0WMTxDkTG9K bSf9wwhnpg3HKpXbW3sxT75QDZ6a6fzs9WiuYAcQo3LsOjd2/uZ1dI4EnTbnal8TI7VW Yon0A/4vPoZhinSqDvC5o2as31YbU/A9uNw4fPtFySVmph7pu2tzqiWZmLnnoRewfj3O CPzjob32xq/hyG/ER99rZQaKH3xMxM5OdGW2dN5T02AL0CvPlp072SCQ5gPFQWHRU/Fv 7keQ== 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 29-v6si189866pfs.40.2018.06.04.05.51.12; Mon, 04 Jun 2018 05:51:27 -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 S1752722AbeFDMus (ORCPT + 99 others); Mon, 4 Jun 2018 08:50:48 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52252 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752611AbeFDMur (ORCPT ); Mon, 4 Jun 2018 08:50:47 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 33C914187E43; Mon, 4 Jun 2018 12:50:47 +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 71BD820357CA; Mon, 4 Jun 2018 12:50:46 +0000 (UTC) Date: Mon, 4 Jun 2018 15:50:46 +0300 From: "Michael S. Tsirkin" To: Benjamin Herrenschmidt Cc: David Gibson , 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, 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: <20180604154355-mutt-send-email-mst@kernel.org> References: <20180522063317.20956-1-khandual@linux.vnet.ibm.com> <20180523213703-mutt-send-email-mst@kernel.org> <20180604085742.GQ4251@umbus> 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.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 04 Jun 2018 12:50:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 04 Jun 2018 12:50:47 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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 07:48:54PM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2018-06-04 at 18:57 +1000, David Gibson 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 ? > > > > This seems weird to me. As a rule HV calls should go through qemu - > > or be allowed to go directly to KVM *by* qemu. > > It's not an HV call, it's a UV call, qemu won't see it, qemu isn't > trusted. Now the UV *will* reflect that to the HV via some synthetized > HV calls, and we *could* have those do a pass by qemu, however, so far, > our entire design doesn't rely on *any* qemu knowledge whatsoever and > it would be sad to add it just for that purpose. It's a temporary work-around. I think that the long-term fix is to support per-device quirks and have the DMA API DTRT for virtio. > Additionally, this is rather orthogonal, see my other email, the > problem we are trying to solve is *not* a qemu problem and it doesn't > make sense to leak that into qemu. > > > We generally reserve > > the latter for hot path things. Since this isn't a hot path, having > > the call handled directly by the kernel seems wrong. > > > > Unless a "UV call" is something different I don't know about. > > Yes, a UV call goes to the Ultravisor, not the Hypervisor. The > Hypervisor isn't trusted. > > > > - 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. > > > Ben.