Skip to content

Commit

Permalink
simulation: properly setup SMP on qemu
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Andy Bui committed Jun 25, 2024
1 parent f43fe93 commit 40d1c05
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake-tool/helpers/simulation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 40d1c05

Please sign in to comment.