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

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

commit 37e853f1028412270875bde930f2ac3309f99cc4
Author: buxiasen <[email protected]>
AuthorDate: Fri Apr 25 18:00:22 2025 +0800

    arch/arm/qemu: copy mmu table from cpu0 when SMP
    
    As out current design, each cpu manage task mmu table by insert
    and erase like-behavior for arm32, have to per-cpu mmu-table when kernel
    build.
    
    Signed-off-by: buxiasen <[email protected]>
---
 arch/arm/src/qemu/qemu_boot.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/src/qemu/qemu_boot.c b/arch/arm/src/qemu/qemu_boot.c
index bab72cb119..4ba14140ff 100644
--- a/arch/arm/src/qemu/qemu_boot.c
+++ b/arch/arm/src/qemu/qemu_boot.c
@@ -136,6 +136,14 @@ int up_cpu_start(int cpu)
   sched_note_cpu_start(this_task(), cpu);
 #endif
 
+#ifdef CONFIG_ARCH_ADDRENV
+  /* Copy cpu0 page table to target cpu. */
+
+  memcpy((uint32_t *)(PGTABLE_BASE_VADDR + PGTABLE_SIZE * cpu),
+          (uint32_t *)PGTABLE_BASE_VADDR, PGTABLE_SIZE);
+  UP_DSB();
+#endif
+
   return psci_cpu_on(cpu, (uintptr_t)__start);
 }
 #endif

Reply via email to