From patchwork Wed Mar 7 16:50:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10264541 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 88BF1602C8 for ; Wed, 7 Mar 2018 17:09:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72A132958A for ; Wed, 7 Mar 2018 17:09:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6414A29595; Wed, 7 Mar 2018 17:09:52 +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 C696A2958A for ; Wed, 7 Mar 2018 17:09:51 +0000 (UTC) Received: from localhost ([::1]:34449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etcZa-0006ZI-SU for patchwork-qemu-devel@patchwork.kernel.org; Wed, 07 Mar 2018 12:09:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etcHv-0004zj-Jo for qemu-devel@nongnu.org; Wed, 07 Mar 2018 11:51:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etcHr-0008TD-EQ for qemu-devel@nongnu.org; Wed, 07 Mar 2018 11:51:35 -0500 Received: from mail-bl2nam02on0075.outbound.protection.outlook.com ([104.47.38.75]:34921 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 1etcHr-0008Sq-8Y for qemu-devel@nongnu.org; Wed, 07 Mar 2018 11:51:31 -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=pdwkxGJlPS56riz2/0SNY+qlxg8xA2QITbuDTyXg8p0=; b=x3zYILUyCnNgeWsBujcgwXHET2WWut3aUoAz8sh98Ncxq4mNj06InyzQ2k9v0b/t8ltYsIxvk9+DFwndNJwhc0g8iUQE1y/1hGQaM1CUrbXIyuT4vpti5grD7HMzsrpkZPCPrzhWv+jbKytkKMRYEJg8vzHKFEbnu/lu5E0KMfc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by SN1PR12MB0158.namprd12.prod.outlook.com (2a01:111:e400:5144::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Wed, 7 Mar 2018 16:51:26 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Wed, 7 Mar 2018 10:50:36 -0600 Message-ID: <20180307165038.88640-27-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180307165038.88640-1-brijesh.singh@amd.com> References: <20180307165038.88640-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: SN4PR0501CA0095.namprd05.prod.outlook.com (2603:10b6:803:22::33) To SN1PR12MB0158.namprd12.prod.outlook.com (2a01:111:e400:5144::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 62ae81f8-76c4-4b8e-5d4e-08d5844baba5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 3:22LQWahOmv0BSd/98hxoKaEb+IVZ4u1LqkpQMjRRp/EtFH8fSaBob4B/7bH6KEu7+EO5EL6q9LEbnJA2735F2rzoYL43dckQhDdtTHZ42s5qJ3r4mTd0JMwt0YmzK/ck0huXDykYlQVLtbvdQ2Ph11ceoZQXnlN2jq8RLAz0nPGHcwDSi4O1xmkk/XuipaQMCmBgO3vXxVfOSCdYo5NZwBVjR4SWNf87XRguu09j69xIr3iB+dS0jxY6JV65np9N; 25:NYyp3xL8lZwMHKt1n4vCJ6Y+14iqMn6NACanKlECh5uwEBBUEHljaWw7mExrpiXr7tyJliul/cISjCXaHEGFp7ZwadUh8HGN4D4c/RDRJbLOAIUjLjbkcqTXZq+3TOYW2n15RQ5MEzHwm5K+W45HzBU7bQIP4aD/dKhV40At/FUWlc8yluo9Rhm2kLlnXZ29zvvo7sBxw1BiGE9MszKmLxrKVa9qF1b/uL5tVnFJpNp1NyiBcOSWNplvL/jjD9DjGNARybXRe92fFVikR3+uGeDEwB5z7Mm77oC2iA/F63UmCcxDxiMADQHZErRUavcpx3pVX/JhzLPeBbL1eJYiAA==; 31:WVOSnj9na9L1Rj8Oky+bnuKGzX+Dw9qR2hOOjG2h37hj+yZo9VqiHHFAW3INRHj3TincJufIoWHSBpSNk8VaVN+7boUCrOLdVOfLaF+1EzYlOsF82NzVj69ZYKp5EJ0WxzfFdAxSEMIsFySyuS+6AzsDdhDS4bjV6JQcIU8MVPyireV+185y6asiScpYb/OFGjLZisk8isAPcREAbEO50GPeoTNWPny3ucY9Cqx89fw= X-MS-TrafficTypeDiagnostic: SN1PR12MB0158: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 20:nIiVdHhTETdbzbV5kJt7lMKVg0jPBiWoD7OMVpuju7/TC7fMlF+wpj+otIu2Keoywbmk/5Ysynj71brogxSIw8OJhy2lwpTKfpu/P4acm4k40Og8oXAwqf9jdFxw8cfPU6F++DRzYsD/1r4wQ0tuSGDjXEZ3ghtVVXS/nc3QDFfbhOaA8tLRjAPtMT9SvFvIOl+p+H2pCHG/LBun0b3sh+30Rbdjcns7XPthjlCFiPvgAkAdJBldaVxqC34ch/pcPbdbUYTOOMb02Q8aIMawrvlLvwj6ud02na5ubAe+LSQ6r2nwSdECqsshIoWyR+Q14pTiJnmZs2nsN2XN4W0WoRhqQN/rtG0Je3A/aVyeyyKZlVzwMKzNoM6Bvg3mCgJIYQu3GNdV/kxjIXHWoRTLvPQb7DNHa6i8EJA+MBxnznelXCbFTQ55GG++1ScQPif0XFcIPjLKxsxsePOpJ0uIypK/uGF8W+/sX8WcXzmiiLHh/DuIPHsfRaHc0KucGlHV; 4:+MZmSBvEnj12cz7WcJpySKUqrFCD0dKHGVxZJkw5VKXMmHzRRh0kn6L/CjiSzeMB0TJWSbu3trNS3ERPKSVdjW2jLEOfrlbRasLu4Mx/Rcet2qG0Kk2Et3Dr7kxAyF/HBCKXPwOLefCCxikN94bQhs6a32r+n8iOVrHDuzG/52+yBTu5AaXiiHkAbHBgSDDmq52fd8FEnkNyk+isYso+1JnAxUxeLgLxOB6BPfmUdKSiO1OpVHCh4CDvcb3a6AH0vBpR8VMT1rJmnbBwwkqRdnoHqlArIeXKbB0GNGD+GI6xODnzvufDyxsmy10rpxfy X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(3002001)(6055026)(6041288)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0158; X-Forefront-PRVS: 0604AFA86B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(39380400002)(39860400002)(376002)(346002)(396003)(366004)(189003)(199004)(53936002)(8666007)(2950100002)(6486002)(6666003)(6916009)(53416004)(3846002)(1076002)(6116002)(4326008)(54906003)(8656006)(2906002)(2870700001)(25786009)(59450400001)(386003)(68736007)(478600001)(50466002)(105586002)(2361001)(2351001)(575784001)(86362001)(66066001)(106356001)(47776003)(186003)(16526019)(76176011)(52116002)(23676004)(7696005)(26005)(316002)(50226002)(8936002)(8676002)(81156014)(81166006)(36756003)(7416002)(97736004)(305945005)(7736002)(39060400002)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; 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; SN1PR12MB0158; 23:iXBR6aYoRFxwMmblvtjV2LSY3TPmcVofhGxuekVqn?= =?us-ascii?Q?MBxw5R5jv7e+Bw+52MW0DR3ic/gugkXwVrqIpl390ipQTxo2XhxyxLUTT99G?= =?us-ascii?Q?N8mHYogVTZVtVF4N7TmrOud2WNqxwbd0eEHtIWwmR+Y4zzW4clG8aqlZbIKb?= =?us-ascii?Q?C939k/1eAErNZHcyuLPIWJaCAx/vv04Twl1kVUwmjd66JofQA3V8jyTvtT87?= =?us-ascii?Q?tBQwuLXUM4gVqjW+Lt5w5UTsqJNBd/A2VBpfLlMP/3YAx5L813PCqVWEtJBF?= =?us-ascii?Q?W6tTIbkCqk7fHXJxUJBiHPla0c69NIm2Ij+ASk03Sdmblj8UPDXdE6pcUEGq?= =?us-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8FAMe9Ml7gnTIfyipYjPPeDWhPtmIgxHSt1E+BO7iIu9R2gl3QxyKo877MkKBDG1Lr6fyl4Vwow0TjOXmner6kol1IMv58Zns+BKvR2E+uXNF9wy7LURbhQFhYM4gar5foek3/cpThzK7d1OFrR1+eEb6xJpk9RVlKLrF/kmBflxY/PGYtUePG+FHXzQhkVhCg0Upu5b9BFwoISoTG6u9yFawQsB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 20:bNgT3dT5aYWIp+2KdYTaqB8zL4VEav6Pr4Nu6gGd42D6+jYEHDDRt3GQuykcFgs4SqXKB4d4RbEGQhjTP+xHS22Hbm7nrOX6wVCmOJ4+IonztaCjBUEW3U3YJZIp7AwMeRjx0OV0qrWQ2VsQXyx2ZJsRiQECkTH0QA0VGcuD76clw16SKJ1ET8hCXyCHF+RpHn8bMcft3ZKtGX0YBK8DQbUqBUbbFdf+3K3Rjq3b8kizzr8WWsstArR6iMldUmwM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2018 16:51:26.7760 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62ae81f8-76c4-4b8e-5d4e-08d5844baba5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.75 Subject: [Qemu-devel] [PATCH v11 26/28] qmp: add query-sev-capabilities 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 query the SEV capabilities. Cc: "Daniel P. Berrangé" Cc: "Dr. David Alan Gilbert" Cc: Markus Armbruster Signed-off-by: Brijesh Singh --- monitor.c | 7 +++++++ qapi/misc.json | 42 ++++++++++++++++++++++++++++++++++++++++++ target/i386/monitor.c | 6 ++++++ 3 files changed, 55 insertions(+) diff --git a/monitor.c b/monitor.c index d53ecc5ddab3..29ce695a80d5 100644 --- a/monitor.c +++ b/monitor.c @@ -985,6 +985,7 @@ static void qmp_unregister_commands_hack(void) qmp_unregister_command(&qmp_commands, "rtc-reset-reinjection"); qmp_unregister_command(&qmp_commands, "query-sev"); qmp_unregister_command(&qmp_commands, "query-sev-launch-measure"); + qmp_unregister_command(&qmp_commands, "query-sev-capabilities"); #endif #ifndef TARGET_S390X qmp_unregister_command(&qmp_commands, "dump-skeys"); @@ -4117,6 +4118,12 @@ SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) error_setg(errp, QERR_FEATURE_DISABLED, "query-sev-launch-measure"); return NULL; } + +SevCapability *qmp_query_sev_capabilities(Error **errp) +{ + error_setg(errp, QERR_FEATURE_DISABLED, "query-sev-capabilities"); + return NULL; +} #endif #ifndef TARGET_S390X diff --git a/qapi/misc.json b/qapi/misc.json index 66c8229ec406..f34848831a4b 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -3304,3 +3304,45 @@ # ## { 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo' } + +## +# @SevCapability: +# +# The struct describes capability for a Secure Encrypted Virtualization +# feature. +# +# @pdh: Platform Diffie-Hellman key +# +# @cert-chain: PDH certificate chain +# +# @cbitpos: C-bit location in page table entry +# +# @reduced-phys-bits: Number of physical Address bit reduction when SEV is +# enabled +# +# Since: 2.12 +## +{ 'struct': 'SevCapability', + 'data': { 'pdh': 'str', + 'cert-chain': 'str', + 'cbitpos': 'int', + 'reduced-phys-bits': 'int'} } + +## +# @query-sev-capabilities: +# +# This command is used to get the SEV capabilities, and is supported on AMD +# X86 platforms only. +# +# Returns: SevCapability objects. +# +# Since: 2.12 +# +# Example: +# +# -> { "execute": "query-sev-capabilities" } +# <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE", +# "cbitpos": 47, "reduced-phys-bits": 5}} +# +## +{ 'command': 'query-sev-capabilities', 'returns': 'SevCapability' } diff --git a/target/i386/monitor.c b/target/i386/monitor.c index e5596bbc0fc2..33e6bade693b 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -737,3 +737,9 @@ SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) return info; } + +SevCapability *qmp_query_sev_capabilities(Error **errp) +{ + error_setg(errp, "SEV feature is not available"); + return NULL; +}