From patchwork Tue Dec 4 12:37:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 152802 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp8017961ljp; Tue, 4 Dec 2018 04:37:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/XaEaol/QtfHX0R3Chag4H9/lvnOWAgVfEj7/sTjuEzUiwVIVo8l5af9KLNQH01sDNaYQjp X-Received: by 2002:a50:b286:: with SMTP id p6mr17915198edd.202.1543927049919; Tue, 04 Dec 2018 04:37:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543927049; cv=none; d=google.com; s=arc-20160816; b=rz84fJjnjieNk9f6HH+lz1zZC4k15/TXfJSR+pUezDRJHMcAQeGCjxHMeu5RESQzit skUDVg/iU0juYqMleSPONV9g66VwW7ant8seTQTIDmQuoVkWDaSCl/51bjy+RcM/gCgT liGzXu9M8/8HhWMaIsYM9ccV7yu5PXaO9bJg9jyPT5cFZrKeCUgOgcCRkO4IT0lD5UKI lQ3KgrsORo2fYkuLAGUsEM7LdCJcBp7odc+ggmL9UXkkqRjXRcaRwahgbSBxxuQThN+0 BBnRMpInb9C86eFZtiMebFLvL+FV04OuYKjaxUOBJEgaoyjfq4VjWK2jfPQJBRQTTq9k N+/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature; bh=7Gh6ttoawuPkBT/ciC2yDSGK5AEBiFxQvGbCav3xp6s=; b=zAkC2KnKaaMSxMDNqvwos+sxDXZLShj2Hws44ghnBmWe4wv4t/Wkes+D3lZoO0ObeR sqm3ObMMvK5SMOSfn9gA3lhUg5S7YSOMabn+8mP0sI1aQ677z0XIOBSaCBeaQJ5aBsfN kVnnvNQrua5C+F6haLYWFC/nIrolKT8TwLfwLiZl6HF07L9hk4RyOeecOkIEm0/S+wwR /+wUQ8Gdd2sg+b5Kg1P9tnRPa9OKXgqD++3zZ6ls5wIc8K6xI1CuA/ndM/anjrFLPLgj eyyjCi/RpcbB1F4DE0//0pKjdSLJIc75sQHWZZ5mXq7430dpbvQ+ZI+ojGXMKvT7L9Uh e2NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PTet6e70; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id x26si5605721edx.96.2018.12.04.04.37.29; Tue, 04 Dec 2018 04:37:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PTet6e70; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 6503EC22300; Tue, 4 Dec 2018 12:37:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id BCAACC2220B; Tue, 4 Dec 2018 12:37:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8CE5CC2220B; Tue, 4 Dec 2018 12:37:23 +0000 (UTC) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by lists.denx.de (Postfix) with ESMTPS id CE6D1C22206 for ; Tue, 4 Dec 2018 12:37:22 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id v15-v6so14713143ljh.13 for ; Tue, 04 Dec 2018 04:37:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=NeLTK6CAnqgUkghHWiXeRRbultTQck/9JPpWzkFt5vk=; b=PTet6e70VQOvtt5KdAbs077Y+HmdBgi7jQO87IcFZJclX+KNaQEjRZeKyvwDPwHsJz smNEhrGuA2brkXxcRXxve/XSuysNG8a99ggpJpWWwXuv00E6HNhJK91aKmDRW5D1PXaz Rs0Pamav1CUx7NEoO3BqOx938Y0GM8wly+H5Y= 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=NeLTK6CAnqgUkghHWiXeRRbultTQck/9JPpWzkFt5vk=; b=Xm7+oT4tcTU4a71te2XfbFLSToXcdGiZHxcyBfuUF2831XTwm1k/uwuQcant0UsdNo mysIJWTXWBiRl+WE4//+03Un0D1bMedgQTG6yNx+qx2QS/8N7Ed4V71501yRILY9Hq2D RxhMM17aHFQ7hzXkzFGbTo1Uz0mTD5lUmchyGWof9kE7z50C/FfTlYwsXELh1XvtJcfC YpwQieIGJN6bGeum0iOkVPHkUie0Lsu8fBk3QgmQQ6tjhXd+vJuqIKKcyTIcMrA0wh1W QA3NwjQ/DnsFxEBd+8K6e1VjexpEsiWrBYkR0xUJI2+MF0gZyg897OGiZQmu6Bhdh8JU e75w== X-Gm-Message-State: AA+aEWbhVudBy4F4QPdbHw9pomOLp+wTBamDOid60pVNqHuqcEeOGeDo RZDKXoLA9W7DqOFp/PLpo2phedOQGnI= X-Received: by 2002:a2e:8007:: with SMTP id j7-v6mr13184061ljg.22.1543927041651; Tue, 04 Dec 2018 04:37:21 -0800 (PST) Received: from localhost (host-176-36-145-117.la.net.ua. [176.36.145.117]) by smtp.gmail.com with ESMTPSA id a25sm2847577lfk.31.2018.12.04.04.37.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 04:37:20 -0800 (PST) From: Igor Opaniuk To: u-boot@lists.denx.de Date: Tue, 4 Dec 2018 14:37:19 +0200 Message-Id: <1543927039-5504-1-git-send-email-igor.opaniuk@linaro.org> X-Mailer: git-send-email 2.7.4 Cc: trini@konsulko.com, praneeth@ti.com, joakim.bech@linaro.org Subject: [U-Boot] [PATCH 1/1] tee: change return code for REE FS supplicant cmd X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" If OP-TEE core is compiled with support of REE FS and RPMB at the same time (CFG_RPMB_FS ?= y; CFG_RPMB_FS ?= y), and persistent storage API is used with TEE_STORAGE_PRIVATE storage id, it will lead to TA panic. E/TC:? 0 TA panicked with code 0xffff0009 ..... E/TC:? 0 Call stack: E/TC:? 0 0x000000004002f2f8 TEE_OpenPersistentObject at lib/libutee/tee_api_objects.c:422 In this particular case TEE_ERROR_STORAGE_NOT_AVAILABLE is more suitable than TEE_ERROR_NOT_IMPLEMENTED, as it provides to a TA a possibility to handle this error code [1]. >From GPD TEE Internal Core specification [2]: TEE_ERROR_STORAGE_NOT_AVAILABLE - if the persistent object is stored in a storage area which is currently inaccessible. It may be associated with the device but unplugged, busy, or inaccessible for some other reason. [1]: https://github.com/OP-TEE/optee_os/blob/94db01ef448d1e552161c2d861d57a5f8bda0cc0/lib/libutee/tee_api_objects.c#L419 [2]: https://globalplatform.org/wp-content/uploads/2018/06/GPD_TEE_Internal_Core_API_Specification_v1.1.2.50_PublicReview.pdf Signed-off-by: Igor Opaniuk Reviewed-by: Jens Wiklander --- drivers/tee/optee/supplicant.c | 4 ++-- include/tee.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tee/optee/supplicant.c b/drivers/tee/optee/supplicant.c index b1ea65b..c5726ec 100644 --- a/drivers/tee/optee/supplicant.c +++ b/drivers/tee/optee/supplicant.c @@ -82,8 +82,8 @@ void optee_suppl_cmd(struct udevice *dev, struct tee_shm *shm_arg, cmd_shm_free(arg); break; case OPTEE_MSG_RPC_CMD_FS: - debug("OPTEE_MSG_RPC_CMD_FS not implemented\n"); - arg->ret = TEE_ERROR_NOT_IMPLEMENTED; + debug("REE FS storage isn't available\n"); + arg->ret = TEE_ERROR_STORAGE_NOT_AVAILABLE; break; case OPTEE_MSG_RPC_CMD_RPMB: optee_suppl_cmd_rpmb(dev, arg); diff --git a/include/tee.h b/include/tee.h index 98b1c9c..edd9f9b 100644 --- a/include/tee.h +++ b/include/tee.h @@ -34,6 +34,7 @@ * struct tee_version_data::gen_caps */ #define TEE_SUCCESS 0x00000000 +#define TEE_ERROR_STORAGE_NOT_AVAILABLE 0xf0100003 #define TEE_ERROR_GENERIC 0xffff0000 #define TEE_ERROR_BAD_PARAMETERS 0xffff0006 #define TEE_ERROR_ITEM_NOT_FOUND 0xffff0008