Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp322901pxb; Wed, 18 Aug 2021 03:20:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJway7QzfCm1sK+0MWT95+I9DJRenJh8emSsULe7CmWagNBtXKXlJwtlIOHxN6+eq5ZNo+fV X-Received: by 2002:a05:6638:624:: with SMTP id h4mr7483776jar.73.1629282012939; Wed, 18 Aug 2021 03:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629282012; cv=none; d=google.com; s=arc-20160816; b=kRMTMhvUu3aqmtCYiJMp/M+s42KjTJ5q27HQNFfePXE0OOpWzBGdXIiUJq20lwxg4k 42NWkFAkSQvahAIuTMDr8wepxRBTcN75X6LU9sQEjN1yu2WlrXgjKYyT7U5c7x6xYWCt suRLJljACtFbxS3OFz8ktx/72gd/iI3D2rKEMdRCuMAv4ASZjcZfy5MRjrcYrf/koHud lHVjzrI2ZmHtUoUZz5p2i6wObc2UsYPvYWjt3XGzCdGgIHpLvmQ33vq28j/DoMwfMxCM OXH+aL43nKLiRXU1gGo3rsHNQczHdcNNt90WrSKJPlnJpTM/KksegSvP1Q3xG/7Q9KV0 X1BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3e91kQfirH6a922fd9k6DmPw5po4wAqiN1XqXe8pum4=; b=nbrB1KahT09xoxCGjzAoToQXGkPt6eyXX5HWHBcQRA5j9oSLQn58xTt3/v0UyWlh1W 4hf0OjW8O0DrNewiDEFwAS9kgNhKEWVAU0n9hLw35s8N4SU4PpJwDC+hVOfJg/ELNz8C 3no+2Afe+PZ+Ca4+RqPckk1z4Rbqe0fG1zjxFDjvC0/gxpriQBp/6AkM/bz6srUu8NT6 yK0FjY+PMpStLDNmFW5f/kSRpgouUIcwTrpPoqIrmOjDpCo3IH4vEpPajoMZR+NyHdkq ublg/KaKmfh6dSbNSRWCWGjv03btgKtz+Jb+wd7AHx8oX/IjDudsbWAn6PcMB3csnbHS /1qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q8jjU+n7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s10si4322439ioo.6.2021.08.18.03.20.02; Wed, 18 Aug 2021 03:20:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q8jjU+n7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233755AbhHRKTo (ORCPT + 99 others); Wed, 18 Aug 2021 06:19:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231143AbhHRKTm (ORCPT ); Wed, 18 Aug 2021 06:19:42 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F22C9C0613CF for ; Wed, 18 Aug 2021 03:19:07 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id y7so4181219ljp.3 for ; Wed, 18 Aug 2021 03:19:07 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=3e91kQfirH6a922fd9k6DmPw5po4wAqiN1XqXe8pum4=; b=Q8jjU+n7MIxJBH7wrWILgYWYOOJrsba3lzg9ln09V3DshmPDoPwzTVnksd12xNrA9g ZRZ5NkmfwWJpFgdN37WlkhmIsKAcMPfgWNUx0Urb6hL9DMBiK0TFfvowwKxbklKoc9M2 KlypTgmPDzfA5i72/QYV0jpIhhXskpBFP/muUoLCS9SUu9gaXHyTXWuK8JTbPv96GRg1 rJyxsnLCpb0S1+50091V1Kc5VrJOj6yqmgNJOTAT0oIlQCorj1MHPn/I90fTnzfQ0RMG 1Ej6QsPKge03MgT1HtU5OOaDuQCjZjxfmyjANldUQH/RqsUota3x8pLCkgVScyUiQXdo uOJw== 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=3e91kQfirH6a922fd9k6DmPw5po4wAqiN1XqXe8pum4=; b=LrY8V38T1ZnLt4N7Ib/jFt0SyXts8Ds9mI6gBjcEk3EXnyBDIYnQQCTiS+FNhQGPGE dC8qYBHgyNvJkck/1OgVA2u1uxVZpaRtfUYbACkKHaELGenaFPZ0pelHMaNeRkoR42RU dLLZQl8v9gruiiQ+m1h01ixTd4KRD28l40iRN/7jhWZLBctu5n/oP/T6aZ7hw5/rdOz/ VnWv+DkLqd4zZU99EfviSdH779m9ENnuys6KrfRiMMqgNwR0bMgVgyeEfmSyHlEMnPJU 7waSb4gH5eEmnp3uK6P0MBncqqV7+35K9MnafzHHBGvoofLy+ANkqfkRuHVkAD0sYzip M6Nw== X-Gm-Message-State: AOAM533AiEQFzWXUq3N3RdbSKs2MPRsYuNTRNW+wuT4I/Mnjgx2xUn6h eVG5G4XGr2WduvpWbcCpfZyOZ/D/Wvm6IjiV X-Received: by 2002:a2e:a370:: with SMTP id i16mr7355475ljn.444.1629281946193; Wed, 18 Aug 2021 03:19:06 -0700 (PDT) Received: from jade.urgonet (h-94-254-48-165.A175.priv.bahnhof.se. [94.254.48.165]) by smtp.gmail.com with ESMTPSA id l27sm451160lfp.245.2021.08.18.03.19.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 03:19:05 -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 v4 1/6] docs: staging/tee.rst: add a section on OP-TEE notifications Date: Wed, 18 Aug 2021 12:18:44 +0200 Message-Id: <20210818101849.602257-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210818101849.602257-1-jens.wiklander@linaro.org> References: <20210818101849.602257-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adds a section on notifications used by OP-TEE, synchronous and asynchronous. Signed-off-by: Jens Wiklander --- Documentation/staging/tee.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Documentation/staging/tee.rst b/Documentation/staging/tee.rst index 4d4b5f889603..951f07dd026b 100644 --- a/Documentation/staging/tee.rst +++ b/Documentation/staging/tee.rst @@ -184,6 +184,35 @@ 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``. + +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 ============== -- 2.31.1