Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp21110imm; Fri, 25 May 2018 13:24:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrkOwBZgBzpVKT7C+6B/ZOqKo+S0JIRI1w95DQNg9cWkl70WZakHszTuVFkb8p4UwHntwyE X-Received: by 2002:a17:902:a60d:: with SMTP id u13-v6mr4079474plq.40.1527279876930; Fri, 25 May 2018 13:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527279876; cv=none; d=google.com; s=arc-20160816; b=sDYZI39BPXnZCPeW1yq7cZGGbVBuzQZ+xYLJGFmj6rcpzZvxMeaMPsB8zM1foBi+kl I4CazU+LLe7vV92aOwH87UtWQG40bviOCtjayCq6rpAjyFQndgnBrH8UOQ0MWNJZxf0T ZX3b5o0LLhRB8HNv+Z6ApkZ23e9ECstMrZ0BQKGiiUy5n1RqD2om0MBkYP6SlZHpc6KJ YZchwO5pN9yl1M55JV4qovxloZ+UKwbynB2ppK60UvUMe2qdwpRUMnq+8MVjkVr/8Xvo QBsM1rcjEKKCUqf0geKlx9S+UFtSlLpcvwBLIFh1skSbAiWadZnczS8zMqgnujYlfrax XEpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Yj0WhbnZqa9QII6yimIXIXXxZnsOfWdnmgYa4vP7pQc=; b=lHcJqFERqbl942+pCjRSwRVzmC5myLbY8kXrUI+QFGrH3GeuqmcFTeSbWkhsO/8yRF Ax7MV4KjzFXqFXJqWhwd4W30p5QHY+XvXzQtKxVtmvw+/2wzJHXCr2oEWdLBaOAsLAhw BpIn5cFEvL0oQoemoudFRphty1VAFu8XdGqc6AZP9d3WdRoSsc1Zx1rIhenReIk5wJ1h ti+AdubunV6/rhIXSvkP23H0LDGaOjfnyGG0NxzDCMJ2P4/UOwy2mMiTc8+0GGdMBHi5 axxCIZ0conQFhkjqJ+62KD0X72Gjc3K6zvvzAhRR/zWRg1O97qtzDGuqCW2406lddxhA me3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=kYNXri3p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 34-v6si24727372plz.66.2018.05.25.13.24.21; Fri, 25 May 2018 13:24:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=kYNXri3p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968342AbeEYUYE (ORCPT + 99 others); Fri, 25 May 2018 16:24:04 -0400 Received: from mail-sn1nam02on0059.outbound.protection.outlook.com ([104.47.36.59]:55968 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S968304AbeEYUX7 (ORCPT ); Fri, 25 May 2018 16:23:59 -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:X-MS-Exchange-SenderADCheck; bh=Yj0WhbnZqa9QII6yimIXIXXxZnsOfWdnmgYa4vP7pQc=; b=kYNXri3pc565fPeziCj6YyN+2TzU+QLGDkVNj0B/0smJ8qtGxFaFegUjn1HXsIdhjlANyN19IRphKnXO6GTZidyI68YUGVv43vxY0n/mzpkN3UOtET3tO96TFu8nVFGeJkwQpQGYQvo0aCYgrS5dCRvO6A+TF7OOQ4mRY6Xjsqw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Janakarajan.Natarajan@amd.com; Received: from gi-joe.amd.com (165.204.77.1) by CY4PR12MB1368.namprd12.prod.outlook.com (2603:10b6:903:41::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Fri, 25 May 2018 20:23:54 +0000 From: Janakarajan Natarajan To: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tom Lendacky , Gary Hook , Herbert Xu , "David S . Miller" , Brijesh Singh , Borislav Petkov , Paolo Bonzini , Janakarajan Natarajan Subject: [PATCHv2 2/2] crypto: ccp: Add GET_ID SEV command Date: Fri, 25 May 2018 15:23:30 -0500 Message-Id: <00cb51b73bb427d9df36bcbb17ed85c1802d98c6.1527274270.git.Janakarajan.Natarajan@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN4PR0801CA0019.namprd08.prod.outlook.com (2603:10b6:803:29::29) To CY4PR12MB1368.namprd12.prod.outlook.com (2603:10b6:903:41::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:CY4PR12MB1368; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1368;3:zo0wNkmgpxEPabZLkNI5cZGWzGxGZrNzuWLGO3TxUPCPtdOx6zdml40k9rMIDnODgX4lDhYiZiOSSYgmgkwemtOjmqEukP9q18Sp0/iBdMCMASl/YzXmE63VhS4FRW72dBD+2Wx0t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lmWA8Po0vvI9SFCqp6ku55aCqOz5+c4M3pmJNdnV+zmxVrQPXPGOziiMsfm2fh+QyaFJRnB/iMUidtHsA/KBnq4rjSEgddv92eXPVYZlFYECeZuUDTyaRVRxJ88F3HJ7Ir4WYn8GuCT3rM0kAgcfxrfmURda9yIUgeyHnfUe99GPSaRBZfA1KDGygYWb9X63bjqcL3uxS4z;4:42/boFv/K5iNx632f7In221qYfqZfUdFvXSvsgkSJIihmJhXRawuL2zlRfCLD6Hv+q3twuBS6dUA5AgjG79mRLifA/QKvxM5EgooMY3ih/7G69YKw+mW0qV9Q2cDtdqD0RlcVgbOFtLCBdOqfjFPNdY/78AE/5gHl+uBvZGonJrclXIZIc+PtWLUmPs8IbVqhLbJvECcUCldP1ICiKr3uSLV4reua2mFjZpXjiTVRCyQTdMOoxEgw+NyQzkua6kdP7DuV2yHp/WFcarXpsivWqPoSt8P3c/32USTnlc6tGUCaWZFdIKE+aabARt2eUYn X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:CY4PR12MB1368;BCL:0;PCL:0;RULEID:;SRVR:CY4PR12MB1368; X-Forefront-PRVS: 06833C6A67 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39860400002)(39380400002)(346002)(376002)(396003)(366004)(189003)(199004)(118296001)(50466002)(59450400001)(72206003)(6666003)(106356001)(68736007)(48376002)(53416004)(966005)(6306002)(2906002)(4326008)(305945005)(25786009)(6486002)(53936002)(3846002)(5660300001)(105586002)(97736004)(478600001)(7736002)(81156014)(8676002)(486006)(36756003)(6116002)(50226002)(81166006)(54906003)(316002)(8936002)(956004)(2616005)(386003)(7696005)(446003)(51416003)(76176011)(66066001)(476003)(47776003)(16526019)(186003)(16586007)(11346002)(86362001)(26005)(52116002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1368;H:gi-joe.amd.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR12MB1368;23:FeJJA8tCQ+Gkf19AYfmmkCu8wFO3de57QMMkknLHF?= =?us-ascii?Q?1qOvHu7Cz9OGQr0yMpqPeiN+Jcoj7xzvPEpwBFRY6fgBsJ8i3lvc2X9zxrXl?= =?us-ascii?Q?qgwPR02/d1H5zorV4go4BSHq6oaH/p/DK3xkAwi5UwwuGg/YSM9tjnJNJYXI?= =?us-ascii?Q?wd74kp1TovOcxP3xBKe+UrXuP1dOt0cChAzYGpwWTTTEHJc/t8e4pyydDpyp?= =?us-ascii?Q?NlTNJzEj8DBK9ParfKvKV/ymkm+WOhkujRRYlxVmZwMWL3N3EJfxbn0U2S33?= =?us-ascii?Q?SkvcoKoDiLsh1FZaGDqfPyUbBDS7jDfA+SK74fxuwSC8H/s+P0fs3SkPu8Bd?= =?us-ascii?Q?7TXoSQq9mO+XXfAXT8eWJ6PxHwqfqsdJ5uqnCoOl4onDiuIcGe75K8dKZCm9?= =?us-ascii?Q?NdvhyOfNhFMS/X5J6wMbSRseXSLwxiglQTqtSrSatHJfvGxrVxEXElllvqFF?= =?us-ascii?Q?45coqVdHLdr0+c6Vfmtv3ZD7A7x0Xe8kTTjcbZ5YcGIHDGkOzNIdxH6NXXgJ?= =?us-ascii?Q?RXCbLAiHP486Fb/2E0sCugLmcZ/SaY85edqMnQ3/5PPORB8yKaTlTsVSRQQt?= =?us-ascii?Q?wqjrPlnghmFgEtiayXIIOqpg0WdU/pcPYnWdx3Z8FeO6+tRxT/qFr1jXdo/V?= =?us-ascii?Q?jr8RQrzvsiNcPVwfrXaACOCxvhKi1Y0ca6YXyl4eLXy+ImEc6eCicYa8eKCx?= =?us-ascii?Q?UG/W7BTxkUdCx3cRFu3E/EqqRgYzn3abE7zgYHjTwWlhWrKnL5uO5HMTZUgc?= =?us-ascii?Q?iYgSq1e1ElGd4XsMhohXsPzUN6B6h12/evDgk0aDALrjxCSjmzWYChoTCIQB?= =?us-ascii?Q?jhCVuYIFQos0YGgTdA7TK6hyDt3CVLJniizTUVutMTwK3/jEjuTuXtZJXASc?= =?us-ascii?Q?BSQ6mTOyIz51yXdik/uVXSB9FJnGQlPcc4yBsfY+HjDV6AmGOv8zYrlwX8wb?= =?us-ascii?Q?b5eQbmOIEpbLzNhKvug86tUz/Qbli0nDXq4cFEE6ALbsT5zvdsPFQW0eD5Uu?= =?us-ascii?Q?9sMdk8AAgBeyGKuIgIjzR+6Ywzdofdz4YmhXUsJrUfww5W4EquMG2jhaJup7?= =?us-ascii?Q?nN/4fxAjrINYqLZiVXkEtQ/9Amolg35qFhWNN68q/QCmu1HjWvsbFYlIkjfe?= =?us-ascii?Q?hYZZpwdR401InRDdIyxhoaI6YZzPGu7rcCd3Td+OKyqMBFncRwrqCCLk/hvu?= =?us-ascii?Q?WfkSNaa0k2nrGXFWcIjIRJH8oLvCf4OKbJ1MOOQThL24Vql4+6lMbCj9x1BI?= =?us-ascii?Q?utwQrUCOiiRMwL0ul9hxLiFO0/EQMlDQD2Bejj/Qns7eNoTOjr64HqcQxR2i?= =?us-ascii?B?QT09?= X-Microsoft-Antispam-Message-Info: 9RnxVooekFlaMSa7BsnBCd1RrM5lYZqCwRpTCyriZCpeARcdv/1EqrJuY6r74dGlRZW3obXXDSjY9OaZjg2ddCB6f2MK9ZG6JwgankHKSHDtwqqk48Nt7kyqvJZsL0P1F4vw99nM7gwAcujFdd5daND7pP6+Y46lE0DMjq9HBA76P94IVZpZrg3S2SYQFaRl X-Microsoft-Exchange-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n/vlyDnor27iGM/KfgaymycReivZit3TCeH5LV;20:UEd9p7YR/1VWDAXB12t0pGV6ojHdzHPLLcOZAPwdeIjdcxKwFeBZeRdDXTokJhmSr06mnwNx5AnDIHhu2C14u9O30oAc/sgnR765wHMTUayatEG9ND5gmShf59Ghs0bzftRoWekFej7qjBnp98rpKlSp+7J/7k+2GVCUSxw3N7TvxRy7we4FWiXNvA+/Tm7V1UaoJuYA3s934agsG0bTQKwVj7O1BLewQVGD04ywPn4+GD7C36duZv+6RTu1Mmvp X-MS-Office365-Filtering-Correlation-Id: a5d8f227-f65d-4994-f699-08d5c27d7062 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2018 20:23:54.8933 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a5d8f227-f65d-4994-f699-08d5c27d7062 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1368 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The GET_ID command, added as of SEV API v0.16, allows the SEV firmware to be queried about a unique CPU ID. This unique ID can then be used to obtain the public certificate containing the Chip Endorsement Key (CEK) public key signed by the AMD SEV Signing Key (ASK). For more information please refer to "Section 5.12 GET_ID" of https://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf Signed-off-by: Janakarajan Natarajan --- drivers/crypto/ccp/psp-dev.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/psp-sev.h | 11 +++++++++++ include/uapi/linux/psp-sev.h | 12 ++++++++++++ 3 files changed, 67 insertions(+) diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c index 12838b4..ff478d8 100644 --- a/drivers/crypto/ccp/psp-dev.c +++ b/drivers/crypto/ccp/psp-dev.c @@ -119,6 +119,7 @@ static int sev_cmd_buffer_len(int cmd) case SEV_CMD_RECEIVE_UPDATE_VMSA: return sizeof(struct sev_data_receive_update_vmsa); case SEV_CMD_LAUNCH_UPDATE_SECRET: return sizeof(struct sev_data_launch_secret); case SEV_CMD_DOWNLOAD_FIRMWARE: return sizeof(struct sev_data_download_firmware); + case SEV_CMD_GET_ID: return sizeof(struct sev_data_get_id); default: return 0; } @@ -510,6 +511,46 @@ static int sev_ioctl_do_pek_import(struct sev_issue_cmd *argp) return ret; } +static int sev_ioctl_do_get_id(struct sev_issue_cmd *argp) +{ + struct sev_data_get_id *data; + u64 data_size, user_size; + void *id_blob, *mem; + int ret; + + /* SEV GET_ID available from SEV API v0.16 and up */ + if (!SEV_VERSION_GREATER_OR_EQUAL(0, 16)) + return -ENOTSUPP; + + /* SEV FW expects the buffer it fills with the ID to be + * 8-byte aligned. Memory allocated should be enough to + * hold data structure + alignment padding + memory + * where SEV FW writes the ID. + */ + data_size = ALIGN(sizeof(struct sev_data_get_id), 8); + user_size = sizeof(struct sev_user_data_get_id); + + mem = kzalloc(data_size + user_size, GFP_KERNEL); + if (!mem) + return -ENOMEM; + + data = mem; + id_blob = mem + data_size; + + data->address = __psp_pa(id_blob); + data->len = user_size; + + ret = __sev_do_cmd_locked(SEV_CMD_GET_ID, data, &argp->error); + if (!ret) { + if (copy_to_user((void __user *)argp->data, id_blob, data->len)) + ret = -EFAULT; + } + + kfree(mem); + + return ret; +} + static int sev_ioctl_do_pdh_export(struct sev_issue_cmd *argp) { struct sev_user_data_pdh_cert_export input; @@ -647,6 +688,9 @@ static long sev_ioctl(struct file *file, unsigned int ioctl, unsigned long arg) case SEV_PDH_CERT_EXPORT: ret = sev_ioctl_do_pdh_export(&input); break; + case SEV_GET_ID: + ret = sev_ioctl_do_get_id(&input); + break; default: ret = -EINVAL; goto out; diff --git a/include/linux/psp-sev.h b/include/linux/psp-sev.h index 1d24962..827c601 100644 --- a/include/linux/psp-sev.h +++ b/include/linux/psp-sev.h @@ -55,6 +55,7 @@ enum sev_cmd { SEV_CMD_PDH_GEN = 0x009, SEV_CMD_DF_FLUSH = 0x00A, SEV_CMD_DOWNLOAD_FIRMWARE = 0x00B, + SEV_CMD_GET_ID = 0x00C, /* Guest commands */ SEV_CMD_DECOMMISSION = 0x020, @@ -142,6 +143,16 @@ struct sev_data_download_firmware { } __packed; /** + * struct sev_data_get_id - GET_ID command parameters + * + * @address: physical address of region to place unique CPU ID(s) + * @len: len of the region + */ +struct sev_data_get_id { + u64 address; /* In */ + u32 len; /* In/Out */ +} __packed; +/** * struct sev_data_pdh_cert_export - PDH_CERT_EXPORT command parameters * * @pdh_address: PDH certificate address diff --git a/include/uapi/linux/psp-sev.h b/include/uapi/linux/psp-sev.h index 9008f31..ac8c60b 100644 --- a/include/uapi/linux/psp-sev.h +++ b/include/uapi/linux/psp-sev.h @@ -30,6 +30,7 @@ enum { SEV_PDH_GEN, SEV_PDH_CERT_EXPORT, SEV_PEK_CERT_IMPORT, + SEV_GET_ID, SEV_MAX, }; @@ -124,6 +125,17 @@ struct sev_user_data_pdh_cert_export { } __packed; /** + * struct sev_user_data_get_id - GET_ID command parameters + * + * @socket1: Buffer to pass unique ID of first socket + * @socket2: Buffer to pass unique ID of second socket + */ +struct sev_user_data_get_id { + __u8 socket1[64]; /* Out */ + __u8 socket2[64]; /* Out */ +} __packed; + +/** * struct sev_issue_cmd - SEV ioctl parameters * * @cmd: SEV commands to execute -- 2.7.4