hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/include/uapi/linux/psp-sev.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
12 /*
23 * Userspace interface for AMD Secure Encrypted Virtualization (SEV)
34 * platform management commands.
....@@ -6,12 +7,7 @@
67 *
78 * Author: Brijesh Singh <brijesh.singh@amd.com>
89 *
9
- * SEV spec 0.14 is available at:
10
- * http://support.amd.com/TechDocs/55766_SEV-KM%20API_Specification.pdf
11
- *
12
- * This program is free software; you can redistribute it and/or modify
13
- * it under the terms of the GNU General Public License version 2 as
14
- * published by the Free Software Foundation.
10
+ * SEV API specification is available at: https://developer.amd.com/sev/
1511 */
1612
1713 #ifndef __PSP_SEV_USER_H__
....@@ -30,7 +26,8 @@
3026 SEV_PDH_GEN,
3127 SEV_PDH_CERT_EXPORT,
3228 SEV_PEK_CERT_IMPORT,
33
- SEV_GET_ID,
29
+ SEV_GET_ID, /* This command is deprecated, use SEV_GET_ID2 */
30
+ SEV_GET_ID2,
3431
3532 SEV_MAX,
3633 };
....@@ -61,6 +58,9 @@
6158 SEV_RET_HWSEV_RET_PLATFORM,
6259 SEV_RET_HWSEV_RET_UNSAFE,
6360 SEV_RET_UNSUPPORTED,
61
+ SEV_RET_INVALID_PARAM,
62
+ SEV_RET_RESOURCE_LIMIT,
63
+ SEV_RET_SECURE_DATA_INVALID,
6464 SEV_RET_MAX,
6565 } sev_ret_code;
6666
....@@ -82,6 +82,8 @@
8282 __u8 build; /* Out */
8383 __u32 guest_count; /* Out */
8484 } __packed;
85
+
86
+#define SEV_STATUS_FLAGS_CONFIG_ES 0x0100
8587
8688 /**
8789 * struct sev_user_data_pek_csr - PEK_CSR command parameters
....@@ -125,7 +127,7 @@
125127 } __packed;
126128
127129 /**
128
- * struct sev_user_data_get_id - GET_ID command parameters
130
+ * struct sev_user_data_get_id - GET_ID command parameters (deprecated)
129131 *
130132 * @socket1: Buffer to pass unique ID of first socket
131133 * @socket2: Buffer to pass unique ID of second socket
....@@ -136,6 +138,16 @@
136138 } __packed;
137139
138140 /**
141
+ * struct sev_user_data_get_id2 - GET_ID command parameters
142
+ * @address: Buffer to store unique ID
143
+ * @length: length of the unique ID
144
+ */
145
+struct sev_user_data_get_id2 {
146
+ __u64 address; /* In */
147
+ __u32 length; /* In/Out */
148
+} __packed;
149
+
150
+/**
139151 * struct sev_issue_cmd - SEV ioctl parameters
140152 *
141153 * @cmd: SEV commands to execute