From patchwork Tue Oct 26 08:31:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 516169 Delivered-To: patches@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp50560imj; Tue, 26 Oct 2021 01:31:45 -0700 (PDT) X-Received: by 2002:a05:6512:33d1:: with SMTP id d17mr21405541lfg.194.1635237105248; Tue, 26 Oct 2021 01:31:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635237105; cv=none; d=google.com; s=arc-20160816; b=FktHrV6v88RChc9kqmF3UmwxEZWy64F08tajQslkJFjbw0vBpy48MBp55DR6IBa1P9 cYWt18+wK/p/FURbUXzuDHh+dUYuRt4BN8qG6O1v5jRuso6omHeRinKiepSDFArQuKo9 YohEiukdAqD7A1US500AXkK8QiNojsPM+qJag4ys1xmBKIBC3McVP65WCamvTw+4UEJN 9tqh3ADGO/i2XX0NZHQQH2KBn3OjlHjw12X/nFOEn1ppYMWBYKOlvfvsyD8YEaSPmLDN nZ/S8FfidDJBsn2lcleocf2WmcqKGgonbIoVM7XDSsuPGn8EdD3aWlzFuYMiNihBrYgh vS1Q== 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=nJY8BVmSGkgTm20CsRqOlZqDh54ZnLLnIcGJozAZVtQ=; b=098GJErPo68hLaHTiPeiFyYnV2QDJl0WnWkNlcwFXufbNc1GzHcFLkm9ApB/PfrRBg oeiMwUtyhbI3kfc5z4Ao7Y1l75d0A8fpLDzkjT5ChlVTo3W/OgVPM/kwvG3gHLLkNYTw 6z0/QEYqHGnzM3MkHSc7gvr+dmxMfEkQjMXvwd30WdBt1Ggkh/Enpc6QVdIRY7Y2cUiO Yf964BRcwIfpBQtNWmzrkc9lfceZTsa3w6zUvswiPbXNrF1bZsVdU2BVLZ2olw45VBZz 7vVUQJOs09K/CdWyHQvu1cewl6+BZBmNcgk69ePe5BsmMqOVGf3tcF3kn8rJ4OafUG1t eP8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x6wpGGZ4; 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 q21sor7807642ljp.26.2021.10.26.01.31.45 for (Google Transport Security); Tue, 26 Oct 2021 01:31:45 -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=x6wpGGZ4; 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=nJY8BVmSGkgTm20CsRqOlZqDh54ZnLLnIcGJozAZVtQ=; b=x6wpGGZ4t4jpHZXbOtVtiqY9J28NnXCjPP+t+zbf5ZLXQknU6PZKpyIRv59OjvwQ2L MRo/9tRg1j8RtVI36taOo+vMSkONJCGbZLhgQR2ky+H3wgoIrtxKgwPRfRDuYH4b0kJd 6oJ9070IcWTB1lHteM3ZY8CxxFYGSQOdHy9wWT0k9qaZwqNaaaTeyc9wwa7lBVkJUqPw h4eHCwnV5+QV0/LOFhVTce8PPxgVFdQppiKF+IZFE5tfR5T8FIPtOHG4dDtvNlBUgDhi nCzHiQn1rqkewJ4aojuBVjmIU4nTIWNl9ouEOGngtC7Hh/BKZzMwIjjBWQhqeyHRSK7X FXew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nJY8BVmSGkgTm20CsRqOlZqDh54ZnLLnIcGJozAZVtQ=; b=qQemnMuzuG68VYIUgBAEIcSrJBEh6XOPiS/ca4oDMbOOWT/Newfel/Hj95ypD0y9vt dZJ2qJiRN1RS5LA5ttw+84demiDso//V7RSUjuLXVMEVjEmDAv8hF9uAI/1tSz8xqRig dXQ3LpFfxDMKC9eINIyhx37yaFHxeZEaDUJWGdNb/9vY4lqg7OOq2XWxQbrR36fzfSPh hphr+IFTDxu+eERfjhQmGoVgao1gwaGB25yV79vcYzgJw9pxJtJmkq6s8oy/w5PQQGj3 JSAaT1V1G22yAoIs7QHNy012BEEYsXXJfrPOpucljU+zrXzQxcKBn1p4yvp7V8hWvj4M +Naw== X-Gm-Message-State: AOAM533kt40a4Bn/zQjKJzueB82/7lR4d5jYjKLVnnK15mbcUp48dOOy 1D+RYWiYLsNhEoi26EfCcs5oLq6L X-Google-Smtp-Source: ABdhPJz62lWImbRbMZBUEEDsRT6QZPET/1jm/lqlcEQjVChDZ2sw0LXS3GpvH1ezJVF85rwv+zTBfg== X-Received: by 2002:a05:651c:1aa:: with SMTP id c10mr24290846ljn.222.1635237104897; Tue, 26 Oct 2021 01:31:44 -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 e4sm1944598ljn.131.2021.10.26.01.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 01:31:44 -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.vankeirsbilck@kuleuven.be, Jens Wiklander Subject: [PATCH v7 1/6] docs: staging/tee.rst: add a section on OP-TEE notifications Date: Tue, 26 Oct 2021 10:31:33 +0200 Message-Id: <20211026083138.1818705-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026083138.1818705-1-jens.wiklander@linaro.org> References: <20211026083138.1818705-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Adds a section on notifications used by OP-TEE, synchronous and asynchronous. Reviewed-by: Sumit Garg Acked-by: Marc Zyngier Signed-off-by: Jens Wiklander --- Documentation/staging/tee.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) -- 2.31.1 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 ==============