From patchwork Thu Mar 8 12:48:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10268037 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 D6C3060211 for ; Thu, 8 Mar 2018 13:07:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C878729918 for ; Thu, 8 Mar 2018 13:07:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3500C2999D; Thu, 8 Mar 2018 13:07:28 +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 6766329955 for ; Thu, 8 Mar 2018 13:07:22 +0000 (UTC) Received: from localhost ([::1]:38551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etvGT-0002kF-5e for patchwork-qemu-devel@patchwork.kernel.org; Thu, 08 Mar 2018 08:07:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etv0H-0005p2-Di for qemu-devel@nongnu.org; Thu, 08 Mar 2018 07:50:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etv0D-0004OH-7L for qemu-devel@nongnu.org; Thu, 08 Mar 2018 07:50:37 -0500 Received: from mail-co1nam03on0078.outbound.protection.outlook.com ([104.47.40.78]:19744 helo=NAM03-CO1-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 1etv0C-0004NT-SD for qemu-devel@nongnu.org; Thu, 08 Mar 2018 07:50:33 -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=uojUHmEoA+vB/tC+x5pnlAqaU0yESclMPh122/hYrA4=; b=2FR7Gj7RFNzTVd4MxHwlg8akp0ibEy4I/kpcyeFU8uO2+PvsB+6eMzaI3Nk+JIPBSZC5FlygM+oXyEOogNAhIuPUrVSPRYSgVJLO27t3akokekQ7W/mGw3AFEKwT3z8/HC3/1pU9INIR4wK3iZN2xrMxdPB2oIAVwqNn8ELlGH0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by DM2PR12MB0156.namprd12.prod.outlook.com (2a01:111:e400:50ce::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Thu, 8 Mar 2018 12:50:27 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Thu, 8 Mar 2018 06:48:59 -0600 Message-ID: <20180308124901.83533-27-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180308124901.83533-1-brijesh.singh@amd.com> References: <20180308124901.83533-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR14CA0031.namprd14.prod.outlook.com (2603:10b6:404:13f::17) To DM2PR12MB0156.namprd12.prod.outlook.com (2a01:111:e400:50ce::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1a387fa1-6899-4ad1-c783-08d584f32c03 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DM2PR12MB0156; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0156; 3:77ZJpCxFN3zJhvDJF3pQTInkGIBlzVa2llBQrcDBJKwpkD4eMhjVlVX8cB7Q1h1XkRrLHwCKgd0EmBz6w1mTFXzd70cW88Inzqm1EyOGrpHOAegEpBV45/tdl4yFi/qAdMcuzgk2h6bGBvo/ZOuE95ZRpZ+JzCiUeFgq1uHxuroG8nZv/mpAFDFRywHxUYgSGQzxh8c9BrLeS+ykAp+Br9kSCYt1EKtZBg+iB6X1ecnBQv6+arE6kBwIoiIXecDH; 25:FLy/99w5IJtAPzzVaWzsmE2R76kBMyY7G42zv4mpgHglc1kUBzzUpxdRbHPwkcv3DMYkC6RYXGH3icSFSaQ9d9swfVCzHkKYjcEda5fwxXyTu5aRRY/Q+chRmpvSIUdDUgmpFEbgmD+QySlwH3yjl2ZmcVLwp5vL8gzbmVEi/9nnPEZj6jlYSAoiHZokHTeqBaOm5JmsGUT55xY4akUmVPqln0YLUBzF3Gv3exbL1MADr4F6a9ZTqcQljDhPPurV3gnVT2Wzg8ChbqISxYBuPQ1lxnpCMHYCc+NeajIyGvofyYoiTS+tlkO30/t8kFh8PX6eCaZwU0nKeS9JtXYb1g==; 31:W949GAiIG1o+8cSz1MeAkn/Z0lCr/J4jnivJ7Lbv8jQVRhu86f9NeJrEeagT/4XDbrSv93HIaYniUqYKROFx+mKndDyPC/Cof8NxwQ4CmKIKJbK9+Zfb+1/QRXN+gOqsMcYXFx7WAHDZ7Rc28dKs86/OCNqaZJDQqPPvAm3LMafS2hOEL4+/X65ch1Et1CxAGirDKXUQhmV8v1e5rSF2G029KtXB8vbeTT0+xWWkPsU= X-MS-TrafficTypeDiagnostic: DM2PR12MB0156: X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0156; 20:myAQsU6ZK4/AWqSyhSes58EtHQxqj7uJkUjhR2ipadigHuVmVWg8EvoiugXnNmzuOVheKQTCkZ8QUzcvwHuKAw8Na6mCH8NdtY4Jyn2ZL82Pqay42azbJwa/TrQ/nQpmDYPq2SLr5D7KzckcEfE/5pcHdgFShjZbe+nGqZAnu87WWxfPuqLdibsxYCbL08Jpl+xyZJJFPb3mYlJ8+uYwa+qJ1GoKKt2Wpa5K/muKq0iSpJcSuQBXkJsJUQmRoESRXDCjjcz/4e3NktqFKCELqmp7iX6v+fRq5mvrLBvoPd4hvmbkZqFZyxavgR4gLCzwujheQiz7VbgfB7/AhBtiuv56QzuE7fR+5tq+QbE8jyC3oPzy0YVKrXqFXZlOIqoocET1UJMCaSo6rWEbDNzU4tw7tupjdWn6zohS5QgUMK4E/fc//+mWM22R6zHSJ9BlLj0lSczeRJPt0P2S0pZMUab85oq85UYuQKsc8hgRUVf86AZ5lZPxkRp0crTye2VE; 4:ir7wBXNaR2fsHZhmnZUt2IZJbZ8yQhuayZSeF5ZF2gw8V6VTGZu8y1/Mraei8uDIFe5j+kchn9OQprek4Qv8uzLBDQfFsKq5fHw1JVc3Sz2sRBQYaTd91Ym80LGzvedA8j2LzSSoCFRx2F6vgiJV+OE5IN0aLcBdLJxiJehh/3vCWHHb48II1Tb5sn8vPxEEpwEfs6kpXkNx7vDBVOrZ091dUIDhUi0rF56o/6qRdLRXZKCycho6WpchDu6nWtEzFL6R6Yp0fklttld8ZW13hPIFXxNNRm6SAIIFRru/pWNLNcFn06Ilowi28DbAUIf6 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)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:DM2PR12MB0156; BCL:0; PCL:0; RULEID:; SRVR:DM2PR12MB0156; X-Forefront-PRVS: 060503E79B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(39380400002)(39860400002)(376002)(396003)(346002)(366004)(199004)(189003)(50226002)(53936002)(2950100002)(6916009)(2906002)(2361001)(6666003)(2351001)(106356001)(81156014)(2870700001)(53416004)(8676002)(81166006)(7736002)(36756003)(305945005)(8936002)(105586002)(50466002)(68736007)(97736004)(47776003)(66066001)(25786009)(4326008)(39060400002)(6486002)(7416002)(5660300001)(3846002)(478600001)(76176011)(7696005)(52116002)(6116002)(16526019)(186003)(26005)(1076002)(8656006)(386003)(23676004)(54906003)(86362001)(575784001)(316002)(59450400001)(8666007); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0156; 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; DM2PR12MB0156; 23:TmyfYTJGtqhjmXXCbPGZs7W/KQ+oTZrnjzCIEyDTm?= =?us-ascii?Q?ReyhYuhjsqFhl2DB+7ecZVHF/z/L/O2VGsHEvMyplIqiz/yr96L1icDVCI70?= =?us-ascii?Q?qvl9VzsiWhI5j0mHq7Zjc2gQCUfJIkDL6WnBtR6eFSkQQCFgWEB7jkkmsPRK?= =?us-ascii?Q?9G0RCfycAg7caejbowf8HRYP0Hj+1rw+tL1GIgsVpUX55N+bCjREiNEW8Kwl?= =?us-ascii?Q?wQ6M9IFE/iuDdTMzdRid1aCns4JYxH2MQeta3aSbsyU8Esig983tP/w9N0ff?= =?us-ascii?Q?B3CPoXBMMxXGpf/w273INuTVB5OXG9wdlulGWgDJUKAgpMBpI0Aha5D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xtZz7wBGeVIVJyzCWmMol9TbuO9yRtqKYk2S8uSkDHywL92Im0ndIotRmMLbiH1x06iRZQLG8ZFFl5x3BxxT8NkndEguy4JuLXkrk2DECYnEDk+F3qmQOTf9Bc7nHNezMZQk92ZonikkTkjRHaBQxNEVhfx8rYzAq0k0gJBS63T+I80J3OIBkujidhgXzh9pc+TFHTpA9XoOBSe6fGbUrU1tjbhPvdgk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0156; 20:7MoA9W91TT7PIEEb28KZq51r182C+lJDX8xWCOPo7Pio6pd2rHjDyRCQ4CIVXDK5gBf4qpHbmcKP+PVVwlPt0UZD47OKHo863V8h3vAQNJu3XrIbkYNPNfDHM1XFmaTf1GGSg6orKHNj+PjNRia+URN34Ll4p9NpllzsPFZtLtc4PsU60SqOP/FRzo1x3iIRZ36PjEzr6XXHVxziwklmtPuvVUgDWs7sIZgl1ViY9v/QNa6Po+96dLt8ueiOc1CM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2018 12:50:27.3470 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1a387fa1-6899-4ad1-c783-08d584f32c03 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0156 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.40.78 Subject: [Qemu-devel] [PATCH v12 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 a39c43aa64b1..37c89663d8f4 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -3306,3 +3306,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; +}