Message ID | 20231026080409.4149616-1-jens.wiklander@linaro.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp502600vqb; Thu, 26 Oct 2023 01:04:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECupz89S6ZUTf8MBzbnvmBShWk9LScV3oZ8XhKR4H2BbyNXkOf0WiLjjFnYQ11GmJk2m2O X-Received: by 2002:a05:6808:9a2:b0:3a9:ba39:6d6e with SMTP id e2-20020a05680809a200b003a9ba396d6emr18601733oig.0.1698307490892; Thu, 26 Oct 2023 01:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698307490; cv=none; d=google.com; s=arc-20160816; b=RxoAN9BzgMls6gBxmcZjboatvlXEITablS6M1ptSUyq+2blCXrIChmf6ItkKt7tWMB fEG9N41Qw5bX31egHbm2HOvlrJMJamoVkJPwIL8lqtLf2zLHCfJW0LY3suoAr5kSGSHt 8LNet6Ds5Fxpi2PNOZoF4Eh1iGuN3ixL4Pjjb/VeFDErcSEsMT0hSmAPhAf1Vr6HQTKy fNN6yK7AJwTWlZn6/dfpJwfiZ8XZlWmcXQ1rRTWXsL//UI4Xml1f0LRGax4Y1h2LFzY2 FDJKWj8kdg+3Zs/YoessaaaEUMcRQIvWXUw2UhdijHy4agMkL+ohnflAspAl5tMREwNP Tikw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=EbK71PpiWagt9UYz0JbsieBVbIawXnFxgcEDdqiAu9E=; fh=MUQ6rxZ25LNC+jTmyAXdEOxVXq57wz7eCStwGhwbXZY=; b=hqqqszQ+IOnQrSaXV1uqdjep2LhVvj2uvkFiOcvt2hvtakZ1AsHrpYz3QBVqgskKGd HKVGulR9wwEZzXuXdc1IYnu7dVXt+zx0YDrnkt730PoPxaf59y8HI/vaYDb/ovVYhoc9 DECnw7OUMwQOaNq4ZIker0sxa5L3VuWIe8JxCNBbpcxptyB0CNyKxmXDH0k/vdASjFXi B8q5/ijHavpnPLPn9HtT3/FAXPd4bWtfM49XHX5sPVoiZz0huSGRoPJ2NpRudPwq9ScV JWdpA5/QHFkE6CKaop/w32RI0d5e45xdy3GXIEq6DoAD7+XCy2EIsQKnlJylveur+AsX pI8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N+JCDK3z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id g31-20020a25b11f000000b00da072679408si5130414ybj.446.2023.10.26.01.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 01:04:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N+JCDK3z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2A27280DB724; Thu, 26 Oct 2023 01:04:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233221AbjJZIEV (ORCPT <rfc822;aposhian.dev@gmail.com> + 26 others); Thu, 26 Oct 2023 04:04:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbjJZIEU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 26 Oct 2023 04:04:20 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C3CB18D for <linux-kernel@vger.kernel.org>; Thu, 26 Oct 2023 01:04:16 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9b95622c620so99961466b.0 for <linux-kernel@vger.kernel.org>; Thu, 26 Oct 2023 01:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698307454; x=1698912254; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=EbK71PpiWagt9UYz0JbsieBVbIawXnFxgcEDdqiAu9E=; b=N+JCDK3zjrIvVZwEs6CDIPcAuUKBYA3JIXP6OQ3mIGgZ1idBzqYBUs4IHcJLUw6x/Z aqnKDBAMGs5C1mhYaRrdKaezO6W1Ai7oicGOI4gU8qWCpLs5X5gpnjZGLFZN+OUND+57 Fecb7jJHwDvjhP1hgMIwSTb3A+tDtacbewlUEn7x6yIAIzA0O11TpOq2DdQmbksq0v1Q CCK7Qg2nH0Jr/96VwrPQhMCHycLV3F6R86UqybS5aqS8XOuGFeZKUErXsgZSrdCohmE7 zO9B81c0hPU7YaaI3ghN39mub59FKOUCdgTG6UMLa+t7+2DwUNmPIIYdSRkDgxn+Zjl8 giEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698307454; x=1698912254; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EbK71PpiWagt9UYz0JbsieBVbIawXnFxgcEDdqiAu9E=; b=kC53QHhjME3LSzS72dPmLM9cyVx3M9XbATvqiHCU+rNXSmdANZeRCwCZqEqcvXaB4v WVAyNafBV9WRsocJAbqpGHXLAbrYQ9OPq/WlOm8ZIBaUDLLSak5aVGnAd+dHbz2+yv9R 6VUytTfanHClEON6Yghd6tUONC4KQCVim7cJRRZS/6nh6VXBZODV13+z+dHExt3Us7K7 JOfNYlO/FKMjSzn4m79HlHYBQg7TEnPTv6/wk1++Jd4NpsPRVxt0Bp9XEB95jltVjHoo 0uv9X4w6veBx3NeZ8GemBrKvF3FohaacrMqM0fPu4vdADc0XO0KksDnMjKMt+Q+lxNJo O27w== X-Gm-Message-State: AOJu0YxyRLohM3CN5AujriaZeec9JinSp/OQmzO5yj5sHKAF703Z7Krk YCr7sdjndiLXt3tiifKxXUc+Nn+9wAH2c3RsNFA= X-Received: by 2002:a17:907:703:b0:9b6:50cd:a222 with SMTP id xb3-20020a170907070300b009b650cda222mr14579263ejb.54.1698307453983; Thu, 26 Oct 2023 01:04:13 -0700 (PDT) Received: from rayden.urgonet (h-217-31-164-171.A175.priv.bahnhof.se. [217.31.164.171]) by smtp.gmail.com with ESMTPSA id a19-20020a1709065f9300b0099e12a49c8fsm11313448eju.173.2023.10.26.01.04.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 01:04:13 -0700 (PDT) From: Jens Wiklander <jens.wiklander@linaro.org> To: linux-kernel@vger.kernel.org, op-tee@lists.trustedfirmware.org Cc: Sumit Garg <sumit.garg@linaro.org>, Jerome Forissier <jerome.forissier@linaro.org>, Sudeep Holla <sudeep.holla@arm.com>, Marc Bonnici <marc.bonnici@arm.com>, Olivier Deprez <Olivier.Deprez@arm.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, Jens Wiklander <jens.wiklander@linaro.org> Subject: [PATCH 0/2] OP-TEE FF-A notifications Date: Thu, 26 Oct 2023 10:04:07 +0200 Message-Id: <20231026080409.4149616-1-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 26 Oct 2023 01:04:48 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780804475594944163 X-GMAIL-MSGID: 1780804475594944163 |
Series |
OP-TEE FF-A notifications
|
|
Message
Jens Wiklander
Oct. 26, 2023, 8:04 a.m. UTC
Hi all, This patchset adds support for using FF-A notifications as a delivery mechanism of asynchronous notifications from OP-TEE running in the secure world. Support for asynchronous notifications via the SMC ABI was added in [1], here we add the counterpart needed when using the the FF-A ABI. Support for FF-A notifications is added with [2] and this patch set is based on Sudeeps tree at [3]. [1] https://lore.kernel.org/lkml/20211103090255.998070-1-jens.wiklander@linaro.org/ [2] https://lore.kernel.org/linux-arm-kernel/20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com/ [3] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=ffa-updates-6.7 commit bcefd1bf63b1 ("firmware: arm_ffa: Upgrade the driver version to v1.1") Thanks, Jens Jens Wiklander (2): optee: provide optee_do_bottom_half() as a common function optee: ffa_abi: add asynchronous notifications drivers/tee/optee/call.c | 31 ++++++++++- drivers/tee/optee/ffa_abi.c | 91 ++++++++++++++++++++++++++++++- drivers/tee/optee/optee_ffa.h | 28 ++++++++-- drivers/tee/optee/optee_private.h | 9 ++- drivers/tee/optee/smc_abi.c | 36 ++---------- 5 files changed, 153 insertions(+), 42 deletions(-) base-commit: bcefd1bf63b1ec9bb08067021cf47f0fad96f395
Comments
Hi Jens, On Thu, 26 Oct 2023 at 13:34, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > Hi all, > > This patchset adds support for using FF-A notifications as a delivery > mechanism of asynchronous notifications from OP-TEE running in the secure > world. Support for asynchronous notifications via the SMC ABI was added in > [1], here we add the counterpart needed when using the the FF-A ABI. > > Support for FF-A notifications is added with [2] and this patch set is based > on Sudeeps tree at [3]. It's good to see FF-A notifications support coming through. The good aspect here is that FF-A uses a common secure world SGI for notifications and doesn't have to deal with platform specific reserved SPI for notifications. From OP-TEE point of view I think most of the secure SGI donation base would be common, so can we switch the SMC ABI to use this donated secure world SGI for notifications too? -Sumit > > [1] https://lore.kernel.org/lkml/20211103090255.998070-1-jens.wiklander@linaro.org/ > [2] https://lore.kernel.org/linux-arm-kernel/20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com/ > [3] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=ffa-updates-6.7 > commit bcefd1bf63b1 ("firmware: arm_ffa: Upgrade the driver version to v1.1") > > Thanks, > Jens > > Jens Wiklander (2): > optee: provide optee_do_bottom_half() as a common function > optee: ffa_abi: add asynchronous notifications > > drivers/tee/optee/call.c | 31 ++++++++++- > drivers/tee/optee/ffa_abi.c | 91 ++++++++++++++++++++++++++++++- > drivers/tee/optee/optee_ffa.h | 28 ++++++++-- > drivers/tee/optee/optee_private.h | 9 ++- > drivers/tee/optee/smc_abi.c | 36 ++---------- > 5 files changed, 153 insertions(+), 42 deletions(-) > > > base-commit: bcefd1bf63b1ec9bb08067021cf47f0fad96f395 > -- > 2.34.1 >
Hi Sumit, On Mon, Oct 30, 2023 at 11:32:47AM +0530, Sumit Garg wrote: > Hi Jens, > > On Thu, 26 Oct 2023 at 13:34, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > Hi all, > > > > This patchset adds support for using FF-A notifications as a delivery > > mechanism of asynchronous notifications from OP-TEE running in the secure > > world. Support for asynchronous notifications via the SMC ABI was added in > > [1], here we add the counterpart needed when using the the FF-A ABI. > > > > Support for FF-A notifications is added with [2] and this patch set is based > > on Sudeeps tree at [3]. > > It's good to see FF-A notifications support coming through. The good > aspect here is that FF-A uses a common secure world SGI for > notifications and doesn't have to deal with platform specific reserved > SPI for notifications. > > From OP-TEE point of view I think most of the secure SGI donation base > would be common, so can we switch the SMC ABI to use this donated > secure world SGI for notifications too? The SMC ABI driver picks up the interrupt used for notification from device-tree, so there's a chance that it just works if a donated SGI is supplied instead. We'll need some changes in the secure world side of OP-TEE, but they wouldn't affect the ABI. Cheers, Jens > > -Sumit > > > > > [1] https://lore.kernel.org/lkml/20211103090255.998070-1-jens.wiklander@linaro.org/ > > [2] https://lore.kernel.org/linux-arm-kernel/20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com/ > > [3] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=ffa-updates-6.7 > > commit bcefd1bf63b1 ("firmware: arm_ffa: Upgrade the driver version to v1.1") > > > > Thanks, > > Jens > > > > Jens Wiklander (2): > > optee: provide optee_do_bottom_half() as a common function > > optee: ffa_abi: add asynchronous notifications > > > > drivers/tee/optee/call.c | 31 ++++++++++- > > drivers/tee/optee/ffa_abi.c | 91 ++++++++++++++++++++++++++++++- > > drivers/tee/optee/optee_ffa.h | 28 ++++++++-- > > drivers/tee/optee/optee_private.h | 9 ++- > > drivers/tee/optee/smc_abi.c | 36 ++---------- > > 5 files changed, 153 insertions(+), 42 deletions(-) > > > > > > base-commit: bcefd1bf63b1ec9bb08067021cf47f0fad96f395 > > -- > > 2.34.1 > >
On Thu, 2 Nov 2023 at 17:29, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > Hi Sumit, > > On Mon, Oct 30, 2023 at 11:32:47AM +0530, Sumit Garg wrote: > > Hi Jens, > > > > On Thu, 26 Oct 2023 at 13:34, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > Hi all, > > > > > > This patchset adds support for using FF-A notifications as a delivery > > > mechanism of asynchronous notifications from OP-TEE running in the secure > > > world. Support for asynchronous notifications via the SMC ABI was added in > > > [1], here we add the counterpart needed when using the the FF-A ABI. > > > > > > Support for FF-A notifications is added with [2] and this patch set is based > > > on Sudeeps tree at [3]. > > > > It's good to see FF-A notifications support coming through. The good > > aspect here is that FF-A uses a common secure world SGI for > > notifications and doesn't have to deal with platform specific reserved > > SPI for notifications. > > > > From OP-TEE point of view I think most of the secure SGI donation base > > would be common, so can we switch the SMC ABI to use this donated > > secure world SGI for notifications too? > > The SMC ABI driver picks up the interrupt used for notification from > device-tree, so there's a chance that it just works if a donated SGI is > supplied instead. We'll need some changes in the secure world side of > OP-TEE, but they wouldn't affect the ABI. AFAIK, a secure world donated SGIs doesn't support IRQ mapping via DT. The FF-A driver explicitly creates that mapping here [1]. Moreover it's better to detect it via an SMC call rather than hard coded via DT as FF-A driver does. So the ABI should dynamically detect if there is a donated SGI then use it otherwise fallback to SPI/PPI detection via DT. This would make the notifications feature platform agnostic and we can drop legacy DT methods from optee-os entirely but still need to maintain them in the kernel for backwards compatibility. [1] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1283 [2] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1275 -Sumit > > Cheers, > Jens > > > > > -Sumit > > > > > > > > [1] https://lore.kernel.org/lkml/20211103090255.998070-1-jens.wiklander@linaro.org/ > > > [2] https://lore.kernel.org/linux-arm-kernel/20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com/ > > > [3] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=ffa-updates-6.7 > > > commit bcefd1bf63b1 ("firmware: arm_ffa: Upgrade the driver version to v1.1") > > > > > > Thanks, > > > Jens > > > > > > Jens Wiklander (2): > > > optee: provide optee_do_bottom_half() as a common function > > > optee: ffa_abi: add asynchronous notifications > > > > > > drivers/tee/optee/call.c | 31 ++++++++++- > > > drivers/tee/optee/ffa_abi.c | 91 ++++++++++++++++++++++++++++++- > > > drivers/tee/optee/optee_ffa.h | 28 ++++++++-- > > > drivers/tee/optee/optee_private.h | 9 ++- > > > drivers/tee/optee/smc_abi.c | 36 ++---------- > > > 5 files changed, 153 insertions(+), 42 deletions(-) > > > > > > > > > base-commit: bcefd1bf63b1ec9bb08067021cf47f0fad96f395 > > > -- > > > 2.34.1 > > >
On Thu, Nov 02, 2023 at 05:46:55PM +0530, Sumit Garg wrote: > On Thu, 2 Nov 2023 at 17:29, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > Hi Sumit, > > > > On Mon, Oct 30, 2023 at 11:32:47AM +0530, Sumit Garg wrote: > > > Hi Jens, > > > > > > On Thu, 26 Oct 2023 at 13:34, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > > > Hi all, > > > > > > > > This patchset adds support for using FF-A notifications as a delivery > > > > mechanism of asynchronous notifications from OP-TEE running in the secure > > > > world. Support for asynchronous notifications via the SMC ABI was added in > > > > [1], here we add the counterpart needed when using the the FF-A ABI. > > > > > > > > Support for FF-A notifications is added with [2] and this patch set is based > > > > on Sudeeps tree at [3]. > > > > > > It's good to see FF-A notifications support coming through. The good > > > aspect here is that FF-A uses a common secure world SGI for > > > notifications and doesn't have to deal with platform specific reserved > > > SPI for notifications. > > > > > > From OP-TEE point of view I think most of the secure SGI donation base > > > would be common, so can we switch the SMC ABI to use this donated > > > secure world SGI for notifications too? > > > > The SMC ABI driver picks up the interrupt used for notification from > > device-tree, so there's a chance that it just works if a donated SGI is > > supplied instead. We'll need some changes in the secure world side of > > OP-TEE, but they wouldn't affect the ABI. > > AFAIK, a secure world donated SGIs doesn't support IRQ mapping via DT. > The FF-A driver explicitly creates that mapping here [1]. That looks a lot like what platform_get_irq() does via of_irq_get(). > Moreover > it's better to detect it via an SMC call rather than hard coded via DT > as FF-A driver does. Typo? I guess you mean that you prefer that way the FF-A driver does it rather than having it set in the DT. Assuming that you only care about "arm,gic-v3". The SGI will likely always be the same so it shouldn't be too hard to keep the correct configuration in DT. > > So the ABI should dynamically detect if there is a donated SGI then > use it otherwise fallback to SPI/PPI detection via DT. This would make > the notifications feature platform agnostic and we can drop legacy DT > methods from optee-os entirely but still need to maintain them in the > kernel for backwards compatibility. We care about compatibility in both directions so we'd need to keep it in OP-TEE too, but perhaps under a config flag. Thanks, Jens > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1283 > [2] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1275 > > -Sumit > > > > > Cheers, > > Jens > > > > > > > > -Sumit > > > > > > > > > > > [1] https://lore.kernel.org/lkml/20211103090255.998070-1-jens.wiklander@linaro.org/ > > > > [2] https://lore.kernel.org/linux-arm-kernel/20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com/ > > > > [3] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=ffa-updates-6.7 > > > > commit bcefd1bf63b1 ("firmware: arm_ffa: Upgrade the driver version to v1.1") > > > > > > > > Thanks, > > > > Jens > > > > > > > > Jens Wiklander (2): > > > > optee: provide optee_do_bottom_half() as a common function > > > > optee: ffa_abi: add asynchronous notifications > > > > > > > > drivers/tee/optee/call.c | 31 ++++++++++- > > > > drivers/tee/optee/ffa_abi.c | 91 ++++++++++++++++++++++++++++++- > > > > drivers/tee/optee/optee_ffa.h | 28 ++++++++-- > > > > drivers/tee/optee/optee_private.h | 9 ++- > > > > drivers/tee/optee/smc_abi.c | 36 ++---------- > > > > 5 files changed, 153 insertions(+), 42 deletions(-) > > > > > > > > > > > > base-commit: bcefd1bf63b1ec9bb08067021cf47f0fad96f395 > > > > -- > > > > 2.34.1 > > > >
On Thu, 2 Nov 2023 at 18:46, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > On Thu, Nov 02, 2023 at 05:46:55PM +0530, Sumit Garg wrote: > > On Thu, 2 Nov 2023 at 17:29, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > Hi Sumit, > > > > > > On Mon, Oct 30, 2023 at 11:32:47AM +0530, Sumit Garg wrote: > > > > Hi Jens, > > > > > > > > On Thu, 26 Oct 2023 at 13:34, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > > > > > Hi all, > > > > > > > > > > This patchset adds support for using FF-A notifications as a delivery > > > > > mechanism of asynchronous notifications from OP-TEE running in the secure > > > > > world. Support for asynchronous notifications via the SMC ABI was added in > > > > > [1], here we add the counterpart needed when using the the FF-A ABI. > > > > > > > > > > Support for FF-A notifications is added with [2] and this patch set is based > > > > > on Sudeeps tree at [3]. > > > > > > > > It's good to see FF-A notifications support coming through. The good > > > > aspect here is that FF-A uses a common secure world SGI for > > > > notifications and doesn't have to deal with platform specific reserved > > > > SPI for notifications. > > > > > > > > From OP-TEE point of view I think most of the secure SGI donation base > > > > would be common, so can we switch the SMC ABI to use this donated > > > > secure world SGI for notifications too? > > > > > > The SMC ABI driver picks up the interrupt used for notification from > > > device-tree, so there's a chance that it just works if a donated SGI is > > > supplied instead. We'll need some changes in the secure world side of > > > OP-TEE, but they wouldn't affect the ABI. > > > > AFAIK, a secure world donated SGIs doesn't support IRQ mapping via DT. > > The FF-A driver explicitly creates that mapping here [1]. > > That looks a lot like what platform_get_irq() does via of_irq_get(). > There is GIC_SPI or GIC_PPI but nothing like GIC_SGI in DT bindings [1]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/dt-bindings/interrupt-controller/arm-gic.h > > Moreover > > it's better to detect it via an SMC call rather than hard coded via DT > > as FF-A driver does. > > Typo? I guess you mean that you prefer that way the FF-A driver does it > rather than having it set in the DT. Yeah sorry about that. We shouldn't use DT if OP-TEE features are discoverable. > > Assuming that you only care about "arm,gic-v3". The SGI will likely > always be the same so it shouldn't be too hard to keep the correct > configuration in DT. See above, DT looks like it does not support SGI. > > > > > So the ABI should dynamically detect if there is a donated SGI then > > use it otherwise fallback to SPI/PPI detection via DT. This would make > > the notifications feature platform agnostic and we can drop legacy DT > > methods from optee-os entirely but still need to maintain them in the > > kernel for backwards compatibility. > > We care about compatibility in both directions so we'd need to keep it > in OP-TEE too, but perhaps under a config flag. Isn't it just supported on Qemu right now in OP-TEE? I hope dropping a feature won't be a problem there compared with the maintenance burden. -Sumit > > Thanks, > Jens > > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1283 > > [2] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1275 > > > > -Sumit > > > > > > > > Cheers, > > > Jens > > > > > > > > > > > -Sumit > > > > > > > > > > > > > > [1] https://lore.kernel.org/lkml/20211103090255.998070-1-jens.wiklander@linaro.org/ > > > > > [2] https://lore.kernel.org/linux-arm-kernel/20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com/ > > > > > [3] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=ffa-updates-6.7 > > > > > commit bcefd1bf63b1 ("firmware: arm_ffa: Upgrade the driver version to v1.1") > > > > > > > > > > Thanks, > > > > > Jens > > > > > > > > > > Jens Wiklander (2): > > > > > optee: provide optee_do_bottom_half() as a common function > > > > > optee: ffa_abi: add asynchronous notifications > > > > > > > > > > drivers/tee/optee/call.c | 31 ++++++++++- > > > > > drivers/tee/optee/ffa_abi.c | 91 ++++++++++++++++++++++++++++++- > > > > > drivers/tee/optee/optee_ffa.h | 28 ++++++++-- > > > > > drivers/tee/optee/optee_private.h | 9 ++- > > > > > drivers/tee/optee/smc_abi.c | 36 ++---------- > > > > > 5 files changed, 153 insertions(+), 42 deletions(-) > > > > > > > > > > > > > > > base-commit: bcefd1bf63b1ec9bb08067021cf47f0fad96f395 > > > > > -- > > > > > 2.34.1 > > > > >
On Thu, Nov 2, 2023 at 3:05 PM Sumit Garg <sumit.garg@linaro.org> wrote: > > On Thu, 2 Nov 2023 at 18:46, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > On Thu, Nov 02, 2023 at 05:46:55PM +0530, Sumit Garg wrote: > > > On Thu, 2 Nov 2023 at 17:29, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > > > Hi Sumit, > > > > > > > > On Mon, Oct 30, 2023 at 11:32:47AM +0530, Sumit Garg wrote: > > > > > Hi Jens, > > > > > > > > > > On Thu, 26 Oct 2023 at 13:34, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > > > > > > > Hi all, > > > > > > > > > > > > This patchset adds support for using FF-A notifications as a delivery > > > > > > mechanism of asynchronous notifications from OP-TEE running in the secure > > > > > > world. Support for asynchronous notifications via the SMC ABI was added in > > > > > > [1], here we add the counterpart needed when using the the FF-A ABI. > > > > > > > > > > > > Support for FF-A notifications is added with [2] and this patch set is based > > > > > > on Sudeeps tree at [3]. > > > > > > > > > > It's good to see FF-A notifications support coming through. The good > > > > > aspect here is that FF-A uses a common secure world SGI for > > > > > notifications and doesn't have to deal with platform specific reserved > > > > > SPI for notifications. > > > > > > > > > > From OP-TEE point of view I think most of the secure SGI donation base > > > > > would be common, so can we switch the SMC ABI to use this donated > > > > > secure world SGI for notifications too? > > > > > > > > The SMC ABI driver picks up the interrupt used for notification from > > > > device-tree, so there's a chance that it just works if a donated SGI is > > > > supplied instead. We'll need some changes in the secure world side of > > > > OP-TEE, but they wouldn't affect the ABI. > > > > > > AFAIK, a secure world donated SGIs doesn't support IRQ mapping via DT. > > > The FF-A driver explicitly creates that mapping here [1]. > > > > That looks a lot like what platform_get_irq() does via of_irq_get(). > > > > There is GIC_SPI or GIC_PPI but nothing like GIC_SGI in DT bindings [1]. > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/dt-bindings/interrupt-controller/arm-gic.h > > > > Moreover > > > it's better to detect it via an SMC call rather than hard coded via DT > > > as FF-A driver does. > > > > Typo? I guess you mean that you prefer that way the FF-A driver does it > > rather than having it set in the DT. > > Yeah sorry about that. We shouldn't use DT if OP-TEE features are discoverable. > > > > > Assuming that you only care about "arm,gic-v3". The SGI will likely > > always be the same so it shouldn't be too hard to keep the correct > > configuration in DT. > > See above, DT looks like it does not support SGI. You're right. > > > > > > > > > So the ABI should dynamically detect if there is a donated SGI then > > > use it otherwise fallback to SPI/PPI detection via DT. This would make > > > the notifications feature platform agnostic and we can drop legacy DT > > > methods from optee-os entirely but still need to maintain them in the > > > kernel for backwards compatibility. > > > > We care about compatibility in both directions so we'd need to keep it > > in OP-TEE too, but perhaps under a config flag. > > Isn't it just supported on Qemu right now in OP-TEE? I hope dropping a > feature won't be a problem there compared with the maintenance burden. I'd rather not remove this since I believe it can support more configurations (different interrupt controllers), but feel free to propose a patch with the new ABI. Cheers, Jens > > -Sumit > > > > > Thanks, > > Jens > > > > > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1283 > > > [2] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1275 > > > > > > -Sumit > > > > > > > > > > > Cheers, > > > > Jens > > > > > > > > > > > > > > -Sumit > > > > > > > > > > > > > > > > > [1] https://lore.kernel.org/lkml/20211103090255.998070-1-jens.wiklander@linaro.org/ > > > > > > [2] https://lore.kernel.org/linux-arm-kernel/20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com/ > > > > > > [3] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=ffa-updates-6.7 > > > > > > commit bcefd1bf63b1 ("firmware: arm_ffa: Upgrade the driver version to v1.1") > > > > > > > > > > > > Thanks, > > > > > > Jens > > > > > > > > > > > > Jens Wiklander (2): > > > > > > optee: provide optee_do_bottom_half() as a common function > > > > > > optee: ffa_abi: add asynchronous notifications > > > > > > > > > > > > drivers/tee/optee/call.c | 31 ++++++++++- > > > > > > drivers/tee/optee/ffa_abi.c | 91 ++++++++++++++++++++++++++++++- > > > > > > drivers/tee/optee/optee_ffa.h | 28 ++++++++-- > > > > > > drivers/tee/optee/optee_private.h | 9 ++- > > > > > > drivers/tee/optee/smc_abi.c | 36 ++---------- > > > > > > 5 files changed, 153 insertions(+), 42 deletions(-) > > > > > > > > > > > > > > > > > > base-commit: bcefd1bf63b1ec9bb08067021cf47f0fad96f395 > > > > > > -- > > > > > > 2.34.1 > > > > > >
On Fri, 3 Nov 2023 at 13:32, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > On Thu, Nov 2, 2023 at 3:05 PM Sumit Garg <sumit.garg@linaro.org> wrote: > > > > On Thu, 2 Nov 2023 at 18:46, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > On Thu, Nov 02, 2023 at 05:46:55PM +0530, Sumit Garg wrote: > > > > On Thu, 2 Nov 2023 at 17:29, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > > > > > Hi Sumit, > > > > > > > > > > On Mon, Oct 30, 2023 at 11:32:47AM +0530, Sumit Garg wrote: > > > > > > Hi Jens, > > > > > > > > > > > > On Thu, 26 Oct 2023 at 13:34, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > > > > > > > > > Hi all, > > > > > > > > > > > > > > This patchset adds support for using FF-A notifications as a delivery > > > > > > > mechanism of asynchronous notifications from OP-TEE running in the secure > > > > > > > world. Support for asynchronous notifications via the SMC ABI was added in > > > > > > > [1], here we add the counterpart needed when using the the FF-A ABI. > > > > > > > > > > > > > > Support for FF-A notifications is added with [2] and this patch set is based > > > > > > > on Sudeeps tree at [3]. > > > > > > > > > > > > It's good to see FF-A notifications support coming through. The good > > > > > > aspect here is that FF-A uses a common secure world SGI for > > > > > > notifications and doesn't have to deal with platform specific reserved > > > > > > SPI for notifications. > > > > > > > > > > > > From OP-TEE point of view I think most of the secure SGI donation base > > > > > > would be common, so can we switch the SMC ABI to use this donated > > > > > > secure world SGI for notifications too? > > > > > > > > > > The SMC ABI driver picks up the interrupt used for notification from > > > > > device-tree, so there's a chance that it just works if a donated SGI is > > > > > supplied instead. We'll need some changes in the secure world side of > > > > > OP-TEE, but they wouldn't affect the ABI. > > > > > > > > AFAIK, a secure world donated SGIs doesn't support IRQ mapping via DT. > > > > The FF-A driver explicitly creates that mapping here [1]. > > > > > > That looks a lot like what platform_get_irq() does via of_irq_get(). > > > > > > > There is GIC_SPI or GIC_PPI but nothing like GIC_SGI in DT bindings [1]. > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/dt-bindings/interrupt-controller/arm-gic.h > > > > > > Moreover > > > > it's better to detect it via an SMC call rather than hard coded via DT > > > > as FF-A driver does. > > > > > > Typo? I guess you mean that you prefer that way the FF-A driver does it > > > rather than having it set in the DT. > > > > Yeah sorry about that. We shouldn't use DT if OP-TEE features are discoverable. > > > > > > > > Assuming that you only care about "arm,gic-v3". The SGI will likely > > > always be the same so it shouldn't be too hard to keep the correct > > > configuration in DT. > > > > See above, DT looks like it does not support SGI. > > You're right. > > > > > > > > > > > > > > So the ABI should dynamically detect if there is a donated SGI then > > > > use it otherwise fallback to SPI/PPI detection via DT. This would make > > > > the notifications feature platform agnostic and we can drop legacy DT > > > > methods from optee-os entirely but still need to maintain them in the > > > > kernel for backwards compatibility. > > > > > > We care about compatibility in both directions so we'd need to keep it > > > in OP-TEE too, but perhaps under a config flag. > > > > Isn't it just supported on Qemu right now in OP-TEE? I hope dropping a > > feature won't be a problem there compared with the maintenance burden. > > I'd rather not remove this since I believe it can support more > configurations (different interrupt controllers), but feel free to > propose a patch with the new ABI. Having a second thought here, I think adding further ABIs (redundant ABIs become maintenance burden overtime) don't make sense until we see real users of notifications. Have you been able to discover real users of this asynchronous notifications feature in OP-TEE? -Sumit > > Cheers, > Jens > > > > > -Sumit > > > > > > > > Thanks, > > > Jens > > > > > > > > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1283 > > > > [2] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1275 > > > > > > > > -Sumit > > > > > > > > > > > > > > Cheers, > > > > > Jens > > > > > > > > > > > > > > > > > -Sumit > > > > > > > > > > > > > > > > > > > > [1] https://lore.kernel.org/lkml/20211103090255.998070-1-jens.wiklander@linaro.org/ > > > > > > > [2] https://lore.kernel.org/linux-arm-kernel/20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com/ > > > > > > > [3] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=ffa-updates-6.7 > > > > > > > commit bcefd1bf63b1 ("firmware: arm_ffa: Upgrade the driver version to v1.1") > > > > > > > > > > > > > > Thanks, > > > > > > > Jens > > > > > > > > > > > > > > Jens Wiklander (2): > > > > > > > optee: provide optee_do_bottom_half() as a common function > > > > > > > optee: ffa_abi: add asynchronous notifications > > > > > > > > > > > > > > drivers/tee/optee/call.c | 31 ++++++++++- > > > > > > > drivers/tee/optee/ffa_abi.c | 91 ++++++++++++++++++++++++++++++- > > > > > > > drivers/tee/optee/optee_ffa.h | 28 ++++++++-- > > > > > > > drivers/tee/optee/optee_private.h | 9 ++- > > > > > > > drivers/tee/optee/smc_abi.c | 36 ++---------- > > > > > > > 5 files changed, 153 insertions(+), 42 deletions(-) > > > > > > > > > > > > > > > > > > > > > base-commit: bcefd1bf63b1ec9bb08067021cf47f0fad96f395 > > > > > > > -- > > > > > > > 2.34.1 > > > > > > >
On Fri, Nov 3, 2023 at 9:53 AM Sumit Garg <sumit.garg@linaro.org> wrote: > > On Fri, 3 Nov 2023 at 13:32, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > On Thu, Nov 2, 2023 at 3:05 PM Sumit Garg <sumit.garg@linaro.org> wrote: > > > > > > On Thu, 2 Nov 2023 at 18:46, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > > > On Thu, Nov 02, 2023 at 05:46:55PM +0530, Sumit Garg wrote: > > > > > On Thu, 2 Nov 2023 at 17:29, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > > > > > > > Hi Sumit, > > > > > > > > > > > > On Mon, Oct 30, 2023 at 11:32:47AM +0530, Sumit Garg wrote: > > > > > > > Hi Jens, > > > > > > > > > > > > > > On Thu, 26 Oct 2023 at 13:34, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > > > > > > > > > > > Hi all, > > > > > > > > > > > > > > > > This patchset adds support for using FF-A notifications as a delivery > > > > > > > > mechanism of asynchronous notifications from OP-TEE running in the secure > > > > > > > > world. Support for asynchronous notifications via the SMC ABI was added in > > > > > > > > [1], here we add the counterpart needed when using the the FF-A ABI. > > > > > > > > > > > > > > > > Support for FF-A notifications is added with [2] and this patch set is based > > > > > > > > on Sudeeps tree at [3]. > > > > > > > > > > > > > > It's good to see FF-A notifications support coming through. The good > > > > > > > aspect here is that FF-A uses a common secure world SGI for > > > > > > > notifications and doesn't have to deal with platform specific reserved > > > > > > > SPI for notifications. > > > > > > > > > > > > > > From OP-TEE point of view I think most of the secure SGI donation base > > > > > > > would be common, so can we switch the SMC ABI to use this donated > > > > > > > secure world SGI for notifications too? > > > > > > > > > > > > The SMC ABI driver picks up the interrupt used for notification from > > > > > > device-tree, so there's a chance that it just works if a donated SGI is > > > > > > supplied instead. We'll need some changes in the secure world side of > > > > > > OP-TEE, but they wouldn't affect the ABI. > > > > > > > > > > AFAIK, a secure world donated SGIs doesn't support IRQ mapping via DT. > > > > > The FF-A driver explicitly creates that mapping here [1]. > > > > > > > > That looks a lot like what platform_get_irq() does via of_irq_get(). > > > > > > > > > > There is GIC_SPI or GIC_PPI but nothing like GIC_SGI in DT bindings [1]. > > > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/dt-bindings/interrupt-controller/arm-gic.h > > > > > > > > Moreover > > > > > it's better to detect it via an SMC call rather than hard coded via DT > > > > > as FF-A driver does. > > > > > > > > Typo? I guess you mean that you prefer that way the FF-A driver does it > > > > rather than having it set in the DT. > > > > > > Yeah sorry about that. We shouldn't use DT if OP-TEE features are discoverable. > > > > > > > > > > > Assuming that you only care about "arm,gic-v3". The SGI will likely > > > > always be the same so it shouldn't be too hard to keep the correct > > > > configuration in DT. > > > > > > See above, DT looks like it does not support SGI. > > > > You're right. > > > > > > > > > > > > > > > > > > > So the ABI should dynamically detect if there is a donated SGI then > > > > > use it otherwise fallback to SPI/PPI detection via DT. This would make > > > > > the notifications feature platform agnostic and we can drop legacy DT > > > > > methods from optee-os entirely but still need to maintain them in the > > > > > kernel for backwards compatibility. > > > > > > > > We care about compatibility in both directions so we'd need to keep it > > > > in OP-TEE too, but perhaps under a config flag. > > > > > > Isn't it just supported on Qemu right now in OP-TEE? I hope dropping a > > > feature won't be a problem there compared with the maintenance burden. > > > > I'd rather not remove this since I believe it can support more > > configurations (different interrupt controllers), but feel free to > > propose a patch with the new ABI. > > Having a second thought here, I think adding further ABIs (redundant > ABIs become maintenance burden overtime) don't make sense until we see > real users of notifications. Have you been able to discover real users > of this asynchronous notifications feature in OP-TEE? No, not upstream. There have been questions about a feature like this from time to time in the past and I guess non-trivial interrupt handling will soon need it. Cheers, Jens > > -Sumit > > > > > Cheers, > > Jens > > > > > > > > -Sumit > > > > > > > > > > > Thanks, > > > > Jens > > > > > > > > > > > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1283 > > > > > [2] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1275 > > > > > > > > > > -Sumit > > > > > > > > > > > > > > > > > Cheers, > > > > > > Jens > > > > > > > > > > > > > > > > > > > > -Sumit > > > > > > > > > > > > > > > > > > > > > > > [1] https://lore.kernel.org/lkml/20211103090255.998070-1-jens.wiklander@linaro.org/ > > > > > > > > [2] https://lore.kernel.org/linux-arm-kernel/20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com/ > > > > > > > > [3] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=ffa-updates-6.7 > > > > > > > > commit bcefd1bf63b1 ("firmware: arm_ffa: Upgrade the driver version to v1.1") > > > > > > > > > > > > > > > > Thanks, > > > > > > > > Jens > > > > > > > > > > > > > > > > Jens Wiklander (2): > > > > > > > > optee: provide optee_do_bottom_half() as a common function > > > > > > > > optee: ffa_abi: add asynchronous notifications > > > > > > > > > > > > > > > > drivers/tee/optee/call.c | 31 ++++++++++- > > > > > > > > drivers/tee/optee/ffa_abi.c | 91 ++++++++++++++++++++++++++++++- > > > > > > > > drivers/tee/optee/optee_ffa.h | 28 ++++++++-- > > > > > > > > drivers/tee/optee/optee_private.h | 9 ++- > > > > > > > > drivers/tee/optee/smc_abi.c | 36 ++---------- > > > > > > > > 5 files changed, 153 insertions(+), 42 deletions(-) > > > > > > > > > > > > > > > > > > > > > > > > base-commit: bcefd1bf63b1ec9bb08067021cf47f0fad96f395 > > > > > > > > -- > > > > > > > > 2.34.1 > > > > > > > >
On Mon, 6 Nov 2023 at 14:09, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > On Fri, Nov 3, 2023 at 9:53 AM Sumit Garg <sumit.garg@linaro.org> wrote: > > > > On Fri, 3 Nov 2023 at 13:32, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > On Thu, Nov 2, 2023 at 3:05 PM Sumit Garg <sumit.garg@linaro.org> wrote: > > > > > > > > On Thu, 2 Nov 2023 at 18:46, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > > > > > On Thu, Nov 02, 2023 at 05:46:55PM +0530, Sumit Garg wrote: > > > > > > On Thu, 2 Nov 2023 at 17:29, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > > > > > > > > > Hi Sumit, > > > > > > > > > > > > > > On Mon, Oct 30, 2023 at 11:32:47AM +0530, Sumit Garg wrote: > > > > > > > > Hi Jens, > > > > > > > > > > > > > > > > On Thu, 26 Oct 2023 at 13:34, Jens Wiklander <jens.wiklander@linaro.org> wrote: > > > > > > > > > > > > > > > > > > Hi all, > > > > > > > > > > > > > > > > > > This patchset adds support for using FF-A notifications as a delivery > > > > > > > > > mechanism of asynchronous notifications from OP-TEE running in the secure > > > > > > > > > world. Support for asynchronous notifications via the SMC ABI was added in > > > > > > > > > [1], here we add the counterpart needed when using the the FF-A ABI. > > > > > > > > > > > > > > > > > > Support for FF-A notifications is added with [2] and this patch set is based > > > > > > > > > on Sudeeps tree at [3]. > > > > > > > > > > > > > > > > It's good to see FF-A notifications support coming through. The good > > > > > > > > aspect here is that FF-A uses a common secure world SGI for > > > > > > > > notifications and doesn't have to deal with platform specific reserved > > > > > > > > SPI for notifications. > > > > > > > > > > > > > > > > From OP-TEE point of view I think most of the secure SGI donation base > > > > > > > > would be common, so can we switch the SMC ABI to use this donated > > > > > > > > secure world SGI for notifications too? > > > > > > > > > > > > > > The SMC ABI driver picks up the interrupt used for notification from > > > > > > > device-tree, so there's a chance that it just works if a donated SGI is > > > > > > > supplied instead. We'll need some changes in the secure world side of > > > > > > > OP-TEE, but they wouldn't affect the ABI. > > > > > > > > > > > > AFAIK, a secure world donated SGIs doesn't support IRQ mapping via DT. > > > > > > The FF-A driver explicitly creates that mapping here [1]. > > > > > > > > > > That looks a lot like what platform_get_irq() does via of_irq_get(). > > > > > > > > > > > > > There is GIC_SPI or GIC_PPI but nothing like GIC_SGI in DT bindings [1]. > > > > > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/dt-bindings/interrupt-controller/arm-gic.h > > > > > > > > > > Moreover > > > > > > it's better to detect it via an SMC call rather than hard coded via DT > > > > > > as FF-A driver does. > > > > > > > > > > Typo? I guess you mean that you prefer that way the FF-A driver does it > > > > > rather than having it set in the DT. > > > > > > > > Yeah sorry about that. We shouldn't use DT if OP-TEE features are discoverable. > > > > > > > > > > > > > > Assuming that you only care about "arm,gic-v3". The SGI will likely > > > > > always be the same so it shouldn't be too hard to keep the correct > > > > > configuration in DT. > > > > > > > > See above, DT looks like it does not support SGI. > > > > > > You're right. > > > > > > > > > > > > > > > > > > > > > > > > So the ABI should dynamically detect if there is a donated SGI then > > > > > > use it otherwise fallback to SPI/PPI detection via DT. This would make > > > > > > the notifications feature platform agnostic and we can drop legacy DT > > > > > > methods from optee-os entirely but still need to maintain them in the > > > > > > kernel for backwards compatibility. > > > > > > > > > > We care about compatibility in both directions so we'd need to keep it > > > > > in OP-TEE too, but perhaps under a config flag. > > > > > > > > Isn't it just supported on Qemu right now in OP-TEE? I hope dropping a > > > > feature won't be a problem there compared with the maintenance burden. > > > > > > I'd rather not remove this since I believe it can support more > > > configurations (different interrupt controllers), but feel free to > > > propose a patch with the new ABI. > > > > Having a second thought here, I think adding further ABIs (redundant > > ABIs become maintenance burden overtime) don't make sense until we see > > real users of notifications. Have you been able to discover real users > > of this asynchronous notifications feature in OP-TEE? > > No, not upstream. There have been questions about a feature like this > from time to time in the past and I guess non-trivial interrupt > handling will soon need it. Okay let's keep the way it is today unless we really need support for SGIs too. -Sumit > > Cheers, > Jens > > > > > -Sumit > > > > > > > > Cheers, > > > Jens > > > > > > > > > > > -Sumit > > > > > > > > > > > > > > Thanks, > > > > > Jens > > > > > > > > > > > > > > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1283 > > > > > > [2] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tree/drivers/firmware/arm_ffa/driver.c?h=ffa-updates-6.7#n1275 > > > > > > > > > > > > -Sumit > > > > > > > > > > > > > > > > > > > > Cheers, > > > > > > > Jens > > > > > > > > > > > > > > > > > > > > > > > -Sumit > > > > > > > > > > > > > > > > > > > > > > > > > > [1] https://lore.kernel.org/lkml/20211103090255.998070-1-jens.wiklander@linaro.org/ > > > > > > > > > [2] https://lore.kernel.org/linux-arm-kernel/20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com/ > > > > > > > > > [3] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=ffa-updates-6.7 > > > > > > > > > commit bcefd1bf63b1 ("firmware: arm_ffa: Upgrade the driver version to v1.1") > > > > > > > > > > > > > > > > > > Thanks, > > > > > > > > > Jens > > > > > > > > > > > > > > > > > > Jens Wiklander (2): > > > > > > > > > optee: provide optee_do_bottom_half() as a common function > > > > > > > > > optee: ffa_abi: add asynchronous notifications > > > > > > > > > > > > > > > > > > drivers/tee/optee/call.c | 31 ++++++++++- > > > > > > > > > drivers/tee/optee/ffa_abi.c | 91 ++++++++++++++++++++++++++++++- > > > > > > > > > drivers/tee/optee/optee_ffa.h | 28 ++++++++-- > > > > > > > > > drivers/tee/optee/optee_private.h | 9 ++- > > > > > > > > > drivers/tee/optee/smc_abi.c | 36 ++---------- > > > > > > > > > 5 files changed, 153 insertions(+), 42 deletions(-) > > > > > > > > > > > > > > > > > > > > > > > > > > > base-commit: bcefd1bf63b1ec9bb08067021cf47f0fad96f395 > > > > > > > > > -- > > > > > > > > > 2.34.1 > > > > > > > > >
On Thu, Oct 26, 2023 at 10:04:07AM +0200, Jens Wiklander wrote: > Hi all, > > This patchset adds support for using FF-A notifications as a delivery > mechanism of asynchronous notifications from OP-TEE running in the secure > world. Support for asynchronous notifications via the SMC ABI was added in > [1], here we add the counterpart needed when using the the FF-A ABI. > > Support for FF-A notifications is added with [2] and this patch set is based > on Sudeeps tree at [3]. > > [1] https://lore.kernel.org/lkml/20211103090255.998070-1-jens.wiklander@linaro.org/ > [2] https://lore.kernel.org/linux-arm-kernel/20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com/ > [3] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=ffa-updates-6.7 > commit bcefd1bf63b1 ("firmware: arm_ffa: Upgrade the driver version to v1.1") > FWIW: Tested-by: Sudeep Holla <sudeep.holla@arm.com>
On Tue, Nov 7, 2023 at 12:48 PM Sudeep Holla <sudeep.holla@arm.com> wrote: > > On Thu, Oct 26, 2023 at 10:04:07AM +0200, Jens Wiklander wrote: > > Hi all, > > > > This patchset adds support for using FF-A notifications as a delivery > > mechanism of asynchronous notifications from OP-TEE running in the secure > > world. Support for asynchronous notifications via the SMC ABI was added in > > [1], here we add the counterpart needed when using the the FF-A ABI. > > > > Support for FF-A notifications is added with [2] and this patch set is based > > on Sudeeps tree at [3]. > > > > [1] https://lore.kernel.org/lkml/20211103090255.998070-1-jens.wiklander@linaro.org/ > > [2] https://lore.kernel.org/linux-arm-kernel/20231005-ffa_v1-1_notif-v4-0-cddd3237809c@arm.com/ > > [3] https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=ffa-updates-6.7 > > commit bcefd1bf63b1 ("firmware: arm_ffa: Upgrade the driver version to v1.1") > > > > FWIW: > > Tested-by: Sudeep Holla <sudeep.holla@arm.com> Thanks, much appreciated. Cheers, Jens > > -- > Regards, > Sudeep