]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
support/qemu-guest: Workaround for TCG/x86 and Unikraft paging
authorSimon Kuenzer <simon@unikraft.io>
Fri, 11 Aug 2023 21:32:22 +0000 (23:32 +0200)
committerUnikraft <monkey@unikraft.io>
Wed, 16 Aug 2023 16:17:46 +0000 (16:17 +0000)
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>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #1041

support/scripts/qemu-guest

index f7d89920c676957436070b6cab446fdf36a94ba3..1d6ff9b4265b4dc424891f7819d11cdc542d30b0 100755 (executable)
@@ -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")