From patchwork Fri Jul 23 09:44:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 484593 Delivered-To: patches@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1161641jao; Fri, 23 Jul 2021 02:44:31 -0700 (PDT) X-Received: by 2002:a19:a408:: with SMTP id q8mr2562657lfc.154.1627033471703; Fri, 23 Jul 2021 02:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627033471; cv=none; d=google.com; s=arc-20160816; b=gXu/NowhRn21Yq9be/9FMcKEmLT+wK9pakrM0Rx2SDv4LlT+/w2hiWQJGkMPC/RpRW PlJbXqxtlZ6dEoUsiuksobD6JWdFx1aVw+JiUbHYLrAxHxaK52jlUljvRl+lIq3tNj+p pMjW6H7/O7jb4Gr1XC8nyylF+stRO0F3ZThh+Zo7aPnSurqBiaoYDZectXw0mtiO7HyD 2SFn6Keb2+jPKs2J0n7w8R4aKwIO+XDPIRbWJpTcIRipJ93sfLhxNqrieWdKelNvLlSE UMs82BGZace79l7NwavsDpfz5HssthaEwiVx1qByTjA+cLiDPg04uFN3zBfjT6rVT443 qlzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=bPEFf1WmEOew3wXqjPL0D4ZH5STaPbCOCI4W4KStU94=; b=fxyvIIPfJPdJ3AM/JcRWxPWEB3/yMIDyRNQd+bUOaPH15pNU0uCrN+4fNdiGlAYBcA twehhJXNyukV5NrPyF8ROYqRedDia9Gl0dscPRdvgqtH7uKGyB4lpNLRibShbuW4LfjP bg+Hidgu5ePtPqH5/PBcl16ocTJ+Mj1phfWJeUL2IEepvNZ7VJJ6fk2S5rwp9BuzMgs4 Kj4eSkcG8brBNOZN7xwiAdZCCGBXjVNIW5KW61+IswU5n7hWQWD0LJtLzONlR8jZ2jb7 pUIBj63n69WG1Wy4c1T7witVBPTQNTFabZl1LBbs3djeum+4IHR5Hj/Nz8m+dME/91Jy IN/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a1fNzzb0; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id m9sor3813563ljq.33.2021.07.23.02.44.31 for (Google Transport Security); Fri, 23 Jul 2021 02:44:31 -0700 (PDT) Received-SPF: pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a1fNzzb0; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 :mime-version:content-transfer-encoding; bh=bPEFf1WmEOew3wXqjPL0D4ZH5STaPbCOCI4W4KStU94=; b=a1fNzzb05/JkuSVhINb3YkWj8d51JCyyRxYXYiYj6ThohOUOIgdXhsta9RGshy6sRO xGlH3w6PjD2kM6rgZ6xDjYJak4yoqpeogR3WPs2QpRsvLqBzVNel7IRXN0mFXfCTnX7S 9IWMtJCO3+23ZWBKcQ3Hi3z/6mF5vmmuUBGL+TK0LGY6aU1lR3qKU8kvC89mEs8slS8J ypst2K75DdwycYWpHinbHEBc4GxCrlBNvFBEEAaF7246BMUGJ5Bcg5OeHWYvkgVAP62r 9Qo/fmzeZyJ5j0AIfui9ZSA7N/VcVEQZjWzi/xrPfQs43+96jbu4dpbJ7RVjsp2uMjSj EYDg== 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:mime-version:content-transfer-encoding; bh=bPEFf1WmEOew3wXqjPL0D4ZH5STaPbCOCI4W4KStU94=; b=bXMMhCbF5ruwa0qCZoHxpp+aAyJzKkAP+XRREkMGrA1TWsll0J9BLIY+8SyHarTgQ+ hvNC6intfa3MLvb0GFsUfxCnK/N8vGxlmqcGB2g8p9gx46Kobe4Hqab2o/lpPpQN48+3 qVR0SzSlhnGRVLn1uQBOdcXzHDzekuxPot1qr5AY/D3xuH221jRZaWhdDUG2VdpBjQwf /oS3SqJVq5brMfcMqaqj5PurzIHZ1DfDpFBOKb3Zg1rHKFIVbX3ozuqFmPaVClKvrNXl aQzcdbHk0aA8ueTg+SgIeUPMZL9iPiPgYC1y9sR8kfDUqpGLCSlYYPLY6omfgAxK5dDo VO+w== X-Gm-Message-State: AOAM530w2B39dHEnU0ZwLGaphHbI622MA0QMbNCNvZYAWAlt8UBkRtKx Tq4Bc9Gl02DtEsspuqtjqGWl2m+D X-Google-Smtp-Source: ABdhPJyrtqd7az4W16h9/E8eGPNfaNqKDq1w3C76bT8yiFDLgB8Q722esL9ZhZ/kU/AVPUI6p9JWeQ== X-Received: by 2002:a2e:a54d:: with SMTP id e13mr2804045ljn.1.1627033471323; Fri, 23 Jul 2021 02:44:31 -0700 (PDT) Return-Path: Received: from jade.urgonet (h-94-254-48-165.A175.priv.bahnhof.se. [94.254.48.165]) by smtp.gmail.com with ESMTPSA id f2sm403808ljq.131.2021.07.23.02.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jul 2021 02:44:31 -0700 (PDT) From: Jens Wiklander To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, op-tee@lists.trustedfirmware.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org Cc: Jerome Forissier , Etienne Carriere , Sumit Garg , Vincent Guittot , Rob Herring , Jonathan Corbet , Ard Biesheuvel , Marc Zyngier , Jens Wiklander Subject: [PATCH v3 1/6] docs: staging/tee.rst: add a section on OP-TEE notifications Date: Fri, 23 Jul 2021 11:44:17 +0200 Message-Id: <20210723094422.2150313-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210723094422.2150313-1-jens.wiklander@linaro.org> References: <20210723094422.2150313-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Adds a section on notifications used by OP-TEE, synchronous and asynchronous. Signed-off-by: Jens Wiklander --- Documentation/staging/tee.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) -- 2.31.1 diff --git a/Documentation/staging/tee.rst b/Documentation/staging/tee.rst index 4d4b5f889603..37bdd097336f 100644 --- a/Documentation/staging/tee.rst +++ b/Documentation/staging/tee.rst @@ -184,6 +184,33 @@ order to support device enumeration. In other words, OP-TEE driver invokes this application to retrieve a list of Trusted Applications which can be registered as devices on the TEE bus. +OP-TEE notifications +-------------------- + +There are two kinds of notifications that secure world can use to make +normal world aware of some event. + +1. Synchronous notifications delivered with ``OPTEE_RPC_CMD_NOTIFICATION`` + using the ``OPTEE_RPC_NOTIFICATION_SEND`` parameter. +2. Asynchronous notifications delivered with a combination of a non-secure + interrupt and a fast call from the non-secure interrupt handler. + +Synchronous notifications are limited by depending on RPC for delivery, +this is only usable when secure world is entered with a yielding call via +``OPTEE_SMC_CALL_WITH_ARG``. This excludes such notifications from secure +world interrupt handlers. + +An asynchronous notification is delivered via a non-secure interrupt to an +interrupt handler registered in the OP-TEE driver. The actual notification +value are retrieved with the fast call ``OPTEE_SMC_GET_ASYNC_NOTIF_VALUE``. + +One notification value ``OPTEE_SMC_ASYNC_NOTIF_VALUE_DO_BOTTOM_HALF`` has a +special meaning. When this value is received it means that normal world is +supposed to make a yielding call ``OPTEE_MSG_CMD_DO_BOTTOM_HALF``. This +call is done from the thread assisting the interrupt handler. This is a +building block for OP-TEE OS in secure world to implement the top half and +bottom half style of device drivers. + AMD-TEE driver ==============