From patchwork Wed Feb 7 16:06:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10205623 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 BB30D602D8 for ; Wed, 7 Feb 2018 16:33:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1B98290E8 for ; Wed, 7 Feb 2018 16:33:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E7D8290CE; Wed, 7 Feb 2018 16:33:27 +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 32E392912D for ; Wed, 7 Feb 2018 16:31:44 +0000 (UTC) Received: from localhost ([::1]:56236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejSdL-0008TF-6h for patchwork-qemu-devel@patchwork.kernel.org; Wed, 07 Feb 2018 11:31:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejSG4-0006BY-Uf for qemu-devel@nongnu.org; Wed, 07 Feb 2018 11:07:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejSG0-00072n-WE for qemu-devel@nongnu.org; Wed, 07 Feb 2018 11:07:40 -0500 Received: from mail-bl2nam02on0049.outbound.protection.outlook.com ([104.47.38.49]:23040 helo=NAM02-BL2-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 1ejSG0-00072O-QR for qemu-devel@nongnu.org; Wed, 07 Feb 2018 11:07:36 -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=A49jmsEPaZ4LnRemQxByybkhZPQHE0aLCPHekBxQ44k=; b=CH+wgPs5YPkjfvXRw2mMUkE+q0kR0G3tMKYN3eymwYK5s5wrQ7bH2TuyCANJiWGLfxLiIgUckUuQbj6CFNKt9re2VdtSHNj21Bd94Z5cFxQLx/P9yTXpgNCoaZ4Q6yZjfm0CHVcQwlrzFW+bFge0XQNFvAvlkxL7076ZUZp1xO0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by CY1PR12MB0152.namprd12.prod.outlook.com (10.161.173.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Wed, 7 Feb 2018 16:07:34 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Wed, 7 Feb 2018 10:06:38 -0600 Message-ID: <20180207160638.98872-26-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180207160638.98872-1-brijesh.singh@amd.com> References: <20180207160638.98872-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM3PR12CA0071.namprd12.prod.outlook.com (10.161.151.143) To CY1PR12MB0152.namprd12.prod.outlook.com (10.161.173.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4538a326-ae41-4eb2-9b36-08d56e44e6ca X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY1PR12MB0152; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0152; 3:eSf/L9VeqRodgjWba770J3HphJ+kC6GkoVUWPLQPCQINmK7BUkHIvDyFgnwNXR5T9RFdy5JWiJfpLhX7WwoMTqP6jkvYe1NntDOi4HGgWfBzjVN1eNMES/WDOtFi9OI84OttK15OfKFljk1k3v2AuNgQzoAy7L8FWKSwLAJ9XCpKUU+lOyg60zs2BRwrotaO3V3gRCpi2mtRInVU0zj7pEQxUUdZuzncmsbjXjMIyw8pLp/9eN59n+CEBdMJm4/z; 25:/djNZVfenmCdKzz/bKYObMEZ5EzxVOAlWFghKChbLrl0p+bpdtfZWC1iOW+DvK8JlOPfOD+Mx8d0ss5ej4APHvZWs6ogI6940pgRSWa6Ghvw9Q7qEKC5pvEDNvSuENHnQKdxH3xnK2j3I7C7W8/BuHJk4C6qwkZQtSin7eXsbLurKE0cu0mVKJDiZ6Nrsi5oIrQb0Rt964CPlmGDEgQzEloYY+poMiCJ2RpjHcRV5vl8tLNyh9p5Ju5SLsJywKgh9mt7Vf6mOUY4CpEfm82peBgbkPwBETJwUTfxltVXz0FtxzN5Ygc1skcT4mb56p0z/+A6d2gRfDTAZ2aJN936oA==; 31:TCURt4Dgl9S+k7gnwmdyqHb9RlHxeSMeyk5S39OpYZV/yu9QCLaD8F4BeNkJP2qupoz4P4c0+ED7SGjuAZbLOfG5JzJs6RqtM2uDRYxrY/S8N9pwijCubun5JCegHUlx4uxl+QaWFsAVfWXKbmgJ/agG0LdSjLneHodirbj6XSS8i2g1j7VNIh45WQfyZMhbjqUbSKSBuD6KZyUn7jCh+U71v6uLypbx8/NnEKsaUNA= X-MS-TrafficTypeDiagnostic: CY1PR12MB0152: X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0152; 20:e2GwmUcrkmAnUL2/GOEl3zrKMnjfUw1kjgul4imwUz1CP7SJPMR3l5flNXtm+AYQg/WxbxHtn/H0O/vSE8RaSuWyZMgZPqaRtAd5E2R40uVPmLLZ8X2nPX3kG+begeReIeeNYNzxaynaqSRXkMKvW/7qNrN8Gxl+CeAhO+TQ3oua9kU8x0W5OtYJoIAH0F5yLusFp3QBYLxzp2LqOhXEGK9HeBxDkrt4JW4FKV51ECmVMDCQ5//hup5zd91QOkXItTTMZwF6tjtrT9NV1i0e2FqV/+eOWKMFPczsmS3MLQWP3qBz90pR/sbcVKLt/7inM6wFLVnzUVEuIfhwHq06WbzNdlvdMQtQf27htvSJeLWRAZKTCanJnwBmt9mp7XT1P7nMYYdtbBOI92EFqtBru8+/HQypT2i3Ca+xEpfPjnFnXFLZXLs1wWH76oIEBMZtyxwpjPtnKDXSMYxNLvqHKrQwNq4rUFhvUISY1D9xVNsLxRtQ1x2DZzJgS2V9+N9r; 4:KHAxIw049Xo8TPlDs9z+qGE2FxfYZRikOwzvnopdrMUXIkt4JIGXNXjewcKKp9P/Ht1ze4cyEWiZhHYABA8Z2Bsl8oJG8SHgXfPgBskjPm8kKwnUUL4YvbNDgJ5Hp067wkxmy0Rb2TNZcI6iTj546pag7AgAJUWdeYY0WGOkdMe9VzAAVgzWiNP2yZoCU9qHizgJSxHtU93/DRCDXUsUgnhL6i29GdRvigQU/joDJE7ZmFHFenAVHHrb4hJCFRAj90v49gjcAxuls/9SgI300abZXMxXNdZz0s13NZgsJLlMsITWJqP7JRkkcnhbNuLg 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)(93006095)(93001095)(10201501046)(3231101)(2400082)(944501161)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:CY1PR12MB0152; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0152; X-Forefront-PRVS: 0576145E86 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(39860400002)(366004)(39380400002)(346002)(396003)(376002)(199004)(189003)(50226002)(68736007)(8666007)(6916009)(7696005)(16526019)(1076002)(50466002)(6486002)(53416004)(7736002)(575784001)(305945005)(53936002)(8656006)(8936002)(8676002)(7416002)(86362001)(4326008)(81156014)(81166006)(52116002)(2950100002)(478600001)(23676004)(2351001)(66066001)(2906002)(54906003)(5660300001)(106356001)(2361001)(47776003)(105586002)(3846002)(59450400001)(6116002)(36756003)(386003)(316002)(39060400002)(26005)(97736004)(186003)(2870700001)(76176011)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0152; 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; CY1PR12MB0152; 23:NPJVCL2Uq39w+CybLtM3X3pDhUuu57bU0bexCzfXi?= =?us-ascii?Q?5HghB1rzCUoW4Or0FoEXltCouLnkaMQiSJ84E3qDN/DagRvCMghQ8LkqQCoM?= =?us-ascii?Q?E0vJ9Bb9k2puO6ZXZAE4pdOFoiEsurMuJ/Xip2VoDRAZwzG07wrPms26iWAg?= =?us-ascii?Q?Nm7NJ1/SmWdUSMnoTTs3HO4XxThi369EOFJ03xlA9eRoggTsEV6on4Y01ZDk?= =?us-ascii?Q?erec7M3c/m+EGnqASVGY1ZEZN1k30tLi/ERf2tz6gp6VKempGM6Z4lg4CoeN?= =?us-ascii?Q?N2v5/zlEqAkFuhL6VzFQefYbSuZTskkOKQUlVLkfA54gOVkyU3UBV76ucqoM?= =?us-ascii?Q?4ZAWJHc5ax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ticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0152; 20:7hD7eSRtQHcmXKzXUQIP8GecTTznowy603k3hqgo0x+rSfD2oAKwr6ivGrp5lTt+NRczv3UhZ54QiWRuH+E0fm01DkKaR1EJQECOM1EbJ8Gux5bEDMovWVnECq6W7Ts/6oS9WCpIj95KHPRs1/FPMB4clfUDlnJx/pDZ1/Rq5/rspM1vrHTK1FPgz0yBWkMvwGqcwakNzuBdccnVgRBFBQW3/CaA0g//PkUpPul/bTtSE982cIlvMHDyAXsxrZB/ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2018 16:07:34.2287 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4538a326-ae41-4eb2-9b36-08d56e44e6ca X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0152 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.49 Subject: [Qemu-devel] [PATCH v7 26/26] 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: "Edgar E. Iglesias" , Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcel Apfelbaum , Markus Armbruster , Peter Crosthwaite , Richard Henderson , "Dr. David Alan Gilbert" , Alistair Francis , Christian Borntraeger , Brijesh Singh , Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini , Thomas Lendacky , Borislav Petkov 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 | 30 ++++++++++++++++++++++++++++++ qmp.c | 14 ++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index 447ebb15266e..19331bff8883 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3236,3 +3236,33 @@ # ## { 'command': 'query-sev', 'returns': 'SevInfo' } + +## +# @SevLaunchMeasureInfo: +# +# SEV Guest Launch measurement information +# +# @data: the measurement value encoded in base64 +# +# Since: 2.12 +# +# Notes: If measurement is not available then a null measurement is returned. +## +{ '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 1a5cfad09dd0..5fb19b9d0db3 100644 --- a/qmp.c +++ b/qmp.c @@ -733,3 +733,17 @@ SevInfo *qmp_query_sev(Error **errp) return info; } + +SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) +{ + SevLaunchMeasureInfo *info = NULL; + + if (sev_enabled()) { + info = g_malloc0(sizeof(*info)); + info->data = sev_get_launch_measurement(); + } else { + error_setg(errp, "SEV is not enabled"); + } + + return info; +}