From nobody Tue Feb 10 15:46:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1591253327; cv=none; d=zohomail.com; s=zohoarc; b=fwP7FhnaHGVxX6p0JjA6hgtvmubW3kgKLgjJPOzmbEgTyVD9MCcm9gylpYBZzT7ai/cmwItNTr45v6qKPQSE1ufH8oxAjgmdgVYuCysukVU4bCeAl5MWZ+yqRsYTb9xeDHKxyIRGEtraGzW3U/EzPqrczlgGylD6UyBdbA7YN5o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591253327; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=S8RJz4n/mUhsoh9ALn/rRXPRrxEoMntsI4mB7CRC0Uk=; b=edzqQAAUHyGrQ6uUrnm2dE6wq5KS5wyF3ZMMzMGlgV8VLnk6SVUzbYvnv1qfGu2MzZrKZAbFEHWDui0m7iwEi6kzf2DvL4GqLcFFZkAO0B+2Bb9a9N4Vk/C/OLL/y4tg6sS+fAr5qchvxLQ59dc+lAcbns0vqQ9ENCw9V2AvcpM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1591253327437148.64694814300015; Wed, 3 Jun 2020 23:48:47 -0700 (PDT) Received: from localhost ([::1]:50906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgjgD-0007i0-Ss for importer@patchew.org; Thu, 04 Jun 2020 02:48:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgjaG-00052N-Sy for qemu-devel@nongnu.org; Thu, 04 Jun 2020 02:42:36 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:45387) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgjaF-0000ni-Hk for qemu-devel@nongnu.org; Thu, 04 Jun 2020 02:42:36 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 49cx6D0yx1z9sTV; Thu, 4 Jun 2020 16:42:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1591252948; bh=6MG/UBS88R7qdMJG8taGdNHmp5J64Yq8vcEMkHSWD7I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CHV4tGbhvtnF2MNap+rM5TvnxKbVKH2I5Qs/263/iOUjUxymNXA+1W1tfSajA74X7 K+2UQqhJFPRDeikkUWJDRxrDQ9Dgh+CAkD1dIUbwr9rvfF5f28m5qBW43O+5z1eI8H HYoCFGdKuaPgRUQpid9QYb21y7X/4pDkcVGLteh8= From: David Gibson To: rth@twiddle.net, pbonzini@redhat.com, ekabkost@redhat.com, qemu-devel@nongnu.org Subject: [PATCH 7/9] target/i386: sev: Remove redundant policy field Date: Thu, 4 Jun 2020 16:42:17 +1000 Message-Id: <20200604064219.436242-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200604064219.436242-1-david@gibson.dropbear.id.au> References: <20200604064219.436242-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2401:3900:2:1::2; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: brijesh.singh@amd.com, Eduardo Habkost , Richard Henderson , dgilbert@redhat.com, philmd@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" SEVState::policy is set from the final value of the policy field in the parameter structure for the KVM_SEV_LAUNCH_START ioctl(). But, AFAICT that ioctl() won't ever change it from the original supplied value which comes from SevGuestState::policy. So, remove this field and just use SevGuestState::policy directly. Signed-off-by: David Gibson Reviewed-by: Richard Henderson --- target/i386/sev.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index d25af37136..4b261beaa7 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -39,7 +39,6 @@ struct SEVState { uint8_t api_major; uint8_t api_minor; uint8_t build_id; - uint32_t policy; uint64_t me_mask; uint32_t handle; int sev_fd; @@ -397,7 +396,7 @@ sev_get_info(void) info->api_major =3D sev_guest->state.api_major; info->api_minor =3D sev_guest->state.api_minor; info->build_id =3D sev_guest->state.build_id; - info->policy =3D sev_guest->state.policy; + info->policy =3D sev_guest->policy; info->state =3D sev_guest->state.state; info->handle =3D sev_guest->state.handle; } @@ -520,8 +519,7 @@ sev_launch_start(SevGuestState *sev) =20 start->handle =3D object_property_get_int(OBJECT(sev), "handle", &error_abort); - start->policy =3D object_property_get_int(OBJECT(sev), "policy", - &error_abort); + start->policy =3D sev->policy; if (sev->session_file) { if (sev_read_file_base64(sev->session_file, &session, &sz) < 0) { goto out; @@ -550,7 +548,6 @@ sev_launch_start(SevGuestState *sev) &error_abort); sev_set_guest_state(sev, SEV_STATE_LAUNCH_UPDATE); s->handle =3D start->handle; - s->policy =3D start->policy; ret =3D 0; =20 out: --=20 2.26.2