Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1400285ybv; Thu, 20 Feb 2020 19:37:22 -0800 (PST) X-Google-Smtp-Source: APXvYqynh4Pb6ZE4KFlayic967BZjJLx/I4ijzoGgAueL3dJzV6CCBAaPpaye9ixAw7Spd45isaY X-Received: by 2002:a9d:58cb:: with SMTP id s11mr27164551oth.55.1582256242405; Thu, 20 Feb 2020 19:37:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582256242; cv=none; d=google.com; s=arc-20160816; b=KzfZz01uhZdhZoNZQ6E7NI8x8nOV0ujh8lUs0yCns7JcokIrpRpdBkUl8GOulbBy9p PnTdRFTN5HnQwP7UY2o0YVkAxZP3fIQJpGJjPVhoJ+aKgqZ8uE4SnmRL0+1ugsOppKDN 619vnIv1ysUF0w+3kqZ1ALgJ9agF2ukJb0h69yoGDfDVqsxzlUFneuK0JFJ3XiUC+IO6 JSSHcWoJrXOeiyu4yf/l88f3AZTUM1qBnvV5ghBHDGJ7cmuCLis75PJgL69kxOzurLHh 531g3v1EZC8mPjNh5esZXbFDwRmavuOfek+hCfa9yWcRWjexS3fjtvcvYr6mk4jImzEO 5fvA== 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 :dkim-signature; bh=5s3Sea7PsU0B872k30DQgbWD5HnoUb6/zAJybGKrgNQ=; b=XEsS8Vn+EultGoXetFvKLww0lxUa7EDzWvMSd0YGQyoDXrRYioRuyKV5LBOG1SFBp+ QTdourK0L5n78y+IaSlkJ5puJCqujT6vio7UN0bB9A+axjGiEWzQzEKDblSCPIU46ST2 fxfzFA9ESYOjAXZrqhfS1nNJVDqaZZaBxudfL5kgMqtDXQ7f34ZhBXRdZsCDxBSlsYPe idYJoBXF7fCJFmYyFOa97tVWFpMSgy2fZ6Z81pYWn/P6HwX+v6PmTu7ZGndr8et32eFV 6kndC5msGqzPmVLOCJ23dckk0LX83Ok8YVjt2mGZ/FsUyn+Lgg7hIVrD5YRIC16AOByQ BV2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b=e3zdRwhj; 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 d83si179758oib.166.2020.02.20.19.37.08; Thu, 20 Feb 2020 19:37:22 -0800 (PST) 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=e3zdRwhj; 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 S1729670AbgBUDhA (ORCPT + 99 others); Thu, 20 Feb 2020 22:37:00 -0500 Received: from bilbo.ozlabs.org ([203.11.71.1]:59179 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729632AbgBUDhA (ORCPT ); Thu, 20 Feb 2020 22:37:00 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 48Nxw96pvRz9sS3; Fri, 21 Feb 2020 14:36:57 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1582256217; bh=023zimJNppk3UBUgHQ61G7caK9h50x5C45Mcz1ME6eA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=e3zdRwhjeJUcGi8UjR/bkaGU7iqvokZ0xSIereTY15GrOforn7fnCxaUAuHbxiZM4 emwuWpBssUMeLJe/wGXWIiu66flWbyJ4cJ4MGXqogR27W3pz7uFchHhFUzLrqu3Y2+ PplWrOzzPS2DH7Rn+fVEvIcvBGYlpQZH/yJb1Ohw= Date: Fri, 21 Feb 2020 14:29:07 +1100 From: David Gibson To: Ram Pai Cc: "Michael S. Tsirkin" , Halil Pasic , Jason Wang , Marek Szyprowski , Robin Murphy , Christoph Hellwig , linux-s390@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Christian Borntraeger , Janosch Frank , Viktor Mihajlovski , Cornelia Huck , Thiago Jung Bauermann , "Lendacky, Thomas" , Michael Mueller Subject: Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected Message-ID: <20200221032907.GD2298@umbus.fritz.box> References: <20200220160606.53156-1-pasic@linux.ibm.com> <20200220160606.53156-3-pasic@linux.ibm.com> <20200220154904-mutt-send-email-mst@kernel.org> <20200221011748.GE5713@oc0525413822.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RhUH2Ysw6aD5utA4" Content-Disposition: inline In-Reply-To: <20200221011748.GE5713@oc0525413822.ibm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --RhUH2Ysw6aD5utA4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 20, 2020 at 05:17:48PM -0800, Ram Pai wrote: > On Thu, Feb 20, 2020 at 03:55:14PM -0500, Michael S. Tsirkin wrote: > > On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: > > > Currently the advanced guest memory protection technologies (AMD SEV, > > > powerpc secure guest technology and s390 Protected VMs) abuse the > > > VIRTIO_F_IOMMU_PLATFORM flag to make virtio core use the DMA API, whi= ch > > > is in turn necessary, to make IO work with guest memory protection. > > >=20 > > > But VIRTIO_F_IOMMU_PLATFORM a.k.a. VIRTIO_F_ACCESS_PLATFORM is really= a > > > different beast: with virtio devices whose implementation runs on an = SMP > > > CPU we are still fine with doing all the usual optimizations, it is j= ust > > > that we need to make sure that the memory protection mechanism does n= ot > > > get in the way. The VIRTIO_F_ACCESS_PLATFORM mandates more work on the > > > side of the guest (and possibly he host side as well) than we actually > > > need. > > >=20 > > > An additional benefit of teaching the guest to make the right decision > > > (and use DMA API) on it's own is: removing the need, to mandate speci= al > > > VM configuration for guests that may run with protection. This is > > > especially interesting for s390 as VIRTIO_F_IOMMU_PLATFORM pushes all > > > the virtio control structures into the first 2G of guest memory: > > > something we don't necessarily want to do per-default. > > >=20 > > > Signed-off-by: Halil Pasic > > > Tested-by: Ram Pai > > > Tested-by: Michael Mueller > >=20 > > This might work for you but it's fragile, since without > > VIRTIO_F_ACCESS_PLATFORM hypervisor assumes it gets > > GPA's, not DMA addresses. > >=20 > >=20 > >=20 > > IOW this looks like another iteration of: > >=20 > > virtio: Support encrypted memory on powerpc secure guests > >=20 > > which I was under the impression was abandoned as unnecessary. >=20 > It has been abondoned on powerpc. We enabled VIRTIO_F_ACCESS_PLATFORM; > by default, flag on powerpc. Uh... we haven't yet, though we're working on it. > We would like to enable secure guests on powerpc without this flag > aswell enabled, but past experience has educated us that its not a easy > path. However if Halil makes some inroads in this path for s390, we > will like to support him. >=20 >=20 > RP >=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 --RhUH2Ysw6aD5utA4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAl5PToIACgkQbDjKyiDZ s5L9mw//e6UlWdIjS0sVfS3LR0dfVU8WuWvcWGPlHsAvqf8ahlSYAPlyL8YHIHwe kntSk9WXkEn3jRCsD+nHK+dAu10C1hiGl18RH+S0yisKRnH+WabU1oesIh5cDwaV r+bZsU3HPaTwHS83yVNRYjoic3ZjV97karqDYGMHSnWWbVqCDZDnREwxG3VE1jm7 7sdJak8rTIZ1AUezQwSKgfIy4lkCGVoaUC9ZKIvdWVIHywQvtXDn2ikbGENaY3E3 MaU7NicXVogmy+beOzkOWNst0Xfm6N+oGHw2O/8zRpsmk95YAg84UGYEg4GfTEKE UGjNeeMDAL5lMYRbqdbzBve+wGmgnyThjGwt3PeivwATqEiL3j8AmOelUmQ9SY2y qPOTzprDVU+Vu0A+6NHBPuzvhFZr5dVpD4n5kF+TeH6lp+m4GC9YCIN6hT6NE+DG /yc/2QUJk14otNc/h7Nk+RqVm1+ZORWoDqiISB/M3U2t3kaai0hczJ6q2tDjl1pJ cDx9sX8mVAhyOT3LSxvfOrRDsUwyzuUjrqJCh9gnXv073cc8E6VnFb7g+Cj+NUYP tbh3wOC7KKoovvfI4x2YrPNpkDSAOE91h5gaM1sFtmsB0leF77mrbDAwncZHC5C8 2EWMVf3S2sJLq9s1CulJ8Zc27iCG9F/71Bd88Nitf2HIvFqDSZs= =5mIy -----END PGP SIGNATURE----- --RhUH2Ysw6aD5utA4--