[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v11 14/28] hmp: add 'info sev' command
From: |
Brijesh Singh |
Subject: |
[Qemu-devel] [PATCH v11 14/28] hmp: add 'info sev' command |
Date: |
Wed, 7 Mar 2018 10:50:24 -0600 |
The command can be used to show the SEV information when memory
encryption is enabled on AMD platform.
Cc: Eric Blake <address@hidden>
Cc: "Daniel P. Berrangé" <address@hidden>
Cc: "Dr. David Alan Gilbert" <address@hidden>
Cc: Markus Armbruster <address@hidden>
Reviewed-by: "Dr. David Alan Gilbert" <address@hidden>
Signed-off-by: Brijesh Singh <address@hidden>
---
hmp-commands-info.hx | 16 ++++++++++++++++
hmp.h | 1 +
target/i386/monitor.c | 20 ++++++++++++++++++++
3 files changed, 37 insertions(+)
diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index ad590a4ffb2b..ddfcd5adcca6 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -867,6 +867,22 @@ Display the amount of initially allocated and present
hotpluggable (if
enabled) memory in bytes.
ETEXI
+#if defined(TARGET_I386)
+ {
+ .name = "sev",
+ .args_type = "",
+ .params = "",
+ .help = "show SEV information",
+ .cmd = hmp_info_sev,
+ },
+#endif
+
+STEXI
address@hidden info sev
address@hidden info sev
+Show SEV information.
+ETEXI
+
STEXI
@end table
ETEXI
diff --git a/hmp.h b/hmp.h
index b89733876de1..4e2ec375b0f4 100644
--- a/hmp.h
+++ b/hmp.h
@@ -143,5 +143,6 @@ void hmp_info_ramblock(Monitor *mon, const QDict *qdict);
void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict);
void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict);
void hmp_info_memory_size_summary(Monitor *mon, const QDict *qdict);
+void hmp_info_sev(Monitor *mon, const QDict *qdict);
#endif
diff --git a/target/i386/monitor.c b/target/i386/monitor.c
index 29de61996371..4d9019626031 100644
--- a/target/i386/monitor.c
+++ b/target/i386/monitor.c
@@ -29,6 +29,7 @@
#include "qapi/qmp/qdict.h"
#include "hw/i386/pc.h"
#include "sysemu/kvm.h"
+#include "sysemu/sev.h"
#include "hmp.h"
#include "sev_i386.h"
#include "qapi/qapi-commands-misc.h"
@@ -680,3 +681,22 @@ SevInfo *qmp_query_sev(Error **errp)
return info;
}
+
+void hmp_info_sev(Monitor *mon, const QDict *qdict)
+{
+ SevInfo *info = sev_get_info();
+
+ if (info && info->enabled) {
+ monitor_printf(mon, "handle: %d\n", info->handle);
+ monitor_printf(mon, "state: %s\n", SevState_str(info->state));
+ monitor_printf(mon, "build: %d\n", info->build_id);
+ monitor_printf(mon, "api version: %d.%d\n",
+ info->api_major, info->api_minor);
+ monitor_printf(mon, "debug: %s\n",
+ info->policy & SEV_POLICY_NODBG ? "off" : "on");
+ monitor_printf(mon, "key-sharing: %s\n",
+ info->policy & SEV_POLICY_NOKS ? "off" : "on");
+ } else {
+ monitor_printf(mon, "SEV is not enabled\n");
+ }
+}
--
2.14.3
- [Qemu-devel] [PATCH v11 08/28] target/i386: add Secure Encrypted Virtulization (SEV) object, (continued)
- [Qemu-devel] [PATCH v11 08/28] target/i386: add Secure Encrypted Virtulization (SEV) object, Brijesh Singh, 2018/03/07
- [Qemu-devel] [PATCH v11 12/28] sev/i386: register the guest memory range which may contain encrypted data, Brijesh Singh, 2018/03/07
- [Qemu-devel] [PATCH v11 10/28] include: add psp-sev.h header file, Brijesh Singh, 2018/03/07
- [Qemu-devel] [PATCH v11 15/28] sev/i386: add command to create launch memory encryption context, Brijesh Singh, 2018/03/07
- [Qemu-devel] [PATCH v11 20/28] hw/i386: set ram_debug_ops when memory encryption is enabled, Brijesh Singh, 2018/03/07
- [Qemu-devel] [PATCH v11 19/28] sev/i386: finalize the SEV guest launch flow, Brijesh Singh, 2018/03/07
- [Qemu-devel] [PATCH v11 16/28] sev/i386: add command to encrypt guest memory region, Brijesh Singh, 2018/03/07
- [Qemu-devel] [PATCH v11 18/28] sev/i386: add support to LAUNCH_MEASURE command, Brijesh Singh, 2018/03/07
- [Qemu-devel] [PATCH v11 23/28] qmp: add query-sev-launch-measure command, Brijesh Singh, 2018/03/07
- [Qemu-devel] [PATCH v11 11/28] sev/i386: add command to initialize the memory encryption context, Brijesh Singh, 2018/03/07
- [Qemu-devel] [PATCH v11 14/28] hmp: add 'info sev' command,
Brijesh Singh <=
- [Qemu-devel] [PATCH v11 13/28] kvm: introduce memory encryption APIs, Brijesh Singh, 2018/03/07
- [Qemu-devel] [PATCH v11 17/28] target/i386: encrypt bios rom, Brijesh Singh, 2018/03/07
- [Qemu-devel] [PATCH v11 21/28] sev/i386: add debug encrypt and decrypt commands, Brijesh Singh, 2018/03/07
[Qemu-devel] [PATCH v11 25/28] cpu/i386: populate CPUID 0x8000_001F when SEV is active, Brijesh Singh, 2018/03/07
[Qemu-devel] [PATCH v11 22/28] target/i386: clear C-bit when walking SEV guest page table, Brijesh Singh, 2018/03/07