Message ID | 20180212153715.87555-26-brijesh.singh@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F171B60329 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 12 Feb 2018 16:17:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E228628A44 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 12 Feb 2018 16:17:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3E9528A47; Mon, 12 Feb 2018 16:17:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 39A7528A44 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 12 Feb 2018 16:17:43 +0000 (UTC) Received: from localhost ([::1]:48037 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1elGnW-0003k8-D5 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 12 Feb 2018 11:17:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1elGBv-0003pv-SW for qemu-devel@nongnu.org; Mon, 12 Feb 2018 10:38:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1elGBs-0004fz-DW for qemu-devel@nongnu.org; Mon, 12 Feb 2018 10:38:51 -0500 Received: from mail-by2nam01on0054.outbound.protection.outlook.com ([104.47.34.54]:63968 helo=NAM01-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1elGBs-0004eR-3w for qemu-devel@nongnu.org; Mon, 12 Feb 2018 10:38:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1vSxmGQpw7QyBM3ShK9U0MRoW+EEN/2MF9NI62px+os=; b=T/9t9fapvL1j1QuTMfHaiHedHMCceSgg4K40aL7ebF5dSyF92ik4A+kN/lMK4XQEj+P8KBksLXUC6SXSlSU4TqHF6qCTK6gBJuM2Uj0SIJgWybkSgvYL/DxG3qlbcVRDu/SC2GyCj65A/miWIVV09CCQgcJm7tHxTwYTAo5uBCg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by BY2PR12MB0146.namprd12.prod.outlook.com (10.162.82.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Mon, 12 Feb 2018 15:38:44 +0000 From: Brijesh Singh <brijesh.singh@amd.com> To: qemu-devel@nongnu.org Date: Mon, 12 Feb 2018 09:37:12 -0600 Message-Id: <20180212153715.87555-26-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180212153715.87555-1-brijesh.singh@amd.com> References: <20180212153715.87555-1-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: SN4PR0801CA0004.namprd08.prod.outlook.com (10.161.215.142) To BY2PR12MB0146.namprd12.prod.outlook.com (10.162.82.19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f4c3ec3b-148a-44ff-c709-08d5722eb3f4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:BY2PR12MB0146; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0146; 3:kZAgAm4ZkgZ+DMDKHsKgY+87TtYIlAU2m9a5v2hokkGhx+wOB/mvINI+TVXY6KkZDuD4pqSqyhz1z4uNMxkdgpPFZ0TFgnDp9a4I8Ejtv/NiZLBooYRDKe7JWQh6TRm0iIQduXL/PKKLjDZZQ4BxciXVYCudwpJBRRI3RV00tZWZvGCxBBmqPe5d41mpOjUPryLscu9FqMbf2EA5sxYWwTOkYdP6G65Wwzix2eaR2sBsXdyFBefnQktKElIyll4G; 25:0Mj5eTnwxj1M0q5zWrD2X2PY/ppPFHQWrfxHU0IxukBYapjhuTAW5Qsj9oR/g2QoCEE1FBwaetTc/j34c2hp7B8q3bA1quqSWAsPRS2yFUEYzYojQzl8nwoITOUKx3IvZEu6iFdawpQuIl+vmmPgbopIxckp5P6JC7jVBp6Lyyswv6GQVcLu/AgDcmeEO1lxlcmU3a+3DiBpxd+bttezfZYM+ogdNHTv8mbbOS2K9dqycBKnYHPo+Ys1ijS6kPaunDEB2porz/QCpeuZoQefvOS6KNGwDXSbiWzYmrwXpBiK26PutQhvcHgIpKTX4sEc1A2BC9RKQAG4yq/7yvOiGA==; 31:Tv6tm5sFj690U8D9VcJS4NwUGqHuJx66GOVN69WCFFu+31R++2er+I65ced1kczQe4E0XUmqPhtKaT9Uc6z+wPYNk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PR12MB01464C33F409FE1E4E872E07E5F70@BY2PR12MB0146.namprd12.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231101)(2400082)(944501161)(6055026)(6041288)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:BY2PR12MB0146; BCL:0; PCL:0; RULEID:; SRVR:BY2PR12MB0146; X-Forefront-PRVS: 0581B5AB35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(39380400002)(39860400002)(346002)(396003)(366004)(376002)(199004)(189003)(25786009)(53416004)(66066001)(8676002)(7416002)(105586002)(81156014)(76176011)(81166006)(5660300001)(97736004)(186003)(16526019)(8936002)(106356001)(50226002)(2361001)(6116002)(3846002)(47776003)(305945005)(1076002)(86362001)(26005)(2351001)(7736002)(478600001)(51416003)(36756003)(4326008)(2906002)(53936002)(6666003)(2950100002)(8656006)(52116002)(6486002)(48376002)(39060400002)(68736007)(54906003)(16586007)(7696005)(386003)(316002)(6916009)(50466002)(8666007); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR12MB0146; H:wsp141597wss.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR12MB0146; 23:n0pcn9MltEbWMLbIQ3pyrKHlkASetIZYrWpKST+AY?= =?us-ascii?Q?XSH2HP1Fck5M0bgaj2vs4Ww9Ay5DADCIieSjhd4HVD6fxxxZ6P8m7UI30jhL?= =?us-ascii?Q?tNU++ON9hUYinyPLyNE0uHe8L3JXhYGkzpaVM0maqfFdPAzx9W1qI3AxZayF?= =?us-ascii?Q?RkZtCpbBp80exjU0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3i0S7kgXDgsgeGZULn6R+cBlZhi8p8XV+nBO3PRENWHoX2EBHsSl6czKcr7f0peok1qqUGL1EJKV4P8Q7xvRPPIhKd9VwHxol6jRKULuD6RzPerIqODYbZpH/ba1Ek3+NOb3mXBuaPtfvaWldEbBmyvC7xLfEY42eJrlaYXymf0Jm53EAdezl3eE8fnHyN SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0146; 20:+57FjTqIjUqCO7CavP4JrH3WQOO5dLJDmwXiGeFVZmgT7Kz4OmMZp6DGgiql/12UAiCdw28vmPON7t0aKX3ama2GlNaRK9XAmY9mWtV4GGCEy2TSGa4MuM777LADYiGIFlTb/B7o/e3+2g2CVAMyo0d96VgDGn256NBzrypils3Q004CphkRHGffmxR00b99KLMPrfNO3nvFM0UYiIcTzCXIkHTcf+60j9J7BJnqsUnr0W6pfehkq6Igchgu8EOj X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2018 15:38:44.1645 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4c3ec3b-148a-44ff-c709-08d5722eb3f4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0146 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.34.54 Subject: [Qemu-devel] [PATCH v8 25/28] sev/i386: add support to KVM_SEV_GUEST_STATUS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, Brijesh Singh <brijesh.singh@amd.com>, kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>, Stefan Hajnoczi <stefanha@gmail.com>, Alexander Graf <agraf@suse.de>, "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>, Markus Armbruster <armbru@redhat.com>, Bruce Rogers <brogers@suse.com>, Christian Borntraeger <borntraeger@de.ibm.com>, Marcel Apfelbaum <marcel@redhat.com>, Borislav Petkov <bp@suse.de>, Thomas Lendacky <Thomas.Lendacky@amd.com>, Eduardo Habkost <ehabkost@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Alistair Francis <alistair.francis@xilinx.com>, Cornelia Huck <cornelia.huck@de.ibm.com>, Richard Henderson <rth@twiddle.net>, Peter Crosthwaite <crosthwaite.peter@gmail.com>, Paolo Bonzini <pbonzini@redhat.com> Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/target/i386/sev.c b/target/i386/sev.c index 6df5db3eb2d7..2713e3591d40 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -418,6 +418,22 @@ sev_get_fw_version(uint8_t *major, uint8_t *minor, uint8_t *build) void sev_get_policy(uint32_t *policy) { + struct kvm_sev_guest_status status = {}; + int r, err; + + if (current_sev_guest_state == SEV_STATE_UNINIT) { + return; + } + + r = sev_ioctl(KVM_SEV_GUEST_STATUS, &status, &err); + if (r) { + error_report("%s: failed to get platform status ret=%d " + "fw_error='%d: %s'", __func__, r, err, + fw_error_to_str(err)); + return; + } + + *policy = status.policy; } static int
The command is used to query the current SEV guest status. We use this command to query the guest policy for QMP query-sev command. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Richard Henderson <rth@twiddle.net> Cc: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> --- target/i386/sev.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)