From patchwork Thu Mar 8 12:48:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10268031 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 6ACAF602C8 for ; Thu, 8 Mar 2018 13:05:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A3332987B for ; Thu, 8 Mar 2018 13:05:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EAB329904; Thu, 8 Mar 2018 13:05:43 +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=unavailable 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 A4EDC2987B for ; Thu, 8 Mar 2018 13:05:42 +0000 (UTC) Received: from localhost ([::1]:38549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etvEr-0002Zg-NM for patchwork-qemu-devel@patchwork.kernel.org; Thu, 08 Mar 2018 08:05:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etuze-0005Cx-42 for qemu-devel@nongnu.org; Thu, 08 Mar 2018 07:50:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etuzZ-0003yM-Ni for qemu-devel@nongnu.org; Thu, 08 Mar 2018 07:49:58 -0500 Received: from mail-cys01nam02on0066.outbound.protection.outlook.com ([104.47.37.66]:52661 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 1etuzZ-0003xW-Fx for qemu-devel@nongnu.org; Thu, 08 Mar 2018 07:49:53 -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=cOnc1P1wctgY1YibWGFUBBzMdBnXweNpGN6vslTLgiU=; b=xd8qkq0EpD1pbsis4cTdqL+r8y/UJwKzj+kVhfVx2pFz9DEPOC4jB1pChJoVPTIlOswKZpbGugFkgR47tIsl7IUM+1S1yTM6Cp/JpxIcoIEzE0LMqR857chpDHMn29u6OoidNPooUDNg7uATZ0YL2jqHJ64GjmjLNMj6ksRLBqw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by DM2PR12MB0156.namprd12.prod.outlook.com (2a01:111:e400:50ce::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Thu, 8 Mar 2018 12:49:48 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Thu, 8 Mar 2018 06:48:43 -0600 Message-Id: <20180308124901.83533-11-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180308124901.83533-1-brijesh.singh@amd.com> References: <20180308124901.83533-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR14CA0031.namprd14.prod.outlook.com (2603:10b6:404:13f::17) To DM2PR12MB0156.namprd12.prod.outlook.com (2a01:111:e400:50ce::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a94b040a-b5a6-4485-a6d6-08d584f314bd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DM2PR12MB0156; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0156; 3:g80mWXbTDcanDEU0hzGrddY7D0VTn1Pg2TyeyjwW2fbO+S8of/umsLWnv/mHjiHyAKaHrszaIu6Utqxo6SvMmMryC4uBDRInFhcA2YU84vXIZIHDstmboD7jJZjdMlpOtedR1seIImdWdjAD19Cb6nHKaPqLd7qnz1JROCxqKJm+WZQ2lMUNci2dIesPh7RjqsHuHRGvVJEi+5MnrOmPSw+6zjcBfKH2BIdre0sNWdjn1y+PT0WutYFz37zBA+58; 25:O7sgyAPSSmHpIBSdKDrVjRLMf/aJsAsOzC2k7Jh5pFqgc6nLxI5LuI5VR5FhgRkwnGLdDe7hyQtzpsWnmZ3lxbip6OS7HNmpFzv37srBMQquTRtMCTVtJmZDT7HVnNljCvZQOvr5/J+W0hRZN1JXpWOIWR4Q5PE4zdI9El6TXqpNVyQ/hjkXqLIV2hCeyk2K8b3RfXfKAJeV99y34hARaNpEk4zsbbXiASKqcXDRmwAT71oXWz1Sm0wGNH1OrX/9NHBiEKqfJzRrSYrlV1etipPhHo+d3CBC/XYCDYMAX0gG2bOXhyKm/yHYDCvgKgHi9XqsXqmQAXcFE5a5ie9V5A==; 31:4yPuz7mJRUGNWZeN88iGAGTom8hivsYQ50ZFP/Z6fgqLxObu1LHM2f1uprI7VuxRSUVd515ncoDEk7KdkHbvukzEnh9esyGjaLmNNq2ByNbaQiG2huOncGQFwtG60YRGVyL53rJajVawQn+HfVCff8ggz1Cr4k74sAhw1fwt5Wcufx5uoRcASpOdR1uxi9V8lmpGBlZO/KhLRPAMb7/RsZnVIijvFLZwKVHv8qXdtTc= X-MS-TrafficTypeDiagnostic: DM2PR12MB0156: X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0156; 20:2i3JscZa1Dg+tcAZREXZ7LjT1cQL7ytBr141JxE4vtHTaFwiiXjGcqt/R1M0X5xImZ3vvsO9pXdGvgoaD8NyhDPrOwJb7hPAOUQiGU8Cqecr3BuWtgJ7tVRie49q9e6jrWc6qpwp5qxnauqZamy37nCiCW/6W3xi0ZMLK9jeXEo0KN0gFQLP0/pjPIY9KclsfHfmI4nihWgiuhkznjtuCqa+ttlKjufHSkgmH9Pq5KVEU3XDgg+IsgncwO4pRt21xUObdOOLP3BuDbGAh/vJWfjG6AbBUJJCft1dPUk7Me2zqaMCzAPMSJULRzGY+kL8SLoSlmq9jkgKyn6ON0OH7uqapjE4iRN9b3I9SscXbSD4GW5Akha5MdopDBBf+PYgcjHLLIywrV/MwZu2Eu3T6QkTie6/8vdb8gUNxcw/0z32AS+itID/L8pshyk/GoEBZkdd9d7mShpAu6ms1W2ax4vYCViszvE13YB4p9CvphpaTD+aHQzcB2ULk3BQ3NHz; 4:pErY5X2fclDiekyGG0IFo4LMj9wVqJxaO8zyYzKUjGfG+VfjwuluEq3t276BRJcmtv52y2vVZJ7DAHQ/3LZgstvX6RsXAFxhfRYL44kjgpBLeNWH7+NjnXYlWNqbWIXpYt4LG9F4X21FeGDp3Jdl0VJVPFh/06copOsSzpdj+4yOyCg/l+E03XVz6xcca7Ts3eMcZg/QgJxkoSZdzuTbQFpiD52oN4cZe+5S9K5mYM2MbzI9AGhE1Sh+BkVX6M/1uyObTcovXCHEvItIe8owB0f05utrqAW1lTm9etwh5Yt50+uQi9ggUeEsXbHyOpKj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(3002001)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:DM2PR12MB0156; BCL:0; PCL:0; RULEID:; SRVR:DM2PR12MB0156; X-Forefront-PRVS: 060503E79B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(39380400002)(39860400002)(376002)(396003)(346002)(366004)(199004)(189003)(50226002)(53936002)(6306002)(2950100002)(6916009)(2906002)(2361001)(6666003)(2351001)(106356001)(81156014)(53416004)(8676002)(81166006)(7736002)(36756003)(305945005)(8936002)(105586002)(966005)(48376002)(50466002)(68736007)(97736004)(47776003)(66066001)(25786009)(4326008)(39060400002)(6486002)(7416002)(5660300001)(3846002)(478600001)(76176011)(51416003)(7696005)(52116002)(6116002)(16586007)(16526019)(186003)(26005)(1076002)(8656006)(386003)(54906003)(86362001)(316002)(59450400001)(8666007)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0156; H:wsp141597wss.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: =?us-ascii?Q?1; DM2PR12MB0156; 23:dU740bJzpYyCN5gmdzj3P+r3DxMOvK7WLaNR1p72i?= =?us-ascii?Q?TevgE5h4w3oZXTd0Mad33BMdV16RrxlwcVBP/R3RIMv2DkzyhRRvLN2zLyy/?= =?us-ascii?Q?rfBCD55l9kZEUiXNokrwtjgejJ+DNIYfhHgf+Y1sQ1DUFCpumz60T9LfnSW4?= =?us-ascii?Q?b+hNeNsaenGW6xnLPZJJ+ZvgJqxQk04mnSyV4YM63b8sqQjqLwuWFfVdiPz9?= =?us-ascii?Q?tx5vCmXx5scBXEjef7L5vGUk8ezMhV++P7rmJSeHg2LkS50WPQ/88Dy5RAwz?= =?us-ascii?Q?8p64NMmlNjAdoN4OVxlvYu/vmbYAU7v8j12Ljb0myBm+Kf7wTjzRRKiNJDyh?= =?us-ascii?Q?aX0ZnSQgT48n5B2wZiz6XLzpUo3uBMC/zexvwFHovCEbfLoeQu3Dm8WExFWx?= =?us-ascii?Q?ogS+z5g2F4cZIci5ujRe33lDtiRTv5IAv35x8x4GGH4H5d63jTnH1MLTFkSv?= =?us-ascii?Q?4FPq7OrW+E0avBGNzeOEqNvxO1eryNkhYixSZMdfT3pqfnZz21cg/+pcQmk1?= =?us-ascii?Q?1lQoJC2YLj1+J0cQK1SZBNtlF4rHRlBEddzoJTGVQcX14b7HEEcXQZBKG6ID?= =?us-ascii?Q?F3iGITv1q5ez+fKhUFytmcveW0XZcGfj6eiuWG0tr8kV+6krc6xXinvBBYk9?= =?us-ascii?Q?yXSrrPDsabwP4WS04uYDJOh3e0JCUUnqiSUykJOL/D0VHGlcGLFjysWG9ZgU?= =?us-ascii?Q?3Gd3EMSBagDDgRHFttr2fzPnXRvSoquydzIGh6nwVAxEpzmLV9+x2no5HvjZ?= =?us-ascii?Q?BvPmSj/zRCB2IFZpIr/Yf7lo+2wh1rNgLq4cqMyMKq6KFinTbCfJY8OPjZqk?= =?us-ascii?Q?9rUroMUUi88zcxWYrfYUdRqcNaBKwMz8ys1HT9aRDjYXyAabqHALywR8j/u4?= =?us-ascii?Q?ZELhzB56LgbexR++q73KOzVYxr2++53hHd4v+w4zffXo51PZSarISKrQ2TtO?= =?us-ascii?Q?i26m/PaHQkelUBv/WKght6hl9YuacDZ9QCS3VmflOOX+whHjMJ4dZ2bfsPAx?= =?us-ascii?Q?uwlOF5VfsDnWYgEmEPtqbR3Pin/rHiOjT8JK6np5G036WQbhPdbg9Uqak62A?= =?us-ascii?Q?7dS36ODKUPQ0CNwmWVrVfYoxQ1Dv9spA8mPwFpBctfgfIVpDqaHKNEp4rRui?= =?us-ascii?Q?MvArIDkaoC4pfE3eOu676UkrUOngapJ2L8Z2zMMOoxl+tYyR2trOxyU1CNV2?= =?us-ascii?Q?OZGoG4JlyPbT14sLHVWRBDO9su7L6cgCfHNQG6uqZihMpTuCCXzOmWNiq2c8?= =?us-ascii?Q?/KGk/6oKgdUPmC/pGzChrdLduNlzm1dPX/fIRxqEucxURzd6okbvMxFKzxnP?= =?us-ascii?Q?1MyhPj1Y7jqsqNKLGnLUMUg43+ibShYmifKW2t7qpNRMqFSOMBCBMx2ffiBr?= =?us-ascii?Q?YTg8Q=3D=3D?= X-Microsoft-Antispam-Message-Info: qHDmnvm27AsrKHdyOlAUcQXspfEFMo1yKafnI/X9D45EXj9RnHGFXOEuNeZplt9WJfEmf/f014lMtH5GSClNaKA1eBS6FkHOmZu12wKsZp17URIXix+CjGnGiHEWGqoGGjlO4pzF+jYr6HwB60X1Aj36bKBt0pY10+7jaeuG60pYvG/Dap8kVmdjgw6QCYHl X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0156; 6:c+V6msvLsRwkKl0pJIJ9iPwlc+M6FdMb2TQjrNA51GnVtaqn/oUCIC6P2oO1m7PMK6ihGHn8vORSRuaQh89ynJIbAyYyX6LQXt0d3PvlQ8ssmlj4pc89T1PFGhbddp7V813l7NblULx7RcrV1Oe/edMBxDwA5SZXkcF0C5OE+Xaxz0fvdAn4QISdtdDsOu+IMrVoV+2ZSAbPV3KVYZJGZY6kF7bv+vhyMXAIp6zD05z8J3BNn260GJpEDuwvrcEwJwTGyLei92ed80aMK+Rqtc6Cshf/foa9ObpHP4zTAPJ54jekD5t6IB2+24muLL1hU8i1zg6sdMYD9er7z4hdbNkfB5STBOTM8T4znuo+EyM=; 5:WgAcmqN61PaA4sK18nz/CatmcR80Tv6vCuA0VFpIBa73Oc3HbkiUy12B0r/5awzIt1fKa49r9odN/wUl5LWYCfvVOQNcUFW6+EQtMC2u+8L61oi/Jjo10pezn6+rgYNFv9M1MbTVTQghOy3qGBes5TB2oTMsrTEzvbv480GTgyQ=; 24:urBi07N0GyAn9KZTzUinwVkfsDRjz8GfUQWodKMuAdL5QmCMcVZURao+Xw2mrTap6m45wRdTHFyjcONR0lINoEiNeKmnlCutK+bxsTu5PpI=; 7:whJ4T0iRtut7QNVwV99JOkdDaT7+DatAjr7j1Fl6T01J6GObSp/f2Pyg2fiObBimCNOmWkia4vZMCSyfa92uT80aerlAxkEwqZBlOBHdhlLMA3cArkMNG0ENl0WprS1hx/Bog1lBIGkahiwEeZdJSxOoXbycWj3+tuAYTG9woSXAb1RekS+dagKOXjNFI78koMFHkWZpWBebWXA1J0HrnYGpydCghTeMXb4gxDAvU2UJIVU8JkkOyr8lu+yIPGzb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0156; 20:DxpYT9dt0zNilzVaLaouAWW10ANgQxwC82V2LVQ8PMzOrPuB9BhRji7hEVgqkK8Fq5kVCjFBaYrkPoqjPpPrd8D3tx91BXSDji/oShPyMsw64AcLp1PpHgZTI3T9eWQeR6fl3gVYwryCth9GbrvWtn2OWu9AOytX6kjHcS2Sym6S+xxHkHobPaNfWxQO3q6XWHSy/RgRc2PBQbu8WqchkiDyeKutMtbksBbKxbVtWipGcS4518StgV4oaT/dUnPw X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2018 12:49:48.0498 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a94b040a-b5a6-4485-a6d6-08d584f314bd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0156 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.66 Subject: [Qemu-devel] [PATCH v12 10/28] include: add psp-sev.h header file 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 , Richard Henderson , 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 The header file provide the ioctl command and structure to communicate with /dev/sev device. Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Brijesh Singh --- linux-headers/linux/psp-sev.h | 142 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 linux-headers/linux/psp-sev.h diff --git a/linux-headers/linux/psp-sev.h b/linux-headers/linux/psp-sev.h new file mode 100644 index 000000000000..33e247471ae0 --- /dev/null +++ b/linux-headers/linux/psp-sev.h @@ -0,0 +1,142 @@ +/* + * Userspace interface for AMD Secure Encrypted Virtualization (SEV) + * platform management commands. + * + * Copyright (C) 2016-2017 Advanced Micro Devices, Inc. + * + * Author: Brijesh Singh + * + * SEV spec 0.14 is available at: + * http://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __PSP_SEV_USER_H__ +#define __PSP_SEV_USER_H__ + +#include + +/** + * SEV platform commands + */ +enum { + SEV_FACTORY_RESET = 0, + SEV_PLATFORM_STATUS, + SEV_PEK_GEN, + SEV_PEK_CSR, + SEV_PDH_GEN, + SEV_PDH_CERT_EXPORT, + SEV_PEK_CERT_IMPORT, + + SEV_MAX, +}; + +/** + * SEV Firmware status code + */ +typedef enum { + SEV_RET_SUCCESS = 0, + SEV_RET_INVALID_PLATFORM_STATE, + SEV_RET_INVALID_GUEST_STATE, + SEV_RET_INAVLID_CONFIG, + SEV_RET_INVALID_LEN, + SEV_RET_ALREADY_OWNED, + SEV_RET_INVALID_CERTIFICATE, + SEV_RET_POLICY_FAILURE, + SEV_RET_INACTIVE, + SEV_RET_INVALID_ADDRESS, + SEV_RET_BAD_SIGNATURE, + SEV_RET_BAD_MEASUREMENT, + SEV_RET_ASID_OWNED, + SEV_RET_INVALID_ASID, + SEV_RET_WBINVD_REQUIRED, + SEV_RET_DFFLUSH_REQUIRED, + SEV_RET_INVALID_GUEST, + SEV_RET_INVALID_COMMAND, + SEV_RET_ACTIVE, + SEV_RET_HWSEV_RET_PLATFORM, + SEV_RET_HWSEV_RET_UNSAFE, + SEV_RET_UNSUPPORTED, + SEV_RET_MAX, +} sev_ret_code; + +/** + * struct sev_user_data_status - PLATFORM_STATUS command parameters + * + * @major: major API version + * @minor: minor API version + * @state: platform state + * @flags: platform config flags + * @build: firmware build id for API version + * @guest_count: number of active guests + */ +struct sev_user_data_status { + __u8 api_major; /* Out */ + __u8 api_minor; /* Out */ + __u8 state; /* Out */ + __u32 flags; /* Out */ + __u8 build; /* Out */ + __u32 guest_count; /* Out */ +} __attribute__((packed)); + +/** + * struct sev_user_data_pek_csr - PEK_CSR command parameters + * + * @address: PEK certificate chain + * @length: length of certificate + */ +struct sev_user_data_pek_csr { + __u64 address; /* In */ + __u32 length; /* In/Out */ +} __attribute__((packed)); + +/** + * struct sev_user_data_cert_import - PEK_CERT_IMPORT command parameters + * + * @pek_address: PEK certificate chain + * @pek_len: length of PEK certificate + * @oca_address: OCA certificate chain + * @oca_len: length of OCA certificate + */ +struct sev_user_data_pek_cert_import { + __u64 pek_cert_address; /* In */ + __u32 pek_cert_len; /* In */ + __u64 oca_cert_address; /* In */ + __u32 oca_cert_len; /* In */ +} __attribute__((packed)); + +/** + * struct sev_user_data_pdh_cert_export - PDH_CERT_EXPORT command parameters + * + * @pdh_address: PDH certificate address + * @pdh_len: length of PDH certificate + * @cert_chain_address: PDH certificate chain + * @cert_chain_len: length of PDH certificate chain + */ +struct sev_user_data_pdh_cert_export { + __u64 pdh_cert_address; /* In */ + __u32 pdh_cert_len; /* In/Out */ + __u64 cert_chain_address; /* In */ + __u32 cert_chain_len; /* In/Out */ +} __attribute__((packed)); + +/** + * struct sev_issue_cmd - SEV ioctl parameters + * + * @cmd: SEV commands to execute + * @opaque: pointer to the command structure + * @error: SEV FW return code on failure + */ +struct sev_issue_cmd { + __u32 cmd; /* In */ + __u64 data; /* In */ + __u32 error; /* Out */ +} __attribute__((packed)); + +#define SEV_IOC_TYPE 'S' +#define SEV_ISSUE_CMD _IOWR(SEV_IOC_TYPE, 0x0, struct sev_issue_cmd) + +#endif /* __PSP_USER_SEV_H */