From nobody Mon Feb 9 12:15:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633179265; cv=none; d=zohomail.com; s=zohoarc; b=nkd/EqNJypJYv3YaN/eUa2lPtOK7rv5+21jINxii/ytuzS1QsZBpenbIYOgtMVffHNntSCYSNf8XiFvfamzxCQWenSD1RxmCTiDLY6FIdaDof6ZBDBHR16/L2LbAZSjVxY7eMnwV7yf9agEEmoGgFnZ+nblHP5nAO2ORoj/Iv9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633179265; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=+4z6jUCebNJqEmNFJ/VStW7BTMEQNitBNtR46XouroI=; b=PfC43aAsronVIkfrZgddaVbodG8nVaZJMNwNFmB8q6BD3cNpbiTQXKCJtQBIHkVCJCgiNKccKqBtYssgoLCGa6L/4DFNzplOkRAjFO9rbv4gPwk8yaRRgyfxs++7VR1bfInBJiVcSODD/gZ3hHPHql2du5PZIadLghh0BgR2aHg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1633179265904492.51038193986744; Sat, 2 Oct 2021 05:54:25 -0700 (PDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-397-YFZ78WzIMNyynUU5ofe-Yg-1; Sat, 02 Oct 2021 08:54:23 -0400 Received: by mail-wm1-f72.google.com with SMTP id h24-20020a7bc938000000b0030d400be5b5so3358580wml.0 for ; Sat, 02 Oct 2021 05:54:23 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id o19sm9025753wrg.60.2021.10.02.05.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 05:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633179264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+4z6jUCebNJqEmNFJ/VStW7BTMEQNitBNtR46XouroI=; b=Fgg2WK/FoaEoFd1NraXoeMRhu0Ejvk+ZO18gpE195cVEbiWHmARp3Uq8HKHE8OdlUlC57w 6f3R+TFJOgDiaojdEuLwOWj8r/n4wsZyI3erDBOB4f4EyFTp4zHiIpvMJnjDqsnlxok1kp iLtWb7iQ8gdu/2kxEm+AHe5cXpEK0IU= X-MC-Unique: YFZ78WzIMNyynUU5ofe-Yg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+4z6jUCebNJqEmNFJ/VStW7BTMEQNitBNtR46XouroI=; b=XP2JKnfe/258MfBQVHZyYY7ODHO/MQhCD/krGkN84cRCSo3xOek2BtR+oYFz8mOy0S Mpj2ywjnO9wX85o/ydfB6H5j/jyfSp0MyZaD1tEgY+DQ24jiL0D38Y50yt7Ss/aHcMx8 8vG6gSq8yY5YUNN/tU8Tr47E2E9ZHESIlIAdnCdYFpZgvgG86MBf0wkIabDoWJoNP2rO pE6qg6NOXqcguiqA1x2nYmizLdus7o+vkfwwoVx8cLghwN6ym/IrO6SsNs0z2i4CbZtw otXFYaa9SDDVywJTjoQiToNtl1jN/+Jtc9JG9liPOnvf4dHWwHLEMeqVBCUJNuaLSZUk cSpQ== X-Gm-Message-State: AOAM5339IX/2WfyQwHcKKi1YPSq5c2quzeMkqRkMuLIypC20SV/6DH2n ybw25rnssithfo8/5Hhexc8vtduVsvP0NFvmAKzqo4k9xcHTIn7MKsF0ba+JmErFVuwHVk5h04P ksfMsqll2ISB9qQ== X-Received: by 2002:a05:6000:2c6:: with SMTP id o6mr3376264wry.292.1633179262579; Sat, 02 Oct 2021 05:54:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPg2SUP1KRqKQDM976J1UW+bK/dVfMUDIEqkBzFMQ49KQqAlYHTXe/I8QRvH6n2Zfw+A1FBw== X-Received: by 2002:a05:6000:2c6:: with SMTP id o6mr3376245wry.292.1633179262453; Sat, 02 Oct 2021 05:54:22 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr . David Alan Gilbert" , Dov Murik , Sergio Lopez , kvm@vger.kernel.org, James Bottomley , Eduardo Habkost , Paolo Bonzini , Brijesh Singh , "Daniel P . Berrange" Subject: [PATCH v3 14/22] target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c Date: Sat, 2 Oct 2021 14:53:09 +0200 Message-Id: <20211002125317.3418648-15-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211002125317.3418648-1-philmd@redhat.com> References: <20211002125317.3418648-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633179266376100001 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=C3=A9 Reviewed-by: Paolo Bonzini --- 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); =20 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_h= dr, sev_inject_launch_secret(packet_hdr, secret, gpa, errp); } =20 -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 @@ =20 #include "qemu/osdep.h" #include "qapi/qapi-commands-misc-target.h" +#include "qapi/qmp/qerror.h" #include "qapi/error.h" #include "sev_i386.h" =20 @@ -52,9 +53,9 @@ int sev_es_save_reset_vector(void *flash_ptr, uint64_t fl= ash_size) g_assert_not_reached(); } =20 -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" =20 @@ -487,8 +489,8 @@ out: return cap; } =20 -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 =3D {}; SevAttestationReport *report =3D NULL; @@ -549,6 +551,12 @@ sev_get_attestation_report(const char *mnonce, Error *= *errp) return report; } =20 +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) { --=20 2.31.1