Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755123AbdGXUKV (ORCPT ); Mon, 24 Jul 2017 16:10:21 -0400 Received: from mail-sn1nam02on0051.outbound.protection.outlook.com ([104.47.36.51]:47345 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753869AbdGXUHM (ORCPT ); Mon, 24 Jul 2017 16:07:12 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; From: Brijesh Singh To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: Thomas Gleixner , Borislav Petkov , Joerg Roedel , "Michael S . Tsirkin" , Paolo Bonzini , =?UTF-8?q?=5C=22Radim=20Kr=C4=8Dm=C3=A1=C5=99=5C=22?= , Tom Lendacky , Brijesh Singh Subject: [RFC Part2 PATCH v3 18/26] KVM: SVM: Add support for SEV LAUNCH_FINISH command Date: Mon, 24 Jul 2017 15:02:55 -0500 Message-Id: <20170724200303.12197-19-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170724200303.12197-1-brijesh.singh@amd.com> References: <20170724200303.12197-1-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM3PR12CA0049.namprd12.prod.outlook.com (10.161.151.17) To BY2PR12MB0145.namprd12.prod.outlook.com (10.162.82.18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e07af21f-3c5a-4739-0a53-08d4d2cf164a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BY2PR12MB0145; X-Microsoft-Exchange-Diagnostics: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Q+ha0JA0N2ZQdvgJgJmAQnGbhVg72yQIaAvomANUee7hJg+Qq4ixqqeGKdTcyISQygnbD5S8ldRVvMa0+vJ2oEHnegmetS7yTjPqY1A4xUCWltY26cfTpL6arzAzK1/HcS2qQeyCmJIvrxjsz1gMWpF+P6zBGZPIMcDVf9G6afBRUKgTXghscLyZuvidBa4zedQ7bAdjJULqePVKT3dqySbRtY59HyuhkPWgrLplCuYipMZHpVnuDbbV+W0hQfcEjTYMkIqJP8OXyasLFf6Ylsanyvb7tHr7r/OHJL6lkoNpknXAhXR5bqsTdltnTaaq+EhiR2RGmfbEqgjzbeAYvmOEjStKYx7O4+eJlyqE8oqE2rWHqGaI8= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0145;20:UaNeGo9JWMjCittSjA8KCWx8I0EkHPxQGN+JRUAuIrhJ6G/vTdb8+1/rPUaUgWhjmvQbMDLBKnAzxpc4vAXQ1ECx89+cEF8c9NcvKvkVBynAcAqo5LUwqlsyk4m75xWb5+vLzLoZGMNOkeh7jI5cQy+IH69L8nBoCrj3LmTORUXnq+s8JSyDG0MXd22WCA7K0B+y9vcl/Rdw63r1DLGCuymm41Zw9PEXt2WuAg9WKv4svimOmcw9WKCtHXFB3HGik+wpmLm9JLKiZyHdmYZHD96EkdpRh+t+evNs6KDOA5owrl9gSeJ2rX6y+AEn9oBZlhLBNbvK/r6TeIQwQqipsca65lkDKP1zTB6LuMGJXHybkazDcogPzNNJJaUDf2JSpKH0puqYwk60uFwrhl5HFWs/pJdh/FEq4WhyEFEpiTZ6uCp3QGjv3H4OV78XoIr2eojnX/m8kyxwEVwZg54V81y71sIEv/KsxfJWXuIKoZjRAgAqiqeR5z/WkKyaZkYb X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BY2PR12MB0145;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BY2PR12MB0145; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR12MB0145;4:davAxQH7DiJW8rt8ADgo3kb59RPerKSRqbxduaPRWz?= =?us-ascii?Q?1FHHeQQRx5CQSugUkujtS0M8OIodlOia9SZPWVZ6OKweRZnQfJxpxLI+g8A0?= =?us-ascii?Q?UXab+3JbBblfBwFOzJ4fnRSsIlY+cQD9DEJtTJVp98S2PQXNJnLIL1+bmZMa?= =?us-ascii?Q?1NOwRiJHMH8c8bLlehnuOMQWeP3OJmej0Oq/s7hQHeMxo9key2T21ZUmO9Em?= =?us-ascii?Q?Js/6Tiid8qo11ham8hjSFhN2SpLupeLvr+Bo8K/KkX5myWTWMK2HLExGAbpv?= =?us-ascii?Q?a2mKUiL/r2V1shTbze7CCp7QzROXsd2IpA6LhjAfuxrwvLuphVz3R6bc+wCZ?= =?us-ascii?Q?nI6BXI489MMG/26ZsIML2KerTF1QY3Kcc2Si3IqBRgGO8UxmZIZQJI8SgFBq?= =?us-ascii?Q?LxR2pPQcHlrbqMKkLOTXa/yI4vF+RMhkyShuR3OEUVbxGzE8R9giLc/dv3k3?= =?us-ascii?Q?q+Ei1n3/bMxdn3Iiza+RMGfdrFo18FrAFSjMmY4amxk8kXjdjt1vTY+6vDUp?= =?us-ascii?Q?aKNYGUSkxskh4v0EMGRx5uB/Q9OwwgnZKV9eiNYuorOxAwRd6OdDUUzsFip7?= =?us-ascii?Q?kmFQoSKlub9mQEWP+QO01kYL+bWvPEa4v9UqulLWAszI+63PwvS8zU5+p7xF?= =?us-ascii?Q?oZSGTjy3ADoLPCn1p2TDQklYunOkieNDixor3Xig8vZEAnksuM0TfEe2lXbf?= =?us-ascii?Q?acXIVr2mFOfG13S0uh+TLvblMRDmGmeqPY1yHhxOr0kNIag2x1hIG/B8STFH?= =?us-ascii?Q?ubbaGXsC9ekHQgj3qMF7+vtGwyOjtDH1c6q21UcSHc6zQ6OIBYOYAIwGLb/4?= =?us-ascii?Q?WIvzrQaAedt6XP+CegTbzT0CFFU0u73LQfF4+mPdml1vqnGy42VowKmJ4DUm?= =?us-ascii?Q?+COHOwvGHdwDLDCPsVs1P6VgPANUpvg3QFk3Ov5PD+w2vjQu/++mfLxMrebc?= =?us-ascii?Q?lEM+mHzedBBcIhLAFOwrcHEEN5IPqsZX/WXUf9mD3jGcPX1Jr/Kv9QYN3+cv?= =?us-ascii?Q?zHpIIGrDwopp1CMmidh2Z7UF5UQySGj88X9ZtK4Dj0JJo++9S461CckRKHNz?= =?us-ascii?Q?pndaiaCYhJEmZ2MO7yd/ObWcewFVxzq322zvVt34KZIWgkYpvaQcV/dHEl8Y?= =?us-ascii?Q?XpVmWyaHQ+IH6JKhcj+4Bp1ZfoJ/zPRp3Z4BUSOnyWm9RkZC2bv/gt0Gwmbb?= =?us-ascii?Q?AYfU/zjPNc3YpMZgOEJki6fWZ+u1zSTkF2?= X-Forefront-PRVS: 0378F1E47A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(39450400003)(39410400002)(39400400002)(39850400002)(39860400002)(39840400002)(189002)(199003)(7350300001)(68736007)(53416004)(105586002)(54906002)(97736004)(50466002)(6486002)(48376002)(2906002)(106356001)(33646002)(6116002)(1076002)(53936002)(3846002)(189998001)(101416001)(6666003)(2950100002)(478600001)(50986999)(76176999)(81156014)(50226002)(38730400002)(47776003)(5003940100001)(86362001)(25786009)(4326008)(36756003)(42186005)(8676002)(81166006)(110136004)(5660300001)(66066001)(7736002)(305945005);DI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0EViuzkUA+031vdC?= =?us-ascii?Q?rssUpoJST/WSOGkiWq2lH7dp7/CX10MrgjFfQ0WhqubSoUeNEIFy5EIr/uzq?= =?us-ascii?Q?HCsswvvVTFxXVcr1/8WfxcWjqH6+09Ocq6U44qXwC2+SOAKdCGVKsWg4ME/O?= =?us-ascii?Q?ANILQ0r0rznrJ1j74U4C98f2gpJBEpi8vwoGBTE2K5xivzsvvYkDc1CYoA34?= =?us-ascii?Q?v7AaCpSo0HrUqMwnAjT2+E42I8aCJ/eNpFG5DoJExHcReOLWNVQzHN2AeBVo?= =?us-ascii?Q?4DTBFZcioxb/c3y8lruIW0RlvIEqHDRKB0P516cAHrYWA6u0CK5YR7v4uIlu?= =?us-ascii?Q?1Cz/fB5TZmEtPQw8lGgvh45+PSW7/5U76sN6x3jM7YGvHtXpfQmpLTml1xn6?= =?us-ascii?Q?z40rgysXCj6MVGDxAJc7Jyf+HLegzmK+PDivnAOF0j2GBj0RqCaqZAWdQCqZ?= =?us-ascii?Q?8/H3U4XR5nelnWcyXV5A6NPbTD8uVkGxk6NteIT95fWWiTbYrgcc1/EnXgwM?= =?us-ascii?Q?ty0n/WeCpZElveJFKhesV+buhx5b91adyVxwRty?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR12MB0145;6:qsYLin+7KFmgwdRHX7XGytycq83t2tL2CzU5GQdiB3?= =?us-ascii?Q?2vNwFfSN+jlxIYoIDiaBWPpAyfDz7+DyWlqq+bIEoyeAmNPHAb/HXsnOV4ZV?= =?us-ascii?Q?W/40o12xWhLBoDprhHrjR4U+WiJznLELmXqafa59LMkfVFzMVnma4E5d0vB8?= =?us-ascii?Q?EFbV7l4xWrUsxQhMV6VCfIEaN0hE6UgTQGBNl8Fi73QGx2zam1f6sUdTTI6t?= =?us-ascii?Q?wpjIUyJRGPNRxu42Malc1lViRGOKpxm6Wphu370jXySXa8ho6xwoqp3CQvW0?= =?us-ascii?Q?vzDLVnBOSWL9VvT/F/iMRQkDqhf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JG64IUeeUhmIQSGd27MRxfBiYJZkKQUiguHz7Cw6wM80nTgEZoekVcmoe9T7A8oFJdVt/aNDbH8dP18LmpktS7Ue4H/3AxKfTlfHlQ+GxhnPbbaXydWIfiG0BLBiZnhuV7X5UJgi2XUxXu76kQRUhiOWwd/47JN5Qki4BPP2A6knFk0vRn9J+dg/ldAENtTl69Lwxv4hwGYgDjpT8a74es3BfS88A5mKlqge1plyCyjH4QzmMVPBeldydU1WYxl7Bvq6g4X3h4CI7H9YgWxtUj0KaN4o= X-Microsoft-Exchange-Diagnostics: 1;BY2PR12MB0145;20:GhCOZSHvrRCz5Qq9TRyk3yTOwjSRuTDyoQN5KXs6TAG4aqt50ziKWCsJn1rJCbkE2Nc/IYi+WY6Xck3hoaCxNaleSpNfKsLCq2EJrfSTTuPeXjYfiCmieH+s/2nRZbDLAPnxq8OVOv3zmI28N7HCHtSsXmC7K2AEQseGJBLZl8dcdrgICSkdHbQTcnS7fNvlv0236/UE4k9zllG7gNLgYejgeaW1qeYeeZdTlUin8W4uNzKvpBJ1wWMLUTVkN/38 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2017 20:03:43.0565 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0145 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1231 Lines: 50 The command is used for finializing the SEV guest launch process. Signed-off-by: Brijesh Singh --- arch/x86/kvm/svm.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 9b672eb..7a77197 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -6005,6 +6005,25 @@ static int sev_launch_measure(struct kvm *kvm, struct kvm_sev_cmd *argp) return ret; } +static int sev_launch_finish(struct kvm *kvm, struct kvm_sev_cmd *argp) +{ + struct sev_data_launch_finish *data; + int ret; + + if (!sev_guest(kvm)) + return -ENOTTY; + + data = kzalloc(sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->handle = sev_get_handle(kvm); + ret = sev_issue_cmd(kvm, SEV_CMD_LAUNCH_FINISH, data, &argp->error); + + kfree(data); + return ret; +} + static int svm_memory_encryption_op(struct kvm *kvm, void __user *argp) { struct kvm_sev_cmd sev_cmd; @@ -6032,6 +6051,10 @@ static int svm_memory_encryption_op(struct kvm *kvm, void __user *argp) r = sev_launch_measure(kvm, &sev_cmd); break; } + case KVM_SEV_LAUNCH_FINISH: { + r = sev_launch_finish(kvm, &sev_cmd); + break; + } default: break; } -- 2.9.4