Feed Advanced Search

Jul 4 2019

ccli8 added a comment to T378: Allow NS secure call in interrupt-disabled context.

The WEAK mechanism sounds OK, but I think not just OS abtraction layer, the TFM NS interface (tfm_ns_lock_dispatch(...), tfm_ns_lock_init()) also needs to be WEAK. For the interrupt-disable scenario, the mutex-like reference implementation cannot apply, and the TFM NS interface may need to implement in a wholly different way.

Jul 4 2019, 10:01 AM · Trusted Firmware M

Jun 28 2019

ccli8 added a comment to T378: Allow NS secure call in interrupt-disabled context.

So the NS lock in TF-M is a reference implementation. Proprietary implementation may be needed to meet target platform. But per my mbed-os/tf-m port, mbed-os team follows the rule of importing TF-M and not making modification to such as this NS lock implementation for its maintenance. That's one of my dilemma. My biggest dilemma is still how to make secure call in interrupt-disabled context at NS side of mbed-os. The NS lock mechanism with mutex apparently collides with interrupt-disabled context.

Jun 28 2019, 9:56 AM · Trusted Firmware M
ccli8 added a comment to T378: Allow NS secure call in interrupt-disabled context.

One idea for heuristic. With NS secure call run-to-completion, it can run in interrupt-disabled context with mutex removed. For example, disable task switch during NS secure call period:

Jun 28 2019, 8:46 AM · Trusted Firmware M

Jun 11 2019

ccli8 added a comment to T376: Allow NS secure call at pre-rtos stage.

The secure partition init function cannot cover all use cases. The requirement of pre-rtos secure call actually comes from my mbed-os/tf-m port on Nuvoton's M2351 chip. For example, on mbed-os, the CMSIS API SystemCoreClockUpdate(...) is called to update SystemCoreClock in pre-rtos stage on NS side. On Nuvoton's M2351, SystemCoreClockUpdate(...)'s implementation needs to access CLK space registers which are hardwired to secure. That's where secure call in pre-rtos stage is necessary. I've also checked SystemCoreClockUpdate(...)'s implementation on Arm's Musca A1. It has SystemCoreClock fixed in macro, and so it needn't.

Jun 11 2019, 1:57 AM · Trusted Firmware M

Jun 10 2019

ccli8 added a comment to T376: Allow NS secure call at pre-rtos stage.

This call involves a Thread -> Handler mode request on every service call to check if we are in pre-RTOS stage. I think this will introduce a non-negligible penalty; in most of the cases, we expect this call to happen when the RTOS has been loaded.

Jun 10 2019, 12:38 PM · Trusted Firmware M
ccli8 added a comment to T376: Allow NS secure call at pre-rtos stage.

Upstream change 1231 to support secure call in pre-rtos stage in tfm_ns_lock_dispatch(...). I think some audience would benefit from it. Without it, I need to make an extra check for pre-rtos scenario before making a secure call.

Jun 10 2019, 9:08 AM · Trusted Firmware M
ccli8 added a comment to T376: Allow NS secure call at pre-rtos stage.

After dropping 1123, create another change which adds support for pre-retos dispatch in tfm_ns_lock_dispatch by checking kernel state with osKernelGetState, right?

Jun 10 2019, 2:44 AM · Trusted Firmware M

Jun 7 2019

ccli8 added a comment to T376: Allow NS secure call at pre-rtos stage.

1123 is for NS secure call at pre-rtos stage and 1124 for in interrupt-disabled condition. They are different and so separate changes. For 1123, since osKernelGetState can substitute for get_init_state. I have three choices:

  1. Abandon 1123 (and also get_init_state)
  2. Re-implement get_init_state with osKernelGetState
  3. Abandon 1123 (and also get_init_state) and integrate pre-rtos NS secure call into tfm_ns_lock_dispatch
Jun 7 2019, 2:19 AM · Trusted Firmware M

May 30 2019

ccli8 added a comment to T383: Core: Fix compile error on casting pointer type.

Toolchain: Arm Compiler 6.10
Platform: Nuvoton M2351 (M23-based)
mbed-os/tf-m

May 30 2019, 10:06 AM · Trusted Firmware M

May 29 2019

ccli8 created T378: Allow NS secure call in interrupt-disabled context.
May 29 2019, 9:49 AM · Trusted Firmware M
ccli8 created T376: Allow NS secure call at pre-rtos stage.
May 29 2019, 9:34 AM · Trusted Firmware M