2017-10-27 21:43:34 +08:00
|
|
|
set(EMU_PLATFORM qemu)
|
|
|
|
|
2017-12-07 17:20:03 +08:00
|
|
|
set(QEMU_binary_suffix x86_64)
|
|
|
|
|
2017-12-07 18:50:28 +08:00
|
|
|
# QEMU, in Jailhouse's case, is not emulating Zephyr's hardware
|
|
|
|
# directly, but the root cell/system, with a mount point reaching
|
|
|
|
# the kernel itself available
|
|
|
|
set(QEMU_KERNEL_OPTION ";")
|
|
|
|
|
2017-10-27 21:43:34 +08:00
|
|
|
if(NOT CONFIG_REBOOT)
|
|
|
|
set(REBOOT_FLAG -no-reboot)
|
|
|
|
endif()
|
|
|
|
|
2017-12-08 05:53:42 +08:00
|
|
|
if (NOT DEFINED JAILHOUSE_QEMU_IMG_FILE)
|
|
|
|
message(FATAL_ERROR "You have to provide a valid qcow2 QEMU image to be a Jailhouse root cell (variable JAILHOUSE_QEMU_IMG_FILE)!")
|
|
|
|
endif()
|
|
|
|
|
2017-10-27 21:43:34 +08:00
|
|
|
set(QEMU_CPU_TYPE_${ARCH} kvm64,-kvm_pv_eoi,-kvm_steal_time,-kvm_asyncpf,-kvmclock,+vmx,+x2apic,+arat)
|
|
|
|
set(QEMU_FLAGS_${ARCH}
|
|
|
|
-machine q35,kernel_irqchip=split
|
|
|
|
${REBOOT_FLAG}
|
|
|
|
-m 1G
|
|
|
|
-enable-kvm
|
|
|
|
-smp 4
|
|
|
|
-device intel-iommu,intremap=on,x-buggy-eim=on
|
|
|
|
-cpu ${QEMU_CPU_TYPE_${ARCH}}
|
|
|
|
-drive file=${JAILHOUSE_QEMU_IMG_FILE},format=qcow2,id=disk,if=none
|
|
|
|
-device ide-hd,drive=disk
|
2017-12-07 07:27:50 +08:00
|
|
|
-netdev user,id=net
|
2017-10-27 21:43:34 +08:00
|
|
|
-device e1000e,addr=2.0,netdev=net
|
|
|
|
-device intel-hda,addr=1b.0
|
|
|
|
-device hda-duplex
|
2017-12-07 07:27:50 +08:00
|
|
|
-fsdev local,path=./zephyr,security_model=passthrough,id=vfs
|
2017-10-27 21:43:34 +08:00
|
|
|
-device virtio-9p-pci,addr=1f.7,mount_tag=host,fsdev=vfs
|
|
|
|
)
|
|
|
|
|
|
|
|
# TODO: Support debug
|
2017-11-17 02:32:00 +08:00
|
|
|
# set(BOARD_DEBUG_RUNNER qemu)
|
2017-10-27 21:43:34 +08:00
|
|
|
# debugserver: QEMU_EXTRA_FLAGS += -s -S
|
|
|
|
# debugserver: qemu
|