From patchwork Wed Feb 28 21:10:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10249837 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 B66A060211 for ; Wed, 28 Feb 2018 21:20:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2C0328D9B for ; Wed, 28 Feb 2018 21:20:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96F8B28DBD; Wed, 28 Feb 2018 21:20:36 +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 D266428D9B for ; Wed, 28 Feb 2018 21:20:35 +0000 (UTC) Received: from localhost ([::1]:47001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er99P-00015S-2h for patchwork-qemu-devel@patchwork.kernel.org; Wed, 28 Feb 2018 16:20:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er90W-0001Xj-Eq for qemu-devel@nongnu.org; Wed, 28 Feb 2018 16:11:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1er90S-00066p-KC for qemu-devel@nongnu.org; Wed, 28 Feb 2018 16:11:24 -0500 Received: from mail-dm3nam03on0060.outbound.protection.outlook.com ([104.47.41.60]:17929 helo=NAM03-DM3-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 1er90S-00064W-Bz for qemu-devel@nongnu.org; Wed, 28 Feb 2018 16:11:20 -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=WPk1pzjP91L3uKj7q/8B5wNuw8TR8XALl7kodr18GdY=; b=WlGgYQjyy1yfxwtu+i/Rf9teAShLhkTjwg21eO98TFHcgUfUK4jlIywvJY/eZNSAeVO0RPWVTbueFkKW313r+UBAtO1swX5PZQw+3WcSKZNX/leJxFRSQZO6GVXFneN7W/oq516WVX9k+1OU5tQDgftEULSSYZyCKg6MHk7nIIY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by DM2PR12MB0155.namprd12.prod.outlook.com (2a01:111:e400:50ce::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Wed, 28 Feb 2018 21:11:18 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Wed, 28 Feb 2018 15:10:26 -0600 Message-ID: <20180228211028.83970-27-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180228211028.83970-1-brijesh.singh@amd.com> References: <20180228211028.83970-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM5PR10CA0008.namprd10.prod.outlook.com (2603:10b6:4:2::18) To DM2PR12MB0155.namprd12.prod.outlook.com (2a01:111:e400:50ce::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 260588b7-625d-4c93-c9b8-08d57eefcfc5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM2PR12MB0155; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 3:us0WC+49441ovhsZoaNR7Fbh4tJ2/GrGEnuRcOKs865BM20y0DxlJ+6ynoL4CMxuole7skcUd5PVffsjvmRNw1QyiqMHWeCgJjRZB5KcvW9ovP89Y9qPWWrYVIeXnxhiNXCD5xnverazbFQ9flpSPDMtnhfJ6ZR1g+9j4SSSxjV2DrYjfwmJIzvWOOFd54tAfUK25ED08SaA1CkLkDVa+ompktku3GuqbMNf+qRZi78Y52IsFs/KETnH1y5IsJnx; 25:/6g5XS+lStVnNuR3KX7zWIBRynKgpmSWsGpV4NGkJgWu+jKSCaX67zrGiBEFJMkqfBLoQIb39M0A6fiJQqHO4G7HHBUnbJuou99q9b2TBDESL6Rqw186Ba904T/qCK4XrdyHWM1a8TyrlplWD9FilbMS2uLNAsog93T1PlCidW/+A3S58KJgtCqUaY1r3HN/S33yFweAv7N7fesYozX4KJBLVX7MPSrliF5owlgLHPGYhlbpp5dWHy3DYZ/PozS+Uv5l7KIQRYIgZ3bBkjbpEwkOvpxXqq3NGKZW2El7hJvStTz0yagRC1i/JaAsejVI2qYt6+GlFeRApIUtZRhBTA==; 31:HN7pOaGB/to9lVqfh+o9uhkyUDM5XRIQmMv9oIRYvfTHRp5XDRuVfVAvtelDBrkBLa65UCMZExM0arigvvGU3MZv0OWpZZvxTSVJmg+qBz0y4wbkoiIsds8UsR2+uZ9GkHHbeg8cVW5+nZ9Tz+hK+qzyVFzw9TSfhZg1u2b9tHsLE0mbouRhtSiNMBr1CPFVg4BbEwobOksQlfDJ+fV6yeeiXdMbU0cJ7y6SfVZGrIo= X-MS-TrafficTypeDiagnostic: DM2PR12MB0155: X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 20:U1YQihvpq1GLE5kiA9abZn1wlfAtn4wDu7ztbQKeW1XrOY9A3JYs2+xzUEMnrW1BfcnHeG7Bzi7lZOlu0lpD9obUWI6ECkAPm3xiGXVLlenjUXLKdRTsQCGB53vmUqciH7wt6P2UsPz0Fi7415+AOfg6q31FTPAwnUj0wSA3ESTl0Mur/KaIhFVSKJ4YxoLY1HJvsLW56++tzKpLHysPLWdAzLHAA1YmpSb57p/Vxbs84OZC57xtNw2Kd6TPp4TcwwPt88c73PnWkthLoM8kFeBzWTIi2wiobQKLCAVT6QLKw9z8sYAclzk1Og3IRb6OGKNxZmLO8Mn9F8MzIqEMifc34csVbgBzGss41QYKogRbvS6i8s9WC2sioffwLDhXr6N3lgpcXaBW5ENrMnazIBXx2KTFC8PbB2Xmyfj2dRhd3WO+fGMPykssUlPRWZ2QhWcATynloAahkNOYmKAsuPWhPR+Evc2q+rrSQOK/7Sj9gXMmZS0geo5j7NCp9FCS; 4:IHtBxT2vJ3L9YpLGCjKx7HILY64ZDH0LOR0ktHR/SIJpKJTVD3uqOIyxQQ8W/IK6kjFtNTcYppPYNm45hfjxvPeBcuTPyVX+kDANA6UVc8QNIZIJPS2uCewp28p26Nt6Hj/uRr6SckDXV1QVdZYVaKSl4afbR6EkNuNb7a3iAX1hyqDcHZpmyudKmwgBSHNGko1qHqKNg5EoPWpS35xguRGl3BW1Jk7NApXs4Z3BZdOUt7wOppk2CrIlfVm+enuCScjiBI/DrY8OyeXQEkRuWGzjGrL69cpst+PvLjiW3WqH01/SN3hqhsW/3e/VuVan 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)(8121501046)(5005006)(3231220)(944501219)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041288)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM2PR12MB0155; BCL:0; PCL:0; RULEID:; SRVR:DM2PR12MB0155; X-Forefront-PRVS: 0597911EE1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(39860400002)(39380400002)(396003)(346002)(366004)(376002)(189003)(199004)(6486002)(6116002)(1076002)(2351001)(36756003)(16526019)(54906003)(53416004)(26005)(53936002)(66066001)(186003)(47776003)(59450400001)(2361001)(478600001)(8666007)(316002)(81166006)(50226002)(8676002)(8936002)(386003)(106356001)(2870700001)(97736004)(5660300001)(2950100002)(6666003)(23676004)(305945005)(4326008)(76176011)(7736002)(39060400002)(8656006)(105586002)(68736007)(50466002)(575784001)(7696005)(25786009)(52116002)(3846002)(2906002)(86362001)(81156014)(7416002)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0155; 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; DM2PR12MB0155; 23:l4iWubs82e0QEvxpQ9xyohYBNELYYbaHNHL4evMMf?= =?us-ascii?Q?+dxve2qINPHdSJhAdDGNPSJ+pYRzBvxtvGrIxjlBrkrIwvDDGeQvRpUSU3va?= =?us-ascii?Q?YE+Z7++A7NSJS4OqGQXP+dmbbY+fhNCTDMx0jluEx1h0fxa3T8rh2zlUdaoa?= =?us-ascii?Q?qvqIsckZxZPl3rbB9vhUujRcugNSkqxPr+boOUXYYFlrRltYIBVpDClwsVNG?= =?us-ascii?Q?FfKiMSo21JWIYV0enE4OvQvOqi8hAN2R1kcIn79dsKZnMB2L2P1Xr4bTApEJ?= =?us-ascii?Q?pyzcNbUKLuu9vR7gqFy0gvvtK5SPSBpn5lkpI2KV2OuSPpZfWq86l9xGz4oB?= =?us-ascii?Q?TeXtmJr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DiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 20:xRaTINUTLrYbnFkvYn+DIHFY4ttKDTCFsy5ru6VYeHOyuhEzk4rMwfle/Cbj4Loh28upvXd9hhAyestVppJ3GVoox8GcaUwFFOzvBhMXD4q19Ve+nucM37CbYfXazOcuUXQW9yKh0hv2vTvrYzH3R/VPS15PrxigBsIdvqUaOsuvZorV1O48eKqfBhFwJnm84vr+pJhtzBEiJL0+vKpAV4L3jPXGZzLNm1dll6y/pCMKir3wMK8EO4LDwOQIXRi+ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2018 21:11:18.3110 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 260588b7-625d-4c93-c9b8-08d57eefcfc5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0155 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.41.60 Subject: [Qemu-devel] [PATCH v10 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-schema.json | 42 ++++++++++++++++++++++++++++++++++++++++++ target/i386/monitor.c | 5 +++++ 3 files changed, 54 insertions(+) diff --git a/monitor.c b/monitor.c index d0ebd5906d9d..26d86685a9f9 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"); @@ -4171,6 +4172,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-schema.json b/qapi-schema.json index facf2138df6b..9a50d9b8017e 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3279,3 +3279,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 supported on AMD +# X86 platform only. +# +# Returns: a list of 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 577d50eebaaa..1b55dd0fff88 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -737,3 +737,8 @@ SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp) return info; } + +SevCapability *qmp_query_sev_capabilities(Error **errp) +{ + return NULL; +}