I run a Debian 12 VM with XFCE on my home server so that it can serve dual purpose as a desktop. Obviously, that needs GPU and USB controllers to be passed through to the VM.
Without the GPU passed through, the guest kernel detects the hypervisor and everything works as expected:
However, upon passing through the GPU (doesn't matter whether the virtual display is enabled or not) the guest kernel does not detect the hypervisor. Everything is perfectly functional, but there are performance implications.
You can see the kernel itself just straight up doesn't see KVM. It is not enabling kvm-clock or other guest features. Whatever systemd is doing results in it detecting "qemu" instead of "kvm."
Just for testing purposes, I also reproduced this with Arch Linux, so this is not Debian-specific.
Is this expected behavior? I couldn't find any other information online about it. Has anyone else experienced this?
Without the GPU passed through, the guest kernel detects the hypervisor and everything works as expected:
[ 0.000000] Hypervisor detected: KVM
[ 0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00
[ 0.000001] kvm-clock: using sched offset of 10747905976 cycles
[ 0.000002] clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
[ 0.022687] kvm-guest: KVM setup pv remote TLB flush
[ 0.022690] kvm-guest: setup PV sched yield
[ 0.022719] Booting paravirtualized kernel on KVM
[ 0.026355] kvm-guest: PV spinlocks enabled
[ 0.054739] kvm-guest: setup PV IPIs
[ 0.384071] clocksource: Switched to clocksource kvm-clock
[ 2.158906] systemd[1]: Detected virtualization kvm.
However, upon passing through the GPU (doesn't matter whether the virtual display is enabled or not) the guest kernel does not detect the hypervisor. Everything is perfectly functional, but there are performance implications.
[ 0.023278] Booting paravirtualized kernel on bare hardware
[ 0.098690] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x30e5ee828bd, max_idle_ns: 440795330237 ns
[ 0.655009] clocksource: Switched to clocksource tsc-early
[ 1.779190] tsc: Refined TSC clocksource calibration: 3392.210 MHz
[ 1.779211] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x30e58ff2122, max_idle_ns: 440795341059 ns
[ 1.780029] clocksource: Switched to clocksource tsc
[ 2.381796] systemd[1]: Detected virtualization qemu.
You can see the kernel itself just straight up doesn't see KVM. It is not enabling kvm-clock or other guest features. Whatever systemd is doing results in it detecting "qemu" instead of "kvm."
Just for testing purposes, I also reproduced this with Arch Linux, so this is not Debian-specific.
Is this expected behavior? I couldn't find any other information online about it. Has anyone else experienced this?
Last edited: