|
@@ -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 "qapi/error.h"
|
|
|
#include "sev_i386.h"
|
|
@@ -677,3 +678,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");
|
|
|
+ }
|
|
|
+}
|