From patchwork Thu Feb 15 15:39:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10222117 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 692E060600 for ; Thu, 15 Feb 2018 15:54:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A49F29340 for ; Thu, 15 Feb 2018 15:54:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EA8829431; Thu, 15 Feb 2018 15:54:44 +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 C387A29340 for ; Thu, 15 Feb 2018 15:54:42 +0000 (UTC) Received: from localhost ([::1]:60807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emLrt-0002f6-OH for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Feb 2018 10:54:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emLeO-0004D0-RS for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:40:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emLeK-0003S0-Tb for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:40:44 -0500 Received: from mail-bn3nam01on0086.outbound.protection.outlook.com ([104.47.33.86]:23872 helo=NAM01-BN3-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 1emLeK-0003RR-OR for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:40:40 -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=73Ii9E+n7IFm3feCCTQcyV5fraVoYcfsZA+UtvKbi0w=; b=la2NFWZWt4mX9ujPrWa/O3fr08YNHKpDeOGbh+ll6tw7ug/f+gNpWsKWUls1SmU9jqSGHMkLoLZZDNnGisLEPx+GmBX3XfJgtokq1llDPD1PIOc1hXlYPx7toiV4HZkSKHRfv82ANePDmApTNfwF5kzYfo/RRLRNoHJ7hdg3VI0= 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:35 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Thu, 15 Feb 2018 09:39:35 -0600 Message-ID: <20180215153955.3253-10-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: 7a956e1d-8f55-43a8-c952-08d5748a75c6 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:cReR4H9KDfJP1Xvi3K7kFfrALne3qSuqJ3PgSIXOBzf3dotKBYxCKgTFe6T5kJJgqEMOM8qrW1y8eCB1al1b0uFUXXcnYAhNs5tGiVZznQWlt35djIl/FfA8gCkNEcjqwWO5HkpAFvmrpS4QaeoxSVED8Vt6SsElICwglPUiW/7GoWQyG/qNnRvXl4rD6mjlos9Br5ZcsPSv+dOQyIUrVfj2zzfhIMUNuhXMw/NUxV5BhXHbdkZoIXjgH/k7CGdV; 25:KHZpefdC3gJGLn6Fc2ZO6+RwDlj4pmy9IRSN+sqmrnuNBNxvCcEzR/dpsKNZIAzkw6E7JiZt0Zp/QOHmbyXof7XrFlZuR0mWDfnms5U9I6ywOrQj5aBghy0lLoB0FzKDGdAB/6h3czLckwvLAQhaSSrEtULCi1Ah8rmUIb0tiP1kH6nkYJuf2bBwj0lEdd17grvUfLZwEEH4vMYQ9rkCEbI9MfUX020viyxeE1CCZvp4/1Qxr1AZxRiFibEInbVWEm2qPW0vkeHzbAaFKtjjInQbvxrilcrbA1BOeFEDDfhH/UhKsJiKuGYwKBwetlRi61cLIgzESFvJtffVABzrbw==; 31:knInSRhIL6p4sEa8kv/iXIM+9g46/62IdgtWb/ngztvvswbct36gacua6zL/E8WmsnZJ6xtmmTzgYLWbNmfSZfbtXfqL5BOahryfrr8TwN812GlnS5fbIKTxtRRQS4Gcwo7Cla7W2QpATUWkO/Bnwbx4qSJttGTlzZhL2CgzcgSOWpkuhFfLrjfZD6IMSpIBq8DKA6DkQDm1glnQ+tCTW3hq6cpq+5tMpe5jd0DAbNE= X-MS-TrafficTypeDiagnostic: SN1PR12MB0157: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 20:DXw9+gMNIEsgjQDlBeWY6rX07TDzQ9HdKcfEbbc5NQuK8qJtS5gRr6Wf6mqArwgti4tZkvfvcejvi6dfQq7/vDF2DvoearxRFYpGFVIA9RhWgkGx+yt9g14Vm4hO9NaFH50zvqQi7VV/a8b6uJ2HhLbNmyiK/F8D0swj4FnPF+JmqIqxDbYXECV1AWb2yBSeQok3QIghlvbJohwTPR0EumxdDfAc2IfcFgDIszzP/8rpNQ+93j2O29i84BgUb32+wy62JKP6sMyxCeVnK6oy3s+iT0EOndiKGJKBbNjI5OdbPu4Xowcf6nW0rVVJox06q3258QgPtth2sij93zKSiqz6kCmfD6bWGRvO2MeyUDJZZKtOf8p+IMc+8fHHkQ+HDJ7ijQ6dYm1vcP0YOoV6ITnsSyQyeN/2rJG59gUvwYbtKwfv++0p/0NeJmA9rg0bbtLrW1RagB7Qkt0iHUV2R7zzVg+XXJWb0gVbiVybi6OP6FLHsJuixESVBtTcm221; 4:0UZxYmVYb0b29oIX3XqDlIK3WNAw5h8ZWcMl3gK4RvoH5sFCw80tvjqFyA81Kr9SNP683J9fJsgi9cm9vBbSGE9xdYS6du/9ILrccdkAzfb4PnJu4WMj+LmDiM34jnm841TxuQ9hLLCP8ovGko8SJrMwdvxvsu/riRE2DRpnS/3pmeQwiQbvtpTkZ5uuVSLkYjherTb7imo2ujfPD0yWnEJ7XPVr3ZtNq/hy5EFz8rDmu7bbUgIB5k5V3WWBPPd63Ezk40oLQudk7iziTNiG2dCC2Wn5I4XUKeBkGq8VDJUTIvMkpV4+CEIPfRc8T+ZG 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)(376002)(39380400002)(346002)(396003)(39860400002)(366004)(189003)(199004)(26005)(3846002)(386003)(8936002)(5660300001)(186003)(16526019)(316002)(8666007)(1076002)(54906003)(6116002)(50466002)(7416002)(478600001)(8676002)(68736007)(86362001)(575784001)(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:7XWzXPJnN3yG1syDK1qk8RwJ1PHzyjYlRm/5HNjwG?= =?us-ascii?Q?s+Gg+fWRqAFNSXdKD10XlftOhCn/xSK/tRKcN4AAMkMYzZZv9iHMMPUr37xD?= =?us-ascii?Q?+uEuPlCyGAyliYJWkAZ272BUbfGoUvAEudn3davnPQk6GhdMuFQ4a3WzO5b7?= =?us-ascii?Q?zlodb1jMLQsqSa4OVz+M23efgkT7d8g6LxnX//XFJMnMkjSK5RpCpuacto2v?= =?us-ascii?Q?1mN2liAiHXbYPGMiku6Gr8F6J85Zz1hKJ3fUua7LO1jWX/vQqHVPq/BU3+IS?= =?us-ascii?Q?8KnzdhyUKrsy2+mEYCK74/vu7Xkde76q19EytuoIjYruwSwPAHRMKqpWkWs+?= =?us-ascii?Q?l95/g7kRxOSJdeY9w+Im1eqdxspKO7mHXfg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?ZJxdxHzvZWZIa7ddhk=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 6:UQA9hd4WOBZGzm09YGyJNXm4mqN10M8GHagpKqSLEK1WTHIHp3/P4D0+w9fWE5qOUz2XrrsJhk7VV1VLC763VYhez0E0LeZC3eRwufAzrQ5WE2/tgHA9IFX+jgJqbUJlj3PxmWYNaJs7jqVAoIAQVFFqcgnt+yJkghxm2iRh7PcQfKkxm27j/C4Y98zsDP654YgFA4XtLzlmY28QdWc90KlHkYfKAfJaIcusjfVsfKFIPMSyM+5Prs8vX8nizar1vZeVtcETBNeETTDSeETghT2PZfPkNSLTKDqnAOhXcbThnzE6ezpCBOxM4XE7stECEA5rajElf3vqtMU0/fyEsanxh4jvoP8elUixWrUgxDk=; 5:SZlR777yGl+D2bzYE4U2eK8cfmJ5zKjbCRJROcAaZHwW3gzZZFea+8/7ry6EpohdPGM9wS+23WOaMfrC5GHl1u3o9NAwbIhM5sxBuHVa7C7xtwQDabV/1E46+/Ao5a6JCekmybTniXgMK8URWkx67DGN4UAE0UQ8k/PC6iMMOXQ=; 24:Vfwp0XP8fEQ/cY/ryKh8ui3xtv9sC3UkTwd2k8A4oZEBk2F3jGJVQpno1dTcoJCM6tHvBlZe7CptoWPbfg6IUYNonXbRtJ6ZJdr1EVNlUPQ=; 7:HjsLZeRMJOTv9ioivlgjDoAezmidsdmMnxPT2ubPeRcPu8u7PQ2JTgi7XNci8EEmH7OB5YB9b2z0dQ9n2t+kMkpSPVNPNjD6oCys5D8Jfd/MsWyany+idbgHcoWAtLWZTqkbNkaHgwiOhJpmS3dYPslOttC99EXXozth5S1cNtGEq+Gabk21ef8dHIz9c5eYl7UugxgmfDowgS/nd5iArJyXuxniI0KTZqymboJKWIHLo0tAWfCC63bUpsrMjTph SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 20:iAnx02xljbm7mfVnypaEXFwsEQ0OP0wwtbVbSWSP1Plq8hfE3zllKPYnhdYEcizXBHZNh6F/hC3p/TyYIEE4m/gWD7Z7y41/i1ySQZo0OK/k7PT9z4ufibMZAKYqhGU2B5JM0eMaQJ5E+6iKsCyDhNv4qs5Noydn9OBc1IsGdFHujbf6t8IB9V/zaifA0apnGePgQFdHbOQ0YUhpI1INgBrXL9L6EAdWmOGPp66CCvVeHvRmbPAVWVDuE3vqOjx5 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2018 15:40:35.7126 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a956e1d-8f55-43a8-c952-08d5748a75c6 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.33.86 Subject: [Qemu-devel] [PATCH v9 09/29] qmp: add query-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 QMP query command can used to retrieve 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 --- qapi-schema.json | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ qmp.c | 6 ++++++ 2 files changed, 63 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index 0262b9f20bc6..46f7a3c9ea83 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3189,3 +3189,60 @@ # Since: 2.11 ## { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} } + +## +# @SevState: +# +# An enumeration of SEV state information used during @query-sev. +# +# Since: 2.12 +## +{ 'enum': 'SevState', + 'data': ['uninit', 'lupdate', 'lsecret', 'running', 'supdate', 'rupdate' ] } + +## +# @SevInfo: +# +# Information about Secure Encrypted Virtualization (SEV) support +# +# @enabled: true if SEV is active +# +# @api-major: SEV API major version +# +# @api-minor: SEV API minor version +# +# @build-id: SEV FW build id +# +# @policy: SEV policy value +# +# @state: SEV guest state +# +# Since: 2.12 +## +{ 'struct': 'SevInfo', + 'data': { 'enabled': 'bool', + 'api-major': 'uint8', + 'api-minor' : 'uint8', + 'build-id' : 'uint8', + 'policy' : 'uint32', + 'state' : 'SevState' + } +} + +## +# @query-sev: +# +# Returns information about SEV +# +# Returns: @SevInfo +# +# Since: 2.12 +# +# Example: +# +# -> { "execute": "query-sev" } +# <- { "return": { "enabled": true, "api-major" : 0, "api-minor" : 0, +# "build-id" : 0, "policy" : 0, "state" : "running" } } +# +## +{ 'command': 'query-sev', 'returns': 'SevInfo' } diff --git a/qmp.c b/qmp.c index 793f6f332302..baf0b96528ae 100644 --- a/qmp.c +++ b/qmp.c @@ -39,6 +39,7 @@ #include "qom/object_interfaces.h" #include "hw/mem/pc-dimm.h" #include "hw/acpi/acpi_dev_interface.h" +#include "sysemu/sev.h" NameInfo *qmp_query_name(Error **errp) { @@ -719,3 +720,8 @@ MemoryInfo *qmp_query_memory_size_summary(Error **errp) return mem_info; } + +SevInfo *qmp_query_sev(Error **errp) +{ + return NULL; +}