From mboxrd@z Thu Jan 1 00:00:00 1970 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.5 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 05F6CC4320A for ; Thu, 26 Aug 2021 12:33:43 +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 CBA1A6109F for ; Thu, 26 Aug 2021 12:33:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CBA1A6109F 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=9gJ3QBUlg6tGXrQpCfBnLHmBjVZCRv484TyquAVYEz4=; b=0VU8+8KN+9BcdQ ibqH9UOzZzHHzsoAbKHRCBY1S7hZ4hjKHuI0hy07SIjRTV4WhuamnT0YEY+6JE65rb/uBm6aV49I7 K3GFIQsRYXVVmIsIo0UxfDk4iLI4dis//SaKOrUYA2hj4SLS5FlYDNe0QWet36xuTfwgVkWvbk7sA pIUr/bJaVdKwFuUdHsDqhHKn9NIz4GRbK9syBoWbcXk19Tr40HSV9yYLF7BsUBy2kFzIrvV5ykUgt w6fyrS7FYZAhkYIg9n/sLQuci8QTOTKWQuofNBB+kJBNs468Sdnidxm8z1kBqczFM+AJt0Chkn5n8 52s0Mjjlx/ovyNt+Rl+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJEX6-00A3wN-MB; Thu, 26 Aug 2021 12:31:00 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJEWo-00A3pf-KW for linux-arm-kernel@lists.infradead.org; Thu, 26 Aug 2021 12:30:46 +0000 Received: by mail-lf1-x12d.google.com with SMTP id z2so6531236lft.1 for ; Thu, 26 Aug 2021 05:30:42 -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=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=WbCmTiETvlSIEkDahH6kkTsXRY+mA2Pi3cZNOZrBYtdeHcw1cshPPjkQ6pz1x00968 jdAfuCPULN8FSBBFz1padK2s0VEBmrN73q5FpHLGlmqZGsawx9/r0a9ceQ4sxG4yf898 RGCOPbg75W8LZJXgop/LGs8tBJph/BdzSiplz2XfXjaqx13aZmkCKpNBYqYc/7jDqx1L 685XbkI5BKzmLJa5RbjkTeavjGYKSLWWPRGA2OBeXWS+xso0PLLDZv3rNRfFR39KFuIH FLOJ8qd6fQxJMw1ozsiTt6FtPT4RwL5gB/Qac5jOW3NkFj8C2FVa3LuzeKigcWc0+fc3 3g+Q== X-Gm-Message-State: AOAM531cohcbTOe0ogLPxOX6gfl3bd7CyoJ8ShVbUhu7EbEUOvVZ49dh MgKlpZIO0qamKbRm9o4XlEWCk7jkK8D8fA== 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) 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210826_053042_717727_F82EAEC0 X-CRM114-Status: GOOD ( 13.40 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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. Acked-by: Marc Zyngier Signed-off-by: Jens Wiklander --- Documentation/staging/tee.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) 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 ============== -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel