From c5f182b493e5b07b65fcc549de285ee4d4f2b3df Mon Sep 17 00:00:00 2001 From: Andy Bui Date: Tue, 25 Jun 2024 23:28:45 +1000 Subject: [PATCH] simulation: properly setup SMP on qemu We always use the EL2 qemu implementation, this allows the elfloader to boot secondary cores using SMC (the only method it supports). Note this is fine even if CONFIG_ARM_HYPERVISOR_SUPPORT is not set as the elfloader will drop from EL2 to EL1 before entering the seL4 kernel. We also set the -smp flag to KernelMaxNumNodes, to launch the necessary CPUs. Signed-off-by: Andy Bui --- cmake-tool/helpers/simulation.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake-tool/helpers/simulation.cmake b/cmake-tool/helpers/simulation.cmake index cf38b557..2cfb5cb6 100644 --- a/cmake-tool/helpers/simulation.cmake +++ b/cmake-tool/helpers/simulation.cmake @@ -144,14 +144,19 @@ function(GenerateSimulateScript) set(qemu_sim_extra_args "-bios none") elseif(KernelPlatformQEMUArmVirt) set(QemuBinaryMachine "qemu-system-${QEMU_ARCH}") - if(KernelArmHypervisorSupport) + if(Kernel32) set(sim_machine "virt,virtualization=on,highmem=off,secure=off") else() - set(sim_machine "virt") + set(sim_machine "virt,virtualization=on,highmem=on,secure=off") endif() set(sim_graphic_opt "-nographic") set(sim_cpu "${KernelArmCPU}") SetDefaultMemSize("${QEMU_MEMORY}") + if(KernelMaxNumNodes) + set(qemu_sim_extra_args "-smp ${KernelMaxNumNodes}") + else() + set(qemu_sim_extra_args "-smp 1") + endif() elseif(KernelPlatformQEMURiscVVirt) set(QemuBinaryMachine "qemu-system-${KernelSel4Arch}") set(sim_machine "virt")