hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/uapi/linux/tee.h
....@@ -51,11 +51,15 @@
5151 #define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */
5252 #define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplicant) */
5353 #define TEE_GEN_CAP_REG_MEM (1 << 2)/* Supports registering shared memory */
54
+#define TEE_GEN_CAP_MEMREF_NULL (1 << 3)/* NULL MemRef support */
55
+
56
+#define TEE_MEMREF_NULL (__u64)(-1) /* NULL MemRef Buffer */
5457
5558 /*
5659 * TEE Implementation ID
5760 */
5861 #define TEE_IMPL_ID_OPTEE 1
62
+#define TEE_IMPL_ID_AMDTEE 2
5963
6064 /*
6165 * OP-TEE specific capabilities
....@@ -172,6 +176,15 @@
172176 #define TEE_IOCTL_LOGIN_APPLICATION 4
173177 #define TEE_IOCTL_LOGIN_USER_APPLICATION 5
174178 #define TEE_IOCTL_LOGIN_GROUP_APPLICATION 6
179
+/*
180
+ * Disallow user-space to use GP implementation specific login
181
+ * method range (0x80000000 - 0xBFFFFFFF). This range is rather
182
+ * being reserved for REE kernel clients or TEE implementation.
183
+ */
184
+#define TEE_IOCTL_LOGIN_REE_KERNEL_MIN 0x80000000
185
+#define TEE_IOCTL_LOGIN_REE_KERNEL_MAX 0xBFFFFFFF
186
+/* Private login method for REE kernel clients */
187
+#define TEE_IOCTL_LOGIN_REE_KERNEL 0x80000000
175188
176189 /**
177190 * struct tee_ioctl_param - parameter
....@@ -190,6 +203,16 @@
190203 * a part of a shared memory by specifying an offset (@a) and size (@b) of
191204 * the object. To supply the entire shared memory object set the offset
192205 * (@a) to 0 and size (@b) to the previously returned size of the object.
206
+ *
207
+ * A client may need to present a NULL pointer in the argument
208
+ * passed to a trusted application in the TEE.
209
+ * This is also a requirement in GlobalPlatform Client API v1.0c
210
+ * (section 3.2.5 memory references), which can be found at
211
+ * http://www.globalplatform.org/specificationsdevice.asp
212
+ *
213
+ * If a NULL pointer is passed to a TA in the TEE, the (@c)
214
+ * IOCTL parameters value must be set to TEE_MEMREF_NULL indicating a NULL
215
+ * memory reference.
193216 */
194217 struct tee_ioctl_param {
195218 __u64 attr;