From patchwork Wed Jun 16 10:36:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 461385 Delivered-To: patches@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp487118jae; Wed, 16 Jun 2021 03:37:10 -0700 (PDT) X-Received: by 2002:ac2:5d69:: with SMTP id h9mr3046461lft.603.1623839830808; Wed, 16 Jun 2021 03:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623839830; cv=none; d=google.com; s=arc-20160816; b=GiJX7Ua+ByD0YM9eeQXRAdQ89RM5/kMkwc/PUtv5oRX6IGHO2r9qLx2z73PVG4bb58 Uc3e1W6RIqDOAYhqK1fD6qcppKC0KpnaLr0lyH7MmH3B+z4WYmlGPaNC80rde+mGnHlp nH2lhYq8DeCAcD+CElwji1mXAybSv1g6TElIeOhwujrY2KQdxuws4L2vMU+1T9uv/REK ayQej+n5JYQqgDalKd67LS0nnHyo25KbUSeo/5kwEiOw6YbIrZS71D+yurswEUyev/lo Fou1yFHfvYLlSMXNt5bq6ImK87Wsomirc2IIM0t++LUnjrjL+ZHMhCgLWsaJlQeUn6Ff qMUQ== 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=bPEFf1WmEOew3wXqjPL0D4ZH5STaPbCOCI4W4KStU94=; b=tDnEYkiUQYy+54S27ZN5C7AsAUr3hb3el7+oB1Z0KbLz6Jz9GBGMTzWNk0hLKdldm+ m2t+ldlm9jN0VXUkrHid9sGFAfPxTWMJk830YnTlUE3eLteGamU/axmQ0fhq6N/hN0EW sIWFytAYgN5HuK2Ff3RoUnkM4QAIiVs6VhyaEI1k1AUba/mksYOBCCiufugItDgn5Ure KOEeuX96H9IDMPmb7WBtBQMlmVQiG+TPPUifeKtVgdaPeAN0hQ7ufeid2TU18ubC/QQ3 iAs/6kKpjgLzslztrxSshf+krcWUtHmB76cd3uThcqZGE91USduQRiWiYHjWVGvp4k1e xX4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wu0BlJMG; 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 i3sor799814lji.70.2021.06.16.03.37.10 for (Google Transport Security); Wed, 16 Jun 2021 03:37:10 -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=Wu0BlJMG; 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=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=BRHZNmLGMNtfvJWbcqs7pu6AEFk7U3uH4lqwKA5XLJxr9CxbOpVrog3zFFM1py1mnc ye8yhw+LOQ47LGG63r+78CZZBdPMuYGNCAQ8tOuNUYKt5CGhU3RqE22G8bc4FL61EcNH Vpji3apL/A3wRc4kUObjz9jUsJ3ZMFaqHCtozI6GmJ+Yn/YMI+mTTag+3aipTBvUKnO6 fIRoF6FsTsmh0GB4REO4MG/Fc+3QWovkSP5k0VlqnrNJroUaQndR3vxo/rEZgAJ8lcZG Z/16urI0Lh3O5eOPAAleKs1UTRjgMo1hLTDSmrRxLj2TN5UOI1yxE8WfsiWQrqy2xdcU IpGw== X-Gm-Message-State: AOAM532TxeVKvhqVu67Q0HKdfhfWA1QE6DJzN8YazH6+Sils81gclstm OfBeQo9foizKf0mVQwUmVqD1uZoN 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) Return-Path: 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 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(+) -- 2.31.1 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 ==============