Message ID | 20171106181130.68491-16-brijesh.singh@amd.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Herbert Xu |
Headers | show
Return-Path: <linux-crypto-owner@kernel.org> 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 B813760247 for <patchwork-linux-crypto@patchwork.kernel.org>; Mon, 6 Nov 2017 18:23:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF46C29E00 for <patchwork-linux-crypto@patchwork.kernel.org>; Mon, 6 Nov 2017 18:23:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3E7E29F0C; Mon, 6 Nov 2017 18:23:15 +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 49DA329E00 for <patchwork-linux-crypto@patchwork.kernel.org>; Mon, 6 Nov 2017 18:23:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933078AbdKFSWb (ORCPT <rfc822;patchwork-linux-crypto@patchwork.kernel.org>); Mon, 6 Nov 2017 13:22:31 -0500 Received: from mail-by2nam03on0078.outbound.protection.outlook.com ([104.47.42.78]:49424 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932671AbdKFSM0 (ORCPT <rfc822;linux-crypto@vger.kernel.org>); Mon, 6 Nov 2017 13:12:26 -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=4+PiGyZYcgYU+FOcutFaCkfDAH0N1aykpx2Grvbf9rw=; b=0JpJ9jwMAt/AHhVFoL/0ZZou8+BsH0CKfi+RW/YtGoIkpfcxu0EcDRs2zR483+XhtQ5iHiq47YYuKIuNqG0FQQvCkUNemniKA0suRAG0U7+4wQjqtdzeM9+1vqEYzzDem2lM+i+gZMbDU5hW4QohUyWDqWDnqGbaE4mINa3ryVo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by SN1PR12MB0159.namprd12.prod.outlook.com (10.162.3.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Mon, 6 Nov 2017 18:12:13 +0000 From: Brijesh Singh <brijesh.singh@amd.com> To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: bp@alien8.de, Brijesh Singh <brijesh.singh@amd.com>, Paolo Bonzini <pbonzini@redhat.com>, =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= <rkrcmar@redhat.com>, Borislav Petkov <bp@suse.de>, Herbert Xu <herbert@gondor.apana.org.au>, Gary Hook <gary.hook@amd.com>, Tom Lendacky <thomas.lendacky@amd.com>, linux-crypto@vger.kernel.org Subject: [Part2 PATCH v8 15/38] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command Date: Mon, 6 Nov 2017 12:11:07 -0600 Message-Id: <20171106181130.68491-16-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171106181130.68491-1-brijesh.singh@amd.com> References: <20171106181130.68491-1-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR10CA0031.namprd10.prod.outlook.com (10.175.102.145) To SN1PR12MB0159.namprd12.prod.outlook.com (10.162.3.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e08b1f91-058e-41db-d08f-08d52541e8c2 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603199); SRVR:SN1PR12MB0159; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0159; 3:MaK8lS6OIDFMzTquksQjPT2g/hOm7qUxI01FENQSg0Tc+7M0dFWZyDur2EjafsiB1W1BidWITfp1WY6DBIuWbgFCDQRkGWSI8yzh63nuXp86pkOJf7ppYQ/ekC+wt7LukCGDhHYbc1dFgaRrL2VWlPwaPiPLvu1ve4jb0MzBwCEEEF4GDAQI5UY8Sw5zV1dLefkaMWS1mlV2GEzsHQKiolblv95cwrtYSGPlEcHxU0iqMVyEp1+diEjQUeSyOu2x; 25:P8nrwTPJc/0sKyQlHt9BjHETNyQFPy8rFrUKa1pkD7ksrMJ/fjHYyl+B2oktthOZ1GQeaPR/B7EAw7920lhpFaISeROPx1dipk2pRWFM7ebZ7FaIdMaY6ZHY8tdTAZOhwmEVynXdpwnTrTcWWy1j5pb5ZU3lcf8oKS70fKASRTNjUHmliC1jSeAmhYi/YLhLMK0Tt6wlea/W8MN8JAYRvckHRQfkSb2WsUcSTf6vHkeWItBlqReZsUb/EiQqKGZYxZ4M5EreMUSZ4EED85dHfBnFwjcu9IIvn2qkfuaVMKFw0EFqrRGFFxhEOsdRJ/9eAy/HlKA4kX6uJ4rpClgvkQ==; 31:DpbKE/VAJ9SxJyJJoy2ltAciqxjNB9NT4epHlfV0tea0Dr63jde4G7WqTQIfk0NPkOYMvCuPS+AB/wgnpJFUW+Xe0AQI5EH4mjHtq8XWnG11QvrJ6mK4g5brRnRA4sZ87jc+ThTeHgVIpexx/OUM940T1cU8SJfuvxiWJcoo2yWYM/n2lOTugiARMgs4qhNNX1zZ7/mjIocRZZ9yR83/eNayJKYn7VZj0ND7l5WmULU= X-MS-TrafficTypeDiagnostic: SN1PR12MB0159: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0159; 20:Aqb79RVJZ1EKF6lfwTtlveFinArnlBHItnp8b+FY8zr7uVM6rvU5/w+Ch6n6IqhGmlslg9teMeNBeGYTZ1lUKR19OzIaq2RJZpM4pgrWhPayXwVearDszfghhpxiAP2deC19MNwT1bT0QzrioQ+u23x4185T6mnmtqlWGPPgiM+hjClaUoUCMxbMFBX4/9dw+1M5DgwinAJCxnVk/K2JMoaH9Gw67jg4haeJ9BVDQpz3ghTyQuOuSHif4V66kNNhyTbkT9SOB829pKfbCx+k3hrQT+ZJWBkP3SqVXcmD51DKOCvbitu6xHjTpHYBGwqYitB3B5UKGrI0I0hHVjszS72jUPPz4CpCapeoy3dRw1W+N5OfQx0ZDG7jWUyfCyu93Lc4oaHBa8B7oBrpCtQbgvm2VeIqqdSNDf6tuwQXvuoXrnN2mk7sg6FQZv9c2jFW3LGcQiZxx2k/wdL82HDPy05VZlb6pDJo3SrCWikCoNsfj3qWTvytnKvgcaFiVEHZ; 4:F8wN3Z1sayGhCDfJ/odlocZx4C/42SI1uQwgcS8x7xgOl3OFJeJwLWfeS3gNPpIrNrJ2/DRAMgIvFtJyYXbfMfxSpAy9Vk3D4im3jvGdN0lbpvv+8wxAmNtgw2HePFZdjYhwrIB2zu2qT3i9FyFAXIEDmwslaXp6HodrqCLr2D2ldNuj3yrby1O+bhqrnjLo7ChY/QpU4K2UgCJqYRvAPlSCodgMLeHiK11IXZuZIAG2Kh7mj1iCIyoGXl1urkWg5MXVRcCazyudqJwjcuNcwmMkLpaXaMI778d5w/ehDQaFab3yewkOBzBHaoQEZO5nZkG0gqzK94hX0/bQdh4l6g== X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(767451399110); X-Microsoft-Antispam-PRVS: <SN1PR12MB01590F9D72A3D01796B7E93FE5500@SN1PR12MB0159.namprd12.prod.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3231021)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR12MB0159; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR12MB0159; X-Forefront-PRVS: 048396AFA0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(189002)(199003)(45074003)(68736007)(97736004)(4326008)(316002)(16526018)(54906003)(7736002)(8936002)(2906002)(81166006)(81156014)(25786009)(53936002)(8676002)(2870700001)(1076002)(6116002)(23676003)(50226002)(189998001)(305945005)(86362001)(3846002)(50466002)(33646002)(66066001)(36756003)(53416004)(47776003)(5660300001)(76176999)(478600001)(6486002)(105586002)(50986999)(2950100002)(101416001)(106356001)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0159; 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: =?utf-8?B?MTtTTjFQUjEyTUIwMTU5OzIzOlV5dHk5ZHRieE4ySmR4c3VCc3BBNGc3Y2Fv?= =?utf-8?B?TXRjdS9lVjFaeWtWeVVic0FNVmNWRFF0UjJHM01CM0lHL0lkREttZURnYi8z?= =?utf-8?B?ZGtkWGZBSkQ3S3lCK0VnRVUwNXF4dEVReWFRSHJxQ0pQSHNYd2RXbXpNRG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EzUemFukumr53H1snpJWtvJ5qJW9hprQVaxkBBHW3OUlzxXOkD9SQe8YckKggie1Cc+Qicg=; 24:Gbh84YjjfO9S89HwVMgnvVzN1kJWWcQJEBzTzBUC3ASmo3yCd/sEhgi74afU0tEd3dJFtUlcQ1ay4iP3hbKgg6CKO8V9bD3n6K2v3GBOjoY=; 7:44kwCl6M+SqwOEoEp5hvLLa7S51NLgV+8XskepzljYwJ1lv1LssFw/Jau9+80/ActtqKCbV4qgdDliV3B3ryD/m77qY1I6T4hkAiZ+LegIOosNKGOez8H4lWuyca+gt9238dkdrtAQ0V50yemGK6VnhfeFTIz5MoNWZc1R/J/cZ0BlFY70/G15ZYGskdDjdf2KipuLqdnEooEMVX+btlgGKXgOwTS6/P3uWDIt6GdepwmW5T/zTANx4an9+H3IDv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0159; 20:6y9bYjf0L5GXaPDYQdV4klr077GAjbl8WtnmodnJn5OefuJ4oFxQIOhic+nqvlumHSQXvpsHsrywEbyNplLro0DSGFHee8ih5lWz+ZobcKjMqHW5Zgikr/7QdaHpI7NqYabTb0y3fL6INZ++8UUNhRxQUCWpUtvHLFjqEN8roq6dh2TtJnR4VQF1m0o7z1W5RHXtjtzEZJhQ5yh8BuFPOXbA3M+A0oU9r6/sLsVVFFFzaPht6NmKGqp54nSqvwr7 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2017 18:12:13.6601 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e08b1f91-058e-41db-d08f-08d52541e8c2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0159 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: <linux-crypto.vger.kernel.org> X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c index b49583a45a55..a5072b166ab8 100644 --- a/drivers/crypto/ccp/psp-dev.c +++ b/drivers/crypto/ccp/psp-dev.c @@ -274,6 +274,21 @@ static int sev_ioctl_do_reset(struct sev_issue_cmd *argp) return __sev_do_cmd_locked(SEV_CMD_FACTORY_RESET, 0, &argp->error); } +static int sev_ioctl_do_platform_status(struct sev_issue_cmd *argp) +{ + struct sev_user_data_status *data = &psp_master->status_cmd_buf; + int ret; + + ret = __sev_do_cmd_locked(SEV_CMD_PLATFORM_STATUS, data, &argp->error); + if (ret) + return ret; + + if (copy_to_user((void __user *)argp->data, data, sizeof(*data))) + ret = -EFAULT; + + return ret; +} + static long sev_ioctl(struct file *file, unsigned int ioctl, unsigned long arg) { void __user *argp = (void __user *)arg; @@ -299,6 +314,9 @@ static long sev_ioctl(struct file *file, unsigned int ioctl, unsigned long arg) case SEV_FACTORY_RESET: ret = sev_ioctl_do_reset(&input); break; + case SEV_PLATFORM_STATUS: + ret = sev_ioctl_do_platform_status(&input); + break; default: ret = -EINVAL; goto out;