Ken,
Task scheduling (context switching) in our RTOS is always performed in thread mode, even when asynchronous pre-emption occurs resulting from an ISR readying a higher priority task.
All kernel-managed interrupts are routed to a common interrupt dispatcher that, just prior to returning from an interrupt, will invoke the task scheduler when it determines that there are no more interrupts pending and there is scheduling work to do. In that case, an artificial interrupt context is created so that thread mode can be "returned to" from handler mode. The task scheduler is then invoked in thread mode from the stack of the pre-empted task.
Regarding secure interrupts, our use cases only employ secure interrupts as a consequence of a psa_call() initiating a process that completes when an interrupt goes off sometime later.
Rather than spin-waiting for the interrupt-completion signal, or parking in a WFI, we simply return from the psa_call() with a special return code indicating that the process has started and that the calling thread will be notified of completion by the secure callback mechanism I described at the conference in Lyon. The calling thread then pends on a semaphore. When the secure interrupt goes off later on, a dedicated non-secure interrupt is triggered that ultimately ends up posting the semaphore that the NS thread is pended on. Upon returning from the pend, the NS thread then re-enters the SP (using psa_call()) to complete the transaction.
Alan
-----Original Message-----
From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf Of Ken Liu (Arm Technology China) via TF-M
Sent: Tuesday, December 10, 2019 8:04 PM
To: tf-m(a)lists.trustedfirmware.org
Cc: nd
Subject: [EXTERNAL] [TF-M] Secure Interrupt handling - RE: TF-M technical Forum slides and recording
Thank Bill for updating this.
I want to use this thread to follow up on the topic 'secure interrupt' given in the 1st tech forum.
That is a prologue of the scheduler and interrupt designs. And I do see there are some use cases that I did not focus on, so I want to collect more user scenarios first, and then try to enhance the drafting design (will be published after I updated it base on your inputs).
About the secure interrupt usage:
- A secure interrupt would be introduced by a secure service call in general; is there any scenarios that there would be an interval secure interrupt since secure service want to do something? For example, a secure timer triggers to let secure service has the chance to do things in the background (not for an ongoing secure call from NSPE) after a period of time?
And the question about the system Alan mentioned, just want to confirm if it is a pure thread mode scheduling system? How does the system handle interrupts?
Thanks.
-----Original Message-----
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of Bill Fletcher via TF-M
Sent: Monday, December 9, 2019 7:57 PM
To: TF-M mailing list <tf-m(a)lists.trustedfirmware.org>
Subject: [TF-M] TF-M technical Forum slides and recording
Hi all,
I've posted links to the (updated) slide deck and a recording of the call on the meetings page of the Trusted Firmware website:
https://www.trustedfirmware.org/meetings/tf-m-technical-forum/
Regards
Bill
--
[image: Linaro] <http://www.linaro.org/> *Bill Fletcher* | *Field Engineering*
T: +44 7833 498336 <+44+7833+498336>
bill.fletcher(a)linaro.org | Skype: billfletcher2020
--
TF-M mailing list
TF-M(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-m
--
TF-M mailing list
TF-M(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-m
Hi Edison,
Thanks for your quick reply. I will try to upstream a patch later.
Thanks,
Matt
At 2019-12-12 11:15:51, "Edison Ai \\(Arm Technology China\\) via TF-M" <tf-m(a)lists.trustedfirmware.org> wrote:
>Hi Matt,
>
>Thanks very much for your mail. It looks like it is indeed a problem here.
>Can you upstream a patch to help to fix them directly?
>
>Thanks,
>Edison
>
>-----Original Message-----
>From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of lg via TF-M
>Sent: Thursday, December 12, 2019 9:43 AM
>To: tf-m(a)lists.trustedfirmware.org
>Subject: [TF-M] Secure storage and Internal trusted storage code logic check
>
>Hi TFM Secure storage & Internal trusted storage experts,
>
>
> It seems there are code logic errors in both files sst_flash_fs_mblock.c and its_flash_fs_mblock.c.
> There are following codes in function its_flash_fs_mblock_reset_metablock in its_flash_fs_mblock.c:
>
>
> for (i = ITS_INIT_DBLOCK_START; i < ITS_NUM_DEDICATED_DBLOCKS; i++) {
> /* If a flash error is detected, the code erases the rest
> * of the blocks anyway to remove all data stored in them.
> */
> err |= its_flash_erase_block(i);
> }
> This loop starts from ITS_INIT_DBLOCK_START and ends to ITS_NUM_DEDICATED_DBLOCKS.
> If there are four ITS blocks including meta blocks and data blocks in all, that means ITS_INIT_DBLOCK_START
> is 3 and ITS_NUM_DEDICATED_DBLOCKS is 1. But the above loop can not erase the data block any way.
> Should it be the following logic?
>
>
> for (i = 0; i < ITS_NUM_DEDICATED_DBLOCKS; i++) {
> /* If a flash error is detected, the code erases the rest
> * of the blocks anyway to remove all data stored in them.
> */
> err |= its_flash_erase_block(i+ITS_INIT_DBLOCK_START);
> }
> It is the same logic in function sst_flash_fs_mblock_reset_metablock in file sst_flash_fs_mblock.c.
>
>
> Please help to check.
>
>
>Thanks.
>Matt.
>
>--
>TF-M mailing list
>TF-M(a)lists.trustedfirmware.org
>https://lists.trustedfirmware.org/mailman/listinfo/tf-m
>--
>TF-M mailing list
>TF-M(a)lists.trustedfirmware.org
>https://lists.trustedfirmware.org/mailman/listinfo/tf-m
Hi all,
I submit a patch set to extract the duplicated identical template files dummy_xxx.c from targets and put them under platform/ext/common/template folder.
The purpose is to collect a common template of booting/attestation example for platforms and each platform doesn't need to keep a copy under its folder anymore.
Since it is a general change related to all platforms using template files, I'd like to ask for review here. Any comments would be appreciated.
Please check the patch details in https://review.trustedfirmware.org/q/topic:%22template_plat_files%22+(statu…
The background is described in https://developer.trustedfirmware.org/T539.
Best regards,
Hu Ziji
Hi Matt,
Thanks very much for your mail. It looks like it is indeed a problem here.
Can you upstream a patch to help to fix them directly?
Thanks,
Edison
-----Original Message-----
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of lg via TF-M
Sent: Thursday, December 12, 2019 9:43 AM
To: tf-m(a)lists.trustedfirmware.org
Subject: [TF-M] Secure storage and Internal trusted storage code logic check
Hi TFM Secure storage & Internal trusted storage experts,
It seems there are code logic errors in both files sst_flash_fs_mblock.c and its_flash_fs_mblock.c.
There are following codes in function its_flash_fs_mblock_reset_metablock in its_flash_fs_mblock.c:
for (i = ITS_INIT_DBLOCK_START; i < ITS_NUM_DEDICATED_DBLOCKS; i++) {
/* If a flash error is detected, the code erases the rest
* of the blocks anyway to remove all data stored in them.
*/
err |= its_flash_erase_block(i);
}
This loop starts from ITS_INIT_DBLOCK_START and ends to ITS_NUM_DEDICATED_DBLOCKS.
If there are four ITS blocks including meta blocks and data blocks in all, that means ITS_INIT_DBLOCK_START
is 3 and ITS_NUM_DEDICATED_DBLOCKS is 1. But the above loop can not erase the data block any way.
Should it be the following logic?
for (i = 0; i < ITS_NUM_DEDICATED_DBLOCKS; i++) {
/* If a flash error is detected, the code erases the rest
* of the blocks anyway to remove all data stored in them.
*/
err |= its_flash_erase_block(i+ITS_INIT_DBLOCK_START);
}
It is the same logic in function sst_flash_fs_mblock_reset_metablock in file sst_flash_fs_mblock.c.
Please help to check.
Thanks.
Matt.
--
TF-M mailing list
TF-M(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-m
Hi TFM Secure storage & Internal trusted storage experts,
It seems there are code logic errors in both files sst_flash_fs_mblock.c and its_flash_fs_mblock.c.
There are following codes in function its_flash_fs_mblock_reset_metablock in its_flash_fs_mblock.c:
for (i = ITS_INIT_DBLOCK_START; i < ITS_NUM_DEDICATED_DBLOCKS; i++) {
/* If a flash error is detected, the code erases the rest
* of the blocks anyway to remove all data stored in them.
*/
err |= its_flash_erase_block(i);
}
This loop starts from ITS_INIT_DBLOCK_START and ends to ITS_NUM_DEDICATED_DBLOCKS.
If there are four ITS blocks including meta blocks and data blocks in all, that means ITS_INIT_DBLOCK_START
is 3 and ITS_NUM_DEDICATED_DBLOCKS is 1. But the above loop can not erase the data block any way.
Should it be the following logic?
for (i = 0; i < ITS_NUM_DEDICATED_DBLOCKS; i++) {
/* If a flash error is detected, the code erases the rest
* of the blocks anyway to remove all data stored in them.
*/
err |= its_flash_erase_block(i+ITS_INIT_DBLOCK_START);
}
It is the same logic in function sst_flash_fs_mblock_reset_metablock in file sst_flash_fs_mblock.c.
Please help to check.
Thanks.
Matt.
Thanks Thomas.
Let me try that link.
/Ken
-----Original Message-----
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of Thomas Törnblom via TF-M
Sent: Wednesday, December 11, 2019 9:13 PM
To: tf-m(a)lists.trustedfirmware.org
Subject: Re: [TF-M] IAR libc behavior?
Hi Ken,
There should be no difference from GNUARM or ARMCLANG in this respect.
Should not need any special switches.
If you wish to try out our tools, you can download a trial version until we have arranged for a permanent solution, see:
https://www.iar.com/iar-embedded-workbench/#!?architecture=Arm
Cheers,
Thomas
Den 2019-12-11 kl. 11:05, skrev Ken Liu (Arm Technology China) via TF-M:
> Hi Thomas,
>
> I have a question about IAR compiler since we verify default GNUARM and ARMCLANG in the existing sources.
> If we are trying to implementing some internal version of libc APIs like 'memcmp', would IAR link with this implemented version first, or it just report a link error of duplicated symbol? Any switches do we need to assign to support this?
>
> Thanks.
>
> /Ken
--
*Thomas Törnblom*, /Product Engineer/
IAR Systems AB
Box 23051, Strandbodgatan 1
SE-750 23 Uppsala, SWEDEN
Mobile: +46 76 180 17 80 Fax: +46 18 16 78 01
E-mail: thomas.tornblom(a)iar.com <mailto:thomas.tornblom@iar.com>
Website: www.iar.com <http://www.iar.com>
Twitter: www.twitter.com/iarsystems <http://www.twitter.com/iarsystems>
--
TF-M mailing list
TF-M(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-m
Hi Ken,
There should be no difference from GNUARM or ARMCLANG in this respect.
Should not need any special switches.
If you wish to try out our tools, you can download a trial version until
we have arranged for a permanent solution, see:
https://www.iar.com/iar-embedded-workbench/#!?architecture=Arm
Cheers,
Thomas
Den 2019-12-11 kl. 11:05, skrev Ken Liu (Arm Technology China) via TF-M:
> Hi Thomas,
>
> I have a question about IAR compiler since we verify default GNUARM and ARMCLANG in the existing sources.
> If we are trying to implementing some internal version of libc APIs like 'memcmp', would IAR link with this implemented version first, or it just report a link error of duplicated symbol? Any switches do we need to assign to support this?
>
> Thanks.
>
> /Ken
--
*Thomas Törnblom*, /Product Engineer/
IAR Systems AB
Box 23051, Strandbodgatan 1
SE-750 23 Uppsala, SWEDEN
Mobile: +46 76 180 17 80 Fax: +46 18 16 78 01
E-mail: thomas.tornblom(a)iar.com <mailto:thomas.tornblom@iar.com>
Website: www.iar.com <http://www.iar.com>
Twitter: www.twitter.com/iarsystems <http://www.twitter.com/iarsystems>
Hi Thomas,
I have a question about IAR compiler since we verify default GNUARM and ARMCLANG in the existing sources.
If we are trying to implementing some internal version of libc APIs like 'memcmp', would IAR link with this implemented version first, or it just report a link error of duplicated symbol? Any switches do we need to assign to support this?
Thanks.
/Ken
Hi Gyorgy,
Thanks to point it out. I agree with you that it will be better if we can align these two projects in this. I had a quick check the branches from TF-A: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/.
There are three branches in TF-A:
- "integration" branch, should be used for new features.
- "master" branch, which is behind of "integration" branch. But I am nor sure what is the strategy to update it.
- "topics/epic_beta0_spmd", I thinks it should like a feature branch for big feature.
@Soby Mathew Could you help to share more information about it? Thanks very much.
Hi David W,
Thanks for your comments.
For your first comment, I will say yes. Sorry to give the CI problem as a reason.
For your second comment, I think we can use " git merge <commit-id>" to merge up to a special commit of dev to the master branch. In this, we do not need to freeze the patch merging. Maybe other methods to do it. Sorry, I am not a git expert, please correct me if it is wrong.
I agree with you that we need to think clearly about it.
Thanks,
Edison
-----Original Message-----
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of Gyorgy Szing via TF-M
Sent: Wednesday, December 11, 2019 3:58 PM
To: David Wang (Arm Technology China) <David.Wang(a)arm.com>; tf-m(a)lists.trustedfirmware.org
Cc: nd <nd(a)arm.com>
Subject: Re: [TF-M] Create another branch for feature development
Hi,
Please sync up with the TF-A team on branching strategy. It would be preferred to keep the two projects aligned if possible.
/George
-----Original Message-----
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of David Wang (Arm Technology China) via TF-M
Sent: 11 December 2019 07:59
To: tf-m(a)lists.trustedfirmware.org
Cc: nd <nd(a)arm.com>
Subject: Re: [TF-M] Create another branch for feature development
Hi Edison,
It sounds reasonable to evolve the branch management in TF-M because we get more and more contributions in the community. Thanks for raising that.
A few comments:
>> * Reduce the risk to broke the master branch directly especial when the CI cannot work rightly.
This reason of creating dev branch seems like a workaround as CI is not stable.
>> * We can use the "master" branch only for release, and in this, we do not need to freeze the patch merging when preparing the release.
If we don’t have the feature branches you proposed, then the problem seems to be the same. It's because dev branch is acting as the master branch and the release(master) branch get "git fast-forward" to a point of dev branch when doing the release. Then we still can't stop merging the unnecessary patches in the release unless we do manual rebase which is not what we wanted.
For feature branches, I think it's a good idea but we need to make a process/policy about how/when to create the branches, who maintain the branches and the timing of merging this feature. This could align with the roadmap and release plan, e.g. next release will include a few features/bugfixes which are in corresponding branches.
Just share my thoughts.
Regards,
David Wang
Arm Electronic Technology (Shanghai) Co., Ltd
Phone: +86-21-6154 9142 (ext. 59142)
-----Original Message-----
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of Edison Ai (Arm Technology China) via TF-M
Sent: Wednesday, December 11, 2019 2:16 PM
To: Kevin Peng (Arm Technology China) <Kevin.Peng(a)arm.com>; 'tf-m(a)lists.trustedfirmware.org' <tf-m(a)lists.trustedfirmware.org>
Cc: nd <nd(a)arm.com>
Subject: Re: [TF-M] Create another branch for feature development
Hi Kevin,
Yes, you are right. The main point does not break a stable branch, it could be the "master" branch or "release" branch. Your suggest is good for it will not conflict with our current patches(upstream to the master branch). But the users may be more like to fetch code from the master branch for a stable version. We can discuss more about it.
For this, I think we should discuss if it is necessary to create another branch for release or the stable version firstly.
And for "are we already using feature branches such as feature-twincpu?":
Yes, you are right again. But current, only several branches are created for huge features. What I mean it that we should not to merge patch to "master" or "release" branch directly. Or we just merge little change patches to master branch. For others, we can create a dedicated feature branch. For example, PSA FF alignment or even a bug fix.
Thanks,
Edison
-----Original Message-----
From: Kevin Peng (Arm Technology China) <Kevin.Peng(a)arm.com>
Sent: Wednesday, December 11, 2019 1:43 PM
To: Edison Ai (Arm Technology China) <Edison.Ai(a)arm.com>; 'tf-m(a)lists.trustedfirmware.org' <tf-m(a)lists.trustedfirmware.org>
Cc: nd <nd(a)arm.com>
Subject: RE: Create another branch for feature development
Hi Edison,
In your proposal, the new "develop" branch seems to be the current "master" branch and the "master" branch becomes kind of release branch if I'm understand correctly.
So why not create a "release" branch instead.
And are we already using feature branches such as feature-twincpu?
Best Regards,
Kevin
-----Original Message-----
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of Edison Ai (Arm Technology China) via TF-M
Sent: Wednesday, December 11, 2019 11:24 AM
To: tf-m(a)lists.trustedfirmware.org
Cc: nd <nd(a)arm.com>
Subject: [TF-M] Create another branch for feature development
Hi all,
I have a proposal to create a "develop"(or something like this) branch in TF-M for our feature development. The reasons for this are:
* Reduce the risk to broke the master branch directly especial when the CI cannot work rightly.
* We can use the "master" branch only for release, and in this, we do not need to freeze the patch merging when preparing the release.
More addition, we can create more branches for big features development, such as "develop/feature_a" or "develop/feature_b". All these new features branch need to be merged to the "develop" branch first and then release to the "master" branch.
This is different from the current patch upstream mode, and it needs to spend more time maintaining those branches. But I think it is more convenient for us to develop different features. We do not need to spend more time to fix the conflicts and to do rebase when other patches merge to master branch during patch reviewing.
Welcome to comment on this.
Thanks,
Edison
--
TF-M mailing list
TF-M(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-m
--
TF-M mailing list
TF-M(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-m
--
TF-M mailing list
TF-M(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-m
--
TF-M mailing list
TF-M(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-m
Hi all,
I uploaded a hotfix to fix a issue in GNUARM linker script.
https://review.trustedfirmware.org/c/trusted-firmware-m/+/2767
The XXX_ATTR_FN label is named as XXX_LD_ATTR_FN for Application RoT Secure Partitions in GNUARM linker script. Thus GNUARM cannot get the dedicated section address to place the XXX_ATTR_FN section defined in the source code.
It may cause linking error and crash during running.
Please help review the patch. Any comment is welcome and will speed up the fix.
Thank you.
Best regards,
Hu Ziji