From patchwork Wed Aug 18 10:18:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 498886 Delivered-To: patches@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp521235jab; Wed, 18 Aug 2021 03:19:06 -0700 (PDT) X-Received: by 2002:a05:651c:2114:: with SMTP id a20mr1654925ljq.414.1629281946532; Wed, 18 Aug 2021 03:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629281946; cv=none; d=google.com; s=arc-20160816; b=pUC5yVBiwtqdnsABCv1tlyTsvKcuDcmRB7ADJwlZjqVZccsT08ObzDjyYo28KJtNd0 2MdB1M/nwh9JndJiEZg3usEHJgwo+dx/y1w2PTLjaBtTQNHJfwIdO1oNpgRNQequfBbH JdPlreNeK0K99OMkYEQyfQybpbmmt6bISrRMMPRcAvUTswkC2ht8ivFE675EXXg80Pqe FU4HOaZ3NONoILvX0XoA6es3oeO3gWgfhFixqCypG5n4GDe4g5gyApxPqBLIkMkjN5mW mt2Qkau8Iuf5l8DYVorS76L2DTAKZkb41nbMmeLEP0ZTy8lwmTvWaXTKgsLOBlUdxrtS WZrg== 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=3e91kQfirH6a922fd9k6DmPw5po4wAqiN1XqXe8pum4=; b=sWT8XREOwVNPjuJ+CxpnnZ6JGOrpaCBM6OANgYeMbKXkw0OckO+Antv3rtBQ989Yrh Ax+7kSdC7KlDeUFOhawqya7aN0018VPitZTQnq+HO7BtZDd+neWkWSATNHXkF591C2WT 3qbRtdNSI2s2BKXMNsPcqJuKbFMId+VO6albhQPTW3r/oaHSkA3V3pH62k7bQgXhFBh6 m/QNgDPIBLyrPrIHoRu4cgCgH76zxkeJfMM7m3+5J3sSwHO1WCgCgmX6vip32UVwK5Sm PvhAutydmPn+mZQzRQKAqRtJFz9Lm3bcey8yxNPLLwE36XzPMJ+acNQEkMuQEJmExZM3 eTjQ== 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 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 k17sor2515862lji.43.2021.08.18.03.19.06 for (Google Transport Security); Wed, 18 Aug 2021 03:19:06 -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=Q8jjU+n7; 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=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=txr5Q+CbFTP5zrHnaI+mA2AobQy26IfefAuN+fR1MgveCCn3A4Fcc+t2MEvfIwy0sB R/jnfgxWZeHCaFhfyolBKpOVzY/OnQxu8qyxwLBGByodlY2ZRUIRvxoFiJUfYpXxky3W BOiX6u8RaWA5Ba4PhlgoEWNYylwSw9ByaaesgXwqoyzSkW52BduyYoavQBf4E/LBZ7vo VW6FklnDA8OoWDQvQ2NJFYYJ/9lLH+7T+UFHwnsdsx6n75ldWQbDcquZZ6PfGQmCap1X 1xzO7Gxmhw7TA2pBU7EaIYB14Wa1QGlynvy8vZslK5vBSobSvctU44Qr+L7KCCCeOP3k NnEA== X-Gm-Message-State: AOAM530lTwUZLISsxrqGbjwrLJUAd7DrlsqjAVL5NWeGNp8QLNNA8Qt6 QvkU8UzkT0xJ1hx5ivQv3uzO1zts X-Google-Smtp-Source: ABdhPJxKlRCwnxfG5a1PM1Jrxd62jjhZ8/Bvf9gyq+mVIpPUefjihry3BTpVGdJK8Fe4SaWiaRJDFA== X-Received: by 2002:a2e:a370:: with SMTP id i16mr7355475ljn.444.1629281946193; Wed, 18 Aug 2021 03:19:06 -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 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 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(+) -- 2.31.1 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 ==============