From patchwork Wed Jun 9 06:09:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 12309023 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=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 4D744C47095 for ; Wed, 9 Jun 2021 06:11:01 +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 1A61360C40 for ; Wed, 9 Jun 2021 06:11:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A61360C40 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: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:In-Reply-To:References: List-Owner; bh=ULDMORXMOKw0SDctg8HFjHp3BEmxRV+oI3RZ7gENrz0=; b=vGMpUAIesKFuQ1 m1kuz++t7bsK864wGqfPcGiVoN2H0ru24hNjSq6klyqYu3S/BMJHylw9zlHp+1Hchr8MbPVg4V4SF Xnrc7DEd8LJtT6P1zChuRAYq4yd8XVqDFkTVmCYPSUQB1gG8gPkKTnb/ca/diKdVUEZQIEU7PSAH5 LesM+l/FuMxPqQJFK8Kivre3TcTFfePTfnLQLWHRXKtoI8Ks5v1HGi6ojzO1yLWLfDTJzpK7R6fg8 6U52VjdhLans+EQa0SZRySkatgk0JB2wmBRE+YWa9fBASgjjuQAufchAJbhrw8YcPKzbkr75f3wHQ ZryrOjC8br66IM9+BBFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqrP2-00BrWG-Ia; Wed, 09 Jun 2021 06:09:24 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqrOz-00BrUf-SZ for linux-arm-kernel@lists.infradead.org; Wed, 09 Jun 2021 06:09:23 +0000 Received: by mail-lj1-x22e.google.com with SMTP id u18so9990896lju.12 for ; Tue, 08 Jun 2021 23:09:19 -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:mime-version :content-transfer-encoding; bh=xpRw0xQJ4DmRjPc3XZOXCq8Yj+A2BA3B/GaickI4wN8=; b=xVAfZE0A8Unf98HcFCXuX4RZeOIC8Q5dOG09zV2gGNevdLM0zMJq3dLuzH57zS8DoX 3g7to94dmRnjqwU072m/snpS5qSZ1uK+THO+4bYMUC4R6ZtG97z1753bAaxxLfTfnw5p PsiE24KVo9JW2MWWQYmZloqVI3ItixT13V8B6o5VkETPAqsLnmdoGWthypSGqK8JsT9L vaTWLj1shu0bx6Zb+qwzXryK8c1HAF7qFV+S60IM2Bs0+8k24SIRw6ZCJSQLUuCGrx3x ektFdVrwjG+rdnfGMO3iRTeXqg/sKwwvfkoTQnmnYcLHfxYvbd269M2vh+Tgn3g1eUvy T9TA== 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:mime-version :content-transfer-encoding; bh=xpRw0xQJ4DmRjPc3XZOXCq8Yj+A2BA3B/GaickI4wN8=; b=dqFs2221IXPvM9kNwHQn8SVuFfMFzdscxdmrHxWlIZZP/FN5n0DXErbz0psmYiak/F KUIv6kV9cyM4oGNdW1miZye5UahVhbovRijM+hdS59DqTwlnlgFIvhy9lBWsAAghkO4h ugPLncoJfTnIPuqrIwMh8+DanOQD7flFy7ntF+PHVPGAn+ZaONFzNbbgNtDbuZPvy64T mLpKdXplQxZR5JrJKHGJB988n1snYa0hN7cWRqFHT9YJoZ/A8LamzOA+G/O8KYtHJR5O 9hJOVLBODFab3Y664MZZi+yk1hh1504sma8hOy+ZSOJkiNH2fePvUI1UgjrrOXNj1KTf Ow5Q== X-Gm-Message-State: AOAM531kVd5qmq7dngA+yZpIvPm0rTIaqeDUHtLLodhHUaKNVGmVC01V 33Y0RQiV2tqtFAqwGJbASPuajWVIuhnYmw== X-Google-Smtp-Source: ABdhPJyzlIexmGtILhLW7B9H59a3K8PmSTy1VOX2F2Hp6cFGPRPg1J0rmm+bT9kFOnkasmm0JfiFEg== X-Received: by 2002:a2e:9f47:: with SMTP id v7mr21932830ljk.333.1623218958271; Tue, 08 Jun 2021 23:09:18 -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 l26sm213735ljg.87.2021.06.08.23.09.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 23:09:18 -0700 (PDT) From: Jens Wiklander To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, op-tee@lists.trustedfirmware.org Cc: Jerome Forissier , Etienne Carriere , Sumit Garg , Vincent Guittot , Jens Wiklander Subject: [PATCH 0/4] Asynchronous notifications from secure world Date: Wed, 9 Jun 2021 08:09:06 +0200 Message-Id: <20210609060910.1500481-1-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210608_230922_002972_26401011 X-CRM114-Status: GOOD ( 10.00 ) 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 Hi all, This adds support for asynchronous notifications from OP-TEE in secure world to the OP-TEE driver. This allows a design with a top half and bottom half type of driver where the top half runs in secure interrupt context and a notifications tells normal world to schedule a yielding call to do the bottom half processing. An SPI interrupt is used to notify the driver that there are asynchronous notifications pending. Thanks, Jens Jens Wiklander (4): tee: fix put order in teedev_close_context() tee: add tee_dev_open_helper() primitive optee: separate notification functions optee: add asynchronous notifications drivers/tee/optee/Makefile | 1 + drivers/tee/optee/call.c | 27 ++++ drivers/tee/optee/core.c | 104 ++++++++++---- drivers/tee/optee/notif.c | 226 ++++++++++++++++++++++++++++++ drivers/tee/optee/optee_msg.h | 9 ++ drivers/tee/optee/optee_private.h | 23 +-- drivers/tee/optee/optee_rpc_cmd.h | 31 ++-- drivers/tee/optee/optee_smc.h | 79 ++++++++++- drivers/tee/optee/rpc.c | 73 ++-------- drivers/tee/tee_core.c | 37 +++-- include/linux/tee_drv.h | 27 ++++ 11 files changed, 512 insertions(+), 125 deletions(-) create mode 100644 drivers/tee/optee/notif.c