Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3364198imm; Mon, 4 Jun 2018 02:14:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKItsjZPCfyJwQ1wxWyQdgDzak+ucPNX6j0dXt+B+1lP6Y/TsTEKqT9RRyECAVzccVol7w3B X-Received: by 2002:a62:9d82:: with SMTP id a2-v6mr20641267pfk.223.1528103693436; Mon, 04 Jun 2018 02:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528103693; cv=none; d=google.com; s=arc-20160816; b=PBUs9plp/8bMrQdc16X8Hp8HhnM9o2rkleaT+0JfRoW5eOboDVwVEvmlBrD7QTnSqF E2jAm8jBtBFsxmeGN3uAVkCEEgGao8pGcjU4DsriDS9h6Eb5Rrf/gyNSJuiRRRqMrEdH YMKqc6Q6JNAgwajISXoF2XYFQzncrFHrS0Po9pERAC7iNBOTksugCQkO4MESmXJfIlzv MKEI0MIYzqk1LxiDaeEYrw/s70NCr+svA0khIBBcfCViLc2k9Di6fbVUo55DGOi6kja/ oI5DGrrTeQ4VRfUpEXVlhn1mO0TbYDlTDvp7dmarsJ+CDwQRYQBFphHbeYzJ+HefMB9B cHSw== 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=jV0NETIShAJ3Va13N0VgRyKdAPoZ6z72CoOLOR4SBI4=; b=yf69yQpqRMAjd00fy6B9yYLhn00asuHdHZmOqMyni94LjU01tcMv4nPqwK2LSGBgSU n+Z1kyLwmFWO7Y+ynw//Br705lHwmnNiW1ecxJvzuzAecHWr+vEmQl5qRFOpGfc1Or3v Wul18ZHghmZdmiUEjFsRougB+KpSIYv3vntZOVRv0gT6z7bdr3/CtESZU8PjEbtUzWsF gIQifQqn0JaH6BTR0NQy3Ga27y73VxSONq+/rJS28lIWk1CVP09MY04T+vzA7caJirJN 3Rpa/9fj8oIBTi+Exp5SMAsdtFxx4FJ1FW42+ftndEGxuEFKAOJ1ac1Aevz5FI7Eltyl 5mfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b=faayIiWY; 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 d6-v6si44418036plo.542.2018.06.04.02.14.38; Mon, 04 Jun 2018 02:14:53 -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=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b=faayIiWY; 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 S1752087AbeFDJNL (ORCPT + 99 others); Mon, 4 Jun 2018 05:13:11 -0400 Received: from ozlabs.org ([203.11.71.1]:42339 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750866AbeFDJNJ (ORCPT ); Mon, 4 Jun 2018 05:13:09 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 40zq3S1l0vz9s0W; Mon, 4 Jun 2018 19:13:08 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528103588; bh=hrjszWyA6pl2v8rTU5kmWBuPL2SjBZZ6SlcQCYt0HEs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=faayIiWY6VC08NlbWPDlampvDk0PdDHRgTPc+5635VkjwrGqRqSfKa3NuFE0oFWMd pA5fob6ZdYKgpmKpGFN9/sI7zoZYkAYja91yRu42/RhoWU2MEJOPiOiHU/kE06HBsO N10QWR8Jzh2uaNB1W3MsVnhz5FqukEg8qZ04684U= Date: Mon, 4 Jun 2018 18:57:42 +1000 From: David Gibson 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, 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: <20180604085742.GQ4251@umbus> References: <20180522063317.20956-1-khandual@linux.vnet.ibm.com> <20180523213703-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QVgWX4+QEldMe/r9" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --QVgWX4+QEldMe/r9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 24, 2018 at 08:27:04AM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2018-05-23 at 21:50 +0300, Michael S. Tsirkin wrote: >=20 > > I re-read that discussion and I'm still unclear on the > > original question, since I got several apparently > > conflicting answers. > >=20 > > I asked: > >=20 > > Why isn't setting VIRTIO_F_IOMMU_PLATFORM on the > > hypervisor side sufficient? >=20 > I thought I had replied to this... >=20 > There are a couple of reasons: >=20 > - 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. 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. > - 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. >=20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --QVgWX4+QEldMe/r9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAlsU/wQACgkQbDjKyiDZ s5KTZBAA2JRvAwRshKqCoS6sEhIMO2dPsjGf3qAlcnFwyw24Lt3UoLHqz5UQNTNk ki41d+YG7H1hYA2S1DdBvieX87/e/jCI+tXrAl2kM1BFfctUhYBFwvc/WYUPniOD TIlnSL07++YeIpkTvluzT2J2/nTLcrxwRKaD5D0QQlL1MyjNENZlkKqHdH/sG9vk nTXiTmxBKOzU+1mJQo8LjMJcEhXCZxoAMw2yTZtOQkMfsxk4VOnr7clR4qe3v/4c USnb8wCxHhXxQw0NjHM5FiwD5dt1yNGQsAhwFccHOYKvViatHcu93d563g6RID0B hXzE5iKBvwz+XoFEredm4Sz+twRxGN6CA2jqRRZ8jSSSKfBenu5sB7o0MHJEAwY4 qeUcH5GO/71x8CnHCB98nE7LBDLHdueyHE8qtqhzkMQ6Bg5nF9ipPviMnfr7f1TZ Kfuv4p9lRY70dq+dJkeBLpTsO03h55zonZq3LhDKPB+HKX7tmFAyAnEPqCZYTxSW ujWGp6ThNs5RcKQJSLLr1zBVksW/UekrkCWbAOuj8xV1XFFOciPVFKEFmggo09G+ 36DINiPFQMfjIVkYtX8SGuHwEsdR+ae4QDlZAtgdgpeXjTKvRMYVID1Ee+5nXL5j wxAjS2/owJThiSvPpmMQq0dcbTfliEX/J/L5vBnRqg3dnRXJW/c= =z0UZ -----END PGP SIGNATURE----- --QVgWX4+QEldMe/r9--