Linux Remote Processor Subsystem development
 help / color / mirror / Atom feed
From: Arnaud POULIQUEN <arnaud.pouliquen@foss.st.com>
To: Naman Jain <quic_namajain@quicinc.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	"Jens Wiklander" <jens.wiklander@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: <linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-remoteproc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<op-tee@lists.trustedfirmware.org>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH v3 0/7] Introduction of a remoteproc tee to load signed firmware
Date: Fri, 23 Feb 2024 15:10:03 +0100	[thread overview]
Message-ID: <c80d0ca1-1ae3-4af3-ba84-6dc5efaff1c7@foss.st.com> (raw)
In-Reply-To: <8af59b01-53cf-4fc4-9946-6c630fb7b38e@quicinc.com>



On 2/22/24 10:55, Naman Jain wrote:
> On 2/22/2024 2:17 PM, Arnaud POULIQUEN wrote:
>> Hello Naman,
>>
>> On 2/22/24 06:43, Naman Jain wrote:
>>> On 2/14/2024 10:51 PM, Arnaud Pouliquen wrote:
>>>> Updates from the previous version [1]:
>>>>
>>>> This version proposes another approach based on an alternate load and boot
>>>> of the coprocessor. Therefore, the constraint introduced by tee_remoteproc
>>>> is that the firmware has to be authenticated and loaded before the resource
>>>> table can be obtained.
>>>>
>>>> The existing boot sequence is: >
>>>>     1) Get the resource table and store it in a cache,
>>>>        calling rproc->ops->parse_fw().
>>>>     2) Parse the resource table and handle resources,
>>>>        calling rproc_handle_resources.
>>>>     3) Load the firmware, calling rproc->ops->load().
>>>>     4) Start the firmware, calling rproc->ops->start().
>>>>    => Steps 1 and 2 are executed in rproc_fw_boot(), while steps 3 and 4 are
>>>>      executed in rproc_start().
>>>> => the use of rproc->ops->load() ops is mandatory
>>>>
>>>> The boot sequence needed for TEE boot is:
>>>>
>>>>     1) Load the firmware.
>>>>     2) Get the loaded resource, no cache.
>>>>     3) Parse the resource table and handle resources.
>>>>     4) Start the firmware.
>>>
>>> Hi,
>>> What problem are we really addressing here by reordering load, parse of
>>> FW resources?
>>
>> The feature introduced in TEE is the signature of the firmware images. That
>> means that before getting the resource table, we need to first authenticate the
>> firmware images.
>> Authenticating a firmware image means that we have to copy the firmware into
>> protected memory that cannot be corrupted by the non-secure and then verify the
>> signature.
>> The strategy implemented in OP-TEE is to load the firmware into destination
>> memory and then authenticate it.
>> This strategy avoids having a temporary copy of the whole images in a secure
>> memory.
>> This strategy imposes loading the firmware images before retrieving the resource
>> table.
>>
>>> Basically, what are the limitations of the current design you are referring to?
>>> I understood that TEE is designed that way.
>>
>> The limitation of the current design is that we obtain the resource table before
>> loading the firmware. Following the current design would impose constraints in
>> TEE that are not straightforward. Step 1 (getting the resource table and storing
>> it in a cache) would require having a copy of the resource table in TEE after
>> authenticating the images. However, authenticating the firmware, as explained
>> before, depends on the strategy implemented. In TEE implementation, we load the
>> firmware to authenticate it in the destination memory.
>>
>> Regards,
>> Arnaud
> 
> 
> Hello Arnaud,
> I think now I got your point. In TEE, you don't want to do anything(read
> resource table) with FW images, until its loaded and authenticated.
> Since current design was not allowing you to do it, you had to reorganize the
> code so that this can be achieved.
> 
> Generally speaking, in current design, if authentication fails for some
> reason later, one can handle it, but it depends on the implementation of
> parse_fw op if the damage is already done.
> 
> Please correct me if this is wrong assumption.

That's correct.

Regards,
Arnaud

> Patch looks good to me.
> 
> Regards,
> Naman Jain

      reply	other threads:[~2024-02-23 14:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14 17:21 [PATCH v3 0/7] Introduction of a remoteproc tee to load signed firmware Arnaud Pouliquen
2024-02-14 17:21 ` [PATCH v3 1/7] remoteproc: Add TEE support Arnaud Pouliquen
2024-02-20 18:58   ` Mathieu Poirier
2024-02-21  8:39     ` Arnaud POULIQUEN
2024-02-22  5:42   ` Naman Jain
2024-02-23 18:27   ` Mathieu Poirier
2024-02-28  8:20     ` Arnaud POULIQUEN
2024-02-29 16:19       ` Mathieu Poirier
2024-02-29 18:26         ` Arnaud POULIQUEN
2024-02-14 17:21 ` [PATCH v3 2/7] remoteproc: Extract the firmware load from the start Arnaud Pouliquen
2024-02-14 17:21 ` [PATCH v3 3/7] remoteproc: core: Add check on cached_table pointer Arnaud Pouliquen
2024-02-23 18:32   ` Mathieu Poirier
2024-02-14 17:21 ` [PATCH v3 4/7] remoteproc: core: Implement the support of an alternative boot Arnaud Pouliquen
2024-02-14 17:21 ` [PATCH v3 5/7] dt-bindings: remoteproc: Add compatibility for TEE support Arnaud Pouliquen
2024-02-22 18:24   ` Rob Herring
2024-02-14 17:21 ` [PATCH v3 6/7] remoteproc: stm32: Create sub-functions to request shutdown and release Arnaud Pouliquen
2024-02-14 17:21 ` [PATCH v3 7/7] remoteproc: stm32: Add support of an OP-TEE TA to load the firmware Arnaud Pouliquen
2024-02-22 19:02   ` Mathieu Poirier
2024-02-23 13:54     ` Arnaud POULIQUEN
2024-02-23 18:37       ` Mathieu Poirier
2024-02-29 18:16         ` Arnaud POULIQUEN
2024-02-22  5:43 ` [PATCH v3 0/7] Introduction of a remoteproc tee to load signed firmware Naman Jain
2024-02-22  8:47   ` Arnaud POULIQUEN
2024-02-22  9:55     ` Naman Jain
2024-02-23 14:10       ` Arnaud POULIQUEN [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c80d0ca1-1ae3-4af3-ba84-6dc5efaff1c7@foss.st.com \
    --to=arnaud.pouliquen@foss.st.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jens.wiklander@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=op-tee@lists.trustedfirmware.org \
    --cc=quic_namajain@quicinc.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox