From 1b6a034f293a8928b48765a496ce95bed0cdddc4 Mon Sep 17 00:00:00 2001 From: Brijesh Singh Date: Thu, 8 Mar 2018 06:48:56 -0600 Subject: sev/i386: qmp: add query-sev-launch-measure command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The command can be used by libvirt to retrieve the measurement of SEV guest. This measurement is a signature of the memory contents that was encrypted through the LAUNCH_UPDATE_DATA. Cc: "Daniel P. Berrangé" Cc: "Dr. David Alan Gilbert" Cc: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Brijesh Singh Signed-off-by: Paolo Bonzini --- target/i386/monitor.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'target') diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 64b5e6e..f8a0e4b 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -697,3 +697,20 @@ void hmp_info_sev(Monitor *mon, const QDict *qdict) monitor_printf(mon, "SEV is not enabled\n"); } } + +SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) +{ + char *data; + SevLaunchMeasureInfo *info; + + data = sev_get_launch_measurement(); + if (!data) { + error_setg(errp, "Measurement is not available"); + return NULL; + } + + info = g_malloc0(sizeof(*info)); + info->data = data; + + return info; +} -- cgit v1.1