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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS 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 D141AC48BE5 for ; Thu, 17 Jun 2021 06:10:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A695B61245 for ; Thu, 17 Jun 2021 06:10:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbhFQGMW (ORCPT ); Thu, 17 Jun 2021 02:12:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbhFQGMU (ORCPT ); Thu, 17 Jun 2021 02:12:20 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B961C061574 for ; Wed, 16 Jun 2021 23:10:13 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id l7-20020a05600c1d07b02901b0e2ebd6deso2959732wms.1 for ; Wed, 16 Jun 2021 23:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PdEN2Vn0ZqAgaea6WuXSDsvEZZIPmQuRgjxrGHUy6RU=; b=WbEGeUkgSbDt4H0SwzDELXB6Cp96hE7OnIhoEx0zLDHwluepBNsHXSRVpOKDOLlW32 efy5FMPhuYY4ZwFud67ZBHuzs8jSYxt1lsku8UFm5PtXJeiDcqQ/64BqDJE2dBEY/WL8 flZ2Lo9nAAirZ6+dxcMEqWyeE+lGPwwcvmwquTKaIIkhukceh7WSUKtrvfR4D37b/TG2 oaVbQ3DBp4fXqULFCAz6S5CgYmjMm5GZB8nywEHYSDdr/7TdBQPJxTEVc+5PZ/LdYRp9 Ft2+A4pEWf1vEFFOoY2SwDuy3uha3NQFxbozXXYHdGYiDFVFEad3T2XTFn/U04sGDrPz DEYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PdEN2Vn0ZqAgaea6WuXSDsvEZZIPmQuRgjxrGHUy6RU=; b=gBbj2n5rkcN3ghtYHY0jF3gkKbM3g+fpZYr0LNHz75xPXsyiXlDF6wH1fXY65QRci0 CzdI0FMMqmkLeIkvYlXKXaFggAxfUhvPysTLJZMd12B2P6ku269ck02Qox0ZHh0Jdk64 snQdQXWlgudj9DL/Ei0Eq1WW7IzdTb6RvaI5z9MPwyysHZ8hPmz6TDzIv53EnFRKVBxE KtVRmuaHihl29OztkXqht4/uFbq50Nw1QczsJjlOSjXYw7ukUjHiCNS6y2XMqFwtQfYl YYXi6/Ngyn9bayIBWJc2/RiuaGKLccUckuDq/FoVzgcFFbissLEYAfSup8Ww/paeU0hp 924w== X-Gm-Message-State: AOAM533IQqZkOtFWtVRSzHHLQpXTp4xQOyDyab21pTL3I534JJ9+jvXk Vtx++1GfAh9WtqjNdMdlgRWQgaQ3exssK7r37XujgA== X-Google-Smtp-Source: ABdhPJxKf3z6pwh4Nj+hbrkpDJZquWEKfvj17MQeD0zeMW7fLPQBjUMEL0NaBMr98rlCUkZPZO5E7qv9oDvS/kylg+U= X-Received: by 2002:a7b:c853:: with SMTP id c19mr3097635wml.30.1623910212010; Wed, 16 Jun 2021 23:10:12 -0700 (PDT) MIME-Version: 1.0 References: <20210616103649.2662395-1-jens.wiklander@linaro.org> In-Reply-To: From: Jens Wiklander Date: Thu, 17 Jun 2021 08:10:01 +0200 Message-ID: Subject: Re: [PATCH v2 0/7] Asynchronous notifications from secure world To: Sumit Garg Cc: Linux Kernel Mailing List , linux-arm-kernel , OP-TEE TrustedFirmware , Devicetree List , Linux Doc Mailing List , Jerome Forissier , Etienne Carriere , Vincent Guittot , Rob Herring , Jonathan Corbet , Ard Biesheuvel , Marc Zyngier Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sumit, On Thu, Jun 17, 2021 at 6:33 AM Sumit Garg wrote: > > Hi Jens, > > On Wed, 16 Jun 2021 at 16:07, Jens Wiklander wrote: > > > > 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 interrupt is used to notify the driver that there are asynchronous > > notifications pending. > > > > It looks like a nice feature. I would like to get hands on with this. > Can I test this feature on Qemu? Absolutely, you can get this into the normal OP-TEE development repo setup with: repo init -u https://github.com/OP-TEE/manifest.git -m default.xml repo sync Update optee_os with https://github.com/jenswi-linaro/optee_os/tree/async_notif_v2 Update linux with https://github.com/jenswi-linaro/linux-1/tree/async_notif_v2 cd build make all -j... make run-only If you type anything at the secure console you'll notice how it changes behaviour once the Linux kernel has booted. Cheers, Jens > > -Sumit > > > v2: > > * Added documentation > > * Converted optee bindings to json-schema and added interrupt property > > * Configure notification interrupt from DT instead of getting it > > from secure world, suggested by Ard Biesheuvel . > > > > Thanks, > > Jens > > > > Jens Wiklander (7): > > docs: staging/tee.rst: add a section on OP-TEE notifications > > dt-bindings: arm: Convert optee binding to json-schema > > dt-bindings: arm: optee: add interrupt property > > tee: fix put order in teedev_close_context() > > tee: add tee_dev_open_helper() primitive > > optee: separate notification functions > > optee: add asynchronous notifications > > > > .../bindings/arm/firmware/linaro,optee-tz.txt | 31 --- > > .../arm/firmware/linaro,optee-tz.yaml | 57 +++++ > > Documentation/staging/tee.rst | 27 +++ > > drivers/tee/optee/Makefile | 1 + > > drivers/tee/optee/call.c | 27 +++ > > drivers/tee/optee/core.c | 87 +++++-- > > 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 | 75 +++++- > > drivers/tee/optee/rpc.c | 73 +----- > > drivers/tee/tee_core.c | 37 ++- > > include/linux/tee_drv.h | 27 +++ > > 14 files changed, 576 insertions(+), 155 deletions(-) > > delete mode 100644 Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.txt > > create mode 100644 Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > create mode 100644 drivers/tee/optee/notif.c > > > > -- > > 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=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS 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 4F981C2B9F4 for ; Thu, 17 Jun 2021 06:11:42 +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 0918B6023D for ; Thu, 17 Jun 2021 06:11:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0918B6023D 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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FelH3DaWqTt9EwoeIpfzmgoIswfgoHw9Z41CZpuummE=; b=mw0pa3PgLTmpPw Ln4wXBsdmEOCyve4kCmUEtpy03kEukx1iv3j2Zq/74BPh92ud89XlVx/BRTiPUK8D9vikXGXO2iSm UZz4KmQjVaUffOtlXQpJ7ciy/wjr7F7WxVJaKTH1r9ASeWuEXsGAOEoCnd3aiqu9vzKxD3Cd2CGki v44YPNLnCyIYCHvuiatYQ+RlnKRFpifp+pbK0vDUJtc1+n1pt0lpwdL1kOzUKx8tWMbj6Wbo/KBw9 VQq8dj+PARLWgb+vgU2IQIXiOdxiTvsoW1wW2Efta/vqEDf+TN68Pj8m1B92ct6mi8aTV6VCqY1Jd 8ua3P3QeDkRNKycwXxkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltlEI-0093eW-HV; Thu, 17 Jun 2021 06:10:18 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltlEE-0093da-91 for linux-arm-kernel@lists.infradead.org; Thu, 17 Jun 2021 06:10:15 +0000 Received: by mail-wm1-x333.google.com with SMTP id y13-20020a1c4b0d0000b02901c20173e165so2986283wma.0 for ; Wed, 16 Jun 2021 23:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PdEN2Vn0ZqAgaea6WuXSDsvEZZIPmQuRgjxrGHUy6RU=; b=WbEGeUkgSbDt4H0SwzDELXB6Cp96hE7OnIhoEx0zLDHwluepBNsHXSRVpOKDOLlW32 efy5FMPhuYY4ZwFud67ZBHuzs8jSYxt1lsku8UFm5PtXJeiDcqQ/64BqDJE2dBEY/WL8 flZ2Lo9nAAirZ6+dxcMEqWyeE+lGPwwcvmwquTKaIIkhukceh7WSUKtrvfR4D37b/TG2 oaVbQ3DBp4fXqULFCAz6S5CgYmjMm5GZB8nywEHYSDdr/7TdBQPJxTEVc+5PZ/LdYRp9 Ft2+A4pEWf1vEFFOoY2SwDuy3uha3NQFxbozXXYHdGYiDFVFEad3T2XTFn/U04sGDrPz DEYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PdEN2Vn0ZqAgaea6WuXSDsvEZZIPmQuRgjxrGHUy6RU=; b=k5qLkusqVVzv/JlpaQGhl/dzMORI5Hpv99Eld3jmm1Ze9Sn4na5tSXwRLPSyKx4WSC Ww03jGD9vZpf2VzNCr3mx3CCxpzLzJ2LyQ5h+XSjWTXkPRq0DO1/epyfKoIT/Ry6cqnR X4dj4IFRHwl1d5jEZ9QOAvt4ZQwWn+CrKwCV4ylblQ4rwmX/wG/YNrUXlJ8wL5AQa5ak Zvge8cZcpTO9d59tyf1LYNYQZ3xrWk46OVz0HZxW9uJkLDM4BIaY1Ie5t7nPMVuLT6eF 3O2UiEgkw51756lefwm96IPGNvT9TnUMzV9bepD6khupywxi4VcIH+YTWHXmk0AuVhzu raNA== X-Gm-Message-State: AOAM5300pTjbteXzoKEHrgZCtMPD1fnLG64IKpnQro+4yvCNRtr2xTcH 3WTpejIEh84kqKobgQ3wOJ7kQ5HOmgWY/CZSq123QA== X-Google-Smtp-Source: ABdhPJxKf3z6pwh4Nj+hbrkpDJZquWEKfvj17MQeD0zeMW7fLPQBjUMEL0NaBMr98rlCUkZPZO5E7qv9oDvS/kylg+U= X-Received: by 2002:a7b:c853:: with SMTP id c19mr3097635wml.30.1623910212010; Wed, 16 Jun 2021 23:10:12 -0700 (PDT) MIME-Version: 1.0 References: <20210616103649.2662395-1-jens.wiklander@linaro.org> In-Reply-To: From: Jens Wiklander Date: Thu, 17 Jun 2021 08:10:01 +0200 Message-ID: Subject: Re: [PATCH v2 0/7] Asynchronous notifications from secure world To: Sumit Garg Cc: Linux Kernel Mailing List , linux-arm-kernel , OP-TEE TrustedFirmware , Devicetree List , Linux Doc Mailing List , Jerome Forissier , Etienne Carriere , Vincent Guittot , Rob Herring , Jonathan Corbet , Ard Biesheuvel , Marc Zyngier X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210616_231014_395860_FB443512 X-CRM114-Status: GOOD ( 25.96 ) 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 Hi Sumit, On Thu, Jun 17, 2021 at 6:33 AM Sumit Garg wrote: > > Hi Jens, > > On Wed, 16 Jun 2021 at 16:07, Jens Wiklander wrote: > > > > 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 interrupt is used to notify the driver that there are asynchronous > > notifications pending. > > > > It looks like a nice feature. I would like to get hands on with this. > Can I test this feature on Qemu? Absolutely, you can get this into the normal OP-TEE development repo setup with: repo init -u https://github.com/OP-TEE/manifest.git -m default.xml repo sync Update optee_os with https://github.com/jenswi-linaro/optee_os/tree/async_notif_v2 Update linux with https://github.com/jenswi-linaro/linux-1/tree/async_notif_v2 cd build make all -j... make run-only If you type anything at the secure console you'll notice how it changes behaviour once the Linux kernel has booted. Cheers, Jens > > -Sumit > > > v2: > > * Added documentation > > * Converted optee bindings to json-schema and added interrupt property > > * Configure notification interrupt from DT instead of getting it > > from secure world, suggested by Ard Biesheuvel . > > > > Thanks, > > Jens > > > > Jens Wiklander (7): > > docs: staging/tee.rst: add a section on OP-TEE notifications > > dt-bindings: arm: Convert optee binding to json-schema > > dt-bindings: arm: optee: add interrupt property > > tee: fix put order in teedev_close_context() > > tee: add tee_dev_open_helper() primitive > > optee: separate notification functions > > optee: add asynchronous notifications > > > > .../bindings/arm/firmware/linaro,optee-tz.txt | 31 --- > > .../arm/firmware/linaro,optee-tz.yaml | 57 +++++ > > Documentation/staging/tee.rst | 27 +++ > > drivers/tee/optee/Makefile | 1 + > > drivers/tee/optee/call.c | 27 +++ > > drivers/tee/optee/core.c | 87 +++++-- > > 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 | 75 +++++- > > drivers/tee/optee/rpc.c | 73 +----- > > drivers/tee/tee_core.c | 37 ++- > > include/linux/tee_drv.h | 27 +++ > > 14 files changed, 576 insertions(+), 155 deletions(-) > > delete mode 100644 Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.txt > > create mode 100644 Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > create mode 100644 drivers/tee/optee/notif.c > > > > -- > > 2.31.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel