From nobody Mon Feb 9 13:38:20 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=1633179274; cv=none; d=zohomail.com; s=zohoarc; b=eAxlxGNomX3DwOnmvZlQ+Rw35S1bRaolVfkKFC2l2Y865wWEc04aj/68OpfTTJT5MYkDhFGt+8KHmrrBMe1rcntQGcnOqxv20J46oiphAhb7z5qFmO8lYVm0b5NkyVYRdyAz7Vrf3nbwQ/xNFaMTKAhnjg8AlYhaBmMnyjcqI2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633179274; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=h6tz1pzz/4VduuxUJcTVLKl1Lh7BOZFtJinbrllV/PI=; b=ClOeLQJzloTDU8Dodi5zlk3GD1EYS5vYe5ozu8aQnhlpQOorcQN7Nn5l2M6ndKEaZEmmHq2ntdpwfvrWvEWyk+lIOBhSOUx0GhPSRl9xFQT4DQtMezM9S0I1QpHF6uAQkFXnNEgBEK0OcwGDNx/uRsb0jjZj8JsRm66nK5TDSn4= 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 1633179274702543.3136985837938; Sat, 2 Oct 2021 05:54:34 -0700 (PDT) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-231-3RE_954BMRajAAoEOSS9Bw-1; Sat, 02 Oct 2021 08:54:32 -0400 Received: by mail-wm1-f70.google.com with SMTP id v5-20020a1cac05000000b0030b85d2d479so6061013wme.9 for ; Sat, 02 Oct 2021 05:54:32 -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 l25sm8457300wmi.29.2021.10.02.05.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 05:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633179273; 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=h6tz1pzz/4VduuxUJcTVLKl1Lh7BOZFtJinbrllV/PI=; b=YvwW9ped/qvn23GQQ4T2N9ZGWnRJgZT7yGJ9TrhG/6bz6UpILDRQ9puMuJD1vx++fvwop0 /q573ByRd28JPn7YduAqCh4xkD9gLmexnhI/3gJo/yc9Z/jSpDFon2h1VjaI+BvfhEHKE4 KKNA6FuWU9hGh+MdIDCXfb+nRzOF7zg= X-MC-Unique: 3RE_954BMRajAAoEOSS9Bw-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=h6tz1pzz/4VduuxUJcTVLKl1Lh7BOZFtJinbrllV/PI=; b=fdsB7R3WrQdw3MQWNnKHLzOn2xt7+FZupl0cxHLTt4beMGAHDr2Pfivp7NbintnyNQ Spc+aIiml5CJl9ETR/GH7zMewX633GiVlp+FrSm5IitSJ6EzE+epH1Vq/7iHojUH5lrp ACrc+GaaOCVOTVbaNi5ylT8zHsAuH03382prLcNVaNpCzI4cOq3B/Un5oQFZYtr26XMO yEF6Y9/7jdLnkbDb/8lQ2+taAlKzKrIV2iRgjOtOpk9KcSH5yHx2H3RcA25FGu0ROVs0 wVHqit4cP49bK22EWGmrLqPFJO1renCndx0kD/1tt/XrNmVVhtQRgq6uA/AbRLTl1DqI dJ+g== X-Gm-Message-State: AOAM5335hqLGDc+SV5Muv3j3UIC2ROrvt5Fq6Rq/dcu3jBVpK0YI5trK K81pweocnuvvgdX8EiZlbgOTmsm6/0FuRG+2wDcJ6HrQMpt9GuK8ObnXc0gLhdpG2hKpHf/TVnN IPsAvjSATuSazFg== X-Received: by 2002:adf:b311:: with SMTP id j17mr3202011wrd.340.1633179271656; Sat, 02 Oct 2021 05:54:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyu9v9AoE33m8O4FuueDOzXS5cpHqzVSB1CjLXdyosJZ9VfYPRTPpP3kB+NiZ18zNjZf4Yvsw== X-Received: by 2002:adf:b311:: with SMTP id j17mr3201997wrd.340.1633179271459; Sat, 02 Oct 2021 05:54:31 -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 16/22] target/i386/sev: Move qmp_query_sev_capabilities() to sev.c Date: Sat, 2 Oct 2021 14:53:11 +0200 Message-Id: <20211002125317.3418648-17-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: 1633179276980100001 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. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Paolo Bonzini --- target/i386/sev_i386.h | 1 - target/i386/monitor.c | 5 ----- target/i386/sev-sysemu-stub.c | 4 ++-- target/i386/sev.c | 8 ++++++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h index 5f367f78eb7..8d9388d8c5c 100644 --- a/target/i386/sev_i386.h +++ b/target/i386/sev_i386.h @@ -26,7 +26,6 @@ =20 extern SevInfo *sev_get_info(void); extern char *sev_get_launch_measurement(void); -extern SevCapability *sev_get_capabilities(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 188203da6f2..da36522fa15 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -728,11 +728,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 66b69540aa5..cc486a1afbe 100644 --- a/target/i386/sev-sysemu-stub.c +++ b/target/i386/sev-sysemu-stub.c @@ -27,9 +27,9 @@ 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"); + error_setg(errp, QERR_UNSUPPORTED); return NULL; } =20 diff --git a/target/i386/sev.c b/target/i386/sev.c index 2198d550be2..fce007d6749 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -438,8 +438,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; @@ -489,6 +488,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