Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:GA
qemu.15022
0063-sev-i386-qmp-add-query-sev-capabili.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0063-sev-i386-qmp-add-query-sev-capabili.patch of Package qemu.15022
From c05123a94e11be5076b377b7ba66f7c37a28902f Mon Sep 17 00:00:00 2001 From: Brijesh Singh <brijesh.singh@amd.com> Date: Thu, 8 Mar 2018 06:48:59 -0600 Subject: [PATCH] sev/i386: qmp: add query-sev-capabilities command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The command can be used by libvirt to query the SEV capabilities. Cc: "Daniel P. Berrangé" <berrange@redhat.com> Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit 31dd67f684c862303cf3bb18dba10567bc35e0ab) [BR: FATE#322124] Signed-off-by: Bruce Rogers <brogers@suse.com> --- monitor.c | 7 +++++++ qapi-schema.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 f9af7e96a7..4047fbff16 100644 --- a/monitor.c +++ b/monitor.c @@ -983,6 +983,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"); @@ -4170,6 +4171,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-schema.json b/qapi-schema.json index b259027b7d..11ae34687a 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3306,3 +3306,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 9549c04ca9..7e04f96147 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -712,3 +712,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 70a324be49..b874a22d3b 100644 --- a/tests/qmp-test.c +++ b/tests/qmp-test.c @@ -204,6 +204,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;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor