From patchwork Tue Sep 13 14:48:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 9329343 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 F012C6077F for ; Tue, 13 Sep 2016 15:51:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0CB0290E1 for ; Tue, 13 Sep 2016 15:51:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D47E1290FE; Tue, 13 Sep 2016 15:51:10 +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=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 79123290FC for ; Tue, 13 Sep 2016 15:51:09 +0000 (UTC) Received: from localhost ([::1]:49761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpzI-0003DK-Hi for patchwork-qemu-devel@patchwork.kernel.org; Tue, 13 Sep 2016 11:51:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpXF-0004GY-FC for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:22:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjpXA-0001Zp-Lr for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:22:09 -0400 Received: from mail-bn3nam01on0051.outbound.protection.outlook.com ([104.47.33.51]:58328 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpXA-0001YS-FZ for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:22:04 -0400 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=VoaQRC/d9GApOm5fDAlhhKO47ISir01F3JXSoqcGFio=; b=bXqQoR8OWAO/UDc4O0+TfvClEINbGJb34jHxGmJzB/ZiXq6whccFiWdawgtZGVHhVAltORS0cxx1GCdTcSmh0nhAthW9fvOIeV9N5XgOdewGnTG+trTd/fObo2XvqVpe9XOllU4WioA97lEuIrlej38LpUVhqgj46IdRkTZFWiI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from [127.0.1.1] (165.204.77.1) by SN1PR12MB0672.namprd12.prod.outlook.com (10.163.208.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9; Tue, 13 Sep 2016 14:49:04 +0000 From: Brijesh Singh To: , , , , , , , , Date: Tue, 13 Sep 2016 10:48:59 -0400 Message-ID: <147377813927.11859.13242503366595564820.stgit@brijesh-build-machine> In-Reply-To: <147377800565.11859.4411044563640180545.stgit@brijesh-build-machine> References: <147377800565.11859.4411044563640180545.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY1PR08CA0040.namprd08.prod.outlook.com (10.163.94.178) To SN1PR12MB0672.namprd12.prod.outlook.com (10.163.208.30) X-MS-Office365-Filtering-Correlation-Id: 0e1d6f93-447d-421d-73ff-08d3dbe51bdf X-Microsoft-Exchange-Diagnostics: 1; SN1PR12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eTpdg0McrlXehWs1WXN+8E=; 20:9XDPNbzxa4XgeJFxCj73/apjfT2vbGD6TXk2uOwXeuwiPV9yWuzXgVKaaVr+PImxeY6y+0aXZx/huab7DEDBftEDYhacxIDkVhRyMoGXpqEUV3VirjRsHisNmZxDnFP3SkTno0PJOT8kLppdOqOHXjbt7f+y70cOhY0rjZ9Zm61e+TCYyA0qw/sOLszUP5hz3n6iVISCfuEltLZlO5zc+ywqPuyYWEkgDydw0uop6DP/FNKO8ML2+iu+2a1Elzm2s5RPmS1qM+Ief4LdW6dJTndre42jh2zxIVsWhEq3YhfEeb511Q0bCjhAhyV2384XCwSf9+l8aRsz5+3VWRP63mkNQsM2C9QGRDSo8hW3CgiloFLk5xSB7ZeAKweAFuWben6BfjiHXcQgGo+hjkW2jIZ1VgpG2IV/q0bCjbIKELtOIBIvPswpZGSx3xclyJhs/SZb3iceVWGysxybiMUXpcB45wcyBLnsukb8MzVoXn2nKaStQBv6sDI8L4zocYkx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:SN1PR12MB0672; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0672; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0672; 4:UlRWtzehfnRBYRQMfieHwg8KkZa0kLGbsqAO1ORCAYEBpon8Wf/JN5VCGBj2u0TK3c54RYTMLAzy4n8GnrtlB354ZtzvW4lV8gyEdIxyvGLqsjTFc/ig+OBJHrWp6G03fTA89SyIBvdGWFBEuZDiJJvNDYCZE5OFXdw1aGtIVmM9TnXtD9qohrdRnWJRSu0Lb0qRSQHm0WWfjGUF3dI6uPkRtOOsVtKDktqDGqHjJUXVJwgu1eQ/Gi9qynhNupYZfpNmrOqPwoZtIkENsO8NKttoHeNFrE79HxGbc0JFeobDEC0MlK+JhD15UnRgcn1AnoRvJWtBolc/sIVriMXCC83yR88TrIfxlYs0tqKlJuhQRyp7A3xNZ8r113d2zkiYQXlcva8zEf1Emxl1PbDKAJEExKfqbhLQK3dip8quNyDi8y/KXV2Xy4yRKOMkJiQD X-Forefront-PRVS: 0064B3273C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(199003)(189002)(2906002)(189998001)(81156014)(19580395003)(8676002)(101416001)(33716001)(50986999)(81166006)(76176999)(54356999)(2950100001)(42186005)(19580405001)(33646002)(83506001)(92566002)(7846002)(2201001)(3846002)(6116002)(77096005)(305945005)(68736007)(9686002)(86362001)(229853001)(586003)(230700001)(66066001)(5660300001)(4001350100001)(106356001)(97736004)(5001770100001)(107886002)(103116003)(7736002)(105586002)(15650500001)(50466002)(47776003)(23676002)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0672; H:[127.0.1.1]; 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: =?utf-8?B?MTtTTjFQUjEyTUIwNjcyOzIzOkd4MldaOVpxbTlnR0Z2UVZ4NS93ZFpoRnNn?= =?utf-8?B?RVhEZmY1OFE2alRPc1J6Q1JPT3p3bVMrOXNTbzZiUjBCZ1V4THhUaSswaHFL?= =?utf-8?B?c1R5ZjdPWHNMdjNBNGlnS3FvT2RsaG8yVkZWa3U5Sk9jeXZFaGFRUUFIM3Js?= =?utf-8?B?cEpxTU5UVFRUbzM0VFN5cWhTWUlieHpiZVFqR3diaGdWOFAwZ2hER3Z4VkNs?= =?utf-8?B?L0MzanJzdmxMUWxJMk1MaUJKc1VGWUVqa2VHeSs1REgzaG51cFN2OCt2cUo2?= =?utf-8?B?emZjd1dxK29aakdCcmYxTStZRStaRW1OQWphYWhzelhIOTRDNnc1Q0V2cnFC?= =?utf-8?B?MHNyQkk0aUJKMURwNldIMCtZTWI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49ovmLuSBPvmm6BA2ycezN2a6mNNqVW8YCTWya67iKJ/nfYjaw6ytrgHD3fVqSCaRoC4wdn3e3K2oG2snKPM1gzO8EA=; 7:Hov0pVTCfoov6qIMy+cV5Vm+/B+HH99FB8yn8ZD4DBbkwW45wLJEZlHhyROywoiISdtUEgRZHn167h5YWyGvwn6hmHJOybt9Qu8cOB1E19+Uex2y8vV4FjW0dnTXdJelWPCqSp/d1pADu+Yf8zkV2wAn1IWLrTZ4cAL3QJI+AqyBx2mBUGeBhavzplPchUYwjtnBjR2E+YC22d+lDKDayQTYoB6EtEVQeFapU6iteO6WuCchkRSbp/ORbwv5eq1G SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0672; 20:bkOtlP+hfIJ77AN+uRfbJW4mnTQ+1WPoiveQW54zjokKCOdXRCmrHPzQFCmQqg+sq/zD1vtB/cobMBSYJqRpayAwRzWpyMMIcgDM7xLtp1KazV/7ziFauwek9T0Tu4+ebz5Vp4iACvJb4ELZjdHMiIm+j5Yylrhw2UsP0P3EyHR/icRW2br0TM/P7T/zMtTtcC/+qtgCQ/K3HKf9qXYif5phtE8hXCyfWCG6JPMezeae7S33VuJUwWHY8PnSsJvU X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2016 14:49:04.5099 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0672 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.51 X-Mailman-Approved-At: Tue, 13 Sep 2016 11:45:47 -0400 Subject: [Qemu-devel] [RFC PATCH v1 13/22] hmp: update 'info kvm' to display SEV status 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: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Update the 'info kvm' monitor command to display the SEV status. (qemu) info kvm kvm support: enabled sev support: enabled (running) Signed-off-by: Brijesh Singh --- hmp.c | 14 ++++++++++++++ qapi-schema.json | 4 +++- qmp.c | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/hmp.c b/hmp.c index cc2056e..068b77d 100644 --- a/hmp.c +++ b/hmp.c @@ -18,6 +18,7 @@ #include "net/net.h" #include "net/eth.h" #include "sysemu/char.h" +#include "sysemu/sev.h" #include "sysemu/block-backend.h" #include "qemu/option.h" #include "qemu/timer.h" @@ -76,11 +77,24 @@ void hmp_info_version(Monitor *mon, const QDict *qdict) void hmp_info_kvm(Monitor *mon, const QDict *qdict) { KvmInfo *info; + SevState state; + char msg[80] = {0}; info = qmp_query_kvm(NULL); monitor_printf(mon, "kvm support: "); if (info->present) { monitor_printf(mon, "%s\n", info->enabled ? "enabled" : "disabled"); + monitor_printf(mon, "sev support: %s", + info->sev ? "enabled" : "disabled"); + if (info->sev) { + if (kvm_sev_get_status(&state, msg)) { + monitor_printf(mon, " (error)\n"); + } else { + monitor_printf(mon, " (%s)\n", msg); + } + } else { + monitor_printf(mon, "\n"); + } } else { monitor_printf(mon, "not compiled\n"); } diff --git a/qapi-schema.json b/qapi-schema.json index 5658723..86b5dc9 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -99,9 +99,11 @@ # # @present: true if KVM acceleration is built into this executable # +# @sev: true if SEV is active +# # Since: 0.14.0 ## -{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} } +{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool', 'sev' : 'bool'} } ## # @query-kvm: diff --git a/qmp.c b/qmp.c index b6d531e..834edb8 100644 --- a/qmp.c +++ b/qmp.c @@ -77,6 +77,7 @@ KvmInfo *qmp_query_kvm(Error **errp) info->enabled = kvm_enabled(); info->present = kvm_available(); + info->sev = kvm_sev_enabled(); return info; }