hello.
I have ported corestone1000 plaform to tfm and am trying to use mhu to send and receive messages between secure enclave (SPE)core and host core(NSPE). (I want to use it for future encryption requests).
Looking at the rss platform and corstone-1000 tfm code, the function for initializing and registering the mhu seems to be tfm_inter_core_comm_init.
But I can't find the part that calls tfm_inter_core_comm_init.
Can anyone tell me the procedure and a simple example of sending and receiving messages using MHU in a TFM environment? I've been looking through the TFM documentation, but I can't find it yet.
Below is the tfm_inter_core_comm_init function to register the rpc of the spe in rss.
I was wondering where the function below is called and used.
int32_t tfm_inter_core_comm_init(void) { int int32_t ret;
/* Register RPC callbacks */ ret = tfm_rpc_register_ops(&rpc_ops); if (ret != TFM_RPC_SUCCESS) { return ret; }
/* Platform specific initialization */ ret = tfm_multi_core_hal_init(); if (ret != TFM_PLAT_ERR_SUCCESS) { tfm_rpc_unregister_ops(); return ret; }
} return TFM_RPC_SUCCESS; }
You are a newbie to TFM and are looking for help.
That function is called by ns_agent_mailbox, from ns_agent_mailbox_entry in secure_fw/partitions/ns_agent_mailbox/ns_agent_mailbox.c
Chris
-----Original Message----- From: 진국 박 via TF-M tf-m@lists.trustedfirmware.org Sent: Friday, November 17, 2023 4:29 AM To: tf-m@lists.trustedfirmware.org Subject: [TF-M] How can use Mailbox in TF-M on Dual-core System ?
Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safehttps://intranet-content.infineon.com/explore/aboutinfineon/rules/informationsecurity/ug/SocialEngineering/Pages/SocialEngineeringElements_en.aspx.
hello.
I have ported corestone1000 plaform to tfm and am trying to use mhu to send and receive messages between secure enclave (SPE)core and host core(NSPE). (I want to use it for future encryption requests).
Looking at the rss platform and corstone-1000 tfm code, the function for initializing and registering the mhu seems to be tfm_inter_core_comm_init.
But I can't find the part that calls tfm_inter_core_comm_init.
Can anyone tell me the procedure and a simple example of sending and receiving messages using MHU in a TFM environment? I've been looking through the TFM documentation, but I can't find it yet.
Below is the tfm_inter_core_comm_init function to register the rpc of the spe in rss.
I was wondering where the function below is called and used.
int32_t tfm_inter_core_comm_init(void) { int int32_t ret;
/* Register RPC callbacks */ ret = tfm_rpc_register_ops(&rpc_ops); if (ret != TFM_RPC_SUCCESS) { return ret; }
/* Platform specific initialization */ ret = tfm_multi_core_hal_init(); if (ret != TFM_PLAT_ERR_SUCCESS) { tfm_rpc_unregister_ops(); return ret; }
} return TFM_RPC_SUCCESS; }
You are a newbie to TFM and are looking for help. -- TF-M mailing list -- tf-m@lists.trustedfirmware.org To unsubscribe send an email to tf-m-leave@lists.trustedfirmware.org
Thanks for the reply.
I'll try to explain it in more detail.
I checked that the auto-generated load_info_ns_agent_mailobx.c contains the struct partition_tfm_ns_mailbox_agent_load_info_t tfm_ns_mailbox_agent_load and the corresponding struct ns_agent_mailbox_entry.
We also checked that the tfm_s binary image contains tfm_ns_mailbox_agent_load.
However, when I debug tfm_s using trace32, I can't find the point where ns_agent_mailbox_entry is called.
I'm wondering if there is a TFM component I'm missing or something I can refer to.
__attribute__((used, section(".part_load_priority_low"))) = { .load_info = { .psa_ff_ver = 0x0101 | PARTITION_INFO_MAGIC, .pid = TFM_NS_MAILBOX_AGENT, .flags = 0 | PARTITION_MODEL_IPC | PARTITION_MODEL_PSA_ROT | PARTITION_NS_AGENT_MB | PARTITION_PRI_LOW, .entry = ENTRY_TO_POSITION(ns_agent_mailbox_entry), .stack_size = 0x800, .heap_size = 0, .ndeps = TFM_NS_MAILBOX_AGENT_NDEPS, .nservices = TFM_NS_MAILBOX_AGENT_NSERVS, .nassets = TFM_NS_MAILBOX_AGENT_NASSETS, .nirqs = TFM_NS_MAILBOX_AGENT_NIRQS, }, .stack_addr = (uintptr_t)tfm_ns_mailbox_agent_stack, .heap_addr = 0, #if TFM_LVL == 3 .assets = { { .mem.start = (uintptr_t)®ION_NAME(Image$$, PT_TFM_NS_MAILBOX_AGENT_PRIVATE, _DATA_START$$Base), .mem.limit = (uintptr_t)®ION_NAME(Image$$, PT_TFM_NS_MAILBOX_AGENT_PRIVATE, _DATA_END$$Base), .attr = ASSET_ATTR_READ_WRITE, }, }, #else #endif .irqs = { { .init = mailbox_irq_init, .flih_func = 0, .pid = TFM_NS_MAILBOX_AGENT, .source = MAILBOX_IRQ, .signal = MAILBOX_SIGNAL, }, }, };
ns_agent_mailbox_entry is the entry of ns agent mailbox partition. It is assigned to the entry of the corresponding thread at https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/secure_fw/s.... When the ns agent mailbox thread starts, this function is called.
Regards, Sherry Zhang
-----Original Message----- From: 진국 박 via TF-M tf-m@lists.trustedfirmware.org Sent: Monday, November 20, 2023 10:24 AM To: tf-m@lists.trustedfirmware.org Subject: [TF-M] Re: How can use Mailbox in TF-M on Dual-core System ?
Thanks for the reply.
I'll try to explain it in more detail.
I checked that the auto-generated load_info_ns_agent_mailobx.c contains the struct partition_tfm_ns_mailbox_agent_load_info_t tfm_ns_mailbox_agent_load and the corresponding struct ns_agent_mailbox_entry.
We also checked that the tfm_s binary image contains tfm_ns_mailbox_agent_load.
However, when I debug tfm_s using trace32, I can't find the point where ns_agent_mailbox_entry is called.
I'm wondering if there is a TFM component I'm missing or something I can refer to.
__attribute__((used, section(".part_load_priority_low"))) = { .load_info = { .psa_ff_ver = 0x0101 | PARTITION_INFO_MAGIC, .pid = TFM_NS_MAILBOX_AGENT, .flags = 0 | PARTITION_MODEL_IPC | PARTITION_MODEL_PSA_ROT | PARTITION_NS_AGENT_MB | PARTITION_PRI_LOW, .entry = ENTRY_TO_POSITION(ns_agent_mailbox_entry), .stack_size = 0x800, .heap_size = 0, .ndeps = TFM_NS_MAILBOX_AGENT_NDEPS, .nservices = TFM_NS_MAILBOX_AGENT_NSERVS, .nassets = TFM_NS_MAILBOX_AGENT_NASSETS, .nirqs = TFM_NS_MAILBOX_AGENT_NIRQS, }, .stack_addr = (uintptr_t)tfm_ns_mailbox_agent_stack, .heap_addr = 0, #if TFM_LVL == 3 .assets = { { .mem.start = (uintptr_t)®ION_NAME(Image$$, PT_TFM_NS_MAILBOX_AGENT_PRIVATE, _DATA_START$$Base), .mem.limit = (uintptr_t)®ION_NAME(Image$$, PT_TFM_NS_MAILBOX_AGENT_PRIVATE, _DATA_END$$Base), .attr = ASSET_ATTR_READ_WRITE, }, }, #else #endif .irqs = { { .init = mailbox_irq_init, .flih_func = 0, .pid = TFM_NS_MAILBOX_AGENT, .source = MAILBOX_IRQ, .signal = MAILBOX_SIGNAL, }, }, }; -- TF-M mailing list -- tf-m@lists.trustedfirmware.org To unsubscribe send an email to tf-m-leave@lists.trustedfirmware.org
tf-m@lists.trustedfirmware.org