From patchwork Fri Oct 20 02:33:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10018687 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 BE6AC60234 for ; Fri, 20 Oct 2017 02:41:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A902A28E8B for ; Fri, 20 Oct 2017 02:41:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E21528E8D; Fri, 20 Oct 2017 02:41:26 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55E9328E8B for ; Fri, 20 Oct 2017 02:41:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752136AbdJTCf1 (ORCPT ); Thu, 19 Oct 2017 22:35:27 -0400 Received: from mail-bl2nam02on0071.outbound.protection.outlook.com ([104.47.38.71]:59884 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752106AbdJTCfW (ORCPT ); Thu, 19 Oct 2017 22:35:22 -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=3R1R4WUhEiZ6FJWEwFgi2tvjWSWkF02s2E3JPj65UVs=; b=ROvQjdkL2aDV4kZoXi8YkjBDgQ6yJ6FbKfp5Wd8umshikt97epaAr7fCj/PTebmyw4k9HMkx3TpN84PehnnOO5HxTcG/s3PkfbBlEs4IVH8nxnQlG5wkXStc2UvoYFuxXUo43AYHshManNB44RACCiJEUT15uD1KH8Ir5Fjf4Bk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from ubuntu-010236106000.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.156.4; Fri, 20 Oct 2017 02:35:05 +0000 From: Brijesh Singh To: kvm@vger.kernel.org Cc: bp@alien8.de, Brijesh Singh , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Borislav Petkov , Herbert Xu , Gary Hook , Tom Lendacky , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Part2 PATCH v6 17/38] crypto: ccp: Implement SEV_PDH_GEN ioctl command Date: Thu, 19 Oct 2017 21:33:52 -0500 Message-Id: <20171020023413.122280-18-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171020023413.122280-1-brijesh.singh@amd.com> References: <20171020023413.122280-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: MWHPR1701CA0020.namprd17.prod.outlook.com (10.172.58.30) To SN1PR12MB0157.namprd12.prod.outlook.com (10.162.3.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c36ccd38-5f04-4634-41b4-08d517632cfa X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR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fEyRK+vl1OQruScwvoTxhkSIhkfc4sX9rGXmbmWZfonjhIY5N9lIo+jH3L20wyp/P/nr1HjlqSw0k8FtmJfkzmk54W3aOrHNkDjdgy79ZsZ+ZDRZ8Uk2GD1satQ+Aag/RQkDkwwjhifsIhXUkZ3k8JJbEtuvK2pozvHipO7Z2c/8NEYjEd7l0UmPo1NOr4bSlMDy7FEHs6uVdVSPIYkUXwhlkR2SaMEv0b2qQgzV89lW6NYKw5fHj/rGtFqxDPaCg7iXYg/lRdkLAUsHLHrjg35DSg9KzCqdzYIspUZOo7YXTxd4LljcciFA6J0zGHSSzZBbbctvh1T9iJY7Gxj+HAr28faJ/zat77ZSNXXHbuqzQVUJrS6JQ9Qn/7690f9iQD1fSBsYGOomrrjUbmGMV; 4:s5HMD0JN3kGD+kjRR+RPd38FEFebJNthTDuPkPi60FSv7SVB9BgvS0VhXhcgTUqDf7zFmiVDKf2Bv+Je3Z+3arqHc7Kmmf2GsbeXyPNbgzPP+yveeLsqK62V5qdhtCHL+odZLHe/W8qJ+7I7ZYVLccRvxF5ir1zTyDB6Lz6BjjNiVV4wpUw4T+vIcVx/4Mye9BksZ20mYQHIAex2wTFBGQzNdVm1a3VzrMJXdNgDvlJ98I9oCtOPjWBRRBYNg9viCGOiETIKz3hl4dZ6aw0ByOsrdp+cGeBIl8Dn/LuKD+xjMbgesx/pWBV5dVgnWGho X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3231020)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123555025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR12MB0157; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR12MB0157; X-Forefront-PRVS: 0466CA5A45 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(199003)(189002)(36756003)(7736002)(68736007)(50466002)(1076002)(478600001)(4326008)(16526018)(316002)(53936002)(6486002)(86362001)(305945005)(53416004)(54906003)(50226002)(2351001)(106356001)(101416001)(81166006)(105586002)(8676002)(2361001)(76176999)(2870700001)(2906002)(50986999)(6916009)(23676002)(66066001)(47776003)(6666003)(97736004)(6116002)(2950100002)(189998001)(8936002)(3846002)(33646002)(81156014)(5660300001)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0157; H:ubuntu-010236106000.amd.com; 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?MTtTTjFQUjEyTUIwMTU3OzIzOlRuSlNmYkJrbkF2OHlCRE9Kd25ZR0UzWmJ2?= =?utf-8?B?R3p2S1hwSjVQMWZocCtKaExDOWhadmhUcmFnTzUvdU9GR1pzL3RKVWdDNkgv?= =?utf-8?B?M3FCUVdzMDVML3NhRFBxNmN2UzVEZE9RVHpQc1dNaUFFQVZSWWFVY0NOc3hZ?= =?utf-8?B?QkJuQ2dBZTdsdUN6YVNLcDFkTTdIMTNsRGp0djR6VmVTM2VqZm1mOVhjUjlh?= =?utf-8?B?ck1VdWVLWlZ1cjljaVAybmpBSm11cnVSSmR3QUlOZG1BNFNtM3FjS1dkaHVU?= =?utf-8?B?Vys2NHNBdDBxTTVwM2Jqd3JsZ1F5blpuQlUxL3c5cG1PL0E4S3d3QTZkNys2?= =?utf-8?B?S2FWOGVuVno0WnZiSWg5a3dUMmJ4TzZrU2R5OUsrQ0xj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MODVfM71BiNXbClGOEsvbRfZCXij0dY/qinQ3DHXQvazErSlDbj7sD3BURJvpzD0tdiwcg8tH9kcLwpOr1SpzH46zjdY1l3E09ZzZZD7LxJA0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0157; 20:4HxkZUiT3SnXoZ3E0cKqKs7priA929oqOAzyxe64m2uxLaM2sSUhZZGnD2+EX8iHHu645C8OE8/Q7zgPsnMx6GfeKWzKMz7+uDFfGDTZ42cQFoQehXFS10rbkOLl+LdZ2Rl5ZQtqV9HTR5Zean5Fgourc0jD1L6+DixnuM4uZ4i4cFcI8WM6nmf13oXCZlJvqOFR/yL15Yi5ngqMkWUD30PfENSoBGawG6b8iZFXPik7WAZht2zpom406OfJs1uy X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2017 02:35:05.1905 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c36ccd38-5f04-4634-41b4-08d517632cfa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0157 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The SEV_PDH_GEN command is used to re-generate the Platform Diffie-Hellman (PDH) key. The command is defined in SEV spec section 5.6. Cc: Paolo Bonzini Cc: "Radim Krčmář" Cc: Borislav Petkov Cc: Herbert Xu Cc: Gary Hook Cc: Tom Lendacky Cc: linux-crypto@vger.kernel.org Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh Reviewed-by: Borislav Petkov Acked-by: Gary R Hook --- drivers/crypto/ccp/psp-dev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c index 1d7212da25a5..d9771d104eea 100644 --- a/drivers/crypto/ccp/psp-dev.c +++ b/drivers/crypto/ccp/psp-dev.c @@ -239,6 +239,9 @@ static long sev_ioctl(struct file *file, unsigned int ioctl, unsigned long arg) case SEV_PEK_GEN: ret = sev_ioctl_do_pek_pdh_gen(SEV_CMD_PEK_GEN, &input); break; + case SEV_PDH_GEN: + ret = sev_ioctl_do_pek_pdh_gen(SEV_CMD_PDH_GEN, &input); + break; default: ret = -EINVAL; goto out;