From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjvzP-0004k5-B5 for qemu-devel@nongnu.org; Tue, 13 Sep 2016 18:15:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjvzL-000705-4O for qemu-devel@nongnu.org; Tue, 13 Sep 2016 18:15:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjvzK-0006zq-Uo for qemu-devel@nongnu.org; Tue, 13 Sep 2016 18:15:35 -0400 Date: Tue, 13 Sep 2016 19:15:28 -0300 From: Eduardo Habkost Message-ID: <20160913221528.GZ24695@thinpad.lan.raisama.net> References: <147377800565.11859.4411044563640180545.stgit@brijesh-build-machine> <147377809806.11859.4375323376894641953.stgit@brijesh-build-machine> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <147377809806.11859.4375323376894641953.stgit@brijesh-build-machine> Subject: Re: [Qemu-devel] [RFC PATCH v1 09/22] sev: add SEV launch finish command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Brijesh Singh Cc: crosthwaite.peter@gmail.com, armbru@redhat.com, mst@redhat.com, p.fedin@samsung.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com, rth@twiddle.net On Tue, Sep 13, 2016 at 10:48:18AM -0400, Brijesh Singh wrote: > The SEV LAUNCH_FINISH command is used for finalizing the guest launch > process. The commad returned a measurement value that can be handed to > the guest owner to validate the guest before vmrun. > > For more information see [1], section 6.3 > > [1] http://support.amd.com/TechDocs/55766_SEV-KM%20API_Spec.pdf > > The following KVM RFC patches defines and implements this command > http://marc.info/?l=kvm&m=147190852423972&w=2 > http://marc.info/?l=kvm&m=147190856623987&w=2 > > Signed-off-by: Brijesh Singh [...] > +int kvm_sev_guest_measurement(uint8_t *out) I don't see any code calling this function yet. Do you have any plans on how exactly this will be handed back to the guest owner? A QMP command? > +{ > + SEVInfo *s = sev_info; > + struct kvm_sev_launch_finish *finish = s->launch_finish; > + > + if (!s) { > + return 1; > + } > + > + if (s->type == UNENCRYPTED_GUEST && > + s->state == SEV_LAUNCH_FINISH) { > + memcpy(out, finish->measurement, 32); > + } else { > + return 1; Probably it would be more appropriate to use Error** to report errors in most of the code in this series. > + } > + > + return 0; > +} > -- Eduardo