2021-10-07 19:17:06 +03:00
|
|
|
/*
|
|
|
|
* QEMU SEV system stub
|
|
|
|
*
|
|
|
|
* Copyright Advanced Micro Devices 2018
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Brijesh Singh <brijesh.singh@amd.com>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "qemu/osdep.h"
|
2021-10-07 19:17:14 +03:00
|
|
|
#include "monitor/monitor.h"
|
2021-10-07 19:17:15 +03:00
|
|
|
#include "monitor/hmp-target.h"
|
2021-10-07 19:17:06 +03:00
|
|
|
#include "qapi/qapi-commands-misc-target.h"
|
2021-10-07 19:17:10 +03:00
|
|
|
#include "qapi/qmp/qerror.h"
|
2021-10-07 19:17:06 +03:00
|
|
|
#include "qapi/error.h"
|
2021-10-07 19:17:07 +03:00
|
|
|
#include "sev.h"
|
2021-10-07 19:17:06 +03:00
|
|
|
|
2021-10-07 19:17:14 +03:00
|
|
|
SevInfo *qmp_query_sev(Error **errp)
|
2021-10-07 19:17:06 +03:00
|
|
|
{
|
2021-10-07 19:17:14 +03:00
|
|
|
error_setg(errp, "SEV is not available in this QEMU");
|
2021-10-07 19:17:06 +03:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2021-10-07 19:17:13 +03:00
|
|
|
SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp)
|
2021-10-07 19:17:06 +03:00
|
|
|
{
|
2021-10-07 19:17:13 +03:00
|
|
|
error_setg(errp, "SEV is not available in this QEMU");
|
2021-10-07 19:17:06 +03:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2021-10-07 19:17:12 +03:00
|
|
|
SevCapability *qmp_query_sev_capabilities(Error **errp)
|
2021-10-07 19:17:06 +03:00
|
|
|
{
|
|
|
|
error_setg(errp, "SEV is not available in this QEMU");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
target/i386/sev: Move qmp_sev_inject_launch_secret() to sev.c
Move qmp_sev_inject_launch_secret() from monitor.c to sev.c
and make sev_inject_launch_secret() static. We don't need the
stub anymore, remove it.
Previously with binaries built without SEV, management layer
was getting an empty response:
{ "execute": "sev-inject-launch-secret",
"arguments": { "packet-header": "mypkt", "secret": "mypass", "gpa": 4294959104 }
}
{
"return": {
}
}
Now the response is explicit, mentioning the feature is disabled:
{ "execute": "sev-inject-launch-secret",
"arguments": { "packet-header": "mypkt", "secret": "mypass", "gpa": 4294959104 }
}
{
"error": {
"class": "GenericError",
"desc": "this feature or command is not currently supported"
}
}
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211007161716.453984-19-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-10-07 19:17:11 +03:00
|
|
|
void qmp_sev_inject_launch_secret(const char *packet_header, const char *secret,
|
|
|
|
bool has_gpa, uint64_t gpa, Error **errp)
|
2021-10-07 19:17:06 +03:00
|
|
|
{
|
target/i386/sev: Move qmp_sev_inject_launch_secret() to sev.c
Move qmp_sev_inject_launch_secret() from monitor.c to sev.c
and make sev_inject_launch_secret() static. We don't need the
stub anymore, remove it.
Previously with binaries built without SEV, management layer
was getting an empty response:
{ "execute": "sev-inject-launch-secret",
"arguments": { "packet-header": "mypkt", "secret": "mypass", "gpa": 4294959104 }
}
{
"return": {
}
}
Now the response is explicit, mentioning the feature is disabled:
{ "execute": "sev-inject-launch-secret",
"arguments": { "packet-header": "mypkt", "secret": "mypass", "gpa": 4294959104 }
}
{
"error": {
"class": "GenericError",
"desc": "this feature or command is not currently supported"
}
}
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211007161716.453984-19-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-10-07 19:17:11 +03:00
|
|
|
error_setg(errp, "SEV is not available in this QEMU");
|
2021-10-07 19:17:06 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp)
|
|
|
|
{
|
|
|
|
g_assert_not_reached();
|
|
|
|
}
|
|
|
|
|
|
|
|
void sev_es_set_reset_vector(CPUState *cpu)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size)
|
|
|
|
{
|
|
|
|
g_assert_not_reached();
|
|
|
|
}
|
|
|
|
|
2021-10-07 19:17:10 +03:00
|
|
|
SevAttestationReport *qmp_query_sev_attestation_report(const char *mnonce,
|
|
|
|
Error **errp)
|
2021-10-07 19:17:06 +03:00
|
|
|
{
|
|
|
|
error_setg(errp, "SEV is not available in this QEMU");
|
|
|
|
return NULL;
|
|
|
|
}
|
2021-10-07 19:17:14 +03:00
|
|
|
|
|
|
|
void hmp_info_sev(Monitor *mon, const QDict *qdict)
|
|
|
|
{
|
|
|
|
monitor_printf(mon, "SEV is not available in this QEMU\n");
|
|
|
|
}
|