From patchwork Fri Jul 23 09:44:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 12395749 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.2 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 85009C4338F for ; Fri, 23 Jul 2021 09:47:15 +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 5079860725 for ; Fri, 23 Jul 2021 09:47:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5079860725 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=H7KmhtKY01bKGUaIT057z9ruiNb4Oih6yEOdkOqpNvs=; b=In7VLsrQx36fl3 6JNfM+JgKuZz9Ta7h5FN/0WIxB6WC0f2zHWM3hAX8Bke/kCmA/t8Hz97GKHa8RtJc0cDniNc2bjHj pj86R2DbDbO2344gbvjce2LuWqpTOeNw+0RFaOo4SasLN+Im7bssQfEEAUgSSccZL27T/uFMqcT+i A8x4sKfRDN5sMygw4vs7yyHHBw3+Ms/+0Fk4J4s2MPTtKlT0OQwjer+kze5R7DGDIscK/8Xa3aZXu oNwuIDY6k8mt5n7pwsDAZExFb7Dpfru3v/pf3wijgIBWBWjBVsW8dQpr7XjekgrFL8XnkZhPvOKKG Nb+/Qn98QAc7vkkMAkfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6rje-0049J0-P5; Fri, 23 Jul 2021 09:44:50 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6rjM-0049CT-Ty for linux-arm-kernel@lists.infradead.org; Fri, 23 Jul 2021 09:44:34 +0000 Received: by mail-lj1-x22a.google.com with SMTP id l17so1000514ljn.2 for ; Fri, 23 Jul 2021 02:44:32 -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=a1fNzzb05/JkuSVhINb3YkWj8d51JCyyRxYXYiYj6ThohOUOIgdXhsta9RGshy6sRO xGlH3w6PjD2kM6rgZ6xDjYJak4yoqpeogR3WPs2QpRsvLqBzVNel7IRXN0mFXfCTnX7S 9IWMtJCO3+23ZWBKcQ3Hi3z/6mF5vmmuUBGL+TK0LGY6aU1lR3qKU8kvC89mEs8slS8J ypst2K75DdwycYWpHinbHEBc4GxCrlBNvFBEEAaF7246BMUGJ5Bcg5OeHWYvkgVAP62r 9Qo/fmzeZyJ5j0AIfui9ZSA7N/VcVEQZjWzi/xrPfQs43+96jbu4dpbJ7RVjsp2uMjSj EYDg== 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=TnPi8RmN0GeSVKV0PXGhp4Bp/WTPDsjPlQPpSUUW3FRgocppQBAOKw09fyF6fP0Pul Xm0ykQ10NMK3cHqggkxupGf446YxNbr5F5gqmeaMpKHK7hCAlOHcu2bTHW9uhZRHvmZ/ VugaJYEB0zlp5HmZ5lch8B9tA1j4Ie9HQXSbIl9bQz6ySOThfFHDSe6XoHwceMqZi1Zm wKm6RLFNc/H0xABC9rHN2c18ytDPbbDoiIPv0QwLhN2jTZ9UFpaf+bVBnDjJRGSz/13h O5zriw6kTXeE1Yabd8km9XaRizf6+2s7em79ZnL2kr91AqnxeAV036PjouWHucTMs415 jBRw== X-Gm-Message-State: AOAM5318iiPr4WueFLm/1RE27EPQsKAT7gE6LMhDlLXTdmiTuSrP2XA8 Ma2c1godiVBOHGtk54fvEPQhsw== X-Google-Smtp-Source: ABdhPJyrtqd7az4W16h9/E8eGPNfaNqKDq1w3C76bT8yiFDLgB8Q722esL9ZhZ/kU/AVPUI6p9JWeQ== X-Received: by 2002:a2e:a54d:: with SMTP id e13mr2804045ljn.1.1627033471323; Fri, 23 Jul 2021 02:44:31 -0700 (PDT) Received: from jade.urgonet (h-94-254-48-165.A175.priv.bahnhof.se. [94.254.48.165]) by smtp.gmail.com with ESMTPSA id f2sm403808ljq.131.2021.07.23.02.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jul 2021 02:44:31 -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 v3 1/6] docs: staging/tee.rst: add a section on OP-TEE notifications Date: Fri, 23 Jul 2021 11:44:17 +0200 Message-Id: <20210723094422.2150313-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210723094422.2150313-1-jens.wiklander@linaro.org> References: <20210723094422.2150313-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-20210723_024433_024388_729EB347 X-CRM114-Status: GOOD ( 13.25 ) 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: , 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 ==============