SMP on QEMU is failing

Getting below error while enabling smp on Qemu

HVS not supported for PSCI
falied to boot cpu 0x1: 18446744073709551615
abort() called

command used: …/init-build.sh -DPLATFORM=qemu-arm-virt -DAARCH64=1 -DSMP=1 -DNUM_NODES=4 -DSIMULATION=TRUE

The error is indicating that the PSCI interface Qemu is providing to the elfloader is HVC based, but the elfloader doesn’t support this interface. (It only supports the SMC interface). seL4_tools/elfloader-tool/src/arch-arm/drivers/smp-psci.c at master · seL4/seL4_tools · GitHub

Qemu does provide an SMC based interface if the machine option virtualization is set to on. This causes the elfloader to loaded into EL2 and the PSCI interface is SMC based.

You can get the simulate script generated by the build to launch qemu with this option by adding -DKernelARMHypervisorSupport=ON to your init args. This will have the effect of building the kernel with hypervisor support enabled though and it will run in EL2.
Alternatively you can edit the qemu launch command to set virtualization=on and the elfloader has builtin support to switch down to EL1 and launch seL4 in EL1 once the CPU cores are started.

Thank you, I tried as you suggested now the mode is changed from HVC to SMC, verified via dts file, but failing as shown below

psci {
migrate = <0xc4000005>;
cpu_on = <0xc4000003>;
cpu_off = <0x84000002>;
cpu_suspend = <0xc4000001>;
method = “smc”;
compatible = “arm,psci-0.2\0arm,psci”;
};

$…/init-build.sh -DPLATFORM=qemu-arm-virt -DSIMULATION=true -DSMP=1 DKernelArmHypervisorSupport=ON

$ninja

$ ./simulate

./simulate: QEMU command: qemu-system-aarch64 -machine virt,virtualization=on,highmem=off,secure=off -cpu cortex-a53 -nographic -m size=2G -kernel images/sel4test-driver-image-arm-qemu-arm-virt
ELF-loader started on CPU: ARM Ltd. Cortex-A53 r0p4
paddr=[60a60000…60fa3137]
No DTB passed in from boot loader.
Looking for DTB in CPIO archive…found at 60be0040.
Loaded DTB from 60be0040.
paddr=[60250000…60251fff]
ELF-loading image ‘kernel’ to 60000000
paddr=[60000000…6024ffff]
vaddr=[8060000000…806024ffff]
virt_entry=8060000000
ELF-loading image ‘sel4test-driver’ to 60252000
paddr=[60252000…60668fff]
vaddr=[400000…816fff]
virt_entry=40e700
Boot cpu id = 0x0, index=0
Failed to bring up core 0x1 with error 18446744073709551614
Failed to boot cpu 0x1: 18446744073709551615
abort() called.