From patchwork Thu Aug 26 12:30:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 502854 Delivered-To: patches@linaro.org Received: by 2002:a17:906:f46:0:0:0:0 with SMTP id h6csp162438ejj; Thu, 26 Aug 2021 05:30:41 -0700 (PDT) X-Received: by 2002:a05:6512:3b7:: with SMTP id v23mr2515846lfp.41.1629981041359; Thu, 26 Aug 2021 05:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629981041; cv=none; d=google.com; s=arc-20160816; b=ddAN4S/VHWugBCivRthOr8Kkz4cQYJFmG834BvYPNNjV6ZXumGYXZMF194qAZwg0K3 kadfOQ4wk9lj44+McafNGOEWGdkM0wVsCDg92Yj+8QOx/jHIvCJo9X9iRrHPd6T621N+ uzYr9a8F1Lc7pFMhvg+9lMmhtuwkhpoW3yQvjwxjEO1yw8jH68dz3tWSPTrJvngg0pBH CCFhgpBSZMET3FAH3tVikm79ElePumY63ni4lxkdZr4g9OBNpOEE7jUKcvJ35AF0CcBf DPigfGgvGfOoHkQh/3Z/CVpi5AshF11Ig0ltpQkN5TNR6YG/AolOjrKspCWpXTIoOWzI HyFQ== 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=GhgYsmvqrAxJX0LtPmrYeEXggYv/fhoAephchEquNLc=; b=tUAI5pP1UDWpaLuL27Gmr/u+mOYMzPP6MM5Rwy9OoQUYxXvXWOcT8As+qf6Msx2c/A u4EgseMpGv3xTNtwinJdndpiPcro4evg2SVNmp3KqiPtnCDeQ9J8Ns7Io+8wPLN8x0L+ f6XV0lyGQS/g1oaUcDtAAY6s1uoaw98970H1fNNdLup6o8pXgIn0+Wb2Q5No5n8Slp4R RNnHoM3GHAIPfkBX1bVg7qbT+jAKTHdJJp2Ny6WIc1kH4BqOQvuxCK3zvFBGdG79zE5v wgJNJPLu1vgEZVD37CHc8NR4KfjnNdQtzvyPibXnmDeo2iD+eBpuLOCy8JmADiEtkQJM N+kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SiDDwqW3; 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 o15sor819427lfk.107.2021.08.26.05.30.41 for (Google Transport Security); Thu, 26 Aug 2021 05:30:41 -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=SiDDwqW3; 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=GhgYsmvqrAxJX0LtPmrYeEXggYv/fhoAephchEquNLc=; b=SiDDwqW32wUAav4VM8KMQ9B6zVIWZUVIv8hwgF0PUZM6+DGTErVzzLpW1QVyZSthdJ xDCc4TxDcP4XAVEhblYC1/AZA+NQz1/quHZ5jKMYnhRrk2RFxGDEBAR8WFO+qPjU8LGm Vz07x9i9zOh6Mr/J2dy/0Q/q+cJ1BBcyOAyKNfr5VVqulgD8ONj21JQPPbXP7UNszXRo rnvXdeMIuCmXsqqxp/5j38Q+YPr/FctuEIrowQwltE74+7XgEyzbh0gEvFW5NMoQG04U EWudR3uMOWWZhdcrHurLQV4qtxDa86g7LQCU0Ou+FFwmVGZsxbDZKabPS5MXGzx+RAyE CmuQ== 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=GhgYsmvqrAxJX0LtPmrYeEXggYv/fhoAephchEquNLc=; b=eeQBpAFBpPQFSUB9sfCHN2x2DYX0zLu0p9QSfPk30Ls9h0wzJ4NG+wM2hfyxy3Hikq 00QC91+d8vkheH2EUhDp+MHjdvFCZVfGf75AERMRj+ulPIS7X2Iu3F7DYWhl74gmGk4Q J+LpqheIrVV//6E8q4sC7akWGbMG+wPn2WRROEhtiaM77QV//yRxhIQ/cfm/8CanXIAg xmmV3Zz2tpemAUL3nIr+f7Ze0VzMWvCE3iXunYbNUxrqr/r1hzlxxY9TYWgp4cz583FA UIs+Y/2SgMslDm1gl3XiNnDlPX7AuxPPVE8VapRLIxkg78tZ6lgF8Jvt9qtm0Sl+ly1Y Hvyw== X-Gm-Message-State: AOAM5302E44X3Wl2lYGZE8ntdscftf5sCJ+8vl4e8yvUFyvD4ZDOfZFO tQ4b7egWEc6Dy74qRDUPPD+z/9Os X-Google-Smtp-Source: ABdhPJzXMNNF/bi1HIJqWX3/mI79XcU/bUU6dSehJCcvs2LOiH6i8Tz11P+VEt73eqlvd3LlKmse5A== X-Received: by 2002:a19:c148:: with SMTP id r69mr487638lff.281.1629981041039; Thu, 26 Aug 2021 05:30:41 -0700 (PDT) Return-Path: Received: from jade.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id j21sm332283ljh.87.2021.08.26.05.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 05:30:40 -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 v5 1/6] docs: staging/tee.rst: add a section on OP-TEE notifications Date: Thu, 26 Aug 2021 14:30:27 +0200 Message-Id: <20210826123032.1732926-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210826123032.1732926-1-jens.wiklander@linaro.org> References: <20210826123032.1732926-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Adds a section on notifications used by OP-TEE, synchronous and asynchronous. 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 ==============