From patchwork Wed Nov 3 09:02:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 516725 Delivered-To: patches@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp392870iml; Wed, 3 Nov 2021 02:03:02 -0700 (PDT) X-Received: by 2002:a05:6512:48a:: with SMTP id v10mr7510320lfq.434.1635930182474; Wed, 03 Nov 2021 02:03:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635930182; cv=none; d=google.com; s=arc-20160816; b=SBlDi5PNCID4jcRhqXYzD3P+DQ5ZnOVvqh9SeLiY7VFzADltjb8FEN8ipDu0RGgucw M2a/gfBa/JBKBXV0xeRgBMKR62XvxdiIERqtSbK6Wc7xNKdRdaM1RXgGfta14Featugr Fmd1pobNKNurDtc3BpkI/IhwlVEFOQ/tTfjctXkLNduPZX7a0UChIwKMw+R9q4GYrpA1 9HSI7CxVFENa/Gnwlgc0kjYPA/c7sdK8q5Ceo5/enLi8SPeT4IGQlw+25BZOk1lBKesi vOWAnFzdTgMnrEDWIXKSl60OOw5clWjjXk9G8cuzB+HR4eHbxiismLmwRi036B/bPRTv RLgA== 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=nJY8BVmSGkgTm20CsRqOlZqDh54ZnLLnIcGJozAZVtQ=; b=zQiqQ0yK7jjZzMXFryeH1tgE/1IXaD0x7jL0R5PzTjiqRtOQkYWrV2mRJEDSeRBdCi bDcpLodkpCmmPPaewBW6vYo2rM75R95p0ow8IT++/UylaoX8qCCTAhYIhTrjafNGraRG tU84UAqw9urFwg4JeV+e78Fuz3sAuSHypVmyy0QW7Gr29H4tUXtOHokNGerTYF8ukNo6 iCpQ4midiqiXC92syo8tQBcLNqKHRN7XrU30RHu0KCjTuWdWAVJe0qd0fQ42uzXWZ2XP 6pRuA2hRjnWwICVSNKN5BUiXwr99KlQbHPR34kk7P0+kmqMtSPLpIXOyp57W6rKP3MOa IX8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pbU1z0Vj; 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 e26sor772527ljl.1.2021.11.03.02.03.02 for (Google Transport Security); Wed, 03 Nov 2021 02:03:02 -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=pbU1z0Vj; 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=nJY8BVmSGkgTm20CsRqOlZqDh54ZnLLnIcGJozAZVtQ=; b=pbU1z0Vj5sHJUKmosC+O+X4SNnuCMgsM5oZhO7615jidEjVdb6lSRxFrXXLEdOY46l QWln5hwE96k7MpKskbrGrm5mZgqEhABOT9+KVXD8oXhz6z0opaQe58AgUEuIEOaQXF+4 MYxSC6P99XZf0KAxhklD5JnrHdm63D77PYY6ivSpekrPqZXgTGgNbA0pTLsJNanngOWm 39u4I3/DFjm6bVvpejl4RnLO+CNG18D2SuTgjp++8lTrO77zuYTaoUYD1oWBi6O/UTHd yVFytaN4bR734pwXvzCqbABNxVdvqpEtnSr/HLHnASvhxN/XjCQFvC8P1sL0XnvltfKN s9dw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=nJY8BVmSGkgTm20CsRqOlZqDh54ZnLLnIcGJozAZVtQ=; b=BtXnxWqpTjYtkjqmbGYXMjz12rizEyl8TJvhJ1y91k3f9AiMeUOk8luvtiehXql+9r OAQsyXLjnp14mTujukCjWpJmn2nkldAVGM2vrob747M1tFFNLEKWcQJMEjXyMtLP68Op V1/t0UrX5DI4mD9E8y1g6d0aQDh4gOQQy5GnlLfoJn9hbKCDCDBxO82pbPlCwQqnNSeW fDFXI4Zqo212sAE3VjjkNZaUvp5XQBB4Eu+xdwMkSGbdi7XJZcqR2q/S0sETz3DMQ5nx 8Ma8coFQQW7b5fkKXCjMj58dBLsnF4wgUk0K7cblOAXXWei+Ib4HSKtRUuyIP4pK8Sgp VCCg== X-Gm-Message-State: AOAM5322dxbl+dj75JXaX7b5zaro9+Bq2Crmh77Zan0gR2yGEN3Y4T7s /d/+Tx2XT6qNBLY8Fmwo5yWEFWRF X-Google-Smtp-Source: ABdhPJwf6qkKTCAxHYBhHAVkgqQC5SAOerKxxzgblePi8wBo76Wk366WL9aI4kfaHjV/5FosvmDJgw== X-Received: by 2002:a05:651c:b1f:: with SMTP id b31mr19893084ljr.272.1635930182081; Wed, 03 Nov 2021 02:03:02 -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 w16sm124373lfr.233.2021.11.03.02.03.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Nov 2021 02:03:01 -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.vankeirsbilck@kuleuven.be, Jens Wiklander Subject: [PATCH v8 1/6] docs: staging/tee.rst: add a section on OP-TEE notifications Date: Wed, 3 Nov 2021 10:02:50 +0100 Message-Id: <20211103090255.998070-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211103090255.998070-1-jens.wiklander@linaro.org> References: <20211103090255.998070-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Adds a section on notifications used by OP-TEE, synchronous and asynchronous. Reviewed-by: Sumit Garg Acked-by: Marc Zyngier Signed-off-by: Jens Wiklander --- Documentation/staging/tee.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) -- 2.31.1 diff --git a/Documentation/staging/tee.rst b/Documentation/staging/tee.rst index 4d4b5f889603..3c63d8dcd61e 100644 --- a/Documentation/staging/tee.rst +++ b/Documentation/staging/tee.rst @@ -184,6 +184,36 @@ 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 + edge-triggered 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 edge-triggered +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``. Note that one interrupt can represent +multiple notifications. + +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 ==============