From patchwork Thu Nov 4 14:14:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 516799 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp1983465iml; Thu, 4 Nov 2021 07:15:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP92zsMaKF1sBejrCoI/1PpozAOK2/Xqr1ol9kJQhKsGPsCDmzCEek9IHShjyzRKxtfSgW X-Received: by 2002:a05:6402:455:: with SMTP id p21mr29143084edw.384.1636035314802; Thu, 04 Nov 2021 07:15:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636035314; cv=none; d=google.com; s=arc-20160816; b=0JZxwlPhKr81+xZm5vBMm8rs9kpTGBqw0VpTeW3FtLUhS94l0im5to8W2R3VkokbAQ JI80SfjLbl3tWi9tGDn3zTYh8zZ02JfsosxjWCnvQaYu4fVN716k/XA6gdM/oN3fvqNC 68vl78pV6+PwMZko9Nd7RNHGpG9owsdMXFUdfYQweUr5/TMFMoCYOxbTWaQ0gg2IHWxW 0E99z4DUUk5UNKV/lmDirnhXJUFVDqgON4yJhZMbTSOq0qag/0bIOJ2TkYidiBAqKnDF iOkVEwh0mVEqgSD7jNrARjAd7Y7lCVJbMWbic1YPfNTmbMRkJEWOLEQiIzYSc85uGHx+ TKEw== 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=jAMREceLMuAVrzr292tRlH8J/41hxCy6pN3OgRzZiCQ=; b=UNitF0G7vlZ02JB5vx8lWg9u0ZkpH3zghtAje5cUVSeVty8U+uhQ+dPZsJLTq/OMdD 4BZTsGNRwK6xwWBV6N/aI29hFnlFkPV6IXmELamy36a3dp9LwsbaGE78rBDcrtSTSVFz IPS9W3hHW4ewO22fdDiauDh+hIo0jZityKlPa7+S2LVV9++arTz9A/5Y7bvMEcfIiCML 0oifDTaCSwEgSLeoWJu7/lgUyQIKKuuchwZRRYTun5P8Ckl6Kvso5F3tEj7dODfTUsC9 DyVyIzsm2Y9nU0TkOs9by/rN5XW8LQtiiYtrdcqQ9Z4T2C2amP4QHVW/kaYkdVXwfpRh /KIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e2Dm+MMS; 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 la20si7856257ejc.785.2021.11.04.07.15.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:15: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=e2Dm+MMS; 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 11D37836B6; Thu, 4 Nov 2021 15:15:10 +0100 (CET) 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="e2Dm+MMS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 75368836C4; Thu, 4 Nov 2021 15:15:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 41D6D83661 for ; Thu, 4 Nov 2021 15:15:00 +0100 (CET) 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 o29so838644wms.2 for ; Thu, 04 Nov 2021 07:15:00 -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=jAMREceLMuAVrzr292tRlH8J/41hxCy6pN3OgRzZiCQ=; b=e2Dm+MMSM+KTiMg8mWvxdtn1Gq4HuJou9TneS8hmbPYJbFgynYQA/DEr7eiYAca2Pm ssz30IOHE0iFJY+GjVAltBuwfaRJRG4KMCZy7mgCsrrrLsOYMLNcOjTtus7oAzJW8Fqg O+VxX6rc+5ohuTyJV6bSDjMgPPWN7/Jy+y4XZ/MVFfkvILvpK7Ze8aE00RtAfAtqH7fv TW2yZSSCFJ1whvvxBBTi5qFinTCegZB0AI69oS9zvIyjx62/nEbwHKQQA1LUT275moVl IPmkIu/43XNr7SwNWKIpx3vn4KdalvcXWYz2YrfDN5E5AktF5IU1j1nM4PovY+iQ8/A6 pHiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jAMREceLMuAVrzr292tRlH8J/41hxCy6pN3OgRzZiCQ=; b=zshT9dOqchBEqj3L9pdWY2kz5QusOunvWF54TVroj5oEjUSRUNgC7m1tL3uCrgsy+V y0TaxrbdJFmhNtXQBVLAcHG0vukX4qEvPsX4ZFEDvsc7RGvvE4bVZj+Gyt4Pnb5fxmKl 2KDRfEql8T9bUhG44JhFFlOdTCBxOX2h+uPi79+abZbxpQ6ivmL/VLHrYlD4nM5m/TyS zUCvWxFf1OfcI1joF9fizN2QDyIr9IQgbVKX89qs1VkVqTh9vcu8+R/u5meajYqrU2TZ n7cDFWwLUEI/CC9fWIntu7Wt/q6mLAOV+Y3vmcIHDJCj61VH2I6OTLeDyvJ6W0EridQB Eekw== X-Gm-Message-State: AOAM532ouQV+JWDiTR9LaQlB67Az4zVMZ0/aBtbSHr1eMfP7RMx31ywm g6bLY1XKJNRV7pi/mEsyAYoWzNUSekVvAA== X-Received: by 2002:a1c:8015:: with SMTP id b21mr22736953wmd.161.1636035298512; Thu, 04 Nov 2021 07:14:58 -0700 (PDT) Received: from lmecxl0524.lme.st.com ([2a04:cec0:10b3:52ee:40ee:3a6f:5eb8:bd35]) by smtp.gmail.com with ESMTPSA id l26sm5354862wms.15.2021.11.04.07.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:14:57 -0700 (PDT) From: Etienne Carriere To: u-boot@lists.denx.de Cc: Etienne Carriere , Jens Wiklander Subject: [PATCH 1/5] tee: define session login identifiers Date: Thu, 4 Nov 2021 15:14:47 +0100 Message-Id: <20211104141451.29967-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.103.2 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. Cc: Jens Wiklander Signed-off-by: Etienne Carriere Reviewed-by: Patrick Delaunay Reviewed-by: Jens Wiklander --- 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(-) -- 2.17.1 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