All of lore.kernel.org
 help / color / mirror / Atom feed
From: Etienne Carriere <etienne.carriere@linaro.org>
To: u-boot@lists.denx.de
Cc: Etienne Carriere <etienne.carriere@linaro.org>,
	Jens Wiklander <jens.wiklander@linaro.org>
Subject: [PATCH 1/5] tee: define session login identifiers
Date: Thu,  4 Nov 2021 15:14:47 +0100	[thread overview]
Message-ID: <20211104141451.29967-1-etienne.carriere@linaro.org> (raw)

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 <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
This change was previously discussed in the U-Boot ML, see v2 at:
https://patchwork.ozlabs.org/project/uboot/patch/20210519142613.7668-1-etienne.carriere@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                  0x00000000
+#define TEE_LOGIN_USER                    0x00000001
+#define TEE_LOGIN_GROUP                   0x00000002
+#define TEE_LOGIN_APPLICATION             0x00000004
+#define TEE_LOGIN_APPLICATION_USER        0x00000005
+#define TEE_LOGIN_APPLICATION_GROUP       0x00000006
+/*
+ * Reserve use of GP implementation specific login method range
+ * (0x80000000 - 0xBFFFFFFF). This range is rather being used
+ * for REE kernel clients or TEE implementation.
+ */
+#define TEE_LOGIN_REE_KERNEL_MIN          0x80000000
+#define TEE_LOGIN_REE_KERNEL_MAX          0xBFFFFFFF
+/* Private login method for REE kernel/privileged clients */
+#define TEE_LOGIN_REE_KERNEL              0x80000000
+
 /*
  * 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


             reply	other threads:[~2021-11-04 14:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04 14:14 Etienne Carriere [this message]
2021-11-04 14:14 ` [PATCH 2/5] tee: optee: remove unused duplicated login Id macros Etienne Carriere
2021-11-08  9:32   ` Patrick DELAUNAY
2021-11-09  8:41   ` Jens Wiklander
2021-11-04 14:14 ` [PATCH 3/5] tee: optee: define TEE error code TEE_ERROR_SHORT_BUFFER Etienne Carriere
2021-11-08  9:32   ` Patrick DELAUNAY
2021-11-09  8:45   ` Jens Wiklander
2021-11-04 14:14 ` [PATCH 4/5] dt-bindings: arm: scmi: OP-TEE as transport channel for SCMI messages Etienne Carriere
2021-11-08  9:32   ` Patrick DELAUNAY
2021-11-04 14:14 ` [PATCH 5/5] firmware: scmi: Add OP-TEE transport Etienne Carriere
2021-11-08  9:37   ` Patrick DELAUNAY
2021-11-09 14:39   ` Patrick DELAUNAY
2021-11-09 15:44     ` Etienne Carriere
2021-11-08  9:31 ` [PATCH 1/5] tee: define session login identifiers Patrick DELAUNAY
2021-11-09  8:44 ` Jens Wiklander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211104141451.29967-1-etienne.carriere@linaro.org \
    --to=etienne.carriere@linaro.org \
    --cc=jens.wiklander@linaro.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.