[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/22] sev/i386: qmp: add query-sev-capabilities comm
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 21/22] sev/i386: qmp: add query-sev-capabilities command |
Date: |
Tue, 13 Mar 2018 13:56:37 +0100 |
From: Brijesh Singh <address@hidden>
The command can be used by libvirt to query the SEV capabilities.
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>
Signed-off-by: Paolo Bonzini <address@hidden>
---
monitor.c | 7 +++++++
qapi/misc.json | 42 ++++++++++++++++++++++++++++++++++++++++++
target/i386/monitor.c | 6 ++++++
tests/qmp-test.c | 1 +
4 files changed, 56 insertions(+)
diff --git a/monitor.c b/monitor.c
index 36ed087..3117a3e 100644
--- a/monitor.c
+++ b/monitor.c
@@ -985,6 +985,7 @@ static void qmp_unregister_commands_hack(void)
qmp_unregister_command(&qmp_commands, "rtc-reset-reinjection");
qmp_unregister_command(&qmp_commands, "query-sev");
qmp_unregister_command(&qmp_commands, "query-sev-launch-measure");
+ qmp_unregister_command(&qmp_commands, "query-sev-capabilities");
#endif
#ifndef TARGET_S390X
qmp_unregister_command(&qmp_commands, "dump-skeys");
@@ -4117,6 +4118,12 @@ SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error
**errp)
error_setg(errp, QERR_FEATURE_DISABLED, "query-sev-launch-measure");
return NULL;
}
+
+SevCapability *qmp_query_sev_capabilities(Error **errp)
+{
+ error_setg(errp, QERR_FEATURE_DISABLED, "query-sev-capabilities");
+ return NULL;
+}
#endif
#ifndef TARGET_S390X
diff --git a/qapi/misc.json b/qapi/misc.json
index b8318f5..6150b9a 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -3322,3 +3322,45 @@
#
##
{ 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo' }
+
+##
+# @SevCapability:
+#
+# The struct describes capability for a Secure Encrypted Virtualization
+# feature.
+#
+# @pdh: Platform Diffie-Hellman key (base64 encoded)
+#
+# @cert-chain: PDH certificate chain (base64 encoded)
+#
+# @cbitpos: C-bit location in page table entry
+#
+# @reduced-phys-bits: Number of physical Address bit reduction when SEV is
+# enabled
+#
+# Since: 2.12
+##
+{ 'struct': 'SevCapability',
+ 'data': { 'pdh': 'str',
+ 'cert-chain': 'str',
+ 'cbitpos': 'int',
+ 'reduced-phys-bits': 'int'} }
+
+##
+# @query-sev-capabilities:
+#
+# This command is used to get the SEV capabilities, and is supported on AMD
+# X86 platforms only.
+#
+# Returns: SevCapability objects.
+#
+# Since: 2.12
+#
+# Example:
+#
+# -> { "execute": "query-sev-capabilities" }
+# <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE",
+# "cbitpos": 47, "reduced-phys-bits": 5}}
+#
+##
+{ 'command': 'query-sev-capabilities', 'returns': 'SevCapability' }
diff --git a/target/i386/monitor.c b/target/i386/monitor.c
index f8a0e4b..8a786fb 100644
--- a/target/i386/monitor.c
+++ b/target/i386/monitor.c
@@ -714,3 +714,9 @@ SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error
**errp)
return info;
}
+
+SevCapability *qmp_query_sev_capabilities(Error **errp)
+{
+ error_setg(errp, "SEV feature is not available");
+ return NULL;
+}
diff --git a/tests/qmp-test.c b/tests/qmp-test.c
index ec8c7c7..7470c6b 100644
--- a/tests/qmp-test.c
+++ b/tests/qmp-test.c
@@ -208,6 +208,7 @@ static bool query_is_blacklisted(const char *cmd)
"query-sev-launch-measure",
/* Success depends on Host or Hypervisor SEV support */
"query-sev",
+ "query-sev-capabilities",
NULL
};
int i;
--
1.8.3.1
- [Qemu-devel] [PULL 08/22] sev/i386: qmp: add query-sev command, (continued)
- [Qemu-devel] [PULL 08/22] sev/i386: qmp: add query-sev command, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 12/22] sev/i386: add command to create launch memory encryption context, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 10/22] sev/i386: add command to initialize the memory encryption context, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 14/22] target/i386: encrypt bios rom, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 15/22] sev/i386: add support to LAUNCH_MEASURE command, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 16/22] sev/i386: finalize the SEV guest launch flow, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 18/22] cpu/i386: populate CPUID 0x8000_001F when SEV is active, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 19/22] sev/i386: hmp: add 'info sev' command, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 17/22] sev/i386: add migration blocker, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 20/22] sev/i386: qmp: add query-sev-launch-measure command, Paolo Bonzini, 2018/03/13
- [Qemu-devel] [PULL 21/22] sev/i386: qmp: add query-sev-capabilities command,
Paolo Bonzini <=
- [Qemu-devel] [PULL 22/22] sev/i386: add sev_get_capabilities(), Paolo Bonzini, 2018/03/13
- Re: [Qemu-devel] [PULL 00/22] KVM patches for QEMU 2.12 soft freeze, Alex Williamson, 2018/03/13