Crashes of Windows 10 guest with QEMU/KVM

I have continuous crashes of WIndows 10 VM with QEMU/KVM. The Windows crashes are a known issue with VirtualBox on Linux hosts with recent kernels, cfr. https://www.virtualbox.org/ticket/20180 Herein, it was stated that the problem does not occur with QEMU/KVM, which was the reason why I tried QEMU/KVM (I always used VirtualBox in the past).
Sometimes Windows crashes only after one hour, sometimes there are already crashes during a fresh installation of Windows as VM with QEMU/KVM. I have tried previous images of Windows 10 made by VirtualBox (vdi images) and new installations with virt-manager, but the problem is the same.
The error messages (if any) are diverse. Sometimes it’s “KMODE EXCEPTION NOT HANDLED” (i.e. the error received when using VirtualBox, see ticket 20180 above), sometimes there other error messages, sometimes there’s just a black screen and reboot. In the Windows and QEMU logs I didn’t find anything useful until now. (E.g. the Windows logs tell that the “previous shutdown was unexpected” and report some warnings on a driver not loaded (dam) and some problems with the network adapter, but the network connection works fine.)
The QEMU logs just contain some warnings when booting the VM and then (after some time) a shutdown message:

2021-05-22T09:14:32.390837Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2021-05-22T09:14:32.390929Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2021-05-22T09:14:32.392806Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2021-05-22T09:14:32.392827Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2021-05-22T09:14:32.393873Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2021-05-22T09:14:32.393884Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2021-05-22T09:14:32.395292Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2021-05-22T09:14:32.395311Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2021-05-22T09:15:33.465021Z qemu-system-x86_64: terminating on signal 15 from pid 13252 (/usr/sbin/libvirtd)
2021-05-22 09:15:33.665+0000: shutting down, reason=destroyed

XML can be found on https://susepaste.org/17377049
QEMU log file can be found on https://susepaste.org/45775958

Operating System: openSUSE Leap 15.3
KDE Plasma Version: 5.18.6
KDE Frameworks Version: 5.76.0
Qt Version: 5.12.7
Kernel Version: 5.3.18-57-default
OS Type: 64-bit
Processors: 8 × 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz
Memory: 15,4 GiB

QEMU 5.2.0-9.18.x86_64
libvirt 7.1.0-4.1.x86_64

Hi
I run qemu with the following kvm options in a /etc/modprobe.d/10-kvm.conf;


options kvm ignore_msrs=1
options kvm report_ignored_msrs=0

I made such a 10-kvm.conf file with these 2 lines and rebooted, but it seems not to solve the problem.
I had another crash with “KMODE EXCEPTION NOT HANDLED”.

I still see the warnings in the log: https://susepaste.org/58882814
Is that normal with the KVM options added in the conf file? I’m not sure if these warnings are related to the crashes.

Hi
Not sure, I use passthrough here for both gpu and disk as well as Tumbleweed;


#MAIN FUNCTION
function qemu_func
{
qemu-system-x86_64 \
-m 8G \
-cpu host,kvm=off,hv_vendor_id=whatever \
-smp 4,sockets=1,cores=2,threads=2 \
-rtc clock=host,base=utc \
-serial none \
-parallel none \
-vga none \
-nographic \
-usb \
-device usb-host,vendorid=0x05af,productid=0x0808 \
-device vfio-pci,host=05:00.0 \
-device vfio-pci,host=06:00.0 \
-device vfio-pci,host=06:00.1 \
-drive if=pflash,format=raw,unit=0,file=$QEMU_VARS_PATH/$QEMU_CODE,readonly=on \
-drive if=pflash,format=raw,unit=1,file=$QEMU_VARS_PATH/$QEMU_VARS \
-boot order=c \
-machine type=pc-q35-4.0,accel=kvm,kernel_irqchip=on \
-nic tap,ifname=tap0,script=no,downscript=no
}

Now in saying that I have noticed some issue with winX but it’s not used that often so really haven’t investigated since I plan to move it all to another machine.

Is there a way of setting these options of qemu-system-x86_64 by means of virt-manager?
I now built my own start script based on the QEMU log file, so I can now change all options (e.g. regarding cpu, etc.) in that script, but it would be nice if I could set these options (and start the VM) via the virt-manager GUI.

Maybe I ask stupid questions as I’m completely new to QEMU/KVM. I only use it since yesterday.

Hi
You should be able to look around and set most options, else AFAIK you can edit the machine xml file as well (suggest a web search on that…).

The other one to look at is the likes of vagrant/libvirt to bring up machines, I think you would need to create a local repo for a windows 10 box…

I installed a new kernel from the Kernel:/stable repository, namely 5.12.6-1.gfe25271-default.
The Windows 10 VM in QEMU/KVM runs fine now: no more crashes, no more warnings in the log file.

I tried also VirtualBox with the new kernel and a Windows 10 VM, but there the problem (KMODE EXCEPTION NOT HANDLED) is not solved yet.