From patchwork Thu Feb 15 15:39:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10222113 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 CEDE3602CB for ; Thu, 15 Feb 2018 15:54:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B736729340 for ; Thu, 15 Feb 2018 15:54:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB4A829431; Thu, 15 Feb 2018 15:54:32 +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 D026B29340 for ; Thu, 15 Feb 2018 15:54:31 +0000 (UTC) Received: from localhost ([::1]:60806 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emLri-0002V2-Q0 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Feb 2018 10:54:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emLeY-0004Nt-Tv for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:40:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emLeV-0003YP-0D for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:40:54 -0500 Received: from mail-cys01nam02on0087.outbound.protection.outlook.com ([104.47.37.87]:60687 helo=NAM02-CY1-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 1emLeU-0003YB-O8 for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:40:50 -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=FBBL8mdaoqWTAvr+ee58wGAI6Yzlh78CiW4fvigmt14=; b=yR6+6YJhpwvBGizUvZecbT5InDZzwkP0eFt88kBgwR1nw+6P3VdUeAIjRV+uZAhULlJCHILcjtUhjxzDqyZYVX+CHpwp0fGoxop3plBAe6528edBWbC+CTUlpCCTtOXMPLfGRdOGgB2CoveI6KKUkoEvsy7Ea/AbGZGDco1s8EI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by SN1PR12MB0157.namprd12.prod.outlook.com (10.162.3.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.506.18; Thu, 15 Feb 2018 15:40:45 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Thu, 15 Feb 2018 09:39:40 -0600 Message-ID: <20180215153955.3253-15-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180215153955.3253-1-brijesh.singh@amd.com> References: <20180215153955.3253-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: CY4PR04CA0044.namprd04.prod.outlook.com (10.172.133.30) To SN1PR12MB0157.namprd12.prod.outlook.com (10.162.3.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0107a449-94ec-40b3-710c-08d5748a7be0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:SN1PR12MB0157; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 3:zIyEZGP37scEo47Ub8lZ7FWr6RnQmQ1CBzgSIQROZtny4jBu6znjdSn5iyervR1yu6A+qiZG4m99V5lArNpkiHXvwIwlY/u2LaFbmV6PbVuHrgkbQSQGM6hkNa8toFlG3W+xh31Rl1RZJoYx8bwcAWEp7Do6YIbx4GlUDOezHi6zkOgEYBJKqhK2DkUTFlBAgu4GDFbeGlqxFrieBDRVV4R7nR/b2ZolMe9wbqT6QWaJnS0Mna6S8oGPz74X1ANM; 25:oxY7CoEh5B2YdNRN6Ho81PIORh+LQnPYM0FRkVtduYvweIr181c7fSGEnSRewelxIp+P7YUlpMpU+kATbXcNOn45V06qTTMuEYlfjPDWd+vMzHyjhV/OpW4M2i4hLOLWzSjMOfVlZ6GiuBjE5vfrfISNQQLpsQ1gkKPjJVrG2DPEO5sOJ3VgRPEVWnKmlpim14RCBxmt0O9V1SuhpZ/2/6mjgK8aaS83cLNbuUWIre/ssEdcHjZIAbxxJbHqNedaHMJAo+o7np4d+nDfo5NEvVaw6d3bregeqk0G7TBd9tojSa3TB4OiDhMjONcPAxxyzNhNex+etvqcAcBsKfSCxw==; 31:IbTJAax8QsGvZYhlY8QP+OGLMYTY9YT+be6kmznL20u6AlimWPs+Hki4WLn6Rr4X5H8/dJBtP83VpQjC5GGXMetocZFu+g1ZUSKNwaaZ2FYCV+u++zvHqY+QtQnd0sYQGF7+TJRoy3PFmA55oyHxy/C1l6LlbOLiC5eQqsiG8oQnaEFSHHJ5zuOK0rO6lOKOsZoBxptzTrn5UqXWhjwEdpIGJrYn4PDZDITUMpu1e08= X-MS-TrafficTypeDiagnostic: SN1PR12MB0157: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 20:5fTS8T30hSFVeqDELoGSzSz2SY8SSOPTYmRH+BJdAU/cu4ALkpImcBMantZ5HYwUj6BtLD9B8thfS63aV18PW/UeqNwpXiJW0dZPjQ/+A08mhyg0OcDgrY91WbLpo0eHxzlmQXyD28gx9O3PixoHszp436qd9FoH2Bei5Y6azTa+j5O//ckSj7BucstdJeof5XB2S+FJfkZbiow/mVW5Y6cREAHtl+MkZkp1YzbqiGti4PYhmdTXB0wPKla0XJEjW/8PnMwf7bL3wZetbetD+dJklo7tyzEhtlt4kIgL7broyYWPkdcKhbv5cOHpqsdlMNfGMxPNc/Gdi7QzVeSvMLSZzVhJLbPkRilYsRYImEL/6D5AY+0NU+GuNMCCzvEOEpfjaKyxbN3c0BETpxy2ul8s1D8S1UvJh0WmxSOU8+jNp386+OPWSD95INsmk5079rNuFZ37fW1zOuco4s4THGUkkEKr+gudzfmp2q2jIUPXaaPCkNDOsuMXAQMj7G54; 4:hPUXZMMDAgOgcCu+po2inUQ0bLAW3XEMue9qlT3qgUXePe+gomGVClAtnyGmEY016YWPjRrtiTV2HREo273mHs2HfUeQsD4Hi0OZYXHrilZuc3MuCPCKisQMmPIXyA2DuAumt/DjqirmgPFk4CFQXUW9qfwc6D/FgBt4YH/nKIX8DkNuNTPUPljfQxAq3BsZVMds7jTz439uyVTOQRJYOyNxLVTuEYcfWybeWdGKN4f6jBqwfOABtnKwKogYBm9OCqhhrVbxRPsr87p7l9btpIr1im0H0LV3zOeKRS1F8E9+D/ghqKzjCmH5Yghsxe6D 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)(10201501046)(93006095)(93001095)(3231101)(944501161)(6055026)(6041288)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:SN1PR12MB0157; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0157; X-Forefront-PRVS: 058441C12A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(376002)(39380400002)(346002)(396003)(39860400002)(366004)(189003)(199004)(26005)(3846002)(386003)(8936002)(5660300001)(186003)(16526019)(316002)(6666003)(8666007)(1076002)(54906003)(6116002)(50466002)(7416002)(478600001)(59450400001)(8676002)(68736007)(86362001)(2906002)(50226002)(2870700001)(39060400002)(2351001)(6916009)(7736002)(106356001)(23676004)(8656006)(52116002)(25786009)(4326008)(97736004)(2950100002)(6486002)(2361001)(36756003)(76176011)(81166006)(53416004)(66066001)(53936002)(81156014)(47776003)(305945005)(105586002)(7696005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0157; 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; SN1PR12MB0157; 23:TtX4EWDaTaV36oPsGeniu3efQ0WKoCsi0huA+2tKA?= =?us-ascii?Q?6P62MGja18D2eqzQXqCYw+0WeMhkMn0I2drGLkzLS7BoEezuMvcmcA0aT+mV?= =?us-ascii?Q?2CvpFxAumAZgAtU8miuk/dAqApnvbQtPxtD8CHL7Hhv8rHkM73FUFLQSdatO?= =?us-ascii?Q?Rlz22ykb2fiZFk9+Xvn+Uqc2Zj2r32EBX9gHuxSleByVe5XXp40GcIyd5L+Q?= =?us-ascii?Q?/RjmffzbrK6tlpJfD7lXdYsVH+G4ts9tIkjjCXGq6eeZH396KPOPT9oIP/fk?= =?us-ascii?Q?kPkkRoVGoojmKuc5g3Ams/KUFkNXJ3PhTidZxfMO4KdPAMObtf++sJHGLkRe?= =?us-ascii?Q?bKWBvFf6GiPcOsn+p9a0fV2agi3HsVzSgo7ww3I9T7Xe4b/puaFHE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VdH1IA/QTPobhcPRTo8xO?= =?us-ascii?B?dz09?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 6:ADs7J2DCaeIagiqqXfleBVtXydGh14hPbxoc6KltQLExujukrTPAasFzRFFvwSNtTYMsLSkQh0pJT5r98fPN1/i8Tq/T29g8fyu5JEszsA9BQr127LEUGGZiv3MP7rwq3ckZxi0s7ZdZVONPFwIVh6kwc5aTrEUtWlPT0YbdACtWoHoRbXpNdGjRj3WH+VJ26Vm9N1nO1MdQviTwzRVcj8nI9N3bWfWy/iBJ7A03HQETbkLMbEqyUGGTu1eemBRXVO3nAWhJg6VHbpoEbgPndz6o7X3cdK1SguyCqJa+QKaT1s302HVOy4YwA1kCf5WOWlBLBHmd2TgE8zIYDjxoCzA3bT81cIwWmHZQCE99+ME=; 5:66LFdlOBiePp9CLDY00oGEYa7bgWvSk4JA/wn1vG3hbMLz8MoW7vWfyJ6WVOjPPdaQtb5f9HRC9eQeW6XytO0XgmCjrlF9lgfavobDBXW19+GXU9n6hnCTWe6up+KlmY9s6WH1RihyOF3RNDGt9sQmUM1ruGPLcB7+Ljx4kSWDs=; 24:R2leCBTwOFfC1EEKi7niPXuKERkBaq+IJ0ociixW1PK6+Dxr+PTu/Uua6A/nZexMt2EpIoY3YFEA+eC+FOMKWfM9f7g7a3HVV88OSiSuYl8=; 7:kBniBcv6G1edf9ITVvQLfN/0pz5aP6FuY+YsNjOGzfJwae2tOIC1D35KyBWlzfQIq3Re3Ry/PwWQSHEKAgube+lY/sLXua4kF7W43LMB9WWUTm984YVOcwWWALMqnVdpD6oMgBRY3TjKhjsxQTGkZf0rcrSa9fczTkxBJczMYlydCpcczuWuG9VofvKzZKXhkEiVMbiTS7BTnKtzDXCyt6M36YVIGAmiF6nsLNGqzux2SRbWl26TkodOAC/ag071 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 20:t1gt54xfy7qUq2Imw8ryrVYyXQzywUVWXaRC6Iq/IQnfr7WX0tHzt82zXaCCdffhvqQ+ecUSZzNDJYmPtp7kYMwLD5ui7Ol6YSBI9JGamDiwqxkTAlNS5evBsANlCjA6uAV9qRz+m/SKm4CT09gVvD1rB3+FUReWM3+lLdi9MTt2sY0tXju6SavWOnkcQTJ7e3xYpSQ74wn0bynyjeFhee9VZQnEWgEW10ksjE0OncsQ+ghlwlQ6YUKP2RzHgnoW X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2018 15:40:45.9158 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0107a449-94ec-40b3-710c-08d5748a7be0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0157 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.87 Subject: [Qemu-devel] [PATCH v9 14/29] hmp: add 'info sev' 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 to show the SEV information when memory encryption is enabled on AMD platform. Cc: Eric Blake Cc: "Daniel P. Berrangé" Cc: "Dr. David Alan Gilbert" Cc: Markus Armbruster Signed-off-by: Brijesh Singh Reviewed-by: Dr. David Alan Gilbert --- hmp-commands-info.hx | 14 ++++++++++++++ hmp.c | 19 +++++++++++++++++++ hmp.h | 1 + 3 files changed, 34 insertions(+) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index ad590a4ffb2b..236811c465d2 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -865,6 +865,20 @@ STEXI @findex info memory_size_summary Display the amount of initially allocated and present hotpluggable (if enabled) memory in bytes. +ETEXI + + { + .name = "sev", + .args_type = "", + .params = "", + .help = "show SEV information", + .cmd = hmp_info_sev, + }, + +STEXI +@item info sev +@findex info sev +Show SEV information. ETEXI STEXI diff --git a/hmp.c b/hmp.c index 7870d6a3004e..f51a107a9be3 100644 --- a/hmp.c +++ b/hmp.c @@ -2924,3 +2924,22 @@ void hmp_info_memory_size_summary(Monitor *mon, const QDict *qdict) } hmp_handle_error(mon, &err); } + +void hmp_info_sev(Monitor *mon, const QDict *qdict) +{ + SevInfo *info; + + info = qmp_query_sev(NULL); + monitor_printf(mon, "sev support: "); + monitor_printf(mon, "%s\n", info->enabled ? "enabled" : "disabled"); + + if (info->enabled) { + monitor_printf(mon, "state: %s\n", SevState_str(info->state)); + monitor_printf(mon, "policy: 0x%x\n", info->policy); + monitor_printf(mon, "build id: %u\n", info->build_id); + monitor_printf(mon, "api version: %u.%u\n", + info->api_major, info->api_minor); + } + + qapi_free_SevInfo(info); +} diff --git a/hmp.h b/hmp.h index 1143db44a760..4ca1a77b2c1f 100644 --- a/hmp.h +++ b/hmp.h @@ -146,5 +146,6 @@ void hmp_info_ramblock(Monitor *mon, const QDict *qdict); void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict); void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict); void hmp_info_memory_size_summary(Monitor *mon, const QDict *qdict); +void hmp_info_sev(Monitor *mon, const QDict *qdict); #endif