From nobody Mon Feb 9 11:32:36 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=1633623528; cv=none; d=zohomail.com; s=zohoarc; b=K/ETP6sef0CuXs9l1xTtpfm+FBKbx1NCjT0AGzVbiRYZIfWwznbffGORuF5qA+GTgOUa1Q+Im4dNE7HkuXMlvHjdLll8iRu0tSCBi6Md/gKE2+eJgaF183yDlIaMd4eK3MGFisLaWnZfbFTXKtZ3019K5ubVQ/Cbnn/+w2u2DKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633623528; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=eYG5GFyks0GfeQysE3VKr9sF8B7VadEExh3ZaL/jqtM=; b=hCou4B9YY/WyKfrvSbOjUs8ZnhBb1jFbSDKMQnbrJ4KBEnwarYiU1YN9VlyFpVivPDk5OY4DYdNgVcYwcflM9Fh/M27WbxZxVHVhSmO9Az2WuwOnD8a/o7mQ7d4gFudsBYg6sFh7lDrLATVbUVJDZOs11ZCDjId7PMoTylQf4Co= 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 1633623528312673.665803109891; Thu, 7 Oct 2021 09:18:48 -0700 (PDT) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-433-FMdWGB7JMWOc7DKVJjThPA-1; Thu, 07 Oct 2021 12:18:46 -0400 Received: by mail-wr1-f70.google.com with SMTP id d13-20020adfa34d000000b00160aa1cc5f1so5120097wrb.14 for ; Thu, 07 Oct 2021 09:18:46 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id f9sm85962wrt.11.2021.10.07.09.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Oct 2021 09:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633623527; 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=eYG5GFyks0GfeQysE3VKr9sF8B7VadEExh3ZaL/jqtM=; b=HW2M9TbVl0woqCe6zFOpZTW0BXVGpdmlKFMXcKBrDIUUluebWA5aA0qmAftqh8HK8LM3qt UoIUMKehFcAGBcdVdVxDo1x4S3rxSmXq0JCwKZVVzRCyZSNU4SlObpktHfTpPcJyBmRlgK ySy+asmNmalQrRVKRWJiSF2rd0KlvWo= X-MC-Unique: FMdWGB7JMWOc7DKVJjThPA-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=eYG5GFyks0GfeQysE3VKr9sF8B7VadEExh3ZaL/jqtM=; b=Fy6SZVW72hJTn/c4PZgGVypAwOt+OPF3j9DHmlfadiSTiT5637axdggSkrCZLxMXth GM0AZ4xn57iAT8Ty317LcO/PkNidl9A62tBHmswTp4sIPlvnjfTgLyFnVeI7AGetSPP+ /aqkCof3Go7cvpVIl7VWT4PEE1U1cSRcdyoza1SJHXhHprarIgyHHYYyCpDF1mvtSDWx e16uI7639C1K0xqlG022ZfCP0uPXWCwr4myAmxfTpJMsBkckdV6kapzKVirGx5f56sjB H379qWo7ymvw1eYFR1o0QUnkPpL1Sj2DcCs/I2I2MUQ/WvTQNzNJaELJLNEOOvlcOHyr 48Yg== X-Gm-Message-State: AOAM531n5PcJzjrUl71KA+9gpZgeNydsiABRbe5uu5UQAFFMaCneMpp6 jzlbZIeJVmri+pB2q4aBC/pbkxGWN5OzBIzMfd4APLg7XGMJzL+weOqJFMk3tGlJRuxRgjMGAay zTjSkTKT9VSNX3w== X-Received: by 2002:adf:aa92:: with SMTP id h18mr6442644wrc.372.1633623525128; Thu, 07 Oct 2021 09:18:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHHZKQOjYRnT9+FmsxmDtac4YCe8C0X0vefev5KYvlUQXaIrRgt4AfzCSl6KGgaKbHDRYH0g== X-Received: by 2002:adf:aa92:: with SMTP id h18mr6442625wrc.372.1633623524973; Thu, 07 Oct 2021 09:18:44 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , "Dr. David Alan Gilbert" , James Bottomley , Brijesh Singh , Sergio Lopez , Dov Murik , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 19/23] target/i386/sev: Move qmp_query_sev_capabilities() to sev.c Date: Thu, 7 Oct 2021 18:17:12 +0200 Message-Id: <20211007161716.453984-20-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211007161716.453984-1-philmd@redhat.com> References: <20211007161716.453984-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: 1633623530213100001 Move qmp_query_sev_capabilities() from monitor.c to sev.c and make sev_get_capabilities() static. We don't need the stub anymore, remove it. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/sev.h | 1 - target/i386/monitor.c | 5 ----- target/i386/sev-sysemu-stub.c | 2 +- target/i386/sev.c | 8 ++++++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/target/i386/sev.h b/target/i386/sev.h index 2e90c05fc3f..b70b7b56cb8 100644 --- a/target/i386/sev.h +++ b/target/i386/sev.h @@ -51,7 +51,6 @@ extern SevInfo *sev_get_info(void); 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 bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Erro= r **errp); =20 int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp); diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 22883ef2ebb..4c017b59b3a 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -727,11 +727,6 @@ SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Err= or **errp) return info; } =20 -SevCapability *qmp_query_sev_capabilities(Error **errp) -{ - return sev_get_capabilities(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 82c5ebb92fa..3e8cab4c144 100644 --- a/target/i386/sev-sysemu-stub.c +++ b/target/i386/sev-sysemu-stub.c @@ -27,7 +27,7 @@ char *sev_get_launch_measurement(void) return NULL; } =20 -SevCapability *sev_get_capabilities(Error **errp) +SevCapability *qmp_query_sev_capabilities(Error **errp) { error_setg(errp, "SEV is not available in this QEMU"); return NULL; diff --git a/target/i386/sev.c b/target/i386/sev.c index 072bb6f0fd7..56e9e03accd 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -466,8 +466,7 @@ e_free: return 1; } =20 -SevCapability * -sev_get_capabilities(Error **errp) +static SevCapability *sev_get_capabilities(Error **errp) { SevCapability *cap =3D NULL; guchar *pdh_data =3D NULL; @@ -517,6 +516,11 @@ out: return cap; } =20 +SevCapability *qmp_query_sev_capabilities(Error **errp) +{ + return sev_get_capabilities(errp); +} + static SevAttestationReport *sev_get_attestation_report(const char *mnonce, Error **errp) { --=20 2.31.1