Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1393173ybv; Thu, 20 Feb 2020 19:28:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwJOHrtBbwUPGF7XyFbUQrp3EjPquFGCXRz5KceF3kEQDlY4wG66eTN6fdJm/ufy/q7np+9 X-Received: by 2002:a54:4085:: with SMTP id i5mr307671oii.17.1582255692350; Thu, 20 Feb 2020 19:28:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582255692; cv=none; d=google.com; s=arc-20160816; b=q627Jd6CB6kKJyIdCogwkB6nrwbKzrmeZfOyKl0xDktzna3seokBYGnDyIpS971BQx h19wxUFkC9EPjbDfA4AxViyKnQYq0LgdpNmgDZ6uSaBI6algyZh9Mlm4y82XldOIVS9T AcDxgKXd4KIp2JQMxsAakkgH7d9PcWfpVXTD9Gmd62vkvjPRclK83rP17idyenecv2GH dWzhFXM0QcEPHuhydFAyAD+ppNTb2nFzgySIcyIXmuZRiRRgASXaee4/u+2w63L7xNyS Zc8XM3n3P2Giu6XB/M2EpqnxVl7rmeIr79qIFqXHXnOAQIbjC/0HFYt8VVUZJGdzy/Ly JcKg== 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=ZSJt/8+yBIyBajFC/EEkNFPkTMDWC3biiAlpv133tKk=; b=tusb+bOMbWm8jdVCVgfaxTsBhN8io46E5S6/FFzfRvF8xjKbDlwDZgSY8ibbZntl3d XhjdJcqk0k4XCBh9jKmqmWycB1YCHVK+Him0eSzHlU6PtBbMh3weZW7ahGjYSufjVPgi 3tyT7a6QXRuablsjL4oNIe8bzmXQE8f88x6EyPfzbrt2vy1aiF2WeQE2MAwFsZMwHyg5 KJyL4dr4zrLUNqNjKT67SjfqpA17dsUgsQq7K98WqLU4hj2MdgkGXBpSKYH6KrNC2LpW GZPO3SReZ4EgJ2F5owcEEm1eupvwbJ+ZI3ZC1jiT4E0vP8HK06IKIsJ7UrNZzGucEbT+ GpRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b=AzVjCTlM; 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 k13si379409otp.224.2020.02.20.19.28.00; Thu, 20 Feb 2020 19:28:12 -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=AzVjCTlM; 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 S1727944AbgBUD1w (ORCPT + 99 others); Thu, 20 Feb 2020 22:27:52 -0500 Received: from ozlabs.org ([203.11.71.1]:38589 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729229AbgBUD1v (ORCPT ); Thu, 20 Feb 2020 22:27:51 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 48Nxjc3QBLz9sRk; Fri, 21 Feb 2020 14:27:48 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1582255668; bh=y3lVtMpiI83RZRQFRmOykg/5zxHYT5D2zzjV2uwjV3s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AzVjCTlMyorNgEHOIaIpCqwmc5f/HP95xbBaFBc3b6BE149F7e/ZfSyTrQYJcAhWg UsHiPoIQtmjVabo+7H9zIstBLyAgo3Pda472sqcCTQUopX4set3xYqJ7sSrBgq2kM6 TnKBFOgI5IOo+NmbVrJgt4SEJKsed3roEsQY9FCo= Date: Fri, 21 Feb 2020 14:27:27 +1100 From: David Gibson To: Christoph Hellwig Cc: Christian Borntraeger , Halil Pasic , "Michael S. Tsirkin" , Jason Wang , Marek Szyprowski , Robin Murphy , linux-s390@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Janosch Frank , Viktor Mihajlovski , Cornelia Huck , Ram Pai , Thiago Jung Bauermann , "Lendacky, Thomas" , Michael Mueller Subject: Re: [PATCH 1/2] mm: move force_dma_unencrypted() to mem_encrypt.h Message-ID: <20200221032727.GC2298@umbus.fritz.box> References: <20200220160606.53156-1-pasic@linux.ibm.com> <20200220160606.53156-2-pasic@linux.ibm.com> <20200220161146.GA12709@lst.de> <4369f099-e4e4-4a58-b38b-642cf53ccca6@de.ibm.com> <20200220163135.GA13192@lst.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xesSdrSSBC0PokLI" Content-Disposition: inline In-Reply-To: <20200220163135.GA13192@lst.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --xesSdrSSBC0PokLI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 20, 2020 at 05:31:35PM +0100, Christoph Hellwig wrote: > On Thu, Feb 20, 2020 at 05:23:20PM +0100, Christian Borntraeger wrote: > > >From a users perspective it makes absolutely perfect sense to use the > > bounce buffers when they are NEEDED.=20 > > Forcing the user to specify iommu_platform just because you need bounce= buffers > > really feels wrong. And obviously we have a severe performance issue > > because of the indirections. >=20 > The point is that the user should not have to specify iommu_platform. > We need to make sure any new hypervisor (especially one that might require > bounce buffering) always sets it, So, I have draft qemu patches which enable iommu_platform by default. But that's really because of other problems with !iommu_platform, not anything to do with bounce buffering or secure VMs. The thing is that the hypervisor *doesn't* require bounce buffering. In the POWER (and maybe s390 as well) models for Secure VMs, it's the *guest*'s choice to enter secure mode, so the hypervisor has no reason to know whether the guest needs bounce buffering. As far as the hypervisor and qemu are concerned that's a guest internal detail, it just expects to get addresses it can access whether those are GPAs (iommu_platform=3Doff) or IOVAs (iommu_platform=3Don). > as was a rather bogus legacy hack It was certainly a bad idea, but it was a bad idea that went into a public spec and has been widely deployed for many years. We can't just pretend it didn't happen and move on. Turning iommu_platform=3Don by default breaks old guests, some of which we still care about. We can't (automatically) do it only for guests that need bounce buffering, because the hypervisor doesn't know that ahead of time. > that isn't extensibe for cases that for example require bounce buffering. In fact bounce buffering isn't really the issue from the hypervisor (or spec's) point of view. It's the fact that not all of guest memory is accessible to the hypervisor. Bounce buffering is just one way the guest might deal with that. --=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 --xesSdrSSBC0PokLI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAl5PTh0ACgkQbDjKyiDZ s5KxuA/8Dp0u3ClHJcvgYS9sPsWYf3cIiL0ssD718l7m06uHYCC8BZhGbCeMhbfK jDV3bIOPMI6f+L4KTSrPkH71KAYKLKbt52Si354kI/7xkDmCu3B8SmL/u+ptC0Y/ UYD0ZFkgyOLQaOS/jN5zMae3337n6qPRZuOP12epFWZ9QpP4v55Dba2ICuJXkbU1 5QaQIcCLwSBcEYxZOuLqc7s7tWfOt/NeNmvgMnCGJie035XlK0c8q2v7XqRnH8ec 5tej0mQvwOyKgZkYhr35Q/4t2V0LxPDvD+8W636WdH0O9h6wjeMeKlVoq8IpgMyz NkYNX7yaPfnkh3fvqWa7NMmmi32Rt9/85Kk/3I4YD1KCMSzv7AGJ1TBnUMumisYJ F2rB+Q07oGi/r/UNg2VSUE2S4rGgq1k9hD2Xb0yE+3+l1TvowJ+2ly30W1TSo5Hu LZZ/XX0uzsCnrlw4aqzyh4+u4++QcgnlwvDgdfadNXVd3gQdPEoxAP+vV6FhTinx 29Dus3s83/aCpkNeU63NfDWXSIOPTUspWC8Ny1qGE1Vt0Dfie5K+6j7iZdYX0HZT duIb419GYkR2DBTS0vS6jFh9QFN+jThVs4qc4uRqR6ibwocNlXSdxt+jT7QNkaqO 8HtGwkfqQZCCm4Z0uNnoFv4NY9kLB21wa/z0xOVmDJZtVD8Jgto= =NO4r -----END PGP SIGNATURE----- --xesSdrSSBC0PokLI--