From patchwork Wed May 19 14:26:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 442436 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1376734jac; Wed, 19 May 2021 07:27:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEp/MQ6/3lABYjBk+C9A09LATcRnI+esPZElmC80kFl/bAkF60zlT6Bdho5Lal0NE+IDQ7 X-Received: by 2002:a05:6402:2691:: with SMTP id w17mr2691070edd.140.1621434434365; Wed, 19 May 2021 07:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621434434; cv=none; d=google.com; s=arc-20160816; b=cD/8QbvoeNJiVLrRkE8z5YMQ78pjNUkCpJqXv+6SNqcDhygeuLfH4T08Sr8BFOxCgk vdFLywcK8nWG4XUCcVuyT4yGJ6psWeJ0iIZbNZlXwxo5rbsLblYjZ4kAhLOzG6gSXHT2 o3g9JWJUbPPbxTcz0qjGajPc2gasCJCvyhc4i8Y6v39l24iTL8q1vSk6ST9dedTeWLNd vXUZtphMGoTRC8D2TlPYI1F/YsTKgi2MC2fB8PDSXGWn96YK8f5//W6vTj9z1/h2Dwim KArDUKHvA2aaMLDr2q8EXZgMtAFxJrD5sx+j5WcODqYg7DgS/i9rEmD/NaVr7/Z8Tebp avUA== 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=Gkpg62d29yvB9M8GApIocScIVv8QSLMZejkIhJ4OP1I=; b=t6u3NS5Yz+5Jg8P1HrQGbYECK9kH/zqyD+QryI7KfSlyDQzgmDFRDy/4eyLYio+B+L 0/wgJ29+Y3NwljEpEj9vVsg4eBYq4fWkIUlbLR9BgKfu8SZcWGlKfyfve3hFl1Q1Kn+V Z1WtNQgvahAQwtSHSnwJ9mzLnxSyj/FM4IHKAOzVt5+H4LUKrntzfxa8Wio+Prz/ZBBW Xss1cbStHSO9TEtBOUwtB7Obq0/UpiwQEP2oLnk5kTH/mr2PWlVzPtnHxOadee6yGlma br6/AJXMkcaCg73MCl4uqvmjlaQY/0ZQod9nCjD3ItdDo0avnEplH+ZhV0vMTgyO+ewI E/GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xBmumXVu; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id bi15si21493764ejb.299.2021.05.19.07.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 07:27:14 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xBmumXVu; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 07BC881D3B; Wed, 19 May 2021 16:27:11 +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="xBmumXVu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3D03B81F63; Wed, 19 May 2021 16:27:09 +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-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (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 4FA0980C63 for ; Wed, 19 May 2021 16:27:05 +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-x32c.google.com with SMTP id l11-20020a05600c4f0bb029017a7cd488f5so809338wmq.0 for ; Wed, 19 May 2021 07:27:05 -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=Gkpg62d29yvB9M8GApIocScIVv8QSLMZejkIhJ4OP1I=; b=xBmumXVu7+S1Ci04h4zCc4mU/jGsPFNomxqlU7/jfN+uCUXYptyZKkFaN4E8PUnZqO GL4k/0EQ3VoiJh48KOMJrwzTk8mQ/zGwv/+Ial06WTonAVCu2gu9k3uFIZBuq7mXNS1m 60/Bmaz29h2OmSTTpduqJxKLmbBbraMCcS1kra+f9IzdRa99tPAPgD/sE6DQq85XWwL8 uZ1Fuvk3MhUx08UMqQeDXfPiHF+PLWPx/j0CvU5oaL1cSl/WmIU59/cCF1N/9wiwCu5w gMchKSGt9BREFooYHvk6nZCfD+gpVfiya2Q5WBtDH63VRZllCG+dTEICdu++VUBMOtjL pLxg== 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=Gkpg62d29yvB9M8GApIocScIVv8QSLMZejkIhJ4OP1I=; b=bUJ/Q94fuHp/aWBYcrIaEascg7J4wK7Jq1jsM/ZeFq7a19NBvUgS2TiZ8s7DCgSwwk g1GyIRWfvgAnUdETM6x59bHyffr6IQjIvy0YfNiiI2Tl8Ze2c2gaOCVW3Gn37AqHU/71 mEVTgGW6Gnvz4PZxoP9GdR2zROPT1M2nA4LosYYAwf5gmYgtaefSHg310mEq5VAcVfai +NAf0OnURSgu6+8Jr6hK/fViJNPg6Z5yjpIl7GHVuDKlNsws//lwYGgQLC6aOVVvG44v Fyu6zvWvgGwStp1Z4QO70vj8VavqcMvyOg6Nodp3cwKs/gvK9SMVVB2gM9gpHSLZcw7k SAHA== X-Gm-Message-State: AOAM531DUZqMLqqPYoCts2EzQ01xW2yE4IIveK9fxPmpW1M8qRvuTMef BW/WRinnRTIkaWW8nKDw8e5RAZyDD01rhkvj X-Received: by 2002:a05:600c:321a:: with SMTP id r26mr9561901wmp.103.1621434424500; Wed, 19 May 2021 07:27:04 -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 h15sm6752456wmq.1.2021.05.19.07.27.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 07:27:04 -0700 (PDT) From: Etienne Carriere To: u-boot@lists.denx.de Cc: Jens Wiklander , Simon Glass , Etienne Carriere Subject: [PATCH v2 1/2] tee: define session login identifiers Date: Wed, 19 May 2021 16:26:12 +0200 Message-Id: <20210519142613.7668-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 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. Signed-off-by: Etienne Carriere --- Changes since v1: - Rename macros to TEE_LOGIN_* and use same inline description as made in Linux kernel source tree. --- include/tee.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/include/tee.h b/include/tee.h index 99367b258e..d56530653c 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 +/* + * Disallow user-space to use GP implementation specific login + * method range (0x80000000 - 0xBFFFFFFF). This range is rather + * being reserved 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 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