[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/23] target/i386/sev: Move qmp_query_sev_attestation_report(
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 11/23] target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c |
Date: |
Wed, 16 Jun 2021 22:43:16 +0200 |
Move qmp_query_sev_attestation_report() from monitor.c to sev.c
and make sev_get_attestation_report() static. We don't need the
stub anymore, remove it.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
target/i386/sev_i386.h | 2 --
target/i386/monitor.c | 6 ------
target/i386/sev-sysemu-stub.c | 6 +++---
target/i386/sev.c | 12 ++++++++++--
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h
index afa19a0a161..cb5702a2397 100644
--- a/target/i386/sev_i386.h
+++ b/target/i386/sev_i386.h
@@ -30,7 +30,5 @@ extern uint32_t sev_get_cbit_position(void);
extern uint32_t sev_get_reduced_phys_bits(void);
extern char *sev_get_launch_measurement(void);
extern SevCapability *sev_get_capabilities(Error **errp);
-extern SevAttestationReport *
-sev_get_attestation_report(const char *mnonce, Error **errp);
#endif
diff --git a/target/i386/monitor.c b/target/i386/monitor.c
index c83cca80dc2..eb4539bf88b 100644
--- a/target/i386/monitor.c
+++ b/target/i386/monitor.c
@@ -762,9 +762,3 @@ void qmp_sev_inject_launch_secret(const char *packet_hdr,
sev_inject_launch_secret(packet_hdr, secret, gpa, errp);
}
-
-SevAttestationReport *
-qmp_query_sev_attestation_report(const char *mnonce, Error **errp)
-{
- return sev_get_attestation_report(mnonce, errp);
-}
diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c
index d556b4f091f..1f7573ad528 100644
--- a/target/i386/sev-sysemu-stub.c
+++ b/target/i386/sev-sysemu-stub.c
@@ -13,6 +13,7 @@
#include "qemu/osdep.h"
#include "qapi/qapi-commands-misc-target.h"
+#include "qapi/qmp/qerror.h"
#include "qapi/error.h"
#include "sev_i386.h"
@@ -52,9 +53,8 @@ int sev_es_save_reset_vector(void *flash_ptr, uint64_t
flash_size)
g_assert_not_reached();
}
-SevAttestationReport *sev_get_attestation_report(const char *mnonce,
- Error **errp)
+SevAttestationReport *qmp_query_sev_attestation_report(const char *mnonce,
Error **errp)
{
- error_setg(errp, "SEV is not available in this QEMU");
+ error_setg(errp, QERR_UNSUPPORTED);
return NULL;
}
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 791804954e9..809054a84f2 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -31,6 +31,8 @@
#include "migration/blocker.h"
#include "qom/object.h"
#include "monitor/monitor.h"
+#include "qapi/qapi-commands-misc-target.h"
+#include "qapi/qmp/qerror.h"
#include "exec/confidential-guest-support.h"
#include "hw/i386/pc.h"
@@ -487,8 +489,8 @@ out:
return cap;
}
-SevAttestationReport *
-sev_get_attestation_report(const char *mnonce, Error **errp)
+static SevAttestationReport *sev_get_attestation_report(const char *mnonce,
+ Error **errp)
{
struct kvm_sev_attestation_report input = {};
SevAttestationReport *report = NULL;
@@ -549,6 +551,12 @@ sev_get_attestation_report(const char *mnonce, Error
**errp)
return report;
}
+SevAttestationReport *qmp_query_sev_attestation_report(const char *mnonce,
+ Error **errp)
+{
+ return sev_get_attestation_report(mnonce, errp);
+}
+
static int
sev_read_file_base64(const char *filename, guchar **data, gsize *len)
{
--
2.31.1
- [PATCH v2 02/23] qapi/misc-target: Wrap long 'SEV Attestation Report' long lines, (continued)
- [PATCH v2 02/23] qapi/misc-target: Wrap long 'SEV Attestation Report' long lines, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 01/23] MAINTAINERS: Add Connor Kuehl as reviewer for AMD SEV, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 03/23] qapi/misc-target: Group SEV QAPI definitions, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 05/23] target/i386/cpu: Add missing 'qapi/error.h' header, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 04/23] target/i386/monitor: Return QMP error when SEV is disabled in build, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 06/23] target/i386/sev_i386.h: Remove unused headers, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 07/23] target/i386/sev: Remove sev_get_me_mask(), Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 08/23] target/i386/sev: Mark unreachable code with g_assert_not_reached(), Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 09/23] target/i386/sev: sev_get_attestation_report use g_autofree, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 10/23] target/i386/sev: Restrict SEV to system emulation, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 11/23] target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c,
Philippe Mathieu-Daudé <=
- [PATCH v2 12/23] target/i386/sev: Move qmp_sev_inject_launch_secret() to sev.c, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 13/23] target/i386/sev: Move qmp_query_sev_capabilities() to sev.c, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 14/23] target/i386/sev: Move qmp_query_sev_launch_measure() to sev.c, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 15/23] target/i386/sev: Move qmp_query_sev() & hmp_info_sev() to sev.c, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 16/23] monitor: Restrict 'info sev' to x86 targets, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 17/23] hw/i386/acpi-common: Remove unused includes, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 18/23] hw/i386: Rename acpi-build.c -> acpi-pc.c, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 20/23] hw/acpi: Do not restrict ACPI core routines to x86 architecture, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 21/23] hw/i386: Introduce X86_FW_OVMF Kconfig symbol, Philippe Mathieu-Daudé, 2021/06/16