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; From patchwork Wed May 12 15:05:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 435549 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4913571jao; Wed, 12 May 2021 08:06:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTaXx0UwV1c9iJXUy8jdPRi0HeYWRBtMGHRKwf0kqULyzKQzCl0bO4FQfsKF+AIJTDuSZs X-Received: by 2002:a05:600c:4f44:: with SMTP id m4mr39157408wmq.50.1620832004085; Wed, 12 May 2021 08:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620832004; cv=none; d=google.com; s=arc-20160816; b=UigteP9n6vv/Dr6VDqhF5S75aZCiK0kmoWct6NLoiab7hKJd8/bBv7g4snSEnQS9mW bRTKH0JpW8nxsuICQJ5zM7OGqPWr2hwU0t/VxA4UhXgsYaqTRyz54Ktm8XUFR01D07HT bF2dAF7/FlZ4hhQRbLv/H9PyDrZFtLwGTq5FEBmfqAgJbJrTZfOqRnWRGy9Gi9kfWjzV SPOg/yKhUkyuMFS1vbvUbAowaD7TMeXe5pfrCFhm+ZNVhcEBxY1FPnWVgE4KkzGAa718 F61WjUWDvliv3SiqRc6rwTAmJfz7Peuv/v28d/h1bELe5iPN55zMlPm9h3b9dviWCHQX tQeQ== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=3BpLQFr5VKOfy2GRgO8Ub9InrXFYYVl2eTtElC47aRI=; b=VcPZRL27/T11kXiwrqsTL0cI2Yd45iAkEFak3ujVIRJymXUfg4bYW5g0Q8nIA0K+eA LNLtcarKkgMT/CEus/tMmf7bRO9SuoJt3BtTn1cpNFuAkWexEVwRB0DR3cweXKIbdQbz NdCGqs/8lrpv7jBObsXfP/FT3rekB8vwQaqZkkT1j+n+/1DWDV/ROrR+pZqX0nBsASLF kdmBLHgSku87GE7gYwzaGIIIDv/pA5iUCB1BnrULHPpyVdWxMdCTrbkBVZxByvL4CSng aY7xBn/hppixVAgc/5R5Ot2/8GgwxoQhP+FGHavKhPJjGJ0bZtHkWjO7/HbEqMuSvDTs dgRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sYDwnlw3; 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 r15si19268777edy.297.2021.05.12.08.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 08:06:44 -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=sYDwnlw3; 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 5D9A082D4C; Wed, 12 May 2021 17:06:32 +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="sYDwnlw3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2FC3782CC0; Wed, 12 May 2021 17:06:27 +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-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (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 9825282CA8 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-x32e.google.com with SMTP id p14-20020a05600c358eb029015c01f207d7so3212429wmq.5 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:in-reply-to:references; bh=3BpLQFr5VKOfy2GRgO8Ub9InrXFYYVl2eTtElC47aRI=; b=sYDwnlw3Zb+/v1amFR/38HQhuI/luxr5ftooyZoPSN2VxEdW3iIYzLpd22qomqMplO kEtQfS+YmoIc74yhAgF8gvkESeuuoprypGicCFUxkoikLyEl1YkYsqbQsFmlL9DtXOWF 1UFe1PSeKPIXV1rRWqQxzcLLy0kKJMcVqeptaNrzkvxOg2KZ316otPsKsUBXxZP7eRJJ pmz6P1/8C2hzxvOd/EnOWO38LtMdX4qUU7skP/PbTburbjbfwwZNQDf8dgwIm4TlF57H NmqbjmACgTmB9VNDLV2oC6PeNjQM/gKxJi/w3zfhRl6oyq+7JLW6nJqESIP93k/rV2e1 QILA== 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:in-reply-to :references; bh=3BpLQFr5VKOfy2GRgO8Ub9InrXFYYVl2eTtElC47aRI=; b=p2WKL5fmZ0ZMsBSCHB7UC3LIioVyX4GC3dB0w4xSW4QGRRVsNLlh8VvaQODB54pja7 sGXZuEdh9EUBbnBVDL+4jBxxtG7VLvhXhzwdDOw9z5MHkRGk8zngpp16YNRKtKb1ymfL gFvBYq0jT54zFaPFtSwNHByHTLulZsCtGdFhSmFY2AqXCw1GDwF9eKFdNuYESKqv8mOT q2YIG0pV9w12nZZ/fiDJZGCIyWCUoKg/o4hBr5CJsAlJduqTD9T7tuyK1QifbUC+EdPW hq5aEATvV1j8rcvWVdRJ4Zndcs+nPRImF0DaBT5t9ebIO9AmlMMk4YRhu96e8biyd3DU 0t0Q== X-Gm-Message-State: AOAM530N59tB19GxbAq+Yhco2/ASON3w/GactLaRFBRIBJOacO83YYhn v2y53v89s3oFWgiRNvglG1txbRQvLGik0HFZFQI= X-Received: by 2002:a7b:c742:: with SMTP id w2mr2085451wmk.76.1620831983034; Wed, 12 May 2021 08:06:23 -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.22 (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 2/2] tee: optee: support session login as REE kernel Date: Wed, 12 May 2021 17:05:37 +0200 Message-Id: <20210512150537.14758-2-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210512150537.14758-1-etienne.carriere@linaro.org> References: <20210512150537.14758-1-etienne.carriere@linaro.org> 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 OP-TEE supports an API extension to allow client to open a TEE session as REE kernel which OP-TEE uses to differentiate client application services from system services that only the REE OS kernel can access. This change allows U-Boot to invoke OP-TEE which such kernel identity and therefore access kernel client specific services. Signed-off-by: Etienne Carriere --- drivers/tee/optee/core.c | 24 +++++++++++++++++++++++- drivers/tee/optee/optee_msg.h | 2 ++ 2 files changed, 25 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index 73dbb22ba0..526bf125a0 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -349,6 +349,28 @@ static int optee_close_session(struct udevice *dev, u32 session) return 0; } +static uint32_t optee_login_id(enum tee_session_login login) +{ + /* Treat invalid IDs as public login */ + switch (login) { + case TEE_SESSION_LOGIN_USER: + return OPTEE_MSG_LOGIN_USER; + case TEE_SESSION_LOGIN_GROUP: + return OPTEE_MSG_LOGIN_GROUP; + case TEE_SESSION_LOGIN_APPLICATION: + return OPTEE_MSG_LOGIN_APPLICATION; + case TEE_SESSION_LOGIN_APPLICATION_USER: + return OPTEE_MSG_LOGIN_APPLICATION; + case TEE_SESSION_LOGIN_APPLICATION_GROUP: + return OPTEE_MSG_LOGIN_APPLICATION; + case TEE_SESSION_LOGIN_REE_KERNEL: + return OPTEE_MSG_LOGIN_REE_KERNEL; + case TEE_SESSION_LOGIN_PUBLIC: + default: + return OPTEE_MSG_LOGIN_PUBLIC; + } +} + static int optee_open_session(struct udevice *dev, struct tee_open_session_arg *arg, uint num_params, struct tee_param *params) @@ -372,7 +394,7 @@ static int optee_open_session(struct udevice *dev, OPTEE_MSG_ATTR_META; memcpy(&msg_arg->params[0].u.value, arg->uuid, sizeof(arg->uuid)); memcpy(&msg_arg->params[1].u.value, arg->uuid, sizeof(arg->clnt_uuid)); - msg_arg->params[1].u.value.c = arg->clnt_login; + msg_arg->params[1].u.value.c = optee_login_id(arg->clnt_login); rc = to_msg_param(msg_arg->params + 2, num_params, params); if (rc) diff --git a/drivers/tee/optee/optee_msg.h b/drivers/tee/optee/optee_msg.h index 8d40ce60c2..17e8d28e52 100644 --- a/drivers/tee/optee/optee_msg.h +++ b/drivers/tee/optee/optee_msg.h @@ -95,6 +95,8 @@ #define OPTEE_MSG_LOGIN_APPLICATION 0x00000004 #define OPTEE_MSG_LOGIN_APPLICATION_USER 0x00000005 #define OPTEE_MSG_LOGIN_APPLICATION_GROUP 0x00000006 +/* OP-TEE extension: log as REE kernel */ +#define OPTEE_MSG_LOGIN_REE_KERNEL 0x80000000 /* * Page size used in non-contiguous buffer entries