Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp382168pxb; Thu, 26 Aug 2021 05:34:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+Nluh1Euoxk0qTbyCszW2nqDGt5iEYK544YVuJ0TKQI9fZfYBU3MAMvq9ATzFgLciNHEg X-Received: by 2002:aa7:c592:: with SMTP id g18mr3937247edq.324.1629981258069; Thu, 26 Aug 2021 05:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629981258; cv=none; d=google.com; s=arc-20160816; b=0gpI1NMGKUi7jOh55YgKUgzDAvrWipDU/8Whxt2Nbr50hTS+G1hxg78QuOEg4Wh4G3 OgmTXk/Zw5Y9BaU/F/i7DeubmMdYspo44IGPUaQRBEWIXsnX/M/y1Y7qBbZo99JVT8oF MVWWrk+t23nXZLgWxfctjmy/8cSJL2Og+NGrsDzFOMpK5nP2Fjrd60lpPZ9LlXQ/QTnj rnlBsjfPChY3QN1q4ivY1pzG4GXnZu62lpw4SxObVGzdRS/tYy+4lqdRWjsZZYxjat+Y lJcboOhU1rii4x+obSBd1VCb5qO3TaWUCoU93gWxcxvLVgKl9+ZubcKR+1SkdAMgktzl 4yiw== 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=GhgYsmvqrAxJX0LtPmrYeEXggYv/fhoAephchEquNLc=; b=EGB8uNwBMyn3xeUbV8MC7l864KMr/PdlnpvqTvntZlWe36D5CiFk4BM2p8bl64p0Ub FZ6x/ImSAobP49F0AN4KTn04FMWmUs7q8zOvRy6jyJ7o3gid3gUmIexSXZZe0qX51V/T NsJodOfaQvTtrUkshnatGDEj1o/3i6768fAQBsEr9jn63j3sm4GSnp4MBrB0EwG3ph8j YpZupetrYcksw4j/+ABIvpaeH5Ja4tee/PA3WqIdJie2Ziehw1rQTSB7FWOvS1TD/ODS EsMytI00Ihs1QVRw59Cr6570RCvcfvEavJd/3ods6E9Hz5ObducHm4ZZxRarVWc74lrr 65mQ== 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 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 cr15si3773091ejc.254.2021.08.26.05.33.36; Thu, 26 Aug 2021 05:34:18 -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=SiDDwqW3; 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 S241103AbhHZMbb (ORCPT + 99 others); Thu, 26 Aug 2021 08:31:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240950AbhHZMba (ORCPT ); Thu, 26 Aug 2021 08:31:30 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDC7BC0613CF for ; Thu, 26 Aug 2021 05:30:42 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id y34so6445922lfa.8 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=a4TjaVBhHdBk6cub5J3GUQH6Jc7puKLp/rNlXSPcCfE67f1mc2voY7WJZnwjd2iqI9 kG//MSX/JsOEYaliWjkjHIv9eR6CiqHW5w0kamw1bK3xsY2BcoojJemdm/TxMrnm+8BH VOkXb00FicTW96YI5WL4oVEmmQSS7v4Hy0xIL2OXb/1WqAqPMdBrqJzoG5eu2tU7mawT /x+IvyLL2Z+JnwQfahiiYk3fErfYMBHzLdcvazRwl27N5ePMlzgAqd1O29CgiDCsDGdJ bzu15MuywUCbcVnFT5vJfXLBk0w5pRs+/mquENVF5QdrGKPZ0O5PWfvTt4omi4WoNORM 7n/A== X-Gm-Message-State: AOAM531n/TApdqzo+pej0F9j5sLJ5a2EpXX2D003z/Yh76cka/usOk01 ScMuM8HuHSoCUfe9j3oTkUTbo+LF051XsA== 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 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. 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