[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v1 13/22] hmp: update 'info kvm' to display SEV
From: |
Brijesh Singh |
Subject: |
[Qemu-devel] [RFC PATCH v1 13/22] hmp: update 'info kvm' to display SEV status |
Date: |
Tue, 13 Sep 2016 10:48:59 -0400 |
User-agent: |
StGit/0.17.1-dirty |
Update the 'info kvm' monitor command to display the SEV status.
(qemu) info kvm
kvm support: enabled
sev support: enabled (running)
Signed-off-by: Brijesh Singh <address@hidden>
---
hmp.c | 14 ++++++++++++++
qapi-schema.json | 4 +++-
qmp.c | 1 +
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/hmp.c b/hmp.c
index cc2056e..068b77d 100644
--- a/hmp.c
+++ b/hmp.c
@@ -18,6 +18,7 @@
#include "net/net.h"
#include "net/eth.h"
#include "sysemu/char.h"
+#include "sysemu/sev.h"
#include "sysemu/block-backend.h"
#include "qemu/option.h"
#include "qemu/timer.h"
@@ -76,11 +77,24 @@ void hmp_info_version(Monitor *mon, const QDict *qdict)
void hmp_info_kvm(Monitor *mon, const QDict *qdict)
{
KvmInfo *info;
+ SevState state;
+ char msg[80] = {0};
info = qmp_query_kvm(NULL);
monitor_printf(mon, "kvm support: ");
if (info->present) {
monitor_printf(mon, "%s\n", info->enabled ? "enabled" : "disabled");
+ monitor_printf(mon, "sev support: %s",
+ info->sev ? "enabled" : "disabled");
+ if (info->sev) {
+ if (kvm_sev_get_status(&state, msg)) {
+ monitor_printf(mon, " (error)\n");
+ } else {
+ monitor_printf(mon, " (%s)\n", msg);
+ }
+ } else {
+ monitor_printf(mon, "\n");
+ }
} else {
monitor_printf(mon, "not compiled\n");
}
diff --git a/qapi-schema.json b/qapi-schema.json
index 5658723..86b5dc9 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -99,9 +99,11 @@
#
# @present: true if KVM acceleration is built into this executable
#
+# @sev: true if SEV is active
+#
# Since: 0.14.0
##
-{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
+{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool', 'sev' :
'bool'} }
##
# @query-kvm:
diff --git a/qmp.c b/qmp.c
index b6d531e..834edb8 100644
--- a/qmp.c
+++ b/qmp.c
@@ -77,6 +77,7 @@ KvmInfo *qmp_query_kvm(Error **errp)
info->enabled = kvm_enabled();
info->present = kvm_available();
+ info->sev = kvm_sev_enabled();
return info;
}
- [Qemu-devel] [RFC PATCH v1 00/22] x86: Secure Encrypted Virtualization (AMD), Brijesh Singh, 2016/09/13
- Re: [Qemu-devel] [RFC PATCH v1 00/22] x86: Secure Encrypted Virtualization (AMD), Eduardo Habkost, 2016/09/13
- [Qemu-devel] [RFC PATCH v1 01/22] exec: add guest RAM read/write ops, Brijesh Singh, 2016/09/13
- [Qemu-devel] [RFC PATCH v1 03/22] monitor: use debug version of physical memory read api, Brijesh Singh, 2016/09/13
- [Qemu-devel] [RFC PATCH v1 11/22] sev: add SEV debug encrypt command, Brijesh Singh, 2016/09/13
- [Qemu-devel] [RFC PATCH v1 13/22] hmp: update 'info kvm' to display SEV status,
Brijesh Singh <=
- Re: [Qemu-devel] [RFC PATCH v1 13/22] hmp: update 'info kvm' to display SEV status, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [RFC PATCH v1 14/22] sev: provide SEV-enabled guest RAM read/write ops, Brijesh Singh, 2016/09/13
- [Qemu-devel] [RFC PATCH v1 02/22] cpu-common: add debug version of physical memory read/write, Brijesh Singh, 2016/09/13
- [Qemu-devel] [RFC PATCH v1 09/22] sev: add SEV launch finish command, Brijesh Singh, 2016/09/13
- [Qemu-devel] [RFC PATCH v1 10/22] sev: add SEV debug decrypt command, Brijesh Singh, 2016/09/13