Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp335996pxj; Wed, 16 Jun 2021 03:38:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9eelNjiMT9j2dk/Vaf9RnYkW/TMn8lR4dXnLwOPMpdthvgucC2wk+4o4cDNJYcNxgkvXz X-Received: by 2002:a17:906:1952:: with SMTP id b18mr4494293eje.262.1623839935783; Wed, 16 Jun 2021 03:38:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623839935; cv=none; d=google.com; s=arc-20160816; b=trEVKRSscz7sJ01jSzeEboOe2uR4R4CscgcbLEiNEfbd1KTjQUM5bZgWb6+/v3R4Hp Y6ffw5zYlkYcrsItbTRXj8polO6cXAiT872JhYYyeoX9WJcxlMWTh1yUGFtWOYY4ZoC6 Jp7HwmY5jA8SY2W2H73a2t7KSoa3e6OVaKTWNqOKrhaX9cSXSRJ1H2jrdo1avplt09rZ v8ReRrEX8xyrVxS0jhfPevcnKv9ZlmtmQug9QmVChZ0svzukbPoFA8paZJFL3RWOjeIw MR9Sh4woW61yb3BUqDHQXd+bbDwDNZ2NmOZheBeFrMPmlc9gFjNm4BsRuwg3qUZd7lI5 bUJQ== 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=bPEFf1WmEOew3wXqjPL0D4ZH5STaPbCOCI4W4KStU94=; b=BaeQEHWsL0FimHpqv2AZx374gQxBNHo0fGCbVuoq+dCdG2UTVlFyA/pOwZr6C+CJsG fPY3lggGlQ3C0YQQIHIYybx55yvIsaHSaAUQH1bF2KIsCf8VcKeX0mgIw0aF43kiWVyH club+lv/81P08mmRb+xYKJgezpsDBlVABwMVX0hLYpBwzcueAfjYI90WbiOOJLc0EKe9 acmroXAYhoMhmCjkH4xOuWDF2PJFfjuxhJ3+xISSypVNXIeofcpnnTi6n6ajdT1BH9Pj WAkRPQMLbONSxhjIV5jUBazL3hPkE6hH1BssHY/QOwrb30oVy9p9WoxfYYlratAcoaEx xjwQ== 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 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 z22si1752184edc.56.2021.06.16.03.38.33; Wed, 16 Jun 2021 03:38:55 -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=Wu0BlJMG; 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 S232465AbhFPKj3 (ORCPT + 99 others); Wed, 16 Jun 2021 06:39:29 -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-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