[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v9 26/29] qmp: add query-sev-launch-measure command
From: |
Brijesh Singh |
Subject: |
[Qemu-devel] [PATCH v9 26/29] qmp: add query-sev-launch-measure command |
Date: |
Thu, 15 Feb 2018 09:39:52 -0600 |
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é" <address@hidden>
Cc: "Dr. David Alan Gilbert" <address@hidden>
Cc: Markus Armbruster <address@hidden>
Signed-off-by: Brijesh Singh <address@hidden>
---
qapi-schema.json | 29 +++++++++++++++++++++++++++++
qmp.c | 17 +++++++++++++++++
2 files changed, 46 insertions(+)
diff --git a/qapi-schema.json b/qapi-schema.json
index 46f7a3c9ea83..1ae45a908369 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -3246,3 +3246,32 @@
#
##
{ 'command': 'query-sev', 'returns': 'SevInfo' }
+
+##
+# @SevLaunchMeasureInfo:
+#
+# SEV Guest Launch measurement information
+#
+# @data: the measurement value encoded in base64
+#
+# Since: 2.12
+#
+##
+{ 'struct': 'SevLaunchMeasureInfo', 'data': {'data': 'str'} }
+
+##
+# @query-sev-launch-measure:
+#
+# Query the SEV guest launch information.
+#
+# Returns: The @SevLaunchMeasureInfo for the guest
+#
+# Since: 2.12
+#
+# Example:
+#
+# -> { "execute": "query-sev-launch-measure" }
+# <- { "return": { "data": "4l8LXeNlSPUDlXPJG5966/8%YZ" } }
+#
+##
+{ 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo' }
diff --git a/qmp.c b/qmp.c
index 6860ae9ad6ea..7253720a2092 100644
--- a/qmp.c
+++ b/qmp.c
@@ -735,3 +735,20 @@ SevInfo *qmp_query_sev(Error **errp)
return info;
}
+
+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;
+}
--
2.14.3
- [Qemu-devel] [PATCH v9 13/29] kvm: introduce memory encryption APIs, (continued)
- [Qemu-devel] [PATCH v9 13/29] kvm: introduce memory encryption APIs, Brijesh Singh, 2018/02/15
- [Qemu-devel] [PATCH v9 16/29] sev/i386: add command to encrypt guest memory region, Brijesh Singh, 2018/02/15
- [Qemu-devel] [PATCH v9 18/29] sev/i386: add support to LAUNCH_MEASURE command, Brijesh Singh, 2018/02/15
- [Qemu-devel] [PATCH v9 20/29] hw/i386: set ram_debug_ops when memory encryption is enabled, Brijesh Singh, 2018/02/15
- [Qemu-devel] [PATCH v9 17/29] target/i386: encrypt bios rom, Brijesh Singh, 2018/02/15
- [Qemu-devel] [PATCH v9 19/29] sev/i386: finalize the SEV guest launch flow, Brijesh Singh, 2018/02/15
- [Qemu-devel] [PATCH v9 21/29] sev/i386: add debug encrypt and decrypt commands, Brijesh Singh, 2018/02/15
- [Qemu-devel] [PATCH v9 22/29] target/i386: clear C-bit when walking SEV guest page table, Brijesh Singh, 2018/02/15
- [Qemu-devel] [PATCH v9 25/29] sev/i386: add support to KVM_SEV_GUEST_STATUS, Brijesh Singh, 2018/02/15
- [Qemu-devel] [PATCH v9 23/29] include: add psp-sev.h header file, Brijesh Singh, 2018/02/15
- [Qemu-devel] [PATCH v9 26/29] qmp: add query-sev-launch-measure command,
Brijesh Singh <=
- [Qemu-devel] [PATCH v9 27/29] tests/qmp-test: blacklist query-sev-launch-measure command, Brijesh Singh, 2018/02/15
- [Qemu-devel] [PATCH v9 28/29] sev/i386: add migration blocker, Brijesh Singh, 2018/02/15
- [Qemu-devel] [PATCH v9 29/29] cpu/i386: populate CPUID 0x8000_001F when SEV is active, Brijesh Singh, 2018/02/15