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 DAE0EC433DB for ; Tue, 12 Jan 2021 03:51:44 +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 51F37229CA for ; Tue, 12 Jan 2021 03:51:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51F37229CA 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]:32862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzAid-0007Ec-1E for qemu-devel@archiver.kernel.org; Mon, 11 Jan 2021 22:51:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzAgr-0005pv-QE; Mon, 11 Jan 2021 22:49:54 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:36343) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzAgo-00061f-NI; Mon, 11 Jan 2021 22:49:53 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4DFGmS1c5Lz9sXV; Tue, 12 Jan 2021 14:49:44 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1610423384; bh=Pu1uUI8cNnCK2d3m6U8+RaJ5aZcbiR7kyAyYwXtPDOM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ku44Fn78DbjaIJuAGpIfkU4xhTwyz2zi06RWXMpVl2F9BEDULeIBwF+2ZsEtGx9CT TWK+jxKmW2qGK7TUCVF48Kz/uxH3cZM/rje1K4JfEN/PVHC50rjek0GjqF/Qo5oK9/ EGTXYBh6R6fqw2DbU5/GVMVRL5DkNt/3EOS9eZmI= Date: Tue, 12 Jan 2021 14:49:35 +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: <20210112034935.GL3051@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="/ZYM6PqDyfNytx60" Content-Disposition: inline In-Reply-To: <20201204141005.07bf61dd.cohuck@redhat.com> Received-SPF: pass client-ip=2401:3900:2:1::2; 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.249, 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" --/ZYM6PqDyfNytx60 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. Actually, I've realised this isn't even as general as it pretends to be now, so I've taken a different approach for the next spin. >=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 --/ZYM6PqDyfNytx60 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAl/9HE0ACgkQbDjKyiDZ s5Js5A//Yd7jTZccBJbYr8fl6LwL5XR1I53MZzJBdb0mQjdbnkUlRxWOwGoIzTOh hMTP7/m3oKzOePEV76IwEhBIouuYuPALTpP1cOnZdg4kDzKsln+36tP1VA2pMAm3 l2xL6WxqUjdMpXzH5oD3+0FdOLplr7bXGtMZW9vBhGDluLdR5uyfYLveJwswwwHo 72mdv3zcDQ6BSChR8MijtPuKpLWfkuKuyGAtSy2ovQNZfHqEIq9XmstPqFAvCsA/ aKXg2fA7qMm0507tAjdlKXBuSvnxy0O72Kyvl73L+Ipw+gyiZKSnKYpexPODFyLt oN3ZYYb8zphWnDlr/7DjTJDfMpyxxOFjLkE6WMa84eWSi1G8IXJ1CJcDd+0tHtlr 5J26cpGXl/L3Z82bIctc2qJp5CGWNhahRr2ThdEnQebh+3wzW9O6CyF0w3+cY5QX 19kqHodasjj+ige37V6LU0tfEn2jJ7bGyIHedJBnTryNlWK9+OIj5inUvvxpNNg+ KTIsLiphN+6Zr7v5/uCoDmmK6LPOn+8yOf9m2tHfmmRqtUbXkXqiFKSw0Al1vKbZ o2E6yoWGNFI7Y9YKzoKtoge3qdU2BHgt71nnXo3+1WM9i16vTCjr8zH2UaIqoeXL wGPq0aoODgI8G2ZQmiEbc0ieQZcIvYPqh8TaSb+gdf47wy2dQ50= =M33/ -----END PGP SIGNATURE----- --/ZYM6PqDyfNytx60--