From: Paolo Bonzini <pbonzini@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>, qemu-devel@nongnu.org
Cc: Brijesh Singh <brijesh.singh@amd.com>,
kvm@vger.kernel.org, Sergio Lopez <slp@redhat.com>,
James Bottomley <jejb@linux.ibm.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Dov Murik <dovmurik@linux.ibm.com>,
"Daniel P . Berrange" <berrange@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PATCH v3 14/22] target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c
Date: Mon, 4 Oct 2021 10:23:26 +0200 [thread overview]
Message-ID: <86b19b44-a8e2-af97-2b96-8cc21ed1be34@redhat.com> (raw)
In-Reply-To: <20211002125317.3418648-15-philmd@redhat.com>
On 02/10/21 14:53, Philippe Mathieu-Daudé wrote:
> 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>
This was done on purpose, but I have no objection to changing it this
way. We might in fact remove the indirection for SGX as well, and/or
even move the implementation of the monitor commands from target/i386 to
hw/i386 (the monitor is sysemu-specific).
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Thanks,
Paolo
> target/i386/sev_i386.h | 2 --
> target/i386/monitor.c | 6 ------
> target/i386/sev-sysemu-stub.c | 7 ++++---
> target/i386/sev.c | 12 ++++++++++--
> 4 files changed, 14 insertions(+), 13 deletions(-)
>
> diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h
> index 2d9a1a0112e..5f367f78eb7 100644
> --- a/target/i386/sev_i386.h
> +++ b/target/i386/sev_i386.h
> @@ -27,8 +27,6 @@
> extern SevInfo *sev_get_info(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);
>
> int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp);
> int sev_inject_launch_secret(const char *hdr, const char *secret,
> diff --git a/target/i386/monitor.c b/target/i386/monitor.c
> index a9f85acd473..c05d70252a2 100644
> --- a/target/i386/monitor.c
> +++ b/target/i386/monitor.c
> @@ -764,12 +764,6 @@ 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);
> -}
> -
> SGXInfo *qmp_query_sgx(Error **errp)
> {
> return sgx_get_info(errp);
> diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c
> index d556b4f091f..813b9a6a03b 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,9 @@ 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 aefbef4bb63..91a217bbb85 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)
> {
>
next prev parent reply other threads:[~2021-10-04 8:39 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-02 12:52 [PATCH v3 00/22] target/i386/sev: Housekeeping SEV + measured Linux SEV guest Philippe Mathieu-Daudé
2021-10-02 12:52 ` [PATCH v3 01/22] qapi/misc-target: Wrap long 'SEV Attestation Report' long lines Philippe Mathieu-Daudé
2021-10-04 8:05 ` Paolo Bonzini
2021-10-02 12:52 ` [PATCH v3 02/22] qapi/misc-target: Group SEV QAPI definitions Philippe Mathieu-Daudé
2021-10-04 8:05 ` Paolo Bonzini
2021-10-02 12:52 ` [PATCH v3 03/22] target/i386/kvm: Introduce i386_softmmu_kvm Meson source set Philippe Mathieu-Daudé
2021-10-04 8:06 ` Paolo Bonzini
2021-10-02 12:52 ` [PATCH v3 04/22] target/i386/kvm: Restrict SEV stubs to x86 architecture Philippe Mathieu-Daudé
2021-10-04 8:06 ` Paolo Bonzini
2021-10-02 12:53 ` [PATCH v3 05/22] target/i386/monitor: Return QMP error when SEV is disabled in build Philippe Mathieu-Daudé
2021-10-04 8:11 ` Paolo Bonzini
2021-10-07 11:29 ` Philippe Mathieu-Daudé
2021-10-07 12:25 ` Dr. David Alan Gilbert
2021-10-02 12:53 ` [PATCH v3 06/22] target/i386/cpu: Add missing 'qapi/error.h' header Philippe Mathieu-Daudé
2021-10-04 8:11 ` Paolo Bonzini
2021-10-02 12:53 ` [PATCH v3 07/22] target/i386/sev_i386.h: Remove unused headers Philippe Mathieu-Daudé
2021-10-04 8:11 ` Paolo Bonzini
2021-10-02 12:53 ` [PATCH v3 08/22] target/i386/sev: Remove sev_get_me_mask() Philippe Mathieu-Daudé
2021-10-04 8:11 ` Paolo Bonzini
2021-10-04 8:11 ` Paolo Bonzini
2021-10-02 12:53 ` [PATCH v3 09/22] target/i386/sev: Mark unreachable code with g_assert_not_reached() Philippe Mathieu-Daudé
2021-10-04 8:12 ` Paolo Bonzini
2021-10-02 12:53 ` [PATCH v3 10/22] target/i386/sev: sev_get_attestation_report use g_autofree Philippe Mathieu-Daudé
2021-10-04 8:13 ` Paolo Bonzini
2021-10-02 12:53 ` [PATCH v3 11/22] target/i386/sev: Restrict SEV to system emulation Philippe Mathieu-Daudé
2021-10-04 8:14 ` Paolo Bonzini
2021-10-02 12:53 ` [PATCH v3 12/22] target/i386/sev: Declare system-specific functions in 'sev_i386.h' Philippe Mathieu-Daudé
2021-10-04 8:15 ` Paolo Bonzini
2021-10-02 12:53 ` [PATCH v3 13/22] target/i386/sev: Remove stubs by using code elision Philippe Mathieu-Daudé
2021-10-04 8:19 ` Paolo Bonzini
2021-10-06 18:55 ` Philippe Mathieu-Daudé
2021-10-08 15:46 ` Brijesh Singh
2021-10-02 12:53 ` [PATCH v3 14/22] target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c Philippe Mathieu-Daudé
2021-10-04 8:23 ` Paolo Bonzini [this message]
2021-10-06 20:45 ` Philippe Mathieu-Daudé
2021-10-04 9:57 ` Dr. David Alan Gilbert
2021-10-07 9:48 ` Philippe Mathieu-Daudé
2021-10-02 12:53 ` [PATCH v3 15/22] target/i386/sev: Move qmp_sev_inject_launch_secret() " Philippe Mathieu-Daudé
2021-10-04 8:24 ` Paolo Bonzini
2021-10-02 12:53 ` [PATCH v3 16/22] target/i386/sev: Move qmp_query_sev_capabilities() " Philippe Mathieu-Daudé
2021-10-04 8:24 ` Paolo Bonzini
2021-10-02 12:53 ` [PATCH v3 17/22] target/i386/sev: Move qmp_query_sev_launch_measure() " Philippe Mathieu-Daudé
2021-10-04 8:24 ` Paolo Bonzini
2021-10-02 12:53 ` [PATCH v3 18/22] target/i386/sev: Move qmp_query_sev() & hmp_info_sev() " Philippe Mathieu-Daudé
2021-10-04 8:24 ` Paolo Bonzini
2021-10-02 12:53 ` [PATCH v3 19/22] monitor: Restrict 'info sev' to x86 targets Philippe Mathieu-Daudé
2021-10-04 8:26 ` Paolo Bonzini
2021-10-07 15:18 ` Philippe Mathieu-Daudé
2021-10-02 12:53 ` [PATCH v3 20/22] sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux boot Philippe Mathieu-Daudé
2021-10-02 12:53 ` [PATCH v3 21/22] x86/sev: generate SEV kernel loader hashes in x86_load_linux Philippe Mathieu-Daudé
2021-10-02 12:53 ` [PATCH v3 22/22] MAINTAINERS: Cover AMD SEV files Philippe Mathieu-Daudé
2021-10-04 8:27 ` Paolo Bonzini
2021-10-06 20:35 ` Philippe Mathieu-Daudé
2021-10-04 8:27 ` [PATCH v3 00/22] target/i386/sev: Housekeeping SEV + measured Linux SEV guest Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86b19b44-a8e2-af97-2b96-8cc21ed1be34@redhat.com \
--to=pbonzini@redhat.com \
--cc=berrange@redhat.com \
--cc=brijesh.singh@amd.com \
--cc=dgilbert@redhat.com \
--cc=dovmurik@linux.ibm.com \
--cc=ehabkost@redhat.com \
--cc=jejb@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=slp@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).