From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD5B5C433E9 for ; Fri, 8 Jan 2021 05:21:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D33E23383 for ; Fri, 8 Jan 2021 05:21:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D33E23383 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxkDK-00021k-8y for qemu-devel@archiver.kernel.org; Fri, 08 Jan 2021 00:21:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxkBc-0000bC-QF; Fri, 08 Jan 2021 00:19:44 -0500 Received: from ozlabs.org ([203.11.71.1]:49421) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxkBZ-00030z-BJ; Fri, 08 Jan 2021 00:19:44 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4DBrxq326Mz9sWm; Fri, 8 Jan 2021 16:19:27 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1610083167; bh=yM+GSG4Blu08wIh9l4eOZ3YDwhjhMK9nufRyv7Kfvgs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=liZ9gk5HASA02GcL6ulAiQ+LEY5MFhBoA8niYeQtoi54jGblXFYwZzWKg4Skl2s8F o6c6L/XuNLP8SMkRf2Ip4QkzgMcPZDbEoYeqleougcuJCzumNxxa6yCyw55hmpSnh3 pGa6DWFfDz8kgZ+JQ/9b+Qzov7IEDwCf3T+LxtNo= Date: Fri, 8 Jan 2021 15:03:03 +1100 From: David Gibson To: Cornelia Huck Subject: Re: [for-6.0 v5 03/13] securable guest memory: Handle memory encryption via interface Message-ID: <20210108040303.GH3209@yekko.fritz.box> References: <20201204054415.579042-1-david@gibson.dropbear.id.au> <20201204054415.579042-4-david@gibson.dropbear.id.au> <20201204141005.07bf61dd.cohuck@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aF3LVLvitz/VQU3c" Content-Disposition: inline In-Reply-To: <20201204141005.07bf61dd.cohuck@redhat.com> Received-SPF: pass client-ip=203.11.71.1; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.248, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pair@us.ibm.com, brijesh.singh@amd.com, frankja@linux.ibm.com, kvm@vger.kernel.org, "Michael S. Tsirkin" , Richard Henderson , Marcelo Tosatti , david@redhat.com, qemu-devel@nongnu.org, dgilbert@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, berrange@redhat.com, thuth@redhat.com, pbonzini@redhat.com, rth@twiddle.net, mdroth@linux.vnet.ibm.com, Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --aF3LVLvitz/VQU3c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 04, 2020 at 02:10:05PM +0100, Cornelia Huck wrote: > On Fri, 4 Dec 2020 16:44:05 +1100 > David Gibson wrote: >=20 > > At the moment AMD SEV sets a special function pointer, plus an opaque > > handle in KVMState to let things know how to encrypt guest memory. > >=20 > > Now that we have a QOM interface for handling things related to securab= le > > guest memory, use a QOM method on that interface, rather than a bare > > function pointer for this. > >=20 > > Signed-off-by: David Gibson > > Reviewed-by: Richard Henderson > > --- > > accel/kvm/kvm-all.c | 36 +++++--- > > accel/kvm/sev-stub.c | 9 +- > > include/exec/securable-guest-memory.h | 2 + > > include/sysemu/sev.h | 5 +- > > target/i386/monitor.c | 1 - > > target/i386/sev.c | 116 ++++++++++---------------- > > 6 files changed, 77 insertions(+), 92 deletions(-) > >=20 >=20 > > @@ -224,7 +224,7 @@ int kvm_get_max_memslots(void) > > =20 > > bool kvm_memcrypt_enabled(void) > > { > > - if (kvm_state && kvm_state->memcrypt_handle) { > > + if (kvm_state && kvm_state->sgm) { >=20 > If we want to generalize the concept, maybe check for encrypt_data in > sgm here? There's probably room for different callbacks in the sgm > structure. I don't think it's worth changing here. This gets changed again in patch 6, I'll adjust to clarify a bit what's going on there. >=20 > > return true; > > } > > =20 >=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 --aF3LVLvitz/VQU3c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAl/32XQACgkQbDjKyiDZ s5I3Hw//eRYOBsJ2TurIh7rwuauV/QflkcKoHjCC3SbHxSNrIRsiXD/KxU15OTyR TVyCCZIQnyD2mORKhwpNPtSTdPbeds/sTsxGC2mUwAkcudy7s1f5GpQccf9jL7j5 jJjsBAo9Tkn0VJKoQZMPYSEY4ru33Zbqk5zArqR8PvrUsXhw60K3/xXi2mVZ5cUN m82v5dSxl9pIgF5fDm7a2VHeE5YiB5/ZCpdbGFpuX59LvV5y/UmFdx9vbam5e8Ie ekoIjFsv5yJ2eECeZ7jzmBmdJ/KoNWZ5rzX0ID39o8buS5ZZO2KxC9F4Rt/iIt0I RX0YNmD32wX/s3CJzB/KytTTE38jjzdEnU7arlGHEDz5CibGBpDoA/BP2tFIoTll o7ina6lu0s+T4UrNEKS+DagFY5qJGNA+1p7JcuNBGj2ns7QIY8zNXh04K0toyrb5 LFUHd9DT+AciTDaQ5e/I7/ONaFLBh2EAc4AbcUo6r1iXyPQ+df446qaIljA2ljGn oQX0CjYDxWRo+Wn2wBc1yLiL7GD4vu19m5JdTPpom8LdjCDGDtCuGi6Vr56c1NRS DMYbbnOBxtnR49B9umPfqR8VS+lKFeilixsohid8+Yohe940BkyIcgFCVyth+RG0 044z8YFmtRnuZL5HaPXD+YzAG93+OeFSA0MAyxakNE8hrl/EQt4= =e/zG -----END PGP SIGNATURE----- --aF3LVLvitz/VQU3c--