Re: [PATCH v2 1/5] tee: define session login identifiers

2021-11-23 Thread Tom Rini
On Tue, Nov 09, 2021 at 05:08:20PM +0100, Etienne Carriere wrote:

> Define identifiers for clnt_login field in struct tee_open_session_arg
> based in GlobalPlatform Device TEE IDs and on the REE_KERNEL identifier
> extension from OP-TEE OS.
> 
> Cc: Jens Wiklander 
> Reviewed-by: Patrick Delaunay 
> Reviewed-by: Jens Wiklander 
> Signed-off-by: Etienne Carriere 

For the series, applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


[PATCH v2 1/5] tee: define session login identifiers

2021-11-09 Thread Etienne Carriere
Define identifiers for clnt_login field in struct tee_open_session_arg
based in GlobalPlatform Device TEE IDs and on the REE_KERNEL identifier
extension from OP-TEE OS.

Cc: Jens Wiklander 
Reviewed-by: Patrick Delaunay 
Reviewed-by: Jens Wiklander 
Signed-off-by: Etienne Carriere 

---
Changes since v1:
 - Applied review tags

Added info for v1:
This change was previously discussed in the U-Boot ML, see v2 at:
https://patchwork.ozlabs.org/project/uboot/patch/20210519142613.7668-1-etienne.carri...@linaro.org/

Changes since this v2 post:
 - Updated the inline comment describing reserved login Ids
 - Rephrase 'REE kernel agent' to 'REE kernel/privileged agent' to
   better apply to U-Boot that is not a kernel but still runs at a
   privileged execution level.
---
 include/tee.h | 23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/include/tee.h b/include/tee.h
index 44e9cd4321..30ea2ee164 100644
--- a/include/tee.h
+++ b/include/tee.h
@@ -31,6 +31,25 @@
 #define TEE_PARAM_ATTR_MASK(TEE_PARAM_ATTR_TYPE_MASK | \
 TEE_PARAM_ATTR_META)
 
+/*
+ * Global Platform login identifiers for tee_open_session_arg::clnt_login
+ */
+#define TEE_LOGIN_PUBLIC  0x
+#define TEE_LOGIN_USER0x0001
+#define TEE_LOGIN_GROUP   0x0002
+#define TEE_LOGIN_APPLICATION 0x0004
+#define TEE_LOGIN_APPLICATION_USER0x0005
+#define TEE_LOGIN_APPLICATION_GROUP   0x0006
+/*
+ * Reserve use of GP implementation specific login method range
+ * (0x8000 - 0xBFFF). This range is rather being used
+ * for REE kernel clients or TEE implementation.
+ */
+#define TEE_LOGIN_REE_KERNEL_MIN  0x8000
+#define TEE_LOGIN_REE_KERNEL_MAX  0xBFFF
+/* Private login method for REE kernel/privileged clients */
+#define TEE_LOGIN_REE_KERNEL  0x8000
+
 /*
  * Some Global Platform error codes which has a meaning if the
  * TEE_GEN_CAP_GP bit is returned by the driver in
@@ -135,8 +154,8 @@ struct tee_param {
 /**
  * struct tee_open_session_arg - extra arguments for tee_open_session()
  * @uuid:  [in] UUID of the Trusted Application
- * @clnt_uuid: [in] Normally zeroes
- * @clnt_login:[in] Normally 0
+ * @clnt_uuid: [in] UUID of client, zeroes for PUBLIC/REE_KERNEL
+ * @clnt_login:[in] Class of client TEE_LOGIN_*
  * @session:   [out] Session id
  * @ret:   [out] return value
  * @ret_origin:[out] origin of the return value
-- 
2.17.1