This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 84faf3dac0b arm64/smp: skip PSCI CPU_ON when running as TrustZone 
secure OS
84faf3dac0b is described below

commit 84faf3dac0b93e390fb92b9074a7aafc1f5ee6d2
Author: hujun5 <[email protected]>
AuthorDate: Wed May 6 19:46:08 2026 +0800

    arm64/smp: skip PSCI CPU_ON when running as TrustZone secure OS
    
    When CONFIG_ARCH_TRUSTZONE_SECURE is enabled NuttX boots in the secure
    world (EL1-S), and secondary cores are released by the higher EL
    firmware (e.g. TF-A BL31). Issuing psci_cpu_on() from the secure side
    is unnecessary and bounces at EL3.
    
    Guard the PSCI-based secondary CPU startup path (and the now-unused
    cpu_mpid local) with !CONFIG_ARCH_TRUSTZONE_SECURE so the secure-OS
    build skips it.
    
    Signed-off-by: hujun5 <[email protected]>
---
 arch/arm64/src/common/arm64_cpustart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/src/common/arm64_cpustart.c 
b/arch/arm64/src/common/arm64_cpustart.c
index a262c4b0f1e..64ac503a4f9 100644
--- a/arch/arm64/src/common/arm64_cpustart.c
+++ b/arch/arm64/src/common/arm64_cpustart.c
@@ -135,7 +135,7 @@ static void arm64_smp_init_top(void)
 
 static void arm64_start_cpu(int cpu_num)
 {
-#ifdef CONFIG_ARM64_PSCI
+#if defined(CONFIG_ARM64_PSCI) && !defined(CONFIG_ARCH_TRUSTZONE_SECURE)
   uint64_t cpu_mpid = arm64_get_mpid(cpu_num);
 #endif
 
@@ -146,7 +146,7 @@ static void arm64_start_cpu(int cpu_num)
   sched_note_cpu_start(this_task(), cpu_num);
 #endif
 
-#ifdef CONFIG_ARM64_PSCI
+#if defined(CONFIG_ARM64_PSCI) && !defined(CONFIG_ARCH_TRUSTZONE_SECURE)
   if (psci_cpu_on(cpu_mpid, (uint64_t)__start))
     {
       serr("Failed to boot secondary CPU core %d (MPID:%#lx)\n", cpu_num,

Reply via email to