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: 12443853 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27989C432BE for ; Wed, 18 Aug 2021 10:22:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E610160F35 for ; Wed, 18 Aug 2021 10:22:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E610160F35 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0L+Gw41oMdHoZN5IDOO4hGbLA5qTMAqbabTg8xsDamM=; b=CuKDuuVLyENj0S zPFSax1UcZyc2waCsgk/SjlNUlpuPzwKEDqJxTEUsYBvqYOeu39KH/JfCFn11wRrvKjB8GF6aisKn XH1LwkYcIHHQpOhOJtAPF4DvLXFnVqUovQxIhUeQkr8i3mUPGz/oOIyBuAQ79p0nSU8bNdgO3XBVw KpkmmClWankSWj9Zoy+qQco9ISUr4KTlM6NStYoolWBlRGn437Poo5/f/sipVmlHUZFEsrkxouST/ PLr0z0Dk7DzBfK2aZKPZ+y7j0awLacJV3JmRbiMtR6eRrNg2NAQ3lB5gwL5TlQmfBEUf1bODM4VWJ XNZUA+evHWP8DHsGwAQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGIfY-0054vT-Dz; Wed, 18 Aug 2021 10:19:36 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGIf6-0054oQ-QI for linux-arm-kernel@lists.infradead.org; Wed, 18 Aug 2021 10:19:15 +0000 Received: by mail-lj1-x22f.google.com with SMTP id i28so4128887ljm.7 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=jPVIDYxCeZ7TinC8j3okpAGPOlxtmCgYtbkEXBAQM9ChIy+PXhhYe5homGpwYFKSPT ZqPExSR63UceD7tKZIBp5PoQtFFwadNHIwsfu0D9lpW3EssnxMey90Lxu/AJOPESur9R RF52iWa0QoqhZJ9F8Y2EnVubg8B0ffrOy8p7m5zrpSlwSW0TPUy5e/Ev6Pn1TEIz9de5 MLJdxARWlxxmpP0TwcTaV8kgkRLiTbwOBQdDH7WBHAi3PKSl1S+SjkbGm3SG1DAekSlg 1iLeTWXS135bRW4N9qFQEFYfurMfQSwtmpvPiC57f79WHeKQNnPRZAbwTw2pWw83pB/8 iJxA== X-Gm-Message-State: AOAM533+V3oVx7+SH4ZXMTwTgmSQuvQ4faJzdEc2yUExmE8LNNUjr5+p BRDmwhbGGhQ3HGSXRGjpnXka7A== 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) 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210818_031908_895451_4533B4DA X-CRM114-Status: GOOD ( 13.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Adds a section on notifications used by OP-TEE, synchronous and asynchronous. Signed-off-by: Jens Wiklander Acked-by: Marc Zyngier --- 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 ==============