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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE55BC433F5 for ; Wed, 16 Mar 2022 11:18:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355286AbiCPLUG (ORCPT ); Wed, 16 Mar 2022 07:20:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345088AbiCPLUE (ORCPT ); Wed, 16 Mar 2022 07:20:04 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C88EE3388E for ; Wed, 16 Mar 2022 04:18:50 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1nURfz-0003xq-O8; Wed, 16 Mar 2022 12:18:47 +0100 Message-ID: <5ef2f1ae-f6b2-9905-801a-395c7269bd93@pengutronix.de> Date: Wed, 16 Mar 2022 12:18:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v8 1/2] dt-bindings: arm: Add OP-TEE transport for SCMI Content-Language: en-US To: Etienne Carriere Cc: Sudeep Holla , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Cristian Marussi , Vincent Guittot , devicetree@vger.kernel.org, Rob Herring , Pengutronix Kernel Team References: <20211028140009.23331-1-etienne.carriere@linaro.org> <58a0e791-9573-99c2-0cc5-3920a1048113@pengutronix.de> <2b4442d9-fb10-36ee-585d-4103b76abbbb@pengutronix.de> From: Ahmad Fatoum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Etienne, On 08.03.22 11:18, Etienne Carriere wrote: > Hello Ahmad, > > On Tue, 8 Mar 2022 at 10:51, Ahmad Fatoum wrote: >> >> Hello Sudeep, >> >> On 01.03.22 16:12, Sudeep Holla wrote: >>> >>> Hi Ahmad, >>> >>> On Mon, Feb 28, 2022 at 05:01:39PM +0100, Ahmad Fatoum wrote: >>>> Hello Etienne, >>>> >>>> On 28.10.21 16:00, Etienne Carriere wrote: >>>>> Introduce compatible "linaro,scmi-optee" for SCMI transport channel >>>>> based on an OP-TEE service invocation. The compatible mandates a >>>>> channel ID defined with property "linaro,optee-channel-id". >>>> >>> >>> Not sure if Etienne's reply addressed your queries/concerns correctly. >>> I thought I will add my view anyways. >>> >>>> I just found this thread via the compatible in the STM32MP131 patch set: >>>> https://lore.kernel.org/all/20220225133137.813919-1-gabriel.fernandez@foss.st.com/ >>>> >>>> Linux doesn't care whether PSCI is provided by TF-A, OP-TEE or something >>>> else, so there is just the arm,psci* compatible. >>>> >>> >>> Correct, the interface to the kernel is fixed and hence we must be able >>> to manage with the standard and fixed sole set of bindings for the same. >>> >>>> What's different about SCMI that this is not possible? Why couldn't the >>>> existing binding and driver be used to communicate with OP-TEE as secure >>>> monitor as well? >>>> >>> >>> However with SCMI, the spec concentrates and standardises all the aspects >>> of the protocol used for the communication while it allows the transport >>> used for such a communication to be implementation specific. It does >>> address some standard transports like mailbox and PCC(ACPI). However, >>> because of the flexibility and also depending on the hardware(or VM), >>> different transports have been added to the list. SMC/HVC was the one, >>> followed by the virtio and OPTEE. While I agree SMC/HVC and OPTEE seem >>> to have lot of common and may have avoided separate bindings. >>> >>> However the FIDs for SMC/HVC is vendor defined(the spec doesn't cover this >>> and hence we utilised/exploited DT). Some vendors wanted interrupt support >>> too which got added. OPTEE eliminates the need for FID and can also provide >>> dynamic shared memory info. In short, it does differ in a way that the driver >>> needs to understand the difference and act differently with each of the >>> unique transports defined in the binding. >>> >>> Hope that explains and addresses your concern. >> >> Thanks for the elaborate answer. I see now why it's beneficial to have >> an OP-TEE transport in general. I don't yet see the benefit to use it >> in the STM32MP13x instead of SMCs like with STM32MP15x, but that a discussion >> that I need to have in the aforementioned thread. > > Some SCMI operations in OP-TEE need to execute in a threaded context > (preemptible, ...). > There is no SMC function ID defined for an SCMI thread entry in > OP-TEE. We rather use standard invocation of a TEE service: opening a > session and invoking commands. > Invoked commands are executed in an OP-TEE native threaded context. > The service accessed is referred to as the OP-TEE SCMI PTA. > > As for STM32MP15x, one willing to extend resources assigned to secure > world may also need to move mp15 SCMI from SMC transport to optee > transport. Yes. Makes sense. Thanks again for explaining, Ahmad > > Regards, > Etienne > >> >> Thanks again! >> Ahmad >> >> -- >> Pengutronix e.K. | | >> Steuerwalder Str. 21 | http://www.pengutronix.de/ | >> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | >> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | > etienn -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 59778C433F5 for ; Wed, 16 Mar 2022 11:20:01 +0000 (UTC) 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:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=78WAgLyh0Pv7z2WhWHnFXFrWtWp4OtG/jqfCMLgdKqU=; b=NNPoehvg3m2ia8 k57NENjxsvKPqg4MGu4pOEwDFujh4ciutr8wogJSkG1HRxDECDnCT2SXHYsoWfta/bAgRBaLT+Snu nubTZD6ER7hRQYntx4ZygmWMCHsxb70uJMpaj4P/8PTLP6w1GA2pn3VxMO04jOwjDKQE8dWgRg+xy 9sD4kgM36VzBViI6yYNzwZ2je2hhnSEsdyl59mUg2LpttbQhZp73ker6xESP4YDt9n3Haq/7UV2L+ Y9cIjXL/EAqFGLUOBbLlpkUy9gnQWXuPzQx2rrgnxBqSy2s7qruUSzb+xdATZRXU6ZWj+C1KhK8Ce sqUdZDcUYCM/uLi2lzQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nURg5-00CbgX-Oy; Wed, 16 Mar 2022 11:18:53 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nURg2-00Cbfw-SU for linux-arm-kernel@lists.infradead.org; Wed, 16 Mar 2022 11:18:52 +0000 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1nURfz-0003xq-O8; Wed, 16 Mar 2022 12:18:47 +0100 Message-ID: <5ef2f1ae-f6b2-9905-801a-395c7269bd93@pengutronix.de> Date: Wed, 16 Mar 2022 12:18:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v8 1/2] dt-bindings: arm: Add OP-TEE transport for SCMI Content-Language: en-US To: Etienne Carriere Cc: Sudeep Holla , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Cristian Marussi , Vincent Guittot , devicetree@vger.kernel.org, Rob Herring , Pengutronix Kernel Team References: <20211028140009.23331-1-etienne.carriere@linaro.org> <58a0e791-9573-99c2-0cc5-3920a1048113@pengutronix.de> <2b4442d9-fb10-36ee-585d-4103b76abbbb@pengutronix.de> From: Ahmad Fatoum In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220316_041850_958727_83AEA829 X-CRM114-Status: GOOD ( 29.42 ) 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 Hello Etienne, On 08.03.22 11:18, Etienne Carriere wrote: > Hello Ahmad, > > On Tue, 8 Mar 2022 at 10:51, Ahmad Fatoum wrote: >> >> Hello Sudeep, >> >> On 01.03.22 16:12, Sudeep Holla wrote: >>> >>> Hi Ahmad, >>> >>> On Mon, Feb 28, 2022 at 05:01:39PM +0100, Ahmad Fatoum wrote: >>>> Hello Etienne, >>>> >>>> On 28.10.21 16:00, Etienne Carriere wrote: >>>>> Introduce compatible "linaro,scmi-optee" for SCMI transport channel >>>>> based on an OP-TEE service invocation. The compatible mandates a >>>>> channel ID defined with property "linaro,optee-channel-id". >>>> >>> >>> Not sure if Etienne's reply addressed your queries/concerns correctly. >>> I thought I will add my view anyways. >>> >>>> I just found this thread via the compatible in the STM32MP131 patch set: >>>> https://lore.kernel.org/all/20220225133137.813919-1-gabriel.fernandez@foss.st.com/ >>>> >>>> Linux doesn't care whether PSCI is provided by TF-A, OP-TEE or something >>>> else, so there is just the arm,psci* compatible. >>>> >>> >>> Correct, the interface to the kernel is fixed and hence we must be able >>> to manage with the standard and fixed sole set of bindings for the same. >>> >>>> What's different about SCMI that this is not possible? Why couldn't the >>>> existing binding and driver be used to communicate with OP-TEE as secure >>>> monitor as well? >>>> >>> >>> However with SCMI, the spec concentrates and standardises all the aspects >>> of the protocol used for the communication while it allows the transport >>> used for such a communication to be implementation specific. It does >>> address some standard transports like mailbox and PCC(ACPI). However, >>> because of the flexibility and also depending on the hardware(or VM), >>> different transports have been added to the list. SMC/HVC was the one, >>> followed by the virtio and OPTEE. While I agree SMC/HVC and OPTEE seem >>> to have lot of common and may have avoided separate bindings. >>> >>> However the FIDs for SMC/HVC is vendor defined(the spec doesn't cover this >>> and hence we utilised/exploited DT). Some vendors wanted interrupt support >>> too which got added. OPTEE eliminates the need for FID and can also provide >>> dynamic shared memory info. In short, it does differ in a way that the driver >>> needs to understand the difference and act differently with each of the >>> unique transports defined in the binding. >>> >>> Hope that explains and addresses your concern. >> >> Thanks for the elaborate answer. I see now why it's beneficial to have >> an OP-TEE transport in general. I don't yet see the benefit to use it >> in the STM32MP13x instead of SMCs like with STM32MP15x, but that a discussion >> that I need to have in the aforementioned thread. > > Some SCMI operations in OP-TEE need to execute in a threaded context > (preemptible, ...). > There is no SMC function ID defined for an SCMI thread entry in > OP-TEE. We rather use standard invocation of a TEE service: opening a > session and invoking commands. > Invoked commands are executed in an OP-TEE native threaded context. > The service accessed is referred to as the OP-TEE SCMI PTA. > > As for STM32MP15x, one willing to extend resources assigned to secure > world may also need to move mp15 SCMI from SMC transport to optee > transport. Yes. Makes sense. Thanks again for explaining, Ahmad > > Regards, > Etienne > >> >> Thanks again! >> Ahmad >> >> -- >> Pengutronix e.K. | | >> Steuerwalder Str. 21 | http://www.pengutronix.de/ | >> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | >> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | > etienn -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel