Hi Bohdan,

 

It is required to protect shared mailbox resource when multiple slots are enabled. IIUC, it is rare that NS bare metal environment can provide such protection mechanisms.

Therefore, only a single mailbox queue slot is allowed by default in NS bare metal environment.

Besides, PSA Client API are blocking until they are completed. IMO, it won’t bring much benefit to enable multiple mailbox slots in bare metal environment.

 

Best regards,

Hu Ziji

 

From: Bohdan.Hunko--- via TF-M <tf-m@lists.trustedfirmware.org>
Sent: Friday, December 16, 2022 11:30 PM
To: tf-m@lists.trustedfirmware.org
Subject: [TF-M] Multi slot queue in bare metal NSPE

 

Hi all,

 

TFM in current implementation has following condition in tfm_ns_mailbox.h

#if !defined(TFM_MULTI_CORE_NS_OS) && (NUM_MAILBOX_QUEUE_SLOT > 1)

#error "NUM_MAILBOX_QUEUE_SLOT should be set to 1 for NS bare metal environment"

#endif

 

I was wondering whether this is real restriction or this check can be removed.

I am not mailbox expert so please correct me if I am wrong.

Quick look at the code shows that it should be ok to have multi slot queue in bare metal environment, with the note that only one slot will be used (as there is only one thread).

If my understanding is correct then it would be nice to remove this compile time check (I am happy to provide a patch for it).

 

We need this change because we deliver TFM as prebuilt binary and interface (one installed after the build). This binary is built with NUM_MAILBOX_QUEUE_SLOT = 4, so in current implementation it cant be used in bare metal environment.

 

 

Regards,

Bohdan Hunko

 

Cypress Semiconductor Ukraine

Engineer

CSUKR CSS ICW SW FW

Mobile: +38099 50 19 714
Bohdan.Hunko@infineon.com