From patchwork Thu Feb 15 15:39:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10222109 Return-Path: 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 10BB8602CB for ; Thu, 15 Feb 2018 15:54:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0015329340 for ; Thu, 15 Feb 2018 15:54:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E733529431; Thu, 15 Feb 2018 15:54:15 +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 3527E29340 for ; Thu, 15 Feb 2018 15:54:15 +0000 (UTC) Received: from localhost ([::1]:60798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emLrS-00006K-6w for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Feb 2018 10:54:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emLeS-0004H4-M7 for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:40:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emLeO-0003Vy-Ou for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:40:48 -0500 Received: from mail-cys01nam02on0075.outbound.protection.outlook.com ([104.47.37.75]:58240 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1emLeO-0003Ux-Gu for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:40:44 -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=+vpKr9bX4fszvcfdFqF4cRCciANQ15baUbtbUvwO4LE=; b=AGbHRrkC28YBDx01q3hwY+PSYPYCTOyfCvmepPkOqwwEjqQL75/fGrnp5S8j1d/sEz/71oXHafScMwvPsW+ZA0/JmX6zj8QKnuHtj1s83N+dzoO1PwTrpLj96/NqvnmteihS5YIFpWypKJ6/2zAw0iND9cRFAYWl57fRbrs0VNw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by SN1PR12MB0157.namprd12.prod.outlook.com (10.162.3.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.506.18; Thu, 15 Feb 2018 15:40:39 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Thu, 15 Feb 2018 09:39:37 -0600 Message-ID: <20180215153955.3253-12-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180215153955.3253-1-brijesh.singh@amd.com> References: <20180215153955.3253-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: CY4PR04CA0044.namprd04.prod.outlook.com (10.172.133.30) To SN1PR12MB0157.namprd12.prod.outlook.com (10.162.3.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5c11d29a-5bde-4285-3789-08d5748a783c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:SN1PR12MB0157; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 3:NJl0RJ8SkexHf3QDvKfS9dUP1WcriumWeDzV/XiBgpkx5WCgv39jlO7YJPsoJA15fQDu4IMQ1d1/q0cmbeBzLsxeLdK1U8MHk5czb7O4FEi+I1VvVT5UrLoVqoUtD1qp2SqL+XKpJaSoEXeZw9Fz6ihujyQFkM23UjCMcsHe0yZp43WC6UYUU0zQA8SA9HoeVb2DtrBL/MQ0AlPyXdi9Z8pHmA+jrzFTPz5Lc4BKzH/3lpXlCQ3kfMDHIu6pwTH5; 25:RuXl1GvRK+JGU8sg737SCJBtXgNXmhEAb1XY9DIvAuA/L5cnSTe4Lmlg/YmDPb6nkZkq5/hY8iePF/6JAFXRYeqrfqeIXeL1485OmqF7+6P3dmESdDeAA3wrd7pyMl1+Ri+4zGJaGbIwHh89cdhJls1H79CW6/ikOCefYthqcXjKzuK3swItbujyU0LShWjVvIK+/9WIT96Fi1OtTCmtiQ7rVvgzc036Ie97x+fJXKDAzeaidEjrCq/vyD/rAMsngUzLUPMrW+NUYk2NRQODCmWKgF01FmOAZZArDWDBzxl+NT7e9vpB5bzN0y8fE3g95beMWWVzofGqmxV3Zzj8JQ==; 31:ib+j9OUD2NYWqDgAzqp/6CVUlYsRMGKtINZMqaoa54ekNH1QCWkv1sGZNxpcLTPsECwSw3HyU3I5UXuKu8Bd6RiUt/FZNLck16hD78AxyRKY/uNRM1F8UJ1mIu3B3GUxp5Bcth3wAuiVe7ldDMVjXw+QSMm7KRrjL5+PPkugfZtFU6dCMdGcNvnRgQwQCeNV2ca5M9QLZ/LVp/3TqbQ+NwrBOWCbWbQ0pdz0dPxceWk= X-MS-TrafficTypeDiagnostic: SN1PR12MB0157: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 20:LksoMiS98jyZOCh+VYMKlZ/8oK8vINkKHNYfdOZCAFM1NsIMvhdzS9pFnkb6yqp39RnsPdQh+a4w7mEFBeWZ5fCCdaX+AEkhE1ddk5Cpj/9Z3ZCgFy/JJLUgpY3C6JvUjedPfyzrtrqXl9AYeAJnW8HSryQLyuadYqGagIPivylkN0uCfkcUUEvpbKO8+FPzlrhjhHvfcfNZ4Z4JnxfaxWEP08BS0W77PnXt5cC36KX5M31S9XANWttgu07QfQi9sV0oTtYoFXWjR/K+Cwzt0ma5Vs6NtOog6ozL084TtwYFu7cPYuRIE4AIHbj8a8CEjaRJ82oiIEl4tk59ipthttYVcfs/BwKqQT1r2SaBdEhvFIW9PfM4DN7VJZuN5ESY5YvWgvSlBVlSVSXhLHB/rJkjoAURF14Gn6JytBNiPNeYjv5iNS0yG7eqo0bsCmPTxc8+PxGRCmlA90B/reAP5TmhVvdNcKSW/S67Ny5u+alJA9nhJ24zVabPhLWwMxhV; 4:pwp+CjUfMaiNHGbajhTOF+AERg6p5BIDNOc+euY7S9FsBKNs2UE4lcQ3wSm3Ac3bYmGFfnvYZy94xJtxEx2Z6Sbk/OzJlRzcidIR7Ic0bGmQPwmniUb0lLZOijAY5EMD+EK1SuW1EoIxOJmJjgP9DeVG5uLpojwk2QNaxlT9VrItpTMSyKANnm0c8Qp/lIR9Y3oWftNo6xRUMBhazivAvlAF9pYx2XwHLuJZHG4F7ZnnVWe2skaFfjq53WTvQXjxYDwZK3nTIWLJFKTCbitWKMhw18VwBzXO/TGIcU4Y3zxZsYWMHj/zpFDMYvHbb80N X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231101)(944501161)(6055026)(6041288)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:SN1PR12MB0157; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0157; X-Forefront-PRVS: 058441C12A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(376002)(39380400002)(346002)(396003)(39860400002)(366004)(189003)(199004)(26005)(3846002)(386003)(8936002)(5660300001)(186003)(16526019)(316002)(8666007)(1076002)(54906003)(6116002)(50466002)(7416002)(478600001)(59450400001)(8676002)(68736007)(86362001)(575784001)(2906002)(50226002)(2870700001)(39060400002)(2351001)(6916009)(7736002)(106356001)(23676004)(8656006)(52116002)(25786009)(4326008)(97736004)(2950100002)(6486002)(2361001)(36756003)(76176011)(81166006)(53416004)(66066001)(53936002)(81156014)(47776003)(305945005)(105586002)(7696005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0157; H:wsp141597wss.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; SN1PR12MB0157; 23:srzZABfdai02H1icEkDvnsgOSXFSpvupAg++Us467?= =?us-ascii?Q?Hb5x40D1NVaaTeNACvtBxeTPJ3C5ajE5AsGdIiLWruFSBCbj3edcTW1zaYtV?= =?us-ascii?Q?yB/SifIrq5ajirt1bxDirZdPGrWnyhX4AR+ZtuHCkaL43IoeWjJ2OytLbqpI?= =?us-ascii?Q?uI4kZpQVsp1x2SwCCYXWeyMen82StpeCy0PU9BAsT4zVNh/DAOsP2Xb9xvDr?= =?us-ascii?Q?tQCPogT3kIHm0it+wcQrOUDD5xNJjO8IJsXkqUNPn0XRnyhuAr0Mwf6LnKX5?= =?us-ascii?Q?JufowIzVtVtYLBRudLugwZJLRMZUawWmtASs9ReY/2ftWVmLJv/WgVwM0l7R?= =?us-ascii?Q?awxetTZd7vjztou1f1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adata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 20:yqQBLBGjk8mDwbG0F7vfnyqaPTQP+WFB42FCYl+HF2W01O5o28BT14LU7EgpmkBaIOcQi65R4D3rJpAzFrlXvkToVdsXBQVUYkTLK8hv7aPIguyM+k4gxN8vjUqUKCUQneOlPvBjvUpQsi9t0B+byZXgANijjbkVOp8J62zDNvMVjXroKJw+pOu8yq+oqVoVeRRobMUFBD/ZLo2ArJ5oTYDinssc9gMwHoOYZs4I5Q1YcvKjmIOjG7r1y9dUDFeO X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2018 15:40:39.8532 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c11d29a-5bde-4285-3789-08d5748a783c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0157 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.75 Subject: [Qemu-devel] [PATCH v9 11/29] qmp: populate SevInfo fields with SEV guest information X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Brijesh Singh , kvm@vger.kernel.org, "Michael S. Tsirkin" , Stefan Hajnoczi , Alexander Graf , "Edgar E. Iglesias" , Markus Armbruster , Bruce Rogers , Christian Borntraeger , Marcel Apfelbaum , Borislav Petkov , Thomas Lendacky , Eduardo Habkost , Richard Henderson , "Dr. David Alan Gilbert" , Alistair Francis , Cornelia Huck , Peter Crosthwaite , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP query-sev command is used to get the SEV guest information, fill the SevInfo fields with SEV guest information. Cc: Eric Blake Cc: "Daniel P. Berrangé" Cc: "Dr. David Alan Gilbert" Cc: Markus Armbruster Signed-off-by: Brijesh Singh --- qmp.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qmp.c b/qmp.c index baf0b96528ae..6860ae9ad6ea 100644 --- a/qmp.c +++ b/qmp.c @@ -723,5 +723,15 @@ MemoryInfo *qmp_query_memory_size_summary(Error **errp) SevInfo *qmp_query_sev(Error **errp) { - return NULL; + SevInfo *info = g_malloc0(sizeof(*info)); + + info->enabled = sev_enabled(); + if (info->enabled) { + sev_get_fw_version(&info->api_major, + &info->api_minor, &info->build_id); + sev_get_policy(&info->policy); + info->state = sev_get_current_state(); + } + + return info; }