From patchwork Thu Feb 15 15:39:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10222221 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 BE0DE602CB for ; Thu, 15 Feb 2018 16:09:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE96F29457 for ; Thu, 15 Feb 2018 16:09:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A202F29458; Thu, 15 Feb 2018 16:09:37 +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 7EB9828886 for ; Thu, 15 Feb 2018 16:09:36 +0000 (UTC) Received: from localhost ([::1]:33771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emM6J-0008R3-D3 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Feb 2018 11:09:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emLex-0004pg-SE for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:41:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emLet-0003fQ-VO for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:41:19 -0500 Received: from mail-bn3nam01on0047.outbound.protection.outlook.com ([104.47.33.47]:24802 helo=NAM01-BN3-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 1emLet-0003fI-OV for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:41:15 -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=looMoVzqrUjudINBuw0/VV97wEiJ9wJ/+IpdOS+j4h4=; b=sFqlOTxPNhQrRCcMW1QefJR5HmlolcGz5KsTATF73cIeWMcqw4gfjl0OJd7vkk0ZEbrsk9XAeEwcjVy15zxS/pkvqbibfalOgkPb0zJIXfFfZ2jmqjVQcgas3weg6m/DnRat3h25uWjhQdSPP/GZuLf5FqGIUnSG0VxH0oOp66g= 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:41:11 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Thu, 15 Feb 2018 09:39:52 -0600 Message-ID: <20180215153955.3253-27-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: 0a228599-c245-44a3-c6d5-08d5748a8b02 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:YDLxiFOnEIcJtN1n7YSeYQMEy7seevxzBRZ/qyOhQ1KWw461dBQ07mpAdPRxIY1t59INutxejhFHyg0ys3slfJJfw2LrYUU5ViBVJdqCam+j/BFO4Bq5bwKoNv/LDWhBdnzjOdWlntM0+952UVlHypz9BWV1TRPnUzVbkPdNyJ9iXRn3DkVU+4hHrjbxze2wB9Zp0+gipDu/3d7MDgYlAiBfl9Q7xtNE9oji6aaPfGRYkmang6xK0bqYswop0OGb; 25:R3zmJAGqe+kp3r8J6VyvmT3ZTxGWL94ENvH1IrLg/+QRecFoBAnj6RdFGqFw+22DFDeKNfODSAUwfe4swCP/W1mgeKeRZuWf9qtz6qErFNKD+CfVl1N9rI2okNTyHscqzZE4uP1LVYeVVpBbr996gtlLzXl9mHt8cbb1y++wS6H0k9nQCPF2DMcjkAKZTreqBqPd4JGflOnsa7hktfjEiqYKQ7SLXZpXsAgTFG5qpRJg+K7aZy4fHuQMZnhvWSRdgFCRfPsk9bTfDMjhXISGSL57whnqjA2qZLHmUizicZq/kQsqDcJJA9wG4f0uv04+e2uPUwgxKjayguwQ/ikyLg==; 31:X00zgDYZ3u38wHemyTKNOWjbkEBnIbYOlRviOngniNppgtTUqhtggt6rEPde1oDK4bwcBKHVAs4gWVcF32h/A2C77IsS/e7y6AgQ1ny8rKMWdSM/3R0oPILt4g/rjuYi9l3vMS2qBtXV2R/f+5Jd+HPw6ku+ZsGdgY+6NbWCRXeW3KpQbCLkpUcNME2DuHDTQPsDRReC23NTQN+2QaR5yLFyc0NmhqJY6W/aAZ4fuX0= X-MS-TrafficTypeDiagnostic: SN1PR12MB0157: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 20:hAGq3Z01NijGZJjzZpr1XZs4RJyoHWk6aldwtcZvIxtfGI3HaZS0WyzHTe5gYbriWYGIutIU0ieqFk6eVWLdzzzyr8SthIggsdU+WpiSZ11GYHXOIUGLS5WY6vNWMl9cGTGa6cy8vv1zNWa0tTLq9W1g4ddxmIf/PnVXFbm6UKvPvmW317fG/Ts5x9swMCRkY3g+BXX5qzcU0iAuOffObIniKwZPKB++AMqaPlRfvFzfg5+bweW5ewshIspXxHe915WOIojbWH/ZX9i0r5mfJ3hez9of6/qBhpA8kVCZtP+ESf8LbKnOLyQIfzyo6b1Zirbp54HWizyHbncvhecw7kPGHLmHGYk42pguEP9A3YcJUa3JnzFL94ryYJHu/BkW44j84741zkoajKVjRbB2pO0O1i8GUtXnNxnUl587og2uO784gtQoK+nWmQBSxCwCenPbk5DzcforUjwif0o061CzV0ZxLLPKxnWLZMKscCtEnPFL9qwWY1ZsY8CSaSw8; 4:hdR2wGuOzZrspU7MUVe5Vg2u/vnoIed7ihj7c06y128NE5c0t4m60H7H3Ru6Cws8JOwWw74gDHHaWFxWBzDk6M4lgBVH1XarhcNPKY5Puu2HfVJNN6aJqL0BmDGigAj6foFyY1LkNeIYWNo7vWsItdfRhOgdwuEG8rgWWJFYKyXrfjmmaTJMVtBfpdproCsMdMQlJhYGV6KZ/xIheuZhTkkKfNqi3EZFZTKWh84Nq4bPJ/OBJLkVhs0HCwGJOVSFGg/EzEAIBx+zYTKRgP7wfme0He3MqrBAW37xTuckaEB5CAql/fx52m9atGCKBoeg 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)(6666003)(8666007)(1076002)(54906003)(6116002)(50466002)(7416002)(478600001)(59450400001)(8676002)(68736007)(86362001)(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:2bSRU2OmdjaCqGJx0wSJCtJqpFUB88PRTXEw9qLCL?= =?us-ascii?Q?vqoFtXTuMdReFQEU56O2PvQOdV8wXKKXtXiJ7Uz1c1Kv5iNqJ0WmZrWoetsc?= =?us-ascii?Q?rxuMTOVVB/AAEsZX2Ro4J1C/Nz+xCMsVH4I8+c38pFuI4hJ2mDouyQ0R3ni0?= =?us-ascii?Q?FtptFvzH8p0QJMTPqHN7fMDpn5wU0Fo47KuDxuAGjoY3w9uvPJK62rkZMdKL?= =?us-ascii?Q?X1W9/xBjwTAkL4vBzLe8Kra/gjyfCWtC4H+6pCTZGfDnOKAkqFH/4IFLShbs?= =?us-ascii?Q?DiA7KjTS51/Cggx3DEZ4LaYAuI1xcnR4tlud2P7vr0F707KE7Sxp6dUpuwr1?= =?us-ascii?Q?QkL7VT8q6ulmhzwLEfnQdAT+tz8iu7iU2RjayFh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ostics: 1; SN1PR12MB0157; 20:OkjuvSJyv9rSDvDbV50woyQT1hUufdFoNacZnOmo51jerc/bDZ1kWIbBphH815+9WDPa9yFDBX25p4XXjiIgfhCoMD/Gk/iD2uaxS2BXCabOQTL5NEM8hA/ncnCSqMgI2v6MtmICeO37/iP3ecz8kISTxh/nnK3SgD7pyYBaisBwCy/cPxHgMulFOTg7VFcpW1WSXUFxoxf6eJ26wG6woYkpjHqu7RZtZzI4PqAUDnaeUfVHbK7Y4ExsfK8XrhbS X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2018 15:41:11.3066 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a228599-c245-44a3-c6d5-08d5748a8b02 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.33.47 Subject: [Qemu-devel] [PATCH v9 26/29] qmp: add query-sev-launch-measure command 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 The command can be used by libvirt to retrieve the measurement of SEV guest. This measurement is a signature of the memory contents that was encrypted through the LAUNCH_UPDATE_DATA. Cc: "Daniel P. Berrangé" Cc: "Dr. David Alan Gilbert" Cc: Markus Armbruster Signed-off-by: Brijesh Singh --- qapi-schema.json | 29 +++++++++++++++++++++++++++++ qmp.c | 17 +++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index 46f7a3c9ea83..1ae45a908369 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3246,3 +3246,32 @@ # ## { 'command': 'query-sev', 'returns': 'SevInfo' } + +## +# @SevLaunchMeasureInfo: +# +# SEV Guest Launch measurement information +# +# @data: the measurement value encoded in base64 +# +# Since: 2.12 +# +## +{ 'struct': 'SevLaunchMeasureInfo', 'data': {'data': 'str'} } + +## +# @query-sev-launch-measure: +# +# Query the SEV guest launch information. +# +# Returns: The @SevLaunchMeasureInfo for the guest +# +# Since: 2.12 +# +# Example: +# +# -> { "execute": "query-sev-launch-measure" } +# <- { "return": { "data": "4l8LXeNlSPUDlXPJG5966/8%YZ" } } +# +## +{ 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo' } diff --git a/qmp.c b/qmp.c index 6860ae9ad6ea..7253720a2092 100644 --- a/qmp.c +++ b/qmp.c @@ -735,3 +735,20 @@ SevInfo *qmp_query_sev(Error **errp) return info; } + +SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) +{ + char *data; + SevLaunchMeasureInfo *info; + + data = sev_get_launch_measurement(); + if (!data) { + error_setg(errp, "Measurement is not available"); + return NULL; + } + + info = g_malloc0(sizeof(*info)); + info->data = data; + + return info; +}