qemu: set default cpu model for x86_64 explicitly

With the update to sel4 and the gcc 12, assembly instructions are generated
and used, like POPCNT. The instruction is available on our native hardware,
but not emulated by the default cpu model necessarily, which leads to
undefined opcode exceptions (Qemu 4.2.1 && seL4). Additionally, the features
of the default Qemu cpu model may vary between Qemu releases and makes it
harder to correlate effects.
This commit is contained in:
Alexander Boettcher 2023-06-02 09:05:50 +02:00 committed by Norman Feske
parent e0dc544aa5
commit ceaa02230e
3 changed files with 8 additions and 3 deletions

View File

@ -1,2 +1,3 @@
-machine q35
-cpu Nehalem-v2
-net nic,model=e1000,netdev=net0 -netdev user,id=net0

View File

@ -24,9 +24,6 @@ QEMU_OPT += -no-kvm
# use time-tested graphics backend
QEMU_OPT += -display sdl
# use machine model that supports nested virtualization
QEMU_OPT(nova) += -cpu core2duo
# add kernel-specific Qemu arguments
QEMU_OPT += $(QEMU_OPT(${KERNEL}))

View File

@ -150,6 +150,13 @@ proc run_power_on { } {
if {[regexp -- {-netdev\s+user,id=(\w+)} $qemu_args dummy netdev]} {
regsub -all "\\-netdev\\s+user,id=$netdev\\S*" $board_qemu_args "" board_qemu_args }
##
# If -cpu is specified by qemu_args, remove -cpu from board_qemu_args to
# support overwriting it, e.g. used for virtualization scenarios
#
if {[regexp -- {-cpu\s+} $qemu_args dummy]} {
regsub -all {\-cpu\s+\S*} $board_qemu_args "" board_qemu_args }
# append custom board-specific qemu_args
append qemu_args " $board_qemu_args"