From nobody Mon Feb 9 20:34:23 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=1623876290; cv=none; d=zohomail.com; s=zohoarc; b=ShdVkufojd3QsKIcdWc+16xjlQzr1XYBT1m3Eqta1Lij2nqG1sxD1b9G1cYcxzRkx+vYTRvswORQmVug8y20UDO2vaNWjsJEreq4DktlkprZyxl5W89wm6rjbT/y2YnNueh0hEZpR/HN1Vv6sNPAJPBU3ioyviO4bJovKskal/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623876290; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=mTw6coySU0nJcHmY2S2py9HmFIvO1l0fChn4YRCOlgU=; b=jMiMqgS9X207exjaim4RD0HAh5kz1lEAfOngKqyrIXtgsm9UbHWaqcAzEC62dmaR7g8GtyAGjnC7D5m/DVq5vt2ed/mB9VdPiS1TJJc7oFs8F1+GFHTz4hn7k2UUtHaiBb5oJxCB5XxIy/AgbyfnCiS6oDmBjqNmzNOaovhWkWU= 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 1623876290945417.14557987421836; Wed, 16 Jun 2021 13:44:50 -0700 (PDT) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-175-5ecbIED8OKydXnQ8mfGjKQ-1; Wed, 16 Jun 2021 16:44:48 -0400 Received: by mail-wr1-f69.google.com with SMTP id x9-20020a5d49090000b0290118d8746e06so1864017wrq.10 for ; Wed, 16 Jun 2021 13:44:48 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id c12sm3204088wrw.46.2021.06.16.13.44.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 13:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623876290; 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=mTw6coySU0nJcHmY2S2py9HmFIvO1l0fChn4YRCOlgU=; b=WbO122IBGPSlIMKjGBYpwfqlxy8EoIIDF0i4+YbBBwOqPng7G6Dx2F890/yhFldTJKiahf yLz1KIezTlidzEYmPyYC/G05hr1f63xJddg7JuKZCMFYF2umzFgTun7JgaO0nXpLQ2MCtK U6gUyURn7WkRIWc/MgAhSc5go5D4Epw= X-MC-Unique: 5ecbIED8OKydXnQ8mfGjKQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mTw6coySU0nJcHmY2S2py9HmFIvO1l0fChn4YRCOlgU=; b=EMUVLe/MrA6mD7hVe6xZV+oHCO+O/MU7cVMmJDg7YPlL2IajQ2rIChJRcND4g6zQON +Jr8YpHY/XGlIkmnlXz7D67TJ3Lg4Jrmt+JkPTfafoxUiUPB6yZHbcD6KWOhvzlSTJ7+ IPHk5h2w9vAtIeUqDznerTzyOacwYMsAKwGEQdRY9JL4guEcsQ6aL4/WOo2C0MCgqgTi nbacUFavVpEtVyxBHjj9LeuECgxFHc4/DDO+IlV55kxP4JdHE7ZbAq/VrX0hSMavCT20 sX8BOvbA5Ycu4nqytm1wXq9UpTIHh7k5u9IT8L+ZHGq4bayyyGRX2aVkL5/+E3QyxGlv IK/A== X-Gm-Message-State: AOAM532VRAxNUKPuPSMa0X3jSpimiPSkz+9MVDGDn2T/udAu9uajhrcO yVTORPxpjX6eeg6t+M7kxfDu65caxfBnoyCjU/Yt5E/Q3v81d5U9Y3kVUk6xX+vWQZ6LsWeQuoS Ym7V/TA4aLZR5Yw== X-Received: by 2002:a1c:4e03:: with SMTP id g3mr873138wmh.127.1623876287532; Wed, 16 Jun 2021 13:44:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSo8Vje44Byvcni5YZ1Gy6T4dbU1s/gAfyqgBltfLzVwVkSAn7fAd1HH4psiTiXypj7W0VrQ== X-Received: by 2002:a1c:4e03:: with SMTP id g3mr873111wmh.127.1623876287327; Wed, 16 Jun 2021 13:44:47 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Connor Kuehl , Gerd Hoffmann , Brijesh Singh , "Dr . David Alan Gilbert" , Eric Blake , Eduardo Habkost , Markus Armbruster , Igor Mammedov , James Bottomley , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Marcel Apfelbaum , "Michael S. Tsirkin" , Laszlo Ersek , Dov Murik Subject: [PATCH v2 13/23] target/i386/sev: Move qmp_query_sev_capabilities() to sev.c Date: Wed, 16 Jun 2021 22:43:18 +0200 Message-Id: <20210616204328.2611406-14-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616204328.2611406-1-philmd@redhat.com> References: <20210616204328.2611406-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) 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 --- 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 cb5702a2397..62ee2e1b16a 100644 --- a/target/i386/sev_i386.h +++ b/target/i386/sev_i386.h @@ -29,6 +29,5 @@ 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); =20 #endif diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 95b9ada189e..6c6d0b5d707 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -726,8 +726,3 @@ SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Erro= r **errp) =20 return info; } - -SevCapability *qmp_query_sev_capabilities(Error **errp) -{ - return sev_get_capabilities(errp); -} diff --git a/target/i386/sev-sysemu-stub.c b/target/i386/sev-sysemu-stub.c index a66ae4f5efb..e62ac5edd83 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 7cdf8d857c8..23295d74c8b 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