From patchwork Wed May 12 15:05:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 435548 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4913442jao; Wed, 12 May 2021 08:06:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1beAg8iVzLb6ynLkj19wd9S5wcu3/Vuztgh8KxrTzAMymlxuqEwQjjyInbj5oOxu5Ydy2 X-Received: by 2002:a17:906:64c3:: with SMTP id p3mr9023872ejn.351.1620831992243; Wed, 12 May 2021 08:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620831992; cv=none; d=google.com; s=arc-20160816; b=oLFkNIDoZcgWCZGJvsA4GjIfu5IlgDc9BDvSpbTbKmM5JhJaRhKHWat7KaoU7yiimQ rMLxh0bHVRjcHhdWC+9sKKume9osTgzPTLuco3w2TABqgYIwuHh9o5F+EZEEwx73gafq g1SKk3xu6e0M0sdAmTHEPcKqaiDCKfpU2Yboz+Rk9hNenbS4B6RgoVPsvGKXOZaeQwsA txgcAVXgXsBDUVaS6cYR9b5NBEtrIMaaNE9FnWvblbNRRxTSVHWBqTTdLNCu7EowQyVr J2XAAFyrj2oqI4w1CHk1YpkDstDRRKl3iqbZ3z7lqaH0ILb74TjWeHdZJnCLmeWp6hnt hoyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=jgBrblMf/HRY1xxGC30jlvCGoEg+PQfRZ2YqVtd+xmY=; b=0Ydc+hlLSFd0bPixW0NFr9mNzIdrfBM5pu6ZT7paTmZhGyzWSjXoMZt3BPQucDCxu9 YHVl8JnGQGyx2ieYqEubcOl/gzogVhVqSGEaYLqxVYLO470XkuOdCHdUZsE5RDxsU6Rl b5yWn5zDHRGstStJaUv8KdohpF9770rDYRWSr6hG8Pk7565cwEdIeiU4AOZ2bvBvKci8 rg77VObtIHzuyEUwGPoVm8YFW74GJ+Jm+LWHw9iaYim2WA3YlxcTfb9uNi8pq+7oEQav cgv5QdZ7GUCw/oMsviZIPBHvAFCXXbhgODt+f8w6OKruU5kRNx1H6hpyE+v3km7t2TLA blFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IHLf0epw; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id z27si232709ejl.41.2021.05.12.08.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 08:06:32 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IHLf0epw; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 65C0482CA8; Wed, 12 May 2021 17:06:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="IHLf0epw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 660A882CF6; Wed, 12 May 2021 17:06:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 157D282AFF for ; Wed, 12 May 2021 17:06:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=etienne.carriere@linaro.org Received: by mail-wm1-x334.google.com with SMTP id z130so1002060wmg.2 for ; Wed, 12 May 2021 08:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=jgBrblMf/HRY1xxGC30jlvCGoEg+PQfRZ2YqVtd+xmY=; b=IHLf0epwhm44BvYBSfpmwpWt8ooeFFnjXL/cYF40Iq/k7HPXrhiElOgzc3gekLDec9 mZpizq8chzFfoRop4q1jvkJr/WbdCqcLtxmokVTermA+E2r6cGF+khfiaTvXRFP+VZig vBWjxPrblN6/pYOnk2PALzIA7P8uuzJ6rMl/N0FWhB7pp9+3MuLxEVflxXeFdO50AOYN jGDTqO3gHCl4ebnoFDq0QJtb77yg+vWN4GU0jqy7uAQ/KFeCsIYDTuXGX1VCHeS/R5Vz qyMJBFczlI5koTA4lztvEx4Tbi+sGrgQ4Go1YGmAjDOL19Vq3+WrNEv9dXyGzmnhVAuC uupQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jgBrblMf/HRY1xxGC30jlvCGoEg+PQfRZ2YqVtd+xmY=; b=c6dC1IP99TH44UFGAKNiQmyKutlv5PUcIzin0TNzFAhdNpFPKhtEHj9tfV5bIrPcN8 4X8QOh4WKCUwx89Z6YQ8z5KVd/ZJU7qvfnDnd0ELqslo+a2GevK1bInk+i2qCIyiSH65 p6Hgx18xNEwG8XxAYaGwC+RQuXD4Pa7wdJQQA3H1ep6edxU59MRzH6B86kfRcgIMRitA F+rPcP9n64YJm9wX8PcOd0vRyp0d2lRxGUtp56s93pqr3p55vpu9kqUS3bfsFB6zKXou pWXB6awX+Rk3Re9KnrLvy3tXTKna6G4Fyg1Npd5xxaw1++AQ9JjgoCHkpSUdPiJk8vjj TnVA== X-Gm-Message-State: AOAM533jd5k3hPTh/ObQAYgFTNhz+LLpLW2eyEpf9kwwjJeNPfmzs5w1 iRHP1pNtvkQCUaAJguWIXqbtyUshwbRHHqMs4kk= X-Received: by 2002:a1c:e38a:: with SMTP id a132mr38996397wmh.135.1620831982553; Wed, 12 May 2021 08:06:22 -0700 (PDT) Received: from lmecxl0524.lme.st.com (2a01cb058b850800452ff0effb46d5f4.ipv6.abo.wanadoo.fr. [2a01:cb05:8b85:800:452f:f0ef:fb46:d5f4]) by smtp.gmail.com with ESMTPSA id c22sm9974wmb.10.2021.05.12.08.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 08:06:22 -0700 (PDT) From: Etienne Carriere To: u-boot@lists.denx.de Cc: Jens Wiklander , Simon Glass , Etienne Carriere Subject: [PATCH 1/2] tee: define session login identifiers Date: Wed, 12 May 2021 17:05:36 +0200 Message-Id: <20210512150537.14758-1-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean TEE header file defines a clnt_login field in struct tee_open_session_arg but does not define the values expected. This change define identifiers for the field using a enumerated type. Back end TEE driver is expected to convert these IDs into IDs meaningful to the TEE. Signed-off-by: Etienne Carriere --- include/tee.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) -- 2.17.1 Reviewed-by: Patrick Delaunay diff --git a/include/tee.h b/include/tee.h index 99367b258e..b8297601b4 100644 --- a/include/tee.h +++ b/include/tee.h @@ -31,6 +31,19 @@ #define TEE_PARAM_ATTR_MASK (TEE_PARAM_ATTR_TYPE_MASK | \ TEE_PARAM_ATTR_META) +/* + * Value for tee_open_session_arg::clnt_login + */ +enum tee_session_login { + TEE_SESSION_LOGIN_PUBLIC = 0, + TEE_SESSION_LOGIN_USER, + TEE_SESSION_LOGIN_GROUP, + TEE_SESSION_LOGIN_APPLICATION, + TEE_SESSION_LOGIN_APPLICATION_USER, + TEE_SESSION_LOGIN_APPLICATION_GROUP, + TEE_SESSION_LOGIN_REE_KERNEL, +}; + /* * Some Global Platform error codes which has a meaning if the * TEE_GEN_CAP_GP bit is returned by the driver in @@ -135,8 +148,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_SESSION_LOGIN_* * @session: [out] Session id * @ret: [out] return value * @ret_origin: [out] origin of the return value @@ -144,7 +157,7 @@ struct tee_param { struct tee_open_session_arg { u8 uuid[TEE_UUID_LEN]; u8 clnt_uuid[TEE_UUID_LEN]; - u32 clnt_login; + enum tee_session_login clnt_login; u32 session; u32 ret; u32 ret_origin;