From patchwork Thu Feb 15 15:39:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10222001 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 D9401601D7 for ; Thu, 15 Feb 2018 15:44:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB38A29427 for ; Thu, 15 Feb 2018 15:44:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF9F52942B; Thu, 15 Feb 2018 15:44: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 93AFE29428 for ; Thu, 15 Feb 2018 15:44:43 +0000 (UTC) Received: from localhost ([::1]:60729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emLiE-0007mM-JA for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Feb 2018 10:44:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emLeG-000479-DL for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:40:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emLeC-0003Ou-PU for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:40:36 -0500 Received: from mail-cys01nam02on0084.outbound.protection.outlook.com ([104.47.37.84]:12640 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 1emLeC-0003OJ-HP for qemu-devel@nongnu.org; Thu, 15 Feb 2018 10:40:32 -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=QEpSh1ME5HG8JbbWotImlFytQx5BM+TL2S705CohDKE=; b=3KK88KT8lT8jJMM9sWiMTWicLMWpk6i8+oSt/q8/1MBJGOHNLrfz9ZM38y7tk2+jz7PQbVI3DbGiXw+OE71YGCJNq+lCT7JJFBoR7+GyoOSg0jtftGPWa/dMGQorw7YTvs4KR2F9iWKRdMYBqAJN2MjEVgh4HcuXoUxKOd5J21k= 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:28 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Thu, 15 Feb 2018 09:39:31 -0600 Message-Id: <20180215153955.3253-6-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: 6d9b1994-93e4-4a3f-242d-08d5748a7134 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:oxwdPANIZCYSMxkm52a7b7WuGDNtLxPqjuTcxYhS8eY4/UBA6uyanNd8zPR224mhv/ltPwtpWPio//vW1xoZK4QZ2bHE+yc4byT7aJInlLKVWj4Fe+nMU/6fYNNnophwJMWWpOGIEpDNxYn3UVi7s1+38V8byl//df9RX+xhLbLRyORo1AXDgoI43o4NHL65qXgarhUeZtDONoTHdbg1j3uCdV1yHwJbTNihFAxqXIhISkmxtCgCDNHIN5v5E+yk; 25:2Pn6wVAZwrP4fgpFDdswVbMHlXDYqTJhOnni8POXqvxm/rR2XuEThQdEc8Bh55Do3bL+p9rOiXR58AtqeCA+wJF57L72zHe8s67sGeBf+tMl6I76EdsXnC1jXDY9/IaUjvNNVzs3fJtMgZEqW8BU4KHG80MX5dl9tXuIEVa4J0uaGtXlYT1o+2zLCUd6cQe2j+ys6zwboFrxd9onR7raDzvT8i8iR2qZ+9bHB+QZhD1kI2TDiw9SkgNc2+S1vcIll++CdCpiMFBwVUpYNk9TLkINo5q8xpio4R6ZaXG50gyKdnT17LHFUVb20+xGkA8+damfmwuvxWi3PEGl++o50A==; 31:jk28Aos7nhKXqQLUQYEXXuCMHwTCy1Ivg26fBPYfwetjS9hbb6qDQjEObRISxP2zzBwOfoQmGSgmt8orF1cZXhjRLLVWb6E2zniwax2A7aN9uA15UiyI/I0pl0PvO3peyVAGhtp89EgCtZ6pZ8MGCV5o7AoWHkQYDAFBcBOXNu6/xXHyW9HtpCRxqWwNLxihPFbwHedhArnkgHU3Lga+WkhlNu3giORpDckX9e0BsO0= X-MS-TrafficTypeDiagnostic: SN1PR12MB0157: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 20:KItOjobtSey+Db4aTw+LNdo9aPWao+1KwkwVRlGLb4SvhtsgEn0/FCOem1GIVEoyc2MWBFaEngZ0ADVAjlgkCCyT29M/bHu6OdhzDrJ7sFZZk3X/PVYo4knslLlCV5rPLXYBJsDtaOW8d2mbVev/7uhXXO8fs417mucu0JtHctiLvpRWfCdfUEgCfmhvHQdRr88t+bbpI1kEaPbigUDsRsn/m+xNtHxVH4LwlPSnPtzBW7HyDn7Af18y6oah3m82KNWuXEqC1gtEdvFyUEN0+ypVs0ZFnOxF9EFnh1QjQzBe+0FF7z93q5XhvquPwmfA99rlQ3F5XhxSojs/ub+xhBT2aqJv2aoQeaaRxpFWoaNUDb3a/QGXpxaF4KK9mMtMsbhdY1+zq1SjUCRsCkEQw1NEOZQ0CWfuMVmPbhyrDvJ/Q34KRkYaFJYmNhr5IXBB1gjw6Oa/rWVqZ+Iz96fKV23pzbDZpWc8tCJFITDMcmGqr20OJYkfgrdqHNSAejaE; 4:AoLXIIOgc0MArzH+W1+JrUEeky1iUE7wbNHWLl6erEY1gg3Xf0/kBkrXzv9OhVnfqB2fEyKAEX6nq5RnGwYlxOGqxxmyIAyd3O45B4H3Wp4AdnNFLHN28xaB8PVi+A2kvbwalZrwUeGqEavGxRqIWHsJg7oyctYNSnHiz8Z4erQAIaveHCMnbwox5lSKKwLCcH2zekRVV+NoSAkupQ1pQfeHwolrgHQd4OEGjP4gB06v91TwnzqtrXnO+0oAZvlW3zknGQad14X40MyK6E3CrpZOYqvMjtZVnxzluv9Ud/R+m5ARt2GG+A48aJirlH1DM9bwqGTB1XRV3m+EKJpUMQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158)(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)(979002)(376002)(39380400002)(346002)(396003)(39860400002)(366004)(189003)(199004)(26005)(3846002)(386003)(8936002)(5660300001)(186003)(16526019)(316002)(6666003)(8666007)(1076002)(54906003)(6116002)(48376002)(50466002)(7416002)(478600001)(8676002)(68736007)(86362001)(575784001)(16586007)(2906002)(50226002)(39060400002)(2351001)(6916009)(7736002)(106356001)(51416003)(8656006)(52116002)(25786009)(4326008)(97736004)(2950100002)(6486002)(2361001)(36756003)(76176011)(81166006)(53416004)(66066001)(53936002)(81156014)(47776003)(305945005)(105586002)(7696005)(969003)(989001)(999001)(1009001)(1019001); 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:5dFD/mMaNSn90VdkGTsLsgYRhcZsDRyBi1tuBBxpf?= =?us-ascii?Q?acj1dncGyqUn/gSsya7ve8R2WwG9Mb6H6xmVMQzzKHiGquPdw1ssgxIJhJAz?= =?us-ascii?Q?3oJgV7kNvJwREwJu7XxyFTVXO8YjriQDV78P3czZe7c10cq8n4y/Vsf4+wpA?= =?us-ascii?Q?m3Jy8HP2KQ+d3osTrLr28duUC1zeWjTgzIz4cVTQ57Fu5aeKpzBYsFQTB4FY?= =?us-ascii?Q?xBTrHAhczIcsPdlbzlBs/+ZURBpDay2t18sJS16PSJ1pcM14FXWhr6nfwG9m?= =?us-ascii?Q?qcGgRnIXtbvo5dZbFUKLje/N+ZYqHRywD2EBMT/+Z89euMUpyYy/U+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Wgwu5R772HUgHUnEy/jQxGgYFj5deNqQzWmBDc1/QSPlY/iEMRuF7/7Tst0ha2spxS95n3BfCmJe1/qmpx2VQEXcxw33l SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 20:1Gxv3nnGRwt2o8CwzK2qkedpS6SYoqoww0WcM6LtODGQWMlL/+3O/OjbJ1CSO/9go3AMuq9EOqjsFmOIaKIqKGS5V7NBe+9qt0hV+7NRVdSkdLRAFblvLbJy99ls37REgcCuwKDg8AfyrFcTq4LHSvdHJh5CQ1Kl/LwJW0CwsnWGZ9n47NO+Ts7NnOrJ/7WFR1LM9Ule6eJq1aLUW7Bj5L1XkQ5rvcb6vFejQj479PqYWq1oJBXTlYapKLlUhCBP X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2018 15:40:28.0406 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6d9b1994-93e4-4a3f-242d-08d5748a7134 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.84 Subject: [Qemu-devel] [PATCH v9 05/29] machine: add -memory-encryption property 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 When CPU supports memory encryption feature, the property can be used to specify the encryption object to use when launching an encrypted guest. Cc: Paolo Bonzini Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: Stefan Hajnoczi Signed-off-by: Brijesh Singh --- hw/core/machine.c | 22 ++++++++++++++++++++++ include/hw/boards.h | 1 + qemu-options.hx | 2 ++ 3 files changed, 25 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index 5d445839e89e..414e6e71092d 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -334,6 +334,22 @@ static bool machine_get_enforce_config_section(Object *obj, Error **errp) return ms->enforce_config_section; } +static char *machine_get_memory_encryption(Object *obj, Error **errp) +{ + MachineState *ms = MACHINE(obj); + + return g_strdup(ms->memory_encryption); +} + +static void machine_set_memory_encryption(Object *obj, const char *value, + Error **errp) +{ + MachineState *ms = MACHINE(obj); + + g_free(ms->memory_encryption); + ms->memory_encryption = g_strdup(value); +} + void machine_class_allow_dynamic_sysbus_dev(MachineClass *mc, const char *type) { strList *item = g_new0(strList, 1); @@ -612,6 +628,12 @@ static void machine_class_init(ObjectClass *oc, void *data) &error_abort); object_class_property_set_description(oc, "enforce-config-section", "Set on to enforce configuration section migration", &error_abort); + + object_class_property_add_str(oc, "memory-encryption", + machine_get_memory_encryption, machine_set_memory_encryption, + &error_abort); + object_class_property_set_description(oc, "memory-encryption", + "Set memory encyption object to use", &error_abort); } static void machine_class_base_init(ObjectClass *oc, void *data) diff --git a/include/hw/boards.h b/include/hw/boards.h index efb0a9edfdf1..8ce9a7a21d3d 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -243,6 +243,7 @@ struct MachineState { bool suppress_vmdesc; bool enforce_config_section; bool enable_graphics; + char *memory_encryption; ram_addr_t ram_size; ram_addr_t maxram_size; diff --git a/qemu-options.hx b/qemu-options.hx index 5050a49a5e65..fcbe842c0653 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -110,6 +110,8 @@ code to send configuration section even if the machine-type sets the @option{migration.send-configuration} property to @var{off}. NOTE: this parameter is deprecated. Please use @option{-global} @option{migration.send-configuration}=@var{on|off} instead. +@item memory-encryption=@var{} +Memory encryption object to use. The default is none. @end table ETEXI