Skip to content

Kernel panic when running qemu/vfio-user-v0.9 with -cpu host option #7

@karlatec

Description

@karlatec

Guest OS freezes or kernel panics when Qemu is run with -cpu host option.

qemu built with:

vfio-user-v0.9

commit 29e3142d6c23adb327c9752a4dd988b24c33d24b (HEAD -> vfio-user-v0.9, origin/vfio-user-v0.9)
Author: John Johnson <[email protected]>
Date:   Sun Jun 6 22:51:22 2021 -0700

    remove MAPPABLE flag
    change max_msg to max_xfer
    threading is hard - fix discon race


./configure --target-list="x86_64-softmmu" --enable-kvm --enable-linux-aio --enable-numa && make -j100

Qemu command line:

taskset -a -c 1-2 /home/klateck/work/qemu-vfiouser/build/qemu-system-x86_64 \
-m 1024 \
--enable-kvm \
-cpu host \
-smp 2 \
-vga std \
-vnc :100 -daemonize \
-object memory-backend-file,id=mem,size=1024M,mem-path=/dev/hugepages,share=on,prealloc=yes,host-nodes=0,policy=bind \
-snapshot -monitor telnet:127.0.0.1:10002,server,nowait \
-numa node,memdev=mem \
-pidfile /home/klateck/vhost_test/vms/0/qemu.pid \
-serial file:/home/klateck/vhost_test/vms/0/serial.log \
-D /home/klateck/vhost_test/vms/0/qemu.log \
-chardev file,path=/home/klateck/vhost_test/vms/0/seabios.log,id=seabios \
-device isa-debugcon,iobase=0x402,chardev=seabios \
-net user,hostfwd=tcp::10000-:22,hostfwd=tcp::10001-:8765 \
-net nic \
-drive file=/home/sys_sgci/spdk_dependencies/spdk_test_image.qcow2,if=none,id=os_disk \
-device ide-hd,drive=os_disk,bootindex=0

This results in either a guest OS kernel panic:
kp1.txt
kp2.txt

Or a freeze when booting guest OS:
freeze1.txt
which seems to produce a dmesg error on host at the same time:

[1960842.564891] kvm [4075811]: vcpu0, guest rIP: 0xffffffffaf06b064 disabled perfctr wrmsr: 0xc0010007 data 0xffff

Host OS info:
Fedora 32 5.8.15-201.fc32.x86_64
gcc version 10.2.1 20201125 (Red Hat 10.2.1-9) (GCC)

Guest OS info:
Fedora 32 vhost32-cloud-12806 5.6.6-300.fc32.x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions