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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 5E403C48BE6 for ; Wed, 16 Jun 2021 10:37:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 49FEB61164 for ; Wed, 16 Jun 2021 10:37:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232519AbhFPKja (ORCPT ); Wed, 16 Jun 2021 06:39:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232444AbhFPKjV (ORCPT ); Wed, 16 Jun 2021 06:39:21 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52702C0617AF for ; Wed, 16 Jun 2021 03:37:12 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id b37so3068268ljr.13 for ; Wed, 16 Jun 2021 03:37:12 -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=bPEFf1WmEOew3wXqjPL0D4ZH5STaPbCOCI4W4KStU94=; b=Wu0BlJMGLIrf/wOevRIS+XR+4dQDCMwD8EDfGBMUGP9eS4FoIpWnzRXM1+nWTx/PpE zToRutj8hVoI0s2/HTDsJbO4QPRiQw7Yorz6tX63dgDzXwiKiqqilSNNMbMbI3v7GIL+ tdA2noUiH+fRxWUksAcFbOfRxQu+zO4B3uIfdND97u00fe4zT6R5E1c4iYEhrjRIZbP5 Ou2w5IOhBBxFnuwUqANSnElUDnjy3dZkBJPQJ8qk32ysCSkFhOvYi3MnfhyNnyBXB3Kj lkYkpOfFxOyT+YgKH03rlUjQH5qZd4DNdQVdIeK5Kt64i6oq0XQKdxnyC9O1/vkH+JxH B3Rg== 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=bPEFf1WmEOew3wXqjPL0D4ZH5STaPbCOCI4W4KStU94=; b=oOYx2ISkPGr2QJd2YaKdpiOKjNF+rGrab/aI31R6Fv0qv/3kkIUFxjUq59S5dhjwbM AsPC4VNkLALsfm3XFZcTS5ajg68bBLhKVbt0HvkGeiT+FXuPE4iOVjGJcm4oKcFbBHkv K2UaoBCmIiQ2Uq36gZ9FxVL4NR1yBW8QewU4HmfZ2jTQdLH8M6uyeyeJQb6QlihSutgt 3fUErsN6qfIqUgFA2Swjl1Ht/aRUVsc+yW0rOnc9dKuDCigVOOgWRTc8zfQKg1xOec/c HaSLnnl84sRk0R7fQSnsUt6j2O/029fyhNsTEAZ5QepvVjMGwc4QbunJBdnUy9DSZcBQ eFTw== X-Gm-Message-State: AOAM532is3LovQUKxYlRAUoSizGInMQBU1vrIZde8XxkDtCoO8p5c9dp 4vC6SA6G6hKDrrKR2niNk0cZVVmCJoFd2A== X-Google-Smtp-Source: ABdhPJxUQQnMedGG2WIOuUWHj2MtSIPkky3Mq4+PSdmzlf6IblLKi4pAsrlJngyW2WCidlJrTITXsA== X-Received: by 2002:a2e:a314:: with SMTP id l20mr3865559lje.361.1623839830434; Wed, 16 Jun 2021 03:37:10 -0700 (PDT) Received: from jade.urgonet (h-79-136-85-3.A175.priv.bahnhof.se. [79.136.85.3]) by smtp.gmail.com with ESMTPSA id m17sm205621lfh.288.2021.06.16.03.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 03:37:10 -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 v2 1/7] docs: staging/tee.rst: add a section on OP-TEE notifications Date: Wed, 16 Jun 2021 12:36:43 +0200 Message-Id: <20210616103649.2662395-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616103649.2662395-1-jens.wiklander@linaro.org> References: <20210616103649.2662395-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. Signed-off-by: Jens Wiklander --- Documentation/staging/tee.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Documentation/staging/tee.rst b/Documentation/staging/tee.rst index 4d4b5f889603..37bdd097336f 100644 --- a/Documentation/staging/tee.rst +++ b/Documentation/staging/tee.rst @@ -184,6 +184,33 @@ 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 + 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 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 ============== -- 2.31.1 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=-16.9 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=ham 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 9D948C48BE6 for ; Wed, 16 Jun 2021 10:39:33 +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 6C47761164 for ; Wed, 16 Jun 2021 10:39:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C47761164 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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=H7KmhtKY01bKGUaIT057z9ruiNb4Oih6yEOdkOqpNvs=; b=KHTSFsFS7PdnL5 UWnkeYxpwA2EcIcNFRBdBmoK/VMsp1kK6J/cv9gg14IIdIGzNGxC9xlq7MWtlSzYlIfGoE+11Xp/B pMG8FbbmBP2i9Umt1bPC+ZrK3Gt9jJvCZtTUp8FVoG0PLbju39pOptMCG2KvSmrI9nrh1+KYRPyU/ Ioap8o4mMp5hIfudynH0pQI68OZzI4VVD3/7Ru+vsuBXPX2V7ENpmsfkWO5hB/2i2jp1wqS5Pdetr zpScnDa5Mhhn29XHSnxCHnc6NNzJ3X/DL+UGuuAxN5ShrzSiILVVyYz3IwUR/81sRbPQpAvwhrKk5 v3RCFiI4Wb1V+/Ctjl7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltSvQ-005qMR-D2; Wed, 16 Jun 2021 10:37:36 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltSv2-005qCb-6D for linux-arm-kernel@lists.infradead.org; Wed, 16 Jun 2021 10:37:13 +0000 Received: by mail-lj1-x236.google.com with SMTP id l4so3217694ljg.0 for ; Wed, 16 Jun 2021 03:37:11 -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=bPEFf1WmEOew3wXqjPL0D4ZH5STaPbCOCI4W4KStU94=; b=Wu0BlJMGLIrf/wOevRIS+XR+4dQDCMwD8EDfGBMUGP9eS4FoIpWnzRXM1+nWTx/PpE zToRutj8hVoI0s2/HTDsJbO4QPRiQw7Yorz6tX63dgDzXwiKiqqilSNNMbMbI3v7GIL+ tdA2noUiH+fRxWUksAcFbOfRxQu+zO4B3uIfdND97u00fe4zT6R5E1c4iYEhrjRIZbP5 Ou2w5IOhBBxFnuwUqANSnElUDnjy3dZkBJPQJ8qk32ysCSkFhOvYi3MnfhyNnyBXB3Kj lkYkpOfFxOyT+YgKH03rlUjQH5qZd4DNdQVdIeK5Kt64i6oq0XQKdxnyC9O1/vkH+JxH B3Rg== 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=bPEFf1WmEOew3wXqjPL0D4ZH5STaPbCOCI4W4KStU94=; b=J+Hweb+gIZinoSr4BUQCVD7Of8hqFQ46mDHZG6GbAM1yISPjcUqgwWdn+BjstKn6GN MNolE1Mihnr6MHTgKxWw5VmSh957tD0whYBq9uKJZ05evudSGh/dAYtg4HuM2PvkPo9U eWZRpBYFLT1u5JE8jBktZbppv3lXGuz8V5LnG4QPeHwVRyipZz4bKjNo1zXjy32gMepQ AnMd7C7MtS2ZbITc/8x+7Kp8FXqrYfASI67l7pvnpywQwXtZ5uBWOQSf6iWAqQIancLg u2TCR+RAaCrcGQ2wIhiKA0czvhEOR1u2txOkK+0JtKm//fVQxIMdLNJByVriAh4H+03+ ej2w== X-Gm-Message-State: AOAM5316vramLLq8RObRq/poq7MYa8xCmtvjmsualypHKru0TIUTI5t6 F2fGOOo4ulx5kuLjSClBZ76IYA== X-Google-Smtp-Source: ABdhPJxUQQnMedGG2WIOuUWHj2MtSIPkky3Mq4+PSdmzlf6IblLKi4pAsrlJngyW2WCidlJrTITXsA== X-Received: by 2002:a2e:a314:: with SMTP id l20mr3865559lje.361.1623839830434; Wed, 16 Jun 2021 03:37:10 -0700 (PDT) Received: from jade.urgonet (h-79-136-85-3.A175.priv.bahnhof.se. [79.136.85.3]) by smtp.gmail.com with ESMTPSA id m17sm205621lfh.288.2021.06.16.03.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 03:37:10 -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 v2 1/7] docs: staging/tee.rst: add a section on OP-TEE notifications Date: Wed, 16 Jun 2021 12:36:43 +0200 Message-Id: <20210616103649.2662395-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616103649.2662395-1-jens.wiklander@linaro.org> References: <20210616103649.2662395-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-20210616_033712_319878_F7C9E6DB X-CRM114-Status: GOOD ( 13.04 ) 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. Signed-off-by: Jens Wiklander --- Documentation/staging/tee.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Documentation/staging/tee.rst b/Documentation/staging/tee.rst index 4d4b5f889603..37bdd097336f 100644 --- a/Documentation/staging/tee.rst +++ b/Documentation/staging/tee.rst @@ -184,6 +184,33 @@ 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 + 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 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 ============== -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel