I did some of my own benchmarking with IPC backend (medium profile) and either SFN or IPC frontends. Cycle counts measured using DWT counter. I was expecting SFN frontend to be faster, but it’s actually slightly slower than IPC frontend at least with our platform. Is this expected from the TFM code perspective?
SFN frontend: PSA API benchmarks in cycles: psa_framework_version() call time = 340 BENCH_SP psa_version() call time = 429 BENCH_SP psa_connect() call time = 2884 BENCH_SP psa_call() set TS: call time to = 2470, from = 1155, rt = 3625 BENCH_SP psa_call() NULL 0 invecs: call time to = 1819, from = 1161, rt = 2980 BENCH_SP psa_call() NULL 1 invecs: call time to = 2025, from = 1152, rt = 3177 BENCH_SP psa_call() NULL 2 invecs: call time to = 2153, from = 1152, rt = 3305 BENCH_SP psa_call() NULL 3 invecs: call time to = 2313, from = 1155, rt = 3468
IPC frontend: PSA API benchmarks in cycles: psa_framework_version() call time = 339 BENCH_SP psa_version() call time = 433 BENCH_SP psa_connect() call time = 2866 BENCH_SP psa_call() set TS: call time to = 2458, from = 1147, rt = 3605 BENCH_SP psa_call() NULL 0 invecs: call time to = 1777, from = 1146, rt = 2923 BENCH_SP psa_call() NULL 1 invecs: call time to = 1974, from = 1146, rt = 3120 BENCH_SP psa_call() NULL 2 invecs: call time to = 2109, from = 1133, rt = 3242 BENCH_SP psa_call() NULL 3 invecs: call time to = 2244, from = 1136, rt = 3380
rt = round trip
Regards, Brian
From: Quach, Brian via TF-M tf-m@lists.trustedfirmware.org Sent: Thursday, January 18, 2024 12:08 PM To: Shebu Varghese Kuriakose Shebu.VargheseKuriakose@arm.com; tf-m@lists.trustedfirmware.org Cc: nd nd@arm.com; Antonio De Angelis Antonio.DeAngelis@arm.com Subject: [EXTERNAL] [TF-M] Re: SFN vs IPC partition with IPC backend
Hi Shebu, Thanks for the info but I think you are referring to IPC vs SFN backend. IPC backend is needed for Isolation level > 1 as you said. I am using IPC backend. I’m wondering how using SFN vs IPC frontend with the IPC backend affects ZjQcmQRYFpfptBannerStart This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd Hi Shebu,
Thanks for the info but I think you are referring to IPC vs SFN backend. IPC backend is needed for Isolation level > 1 as you said. I am using IPC backend. I’m wondering how using SFN vs IPC frontend with the IPC backend affects performance & size. All the partitions in TFM are currently SFN frontend so none of the metrics cover IPC frontend.
Hi Antonio,
Thanks for the presentation but I think it only shows IPC vs SFN backends only.
Regards, Brian
From: Shebu Varghese Kuriakose <Shebu.VargheseKuriakose@arm.commailto:Shebu.VargheseKuriakose@arm.com> Sent: Thursday, January 18, 2024 7:50 AM To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org; Quach, Brian <brian@ti.commailto:brian@ti.com> Cc: nd <nd@arm.commailto:nd@arm.com>; Antonio De Angelis <Antonio.DeAngelis@arm.commailto:Antonio.DeAngelis@arm.com> Subject: [EXTERNAL] RE: SFN vs IPC partition with IPC backend
Hi Brian, The TF-M release notes capture the TF-M memory usage on one of the Arm reference platforms. Refer - https: //trustedfirmware-m. readthedocs. io/en/latest/releases/2. 0. 0. html It is probably worth comparing the flash and RAM usage of individual ZjQcmQRYFpfptBannerStart This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd Hi Brian,
The TF-M release notes capture the TF-M memory usage on one of the Arm reference platforms. Refer - https://trustedfirmware-m.readthedocs.io/en/latest/releases/2.0.0.htmlhttps://urldefense.com/v3/__https:/trustedfirmware-m.readthedocs.io/en/latest/releases/2.0.0.html__;!!G3vK!WdS1Ml94ptZFNlUAjfnBB4wjgRsaVH4F0psHmbhWAWi7qaLCGpqxpQtL8kmJTOlgvd8qhNW0YoQGZohpDg$
It is probably worth comparing the flash and RAM usage of individual components in ARoTless and Medium Profiles*. Both profile include almost identical services (except Protected Storage). However, ARoTless uses SFN Isolation level1 while medium profile uses IPC isolation level2. From my understanding, SFN which is function call based is supposedly more light weight in terms of performance and memory compared to the IPC mode. Due to limited security guarantees provided by SFN, it is recommended to be used only in isolation level1. You might already know all this.
The PSA FF-M API calls are more expensive when in IPC mode compared to SFN model. The squad dashboard here tracks the cycle count for the various FF-M PSA API calls for IPC and SFN for various isolation levels. https://qa-reports.linaro.org/tf/tf-m/metrics/?environment=CoreIPC&envir...https://urldefense.com/v3/__https:/qa-reports.linaro.org/tf/tf-m/metrics/?environment=CoreIPC&environment=Default&environment=CoreIPCTfmLevel2&environment=DefaultProfileM&environment=DefaultProfileS&metric=:summary__;!!G3vK!WdS1Ml94ptZFNlUAjfnBB4wjgRsaVH4F0psHmbhWAWi7qaLCGpqxpQtL8kmJTOlgvd8qhNW0YoRRnvTpIQ$:
The required build environment and API calls can be selected in the dashboard. I have selected a few for your reference - https://qa-reports.linaro.org/tf/tf-m/metrics/?environment=PERF-AN521-GCC-Le...https://urldefense.com/v3/__https:/qa-reports.linaro.org/tf/tf-m/metrics/?environment=PERF-AN521-GCC-Level1-SFN-Release&environment=PERF-AN521-GCC-Level1-IPC-Release&environment=PERF-AN521-GCC-Level2-IPC-Release&metric=:summary:&metric=ns_psa_call&metric=ns_psa_connect&metric=ns_psa_close&metric=ns_psa_call_stateless&metric=s_psa_call&range_ns_psa_connect=96,100__;!!G3vK!WdS1Ml94ptZFNlUAjfnBB4wjgRsaVH4F0psHmbhWAWi7qaLCGpqxpQtL8kmJTOlgvd8qhNW0YoT7CQggXA$
Regards, Shebu
* https://trustedfirmware-m.readthedocs.io/en/latest/configuration/profiles/tf...https://urldefense.com/v3/__https:/trustedfirmware-m.readthedocs.io/en/latest/configuration/profiles/tfm_profile_medium_arot-less.html__;!!G3vK!WdS1Ml94ptZFNlUAjfnBB4wjgRsaVH4F0psHmbhWAWi7qaLCGpqxpQtL8kmJTOlgvd8qhNW0YoQwsyYTAw$ https://trustedfirmware-m.readthedocs.io/en/latest/configuration/profiles/tf...https://urldefense.com/v3/__https:/trustedfirmware-m.readthedocs.io/en/latest/configuration/profiles/tfm_profile_medium.html__;!!G3vK!WdS1Ml94ptZFNlUAjfnBB4wjgRsaVH4F0psHmbhWAWi7qaLCGpqxpQtL8kmJTOlgvd8qhNW0YoS3fjp54g$
From: Antonio De Angelis via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Thursday, January 18, 2024 9:34 AM To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org; Quach, Brian <brian@ti.commailto:brian@ti.com> Subject: [TF-M] Re: SFN vs IPC partition with IPC backend
Hi Brian,
some numbers have been shared in this presentation from a while ago:
Microsoft PowerPoint - TF-M Performance Improvement in v1.5.0.pptx (trustedfirmware.org)https://urldefense.com/v3/__https:/www.trustedfirmware.org/docs/tf-m_forum_20211209-TF-M_Performance-Improvement-in-v1.5.0.pdf__;!!G3vK!WdS1Ml94ptZFNlUAjfnBB4wjgRsaVH4F0psHmbhWAWi7qaLCGpqxpQtL8kmJTOlgvd8qhNW0YoRBkS-bQw$
I believe there should be more updated numbers on more recent versions, but I don't seem to find them, maybe somebody else with more updated benchmarking can help here.
Thanks, Antonio ________________________________ From: Quach, Brian via TF-M <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Sent: Thursday, January 18, 2024 00:26 To: tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.orgmailto:tf-m@lists.trustedfirmware.org> Subject: [TF-M] SFN vs IPC partition with IPC backend
If using IPC backend, how much performance and/or memory savings is there when using SFN vs IPC partition model?
I saw FF-M v1.1 recommended SFN partition model but it was not clear to me why it was preferred.
Regards,
Brian Quach
SimpleLink MCU
Texas Instruments Inc.
12500 TI Blvd, MS F-4000
Dallas, TX 75243
214-479-4076