Skip to content

Commit

Permalink
support/qemu-guest: Workaround for TCG/x86 and Unikraft paging
Browse files Browse the repository at this point in the history
Limits QEMU PC machine model up to version 7.0 (pc-i440fx-7.0) for
x86. This is primarily done to keep Unikraft compatibility with TCG.

GitHub-Issue: #1040
Signed-off-by: Simon Kuenzer <simon@unikraft.io>
  • Loading branch information
skuenzer committed Aug 14, 2023
1 parent 750096a commit 45e0cee
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion support/scripts/qemu-guest
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,17 @@ case "$ARG_MACHINETYPE" in
"x86pc")
QEMU_BIN=${QEMU_BIN:-"$( which qemu-system-x86_64 )"}

# WORKAROUND: Unikraft currently only supports QEMUs PC model until 7.0
# See: https://github.com/unikraft/unikraft/issues/1040
"${QEMU_BIN}" -M \? | grep -qe '^pc-i440fx-7\.0[[:space:]]\?'
if [ $? -eq 0 ]; then
QEMU_X86MACH="pc-i440fx-7.0"
else
QEMU_X86MACH="pc"
fi

QEMU_BASE_ARGS+=("-machine")
QEMU_BASE_ARGS+=("pc,accel=${QEMU_ACCEL}")
QEMU_BASE_ARGS+=("${QEMU_X86MACH},accel=${QEMU_ACCEL}")

if [ $OPT_HWACCEL -eq 0 ]; then
QEMU_BASE_ARGS+=("-cpu")
Expand Down

0 comments on commit 45e0cee

Please sign in to comment.