I cherry-picked the commit into my build area and confirmed that it behaves properly.
Alan
> On Jul 29, 2019, at 7:57 PM, DeMars, Alan via TF-M <tf-m(a)lists.trustedfirmware.org> wrote:
>
> Looks fine to me!
>
> On Jul 29, 2019, at 7:19 PM, Summer Qin (Arm Technology China) <Summer.Qin(a)arm.com<mailto:Summer.Qin@arm.com>> wrote:
>
> Hi,
>
> The related patch is pushed into https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1669/
> Please help to review if you have time.
>
> Thanks,
> Summer
> ________________________________
> From: DeMars, Alan <ademars(a)ti.com<mailto:ademars@ti.com>>
> Sent: Tuesday, July 30, 2019 6:45 AM
> To: Summer Qin (Arm Technology China) <Summer.Qin(a)arm.com<mailto:Summer.Qin@arm.com>>
> Cc: tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org> <tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org>>; nd <nd(a)arm.com<mailto:nd@arm.com>>
> Subject: RE: [TF-M] [EXTERNAL] [Maniphest] [Closed] T435: PSA APIs alignment
>
>
> It would be good to get this fix into master ASAP so master doesn’t remain broken for long.
>
>
>
> Alan
>
>
>
> From: Summer Qin (Arm Technology China) [mailto:Summer.Qin@arm.com]
> Sent: Sunday, July 28, 2019 11:18 PM
> To: DeMars, Alan
> Cc: tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org>; nd
> Subject: Re: [TF-M] [EXTERNAL] [Maniphest] [Closed] T435: PSA APIs alignment
>
>
>
> Hi Alan,
>
>
>
> Yeah, I see your proposed changes in the email.
>
> We will make the corrections under my task T435.
>
>
>
>
>
> Thanks,
>
> Summer
>
>
>
> ________________________________
>
> From: DeMars, Alan <ademars(a)ti.com<mailto:ademars@ti.com>>
> Sent: Monday, July 29, 2019 11:30 AM
> To: Summer Qin (Arm Technology China) <Summer.Qin(a)arm.com<mailto:Summer.Qin@arm.com>>
> Cc: tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org> <tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org>>; nd <nd(a)arm.com<mailto:nd@arm.com>>
> Subject: Re: [TF-M] [EXTERNAL] [Maniphest] [Closed] T435: PSA APIs alignment
>
>
>
> Summer,
>
> The email I sent with the attachment was bounced back so I sent another one afterwards that detailed the changes I had to make. I’d rather someone on your team make the corrections to make sure they’re sufficient.
>
> Alan
>
>> On Jul 28, 2019, at 7:41 PM, Summer Qin (Arm Technology China) <Summer.Qin(a)arm.com<mailto:Summer.Qin@arm.com>> wrote:
>>
>> Hi Alan,
>>
>> Thanks for pointing out this issue.
>>
>> The patch related to PSA APIs alignment task is the first patch to align the PSA APIs, we will have some following patches to update.
>> In your last email, I didn't see the attachment, maybe blocked by the system. If it is convenient for you, could you push your patch to https://review.trustedfirmware.org , or you can create one ticket in https://developer.trustedfirmware.org and upload your changes as attachment in the new created task. Attached the change under my task T435 is also OK. We can help to submit the changes for you.
>>
>>
>> Thanks,
>> Summer
>>
>> On 7/28/19, 4:39 PM, "TF-M on behalf of DeMars, Alan via TF-M" <tf-m-bounces(a)lists.trustedfirmware.org<mailto:tf-m-bounces@lists.trustedfirmware.org> on behalf of tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org>> wrote:
>>
>> I found several other code points in tfm_svcalls.c that need to be enhanced to handle 'type' >= PSA_IPC_CALL.
>>
>> Attached is my modified tfm_svcalls.c file. With these modifications, the 'type' argument makes its way through the system without causing tfm_panic() to be invoked.
>>
>> Alan
>>
>> -----Original Message-----
>> From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf Of DeMars, Alan via TF-M
>> Sent: Friday, July 26, 2019 2:28 PM
>> To: Ken Liu (Arm Technology China)
>> Cc: tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org>
>> Subject: Re: [TF-M] [EXTERNAL] [Maniphest] [Closed] T435: PSA APIs alignment
>>
>> In order to pass along the new ‘type’ argument in psa_call, it seems that this line in tfm_svcalls.c:
>>
>> msg = tfm_spm_create_msg(service, handle, PSA_IPC_CALL, ns_caller, invecs,
>> in_num, outvecs, out_num, outptr);
>>
>> Should be:
>>
>> msg = tfm_spm_create_msg(service, handle, type, ns_caller, invecs,
>> in_num, outvecs, out_num, outptr);
>>
>> Otherwise the receiving SP will always see msg.type == PSA_IPC_CALL.
>>
>> Alan
>>
>> From: Summer-ARM (Summer Qin) [mailto:noreply@developer.trustedfirmware.org]
>> Sent: Thursday, July 25, 2019 7:14 PM
>> To: DeMars, Alan
>> Subject: [EXTERNAL] [Maniphest] [Closed] T435: PSA APIs alignment
>>
>> Summer-ARM closed this task as "Resolved".
>>
>>
>> TASK DETAIL
>> https://developer.trustedfirmware.org/T435
>>
>> EMAIL PREFERENCES
>> https://developer.trustedfirmware.org/settings/panel/emailpreferences/
>>
>> To: Summer-ARM
>> Cc: edison-ai, matetothpal, adeaarm, wmnt, ashutoshksingh, KenLSoft, Summer-ARM, akiannillo, ademars, zhengwang721, BabaYB, karl-zh, shebuk, zbh, qixiang, DarshpreetSabharwal, jamesking1, mmorenobarm, abhishek-pandit
>> --
>> TF-M mailing list
>> TF-M(a)lists.trustedfirmware.org<mailto:TF-M@lists.trustedfirmware.org>
>> https://lists.trustedfirmware.org/mailman/listinfo/tf-m
>> --
>> TF-M mailing list
>> TF-M(a)lists.trustedfirmware.org<mailto:TF-M@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 Alan,
The interface call from ' tfm_core_init() ' to 'tfm_spm_hal_set_secure_irq_priority()' is planned to be left there as it is now. If a certain platform implementation doesn't allow interrupt priorities to be set, it can leave the implementation of 'tfm_spm_hal_set_secure_irq_priority()' function empty.
Regards,
Mate
-----Original Message-----
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of DeMars, Alan via TF-M
Sent: 30 July 2019 01:10
To: Adrian Shaw <Adrian.Shaw(a)arm.com>
Cc: tf-m(a)lists.trustedfirmware.org
Subject: Re: [TF-M] including platform specific interrupt definitions
Adrian,
Yes, I noticed this.
I guess that means that the handler name will be derived from the 'source' string. Sadly, it appears that the CMSIS convention for naming IRQ numbers is 'PeripheralX_IRQn'. Given your handler naming convention, that means that the handler names I have to put in my platform's vector table must be 'PeripheralX_IRQn_Handler'. I prefer 'PeripheralX_Handler' myself and that is what I've telegraphed to our development team.
I'm thinking we will honor the PSA FF convention that if ONLY the 'source' attribute is provided for an IRQ, your name mangling rule will be followed for generating the ISR function name.
Additionally, we will modify the template such that if a custom attribute of 'handler_name' (or some such) is ALSO provided, we will use our own name mangling rules for generating the ISR function name so that we are free to populate the vector table with whatever function names we want.
Similarly, it appears that support for the 'tfm_irq_priority' attribute will be a platform-specific extension. Does this mean that the logic currently in tfm_core_init() that calls tfm_spm_hal_set_secure_irq_priority() for each interrupt will be removed from the standard code base?
Alan
-----Original Message-----
From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf Of Adrian Shaw via TF-M
Sent: Monday, July 29, 2019 7:49 AM
To: TF-M(a)lists.trustedfirmware.org
Cc: nd
Subject: [EXTERNAL] Re: [TF-M] including platform specific interrupt definitions
Just as a heads up for future consideration. In the final version of the PSA-FF spec we replaced the `line_num` and `line_name` attributes with a new single attribute called “source”. You can use numbers or string identifiers with it (see change log in Appendix E of PSA-FF 1.0.0).
Best,
Adrian
> On 29 Jul 2019, at 15:37, Mate Toth-Pal via TF-M <tf-m(a)lists.trustedfirmware.org> wrote:
>
> Hi Alan,
>
> When I created the templates, I was thinking that it is a good idea to have the '_Handler' postfix on the privileged interrupt handler names in both cases (e.g. 'line_num' or 'line_name' is provided.). This would keep the names aligned to the current pattern applied in the existing platform implementations.
>
> If I understand your proposal correctly, that means, in case a 'line_name' is provided in the partition manifest, there would be two different entities in the code, which are referred by the same name:
> - The IRQ handler function
> - A macro which is substituted to the number of that IRQ line
>
> I'm not completely sure that it will not happen that the header file containing the macro gets included in a file that defines or declares the function which would break the privileged handler declaration or definition. Although I didn't check this situation occurs in the current implementation.
>
> Is my understanding correct? Is there a benefit of this proposal that I missed?
>
> Thanks,
> Mate
>
> -----Original Message-----
> From: DeMars, Alan <ademars(a)ti.com>
> Sent: 22 July 2019 17:23
> To: tf-m(a)lists.trustedfirmware.org; Mate Toth-Pal
> <Mate.Toth-Pal(a)arm.com>
> Subject: RE: including platform specific interrupt definitions
>
> After pulling in all the latest commits, I have the following suggestion regarding the use of the 'irqs' manifest properties:
>
> 1) Use the 'line_num' property unchanged within the 'tfm_core_irq_signals[]' structure array and as the third argument to tfm_irq_handler(). This is consistent with the PSA FF definition for this property: "line_num: A valid IRQ number for the platform"
>
> 2) When/if it is provided, use the 'line_name' property UNCHANGED as the name of the privileged IRQ handler functions. This is consistent with the PSA FF definition for this property: "line_name: A named IRQ, represented by a string identifier. The string identifier references an external definition, which is resolved in an IMPLEMENTATION DEFINED manner. This is helpful for implementations that do not wish to duplicate information already provided by an existing platform abstraction layer. The string identifiers are not defined in this specification and, as a result, are not portable"
>
> 3) Only if the 'line_name' property is NOT provided, derive the privileged IRQ handler function name by appending '_Handler' to the 'line_num' property.
>
> I achieved the above functionality by simply changing this logic in 'tfm_secure_irq_handlers_ipc.inc.template':
>
> {% if handler.line_num %}
> void irq_{{handler.line_num}}_Handler(void)
> {% elif handler.line_name %} void
> {{handler.line_name}}_Handler(void)
>
> To this:
>
> {% if handler.line_name %}
> void {{handler.line_name}}(void)
> {% elif handler.line_num %} void
> {{handler.line_num}}_Handler(void)
>
> Alan
>
> -----Original Message-----
> From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf
> Of DeMars, Alan via TF-M
> Sent: Friday, July 19, 2019 1:36 PM
> To: Mate Toth-Pal
> Cc: tf-m(a)lists.trustedfirmware.org
> Subject: [EXTERNAL] Re: [TF-M] including platform specific interrupt
> definitions
>
> Mate,
>
> Thank you for your response. I discovered not long after I posted my inquiry that recent merges to master should resolve the problem I'm having. I'm in the process of pulling in those commits locally.
>
> Thanks again,
>
> Alan
>
> -----Original Message-----
> From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf
> Of Mate Toth-Pal via TF-M
> Sent: Friday, July 19, 2019 1:22 PM
> To: TF-M(a)lists.trustedfirmware.org
> Cc: nd
> Subject: [EXTERNAL] Re: [TF-M] including platform specific interrupt
> definitions
>
> Hi Alan,
>
> I'm not sure on what version of TF-M is your base. This part of TF-M changed recently.
>
> https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1354/
> This change introduced the generated manifest header files. For each partition a header file is generated, which contains the signals for the partition. Both IRQ signals, and normal signals in case of IPC mode.
>
> Up to the following change all the signals (except for IRQ) had to be defined manually in a header file tfm_spm_signal_defs.h.
> This replaces the manually created IPC model signal definitions to the generated signals:
> https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1356/
>
> This does the same to the IRQ signals (up until this change, IRQ signals had to be defined in tfm_irq_signal_defs.h):
> https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1589/
>
> This, and the related changes remove the manually created signal files.
> https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1382/
>
> So depending on your base you either need to manually define the signals, or should have it automatically once the generator script is run.
>
> As a general advice I would suggest to look at the IRQ signal 'SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ' which is the IRQ signal for one of the test services, and see where it appears and compare it to yours.
>
> Also if you could publish some of your code in the gerrit, we might be able help to find out what is the problem.
>
> Regards,
> Mate
>
>
> -----Original Message-----
> From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of
> DeMars, Alan via TF-M
> Sent: 19 July 2019 18:35
> To: tf-m(a)lists.trustedfirmware.org
> Subject: [TF-M] including platform specific interrupt definitions
>
> I'm trying to add s secure interrupt to my secure partition manifest but am getting a compile error because there are no definitions of my secure interrupt IRQ name and SIGNAL name.
>
> What is the mechanism for including a platform-specific header that defines platform specific interrupts when compiling "secure_fw/core/ipc/tfm_svcalls.c"?
>
> Alan
> --
> 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
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
--
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 Alan,
Currently there are no plans to deprecate the 'tfm_irq_priority' optional attribute.
Regards,
Mate
-----Original Message-----
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of Ken Liu (Arm Technology China) via TF-M
Sent: 25 July 2019 04:44
To: DeMars, Alan <ademars(a)ti.com>; tf-m(a)lists.trustedfirmware.org
Cc: nd <nd(a)arm.com>
Subject: Re: [TF-M] [EXTERNAL] RE: PSA API prototype update
Hi Alan,
These attributes should be already included in 'test/test_services/tfm_irq_test_service_1' of latest master, you can check the sources.
The alignment is a big task and the patch mentioned in this mail thread is the first one of prototype change. The whole FF 1.0.0 alignment (behaviors change e.g.) would come step by step later on.
And the interrupt priority -- let me check with interrupt designers to know more details. Current from my point of view it is platform defined setting which is out of FF scope.
Thanks.
-Ken
> -----Original Message-----
> From: DeMars, Alan <ademars(a)ti.com>
> Sent: Thursday, July 25, 2019 9:53 AM
> To: Ken Liu (Arm Technology China) <Ken.Liu(a)arm.com>
> Cc: tf-m(a)lists.trustedfirmware.org; nd <nd(a)arm.com>
> Subject: Re: [EXTERNAL] RE: PSA API prototype update
>
> Ken,
>
> Will support for the new “source” attribute in “irqs” be included in
> this API alignment? If not, when might it be supported? Also, is the “irqs” “priority”
> attribute being deprecated?
>
> Alan
>
> > On Jul 24, 2019, at 6:12 PM, Ken Liu (Arm Technology China)
> <Ken.Liu(a)arm.com> wrote:
> >
> > Hi Alan,
> >
> > Should by this weekend or early next week, depends on if there are
> > new
> comments.
> >
> > Thanks.
> >
> > -Ken
> >
> >> -----Original Message-----
> >> From: DeMars, Alan <ademars(a)ti.com>
> >> Sent: Wednesday, July 24, 2019 11:17 PM
> >> To: Ken Liu (Arm Technology China) <Ken.Liu(a)arm.com>
> >> Cc: tf-m(a)lists.trustedfirmware.org
> >> Subject: RE: PSA API prototype update
> >>
> >> When do you anticipate that this patch will be merged to master?
> >>
> >> -----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, July 23, 2019 11:17 PM
> >> To: tf-m(a)lists.trustedfirmware.org
> >> Cc: nd
> >> Subject: [EXTERNAL] [TF-M] PSA API prototype update
> >>
> >> Hi,
> >>
> >> A patch is pushed for couple of days reveals the update on PSA API
> >> prototype and its related caller change:
> >> https://review.trustedfirmware.org/c/trusted-firmware-m/+/1572
> >>
> >> The most obvious part is a new parameter member 'type' is
> >> introduced in 'psa_call'. This is the first step of our upgrading
> >> to the latest PSA Firmware Framework Specification. The API
> >> internal behavior would come step by step later and now we can call PSA FF API in 1.0.0 prototypes.
> >>
> >> The callers included in TF-M has been updated in this patch.
> >> Developers who developed extra services should mention this change
> >> and update PSA API related sources.
> >> Any feedback please comment under the patch, or reply to this mail thread.
> >>
> >> Thanks.
> >>
> >> -Ken
> >> --
> >> 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 Alan,
Yes, this should happen as part of the FF 1.0.0 alignment effort.
Regards,
Mate
-----Original Message-----
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of DeMars, Alan via TF-M
Sent: 25 July 2019 23:59
To: tf-m(a)lists.trustedfirmware.org
Subject: [TF-M] Uniform Secure Service Signature
With the introduction of the 'type' argument in psa_call(), will the 'Uniform Secure Service Signature' also be updated to include 'type' as its first argument?
https://developer.trustedfirmware.org/w/tf_m/design/uniform_secure_service_…
Alan
--
TF-M mailing list
TF-M(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-m
Hi Alan,
Thanks for pointing out this issue.
The patch related to PSA APIs alignment task is the first patch to align the PSA APIs, we will have some following patches to update.
In your last email, I didn't see the attachment, maybe blocked by the system. If it is convenient for you, could you push your patch to https://review.trustedfirmware.org , or you can create one ticket in https://developer.trustedfirmware.org and upload your changes as attachment in the new created task. Attached the change under my task T435 is also OK. We can help to submit the changes for you.
Thanks,
Summer
On 7/28/19, 4:39 PM, "TF-M on behalf of DeMars, Alan via TF-M" <tf-m-bounces(a)lists.trustedfirmware.org on behalf of tf-m(a)lists.trustedfirmware.org> wrote:
I found several other code points in tfm_svcalls.c that need to be enhanced to handle 'type' >= PSA_IPC_CALL.
Attached is my modified tfm_svcalls.c file. With these modifications, the 'type' argument makes its way through the system without causing tfm_panic() to be invoked.
Alan
-----Original Message-----
From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf Of DeMars, Alan via TF-M
Sent: Friday, July 26, 2019 2:28 PM
To: Ken Liu (Arm Technology China)
Cc: tf-m(a)lists.trustedfirmware.org
Subject: Re: [TF-M] [EXTERNAL] [Maniphest] [Closed] T435: PSA APIs alignment
In order to pass along the new ‘type’ argument in psa_call, it seems that this line in tfm_svcalls.c:
msg = tfm_spm_create_msg(service, handle, PSA_IPC_CALL, ns_caller, invecs,
in_num, outvecs, out_num, outptr);
Should be:
msg = tfm_spm_create_msg(service, handle, type, ns_caller, invecs,
in_num, outvecs, out_num, outptr);
Otherwise the receiving SP will always see msg.type == PSA_IPC_CALL.
Alan
From: Summer-ARM (Summer Qin) [mailto:noreply@developer.trustedfirmware.org]
Sent: Thursday, July 25, 2019 7:14 PM
To: DeMars, Alan
Subject: [EXTERNAL] [Maniphest] [Closed] T435: PSA APIs alignment
Summer-ARM closed this task as "Resolved".
TASK DETAIL
https://developer.trustedfirmware.org/T435
EMAIL PREFERENCES
https://developer.trustedfirmware.org/settings/panel/emailpreferences/
To: Summer-ARM
Cc: edison-ai, matetothpal, adeaarm, wmnt, ashutoshksingh, KenLSoft, Summer-ARM, akiannillo, ademars, zhengwang721, BabaYB, karl-zh, shebuk, zbh, qixiang, DarshpreetSabharwal, jamesking1, mmorenobarm, abhishek-pandit
--
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
Adrian,
Yes, I noticed this.
I guess that means that the handler name will be derived from the 'source' string. Sadly, it appears that the CMSIS convention for naming IRQ numbers is 'PeripheralX_IRQn'. Given your handler naming convention, that means that the handler names I have to put in my platform's vector table must be 'PeripheralX_IRQn_Handler'. I prefer 'PeripheralX_Handler' myself and that is what I've telegraphed to our development team.
I'm thinking we will honor the PSA FF convention that if ONLY the 'source' attribute is provided for an IRQ, your name mangling rule will be followed for generating the ISR function name.
Additionally, we will modify the template such that if a custom attribute of 'handler_name' (or some such) is ALSO provided, we will use our own name mangling rules for generating the ISR function name so that we are free to populate the vector table with whatever function names we want.
Similarly, it appears that support for the 'tfm_irq_priority' attribute will be a platform-specific extension. Does this mean that the logic currently in tfm_core_init() that calls tfm_spm_hal_set_secure_irq_priority() for each interrupt will be removed from the standard code base?
Alan
-----Original Message-----
From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf Of Adrian Shaw via TF-M
Sent: Monday, July 29, 2019 7:49 AM
To: TF-M(a)lists.trustedfirmware.org
Cc: nd
Subject: [EXTERNAL] Re: [TF-M] including platform specific interrupt definitions
Just as a heads up for future consideration. In the final version of the PSA-FF spec we replaced the `line_num` and `line_name` attributes with a new single attribute called “source”. You can use numbers or string identifiers with it (see change log in Appendix E of PSA-FF 1.0.0).
Best,
Adrian
> On 29 Jul 2019, at 15:37, Mate Toth-Pal via TF-M <tf-m(a)lists.trustedfirmware.org> wrote:
>
> Hi Alan,
>
> When I created the templates, I was thinking that it is a good idea to have the '_Handler' postfix on the privileged interrupt handler names in both cases (e.g. 'line_num' or 'line_name' is provided.). This would keep the names aligned to the current pattern applied in the existing platform implementations.
>
> If I understand your proposal correctly, that means, in case a 'line_name' is provided in the partition manifest, there would be two different entities in the code, which are referred by the same name:
> - The IRQ handler function
> - A macro which is substituted to the number of that IRQ line
>
> I'm not completely sure that it will not happen that the header file containing the macro gets included in a file that defines or declares the function which would break the privileged handler declaration or definition. Although I didn't check this situation occurs in the current implementation.
>
> Is my understanding correct? Is there a benefit of this proposal that I missed?
>
> Thanks,
> Mate
>
> -----Original Message-----
> From: DeMars, Alan <ademars(a)ti.com>
> Sent: 22 July 2019 17:23
> To: tf-m(a)lists.trustedfirmware.org; Mate Toth-Pal <Mate.Toth-Pal(a)arm.com>
> Subject: RE: including platform specific interrupt definitions
>
> After pulling in all the latest commits, I have the following suggestion regarding the use of the 'irqs' manifest properties:
>
> 1) Use the 'line_num' property unchanged within the 'tfm_core_irq_signals[]' structure array and as the third argument to tfm_irq_handler(). This is consistent with the PSA FF definition for this property: "line_num: A valid IRQ number for the platform"
>
> 2) When/if it is provided, use the 'line_name' property UNCHANGED as the name of the privileged IRQ handler functions. This is consistent with the PSA FF definition for this property: "line_name: A named IRQ, represented by a string identifier. The string identifier references an external definition, which is resolved in an IMPLEMENTATION DEFINED manner. This is helpful for implementations that do not wish to duplicate information already provided by an existing platform abstraction layer. The string identifiers are not defined in this specification and, as a result, are not portable"
>
> 3) Only if the 'line_name' property is NOT provided, derive the privileged IRQ handler function name by appending '_Handler' to the 'line_num' property.
>
> I achieved the above functionality by simply changing this logic in 'tfm_secure_irq_handlers_ipc.inc.template':
>
> {% if handler.line_num %}
> void irq_{{handler.line_num}}_Handler(void)
> {% elif handler.line_name %} void {{handler.line_name}}_Handler(void)
>
> To this:
>
> {% if handler.line_name %}
> void {{handler.line_name}}(void)
> {% elif handler.line_num %}
> void {{handler.line_num}}_Handler(void)
>
> Alan
>
> -----Original Message-----
> From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf Of DeMars, Alan via TF-M
> Sent: Friday, July 19, 2019 1:36 PM
> To: Mate Toth-Pal
> Cc: tf-m(a)lists.trustedfirmware.org
> Subject: [EXTERNAL] Re: [TF-M] including platform specific interrupt definitions
>
> Mate,
>
> Thank you for your response. I discovered not long after I posted my inquiry that recent merges to master should resolve the problem I'm having. I'm in the process of pulling in those commits locally.
>
> Thanks again,
>
> Alan
>
> -----Original Message-----
> From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf Of Mate Toth-Pal via TF-M
> Sent: Friday, July 19, 2019 1:22 PM
> To: TF-M(a)lists.trustedfirmware.org
> Cc: nd
> Subject: [EXTERNAL] Re: [TF-M] including platform specific interrupt definitions
>
> Hi Alan,
>
> I'm not sure on what version of TF-M is your base. This part of TF-M changed recently.
>
> https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1354/
> This change introduced the generated manifest header files. For each partition a header file is generated, which contains the signals for the partition. Both IRQ signals, and normal signals in case of IPC mode.
>
> Up to the following change all the signals (except for IRQ) had to be defined manually in a header file tfm_spm_signal_defs.h.
> This replaces the manually created IPC model signal definitions to the generated signals:
> https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1356/
>
> This does the same to the IRQ signals (up until this change, IRQ signals had to be defined in tfm_irq_signal_defs.h):
> https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1589/
>
> This, and the related changes remove the manually created signal files.
> https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1382/
>
> So depending on your base you either need to manually define the signals, or should have it automatically once the generator script is run.
>
> As a general advice I would suggest to look at the IRQ signal 'SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ' which is the IRQ signal for one of the test services, and see where it appears and compare it to yours.
>
> Also if you could publish some of your code in the gerrit, we might be able help to find out what is the problem.
>
> Regards,
> Mate
>
>
> -----Original Message-----
> From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of DeMars, Alan via TF-M
> Sent: 19 July 2019 18:35
> To: tf-m(a)lists.trustedfirmware.org
> Subject: [TF-M] including platform specific interrupt definitions
>
> I'm trying to add s secure interrupt to my secure partition manifest but am getting a compile error because there are no definitions of my secure interrupt IRQ name and SIGNAL name.
>
> What is the mechanism for including a platform-specific header that defines platform specific interrupts when compiling "secure_fw/core/ipc/tfm_svcalls.c"?
>
> Alan
> --
> 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
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
--
TF-M mailing list
TF-M(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-m
Just as a heads up for future consideration. In the final version of the PSA-FF spec we replaced the `line_num` and `line_name` attributes with a new single attribute called “source”. You can use numbers or string identifiers with it (see change log in Appendix E of PSA-FF 1.0.0).
Best,
Adrian
> On 29 Jul 2019, at 15:37, Mate Toth-Pal via TF-M <tf-m(a)lists.trustedfirmware.org> wrote:
>
> Hi Alan,
>
> When I created the templates, I was thinking that it is a good idea to have the '_Handler' postfix on the privileged interrupt handler names in both cases (e.g. 'line_num' or 'line_name' is provided.). This would keep the names aligned to the current pattern applied in the existing platform implementations.
>
> If I understand your proposal correctly, that means, in case a 'line_name' is provided in the partition manifest, there would be two different entities in the code, which are referred by the same name:
> - The IRQ handler function
> - A macro which is substituted to the number of that IRQ line
>
> I'm not completely sure that it will not happen that the header file containing the macro gets included in a file that defines or declares the function which would break the privileged handler declaration or definition. Although I didn't check this situation occurs in the current implementation.
>
> Is my understanding correct? Is there a benefit of this proposal that I missed?
>
> Thanks,
> Mate
>
> -----Original Message-----
> From: DeMars, Alan <ademars(a)ti.com>
> Sent: 22 July 2019 17:23
> To: tf-m(a)lists.trustedfirmware.org; Mate Toth-Pal <Mate.Toth-Pal(a)arm.com>
> Subject: RE: including platform specific interrupt definitions
>
> After pulling in all the latest commits, I have the following suggestion regarding the use of the 'irqs' manifest properties:
>
> 1) Use the 'line_num' property unchanged within the 'tfm_core_irq_signals[]' structure array and as the third argument to tfm_irq_handler(). This is consistent with the PSA FF definition for this property: "line_num: A valid IRQ number for the platform"
>
> 2) When/if it is provided, use the 'line_name' property UNCHANGED as the name of the privileged IRQ handler functions. This is consistent with the PSA FF definition for this property: "line_name: A named IRQ, represented by a string identifier. The string identifier references an external definition, which is resolved in an IMPLEMENTATION DEFINED manner. This is helpful for implementations that do not wish to duplicate information already provided by an existing platform abstraction layer. The string identifiers are not defined in this specification and, as a result, are not portable"
>
> 3) Only if the 'line_name' property is NOT provided, derive the privileged IRQ handler function name by appending '_Handler' to the 'line_num' property.
>
> I achieved the above functionality by simply changing this logic in 'tfm_secure_irq_handlers_ipc.inc.template':
>
> {% if handler.line_num %}
> void irq_{{handler.line_num}}_Handler(void)
> {% elif handler.line_name %} void {{handler.line_name}}_Handler(void)
>
> To this:
>
> {% if handler.line_name %}
> void {{handler.line_name}}(void)
> {% elif handler.line_num %}
> void {{handler.line_num}}_Handler(void)
>
> Alan
>
> -----Original Message-----
> From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf Of DeMars, Alan via TF-M
> Sent: Friday, July 19, 2019 1:36 PM
> To: Mate Toth-Pal
> Cc: tf-m(a)lists.trustedfirmware.org
> Subject: [EXTERNAL] Re: [TF-M] including platform specific interrupt definitions
>
> Mate,
>
> Thank you for your response. I discovered not long after I posted my inquiry that recent merges to master should resolve the problem I'm having. I'm in the process of pulling in those commits locally.
>
> Thanks again,
>
> Alan
>
> -----Original Message-----
> From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf Of Mate Toth-Pal via TF-M
> Sent: Friday, July 19, 2019 1:22 PM
> To: TF-M(a)lists.trustedfirmware.org
> Cc: nd
> Subject: [EXTERNAL] Re: [TF-M] including platform specific interrupt definitions
>
> Hi Alan,
>
> I'm not sure on what version of TF-M is your base. This part of TF-M changed recently.
>
> https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1354/
> This change introduced the generated manifest header files. For each partition a header file is generated, which contains the signals for the partition. Both IRQ signals, and normal signals in case of IPC mode.
>
> Up to the following change all the signals (except for IRQ) had to be defined manually in a header file tfm_spm_signal_defs.h.
> This replaces the manually created IPC model signal definitions to the generated signals:
> https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1356/
>
> This does the same to the IRQ signals (up until this change, IRQ signals had to be defined in tfm_irq_signal_defs.h):
> https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1589/
>
> This, and the related changes remove the manually created signal files.
> https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1382/
>
> So depending on your base you either need to manually define the signals, or should have it automatically once the generator script is run.
>
> As a general advice I would suggest to look at the IRQ signal 'SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ' which is the IRQ signal for one of the test services, and see where it appears and compare it to yours.
>
> Also if you could publish some of your code in the gerrit, we might be able help to find out what is the problem.
>
> Regards,
> Mate
>
>
> -----Original Message-----
> From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of DeMars, Alan via TF-M
> Sent: 19 July 2019 18:35
> To: tf-m(a)lists.trustedfirmware.org
> Subject: [TF-M] including platform specific interrupt definitions
>
> I'm trying to add s secure interrupt to my secure partition manifest but am getting a compile error because there are no definitions of my secure interrupt IRQ name and SIGNAL name.
>
> What is the mechanism for including a platform-specific header that defines platform specific interrupts when compiling "secure_fw/core/ipc/tfm_svcalls.c"?
>
> Alan
> --
> 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
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
After pulling in all the latest commits, I have the following suggestion regarding the use of the 'irqs' manifest properties:
1) Use the 'line_num' property unchanged within the 'tfm_core_irq_signals[]' structure array and as the third argument to tfm_irq_handler(). This is consistent with the PSA FF definition for this property: "line_num: A valid IRQ number for the platform"
2) When/if it is provided, use the 'line_name' property UNCHANGED as the name of the privileged IRQ handler functions. This is consistent with the PSA FF definition for this property: "line_name: A named IRQ, represented by a string identifier. The string identifier references an external definition, which is resolved in an IMPLEMENTATION DEFINED manner. This is helpful for implementations that do not wish to duplicate information already provided by an existing platform abstraction layer. The string identifiers are not defined in this specification and, as a result, are not portable"
3) Only if the 'line_name' property is NOT provided, derive the privileged IRQ handler function name by appending '_Handler' to the 'line_num' property.
I achieved the above functionality by simply changing this logic in 'tfm_secure_irq_handlers_ipc.inc.template':
{% if handler.line_num %}
void irq_{{handler.line_num}}_Handler(void)
{% elif handler.line_name %}
void {{handler.line_name}}_Handler(void)
To this:
{% if handler.line_name %}
void {{handler.line_name}}(void)
{% elif handler.line_num %}
void {{handler.line_num}}_Handler(void)
Alan
-----Original Message-----
From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf Of DeMars, Alan via TF-M
Sent: Friday, July 19, 2019 1:36 PM
To: Mate Toth-Pal
Cc: tf-m(a)lists.trustedfirmware.org
Subject: [EXTERNAL] Re: [TF-M] including platform specific interrupt definitions
Mate,
Thank you for your response. I discovered not long after I posted my inquiry that recent merges to master should resolve the problem I'm having. I'm in the process of pulling in those commits locally.
Thanks again,
Alan
-----Original Message-----
From: TF-M [mailto:tf-m-bounces@lists.trustedfirmware.org] On Behalf Of Mate Toth-Pal via TF-M
Sent: Friday, July 19, 2019 1:22 PM
To: TF-M(a)lists.trustedfirmware.org
Cc: nd
Subject: [EXTERNAL] Re: [TF-M] including platform specific interrupt definitions
Hi Alan,
I'm not sure on what version of TF-M is your base. This part of TF-M changed recently.
https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1354/
This change introduced the generated manifest header files. For each partition a header file is generated, which contains the signals for the partition. Both IRQ signals, and normal signals in case of IPC mode.
Up to the following change all the signals (except for IRQ) had to be defined manually in a header file tfm_spm_signal_defs.h.
This replaces the manually created IPC model signal definitions to the generated signals:
https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1356/
This does the same to the IRQ signals (up until this change, IRQ signals had to be defined in tfm_irq_signal_defs.h):
https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1589/
This, and the related changes remove the manually created signal files.
https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/1382/
So depending on your base you either need to manually define the signals, or should have it automatically once the generator script is run.
As a general advice I would suggest to look at the IRQ signal 'SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ' which is the IRQ signal for one of the test services, and see where it appears and compare it to yours.
Also if you could publish some of your code in the gerrit, we might be able help to find out what is the problem.
Regards,
Mate
-----Original Message-----
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of DeMars, Alan via TF-M
Sent: 19 July 2019 18:35
To: tf-m(a)lists.trustedfirmware.org
Subject: [TF-M] including platform specific interrupt definitions
I'm trying to add s secure interrupt to my secure partition manifest but am getting a compile error because there are no definitions of my secure interrupt IRQ name and SIGNAL name.
What is the mechanism for including a platform-specific header that defines platform specific interrupts when compiling "secure_fw/core/ipc/tfm_svcalls.c"?
Alan
--
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'm going to merge the multi-core topology improvement patches on feature-twincpu branch on Thursday.
Could you please help review the following patches from https://review.trustedfirmware.org/c/trusted-firmware-m/+/1542 to https://review.trustedfirmware.org/c/trusted-firmware-m/+/1603/2?
Please let me know if there is any issue or improper modification to single Armv8-M scenario. I'd like to fix conflict as much as possible before merging feature-twincpu back to master branch, which may bring a lot of inconvenience to master branch development.
Thank you.
Best regards,
Hu Ziji
-----Original Message-----
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of David Hu (Arm Technology China) via TF-M
Sent: Monday, July 22, 2019 6:57 PM
To: tf-m(a)lists.trustedfirmware.org
Cc: Hao Chuan Chu <charley.chu(a)cypress.com>; nd <nd(a)arm.com>; Andrei Narkevitch <Andrei.Narkevitch(a)cypress.com>; Alamy Liu <Alamy.Liu(a)cypress.com>
Subject: [TF-M] Please review multi-core TF-M topology improvement patches
Sorry. Switch into plain text and correct the bad format. Something was wrong with the Outlook.
Hi all,
Could you please take a look at the following patches to improve topology implementation on `feature-twincpu` branch?
https://review.trustedfirmware.org/c/trusted-firmware-m/+/1542 ~ https://review.trustedfirmware.org/c/trusted-firmware-m/+/1549 and https://review.trustedfirmware.org/c/trusted-firmware-m/+/1603/
As you know, we are bringing up TF-M on multi-core topology platform. Currently, preprocessor directives TFM_MULTI_CORE_TOPOLOGY are used to comment/uncomment the functionalities here and there to fit different scenarios. It can work but makes code difficult to be understood or maintained, in both single Armv8-M and multi-core topologies.
The above patches try to eliminate multi-core directives from common sequence and functions shared by single Armv8-M and multi-core topologies. It is expected to not only improve the code readability, but also protect one topology from being affected by changes to another.
Although those changes are for twincpu feature branch, I'd like to ask for review and comment since they also impact the single Armv8-M scenario. Merging feature-twincpu branch back to master would be more smooth if we can figure out and fix issues now on `feature-twincpu`.
I'd like to summarize the common basic ideas of the topology implementation.
1. If single Armv8-M and multi-core topology both call the same API but require different implementations
a. If that API can be classified to a specific functionality/module, separate the implementations into topology exclusive files.
Take https://review.trustedfirmware.org/c/trusted-firmware-m/+/1542 as an example. Add multi-core specific NS Client ID implementations in tfm_multi_core.c. Thus multi-core topology doesn't rely on the single Armv8-M implementations in tfm_nspm.c.
Then all the multi-core directives can be removed from tfm_nspm.c and tfm_nspm.c can be clearly excluded from multi-core topology build.
b. If that API don't belong to a specific functionality/module, extract it out and organize the implementations in topology abstraction file.
For example, in https://review.trustedfirmware.org/c/trusted-firmware-m/+/1545, tfm_core_topology_set_pendsv_priority() is defined to wrap the PendSV settings in diverse topologies. The implementations are selected according to current topology in tfm_core_topology.h.
It help maintain a more clear and uniform sequence by removing multi-core directives from tfm_core.c.
2. In common sequence, if an API is called in single Armv8-M but not used in multi-core topology, add an empty function for this API in multi-core topology in the header file and vice versa.
For example, secure core in multi-core topology doesn't need to configure_ns_code().
As show in https://review.trustedfirmware.org/c/trusted-firmware-m/+/1543, instead of placing several multi-core directives in tfm_core.c, move configure_ns_code() implementation to tfm_nspm.c and define an empty function in header file tfm_nspm.h in multi-core topology for configure_ns_code().
Any comment or suggestion is welcome. Please kindly let me know if the above changes may cause troubles in single Armv8-M scenario.
Thank you.
Best regards,
Hu Ziji
--
TF-M mailing list
TF-M(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/tf-m
Hi Alan,
Can you share us your usage details? This could help us on defining the svc number things you mentioned.
Thanks.
-Ken
> -----Original Message-----
> From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of DeMars,
> Alan via TF-M
> Sent: Friday, July 26, 2019 6:59 AM
> To: tf-m(a)lists.trustedfirmware.org
> Subject: [TF-M] Adding a platform specific tfm_svc_number_t
>
> I need to define platform specific SPM APIs that will be invoked by our SPs.
>
> Is there a convention for 'cleanly' adding platform specific SVC enumerations to
> the tfm_svc_number_t typedef in tfm_svc.h as well as platform specific 'case's
> to SVCHandler_main() and/or SVC_Handler_IPC()?
>
> Alan
>
>
> --
> TF-M mailing list
> TF-M(a)lists.trustedfirmware.org
> https://lists.trustedfirmware.org/mailman/listinfo/tf-m