-
Notifications
You must be signed in to change notification settings - Fork 621
virtio-net control queue returns VIRTIO_NET_ERR for unsupported commands, breaking Windows NetKVM driver #7925
Description
Describe the bug
Cloud Hypervisor's virtio-net control virtqueue returns VIRTIO_NET_ERR for all command classes except VIRTIO_NET_CTRL_MQ and VIRTIO_NET_CTRL_GUEST_OFFLOADS. This causes the Windows VirtIO NetKVM driver (virtio-win >= 0.1.271) to fail during initialization with NDIS Event 10317: "The miniport has detected an internal error" and PnP Problem Code 43 (CM_PROB_FAILED_POST_START).
The unsupported command classes that trigger the failure include VIRTIO_NET_CTRL_RX (class 0), VIRTIO_NET_CTRL_MAC (class 1), VIRTIO_NET_CTRL_VLAN (class 2), and VIRTIO_NET_CTRL_ANNOUNCE (class 3). QEMU handles all of these correctly, so the same drivers work there.
Only virtio-win 0.1.240 (July 2023) works, as it silently tolerates the error. 0.1.271+ results in a non-functional NIC, and 0.1.285+ immediately tears down the miniport via NdisMRemoveMiniport() (commit 50e7db9 in virtio-win -- "indicate driver error on unexpected CX behavior").
A safe fix would be to return VIRTIO_NET_OK for unimplemented command classes instead of VIRTIO_NET_ERR, as these commands (RX filtering, MAC table, VLAN, gratuitous ARP) can be safely no-op'd per the virtio spec.
To Reproduce
- Install Windows 11 25H2 with virtio-win >= 0.1.271 NetKVM driver (installed via QEMU with
disable-legacy=on) - Boot the image with Cloud Hypervisor (see VM configuration below)
- In SAC CMD or RDP, run
pnputil /enum-devices /class Net-- VirtIO adapter shows Status: Problem, Problem Code: 43 - Event Viewer -> System log shows NDIS Event ID 10317: "Miniport Red Hat VirtIO Ethernet Adapter had event Fatal error: The miniport has detected an internal error"
ipconfigshows no network adapter / no IP address- Repeat with virtio-win 0.1.240 -- networking works normally
Version
Output of cloud-hypervisor --version:
cloud-hypervisor v50.2
Also reproduced on v51.1. Pre-built binaries from GitHub releases.
VM configuration
What command line did you run:
cloud-hypervisor \
--kernel CLOUDHV.fd \
--disk path=windows-11-25h2.qcow2,num_queues=2,queue_size=512 \
--cpus boot=2,kvm_hyperv=on \
--memory size=4G \
--net tap=vmtap0,mac=52:54:00:12:34:56,num_queues=2 \
--serial tty \
--console off
Guest OS version details: Windows 11 25H2 (build 26100.8037)
Host OS version details: Ubuntu, Linux 6.17.0-1009-gcp, KVM
Drivers tested:
- virtio-win 0.1.240 -- works
- virtio-win 0.1.271 -- broken
- virtio-win 0.1.285 -- broken
- attestation-virtio-win-prewhql 0.1.298 -- broken
Logs
Cloud Hypervisor log (-v) shows no error -- the unsupported control command is only logged as a warning:
cloud-hypervisor: WARN: net_util/src/ctrl_queue.rs -- Unsupported command class
Windows guest pnputil output (broken with 0.1.271+):
Instance ID: PCI\VEN_1AF4&DEV_1041&SUBSYS_10411AF4&REV_01\3&11583659&0&10
Device Description: Red Hat VirtIO Ethernet Adapter #2
Status: Problem
Problem Code: 43 (0x2B) [CM_PROB_FAILED_POST_START]
Driver Name: oem0.inf
Windows Event Log (NDIS):
Source: Microsoft-Windows-NDIS
Event ID: 10317
Level: Error
Description: Miniport Red Hat VirtIO Ethernet Adapter #2, {dc6ea326-...},
had event Fatal error: The miniport has detected an internal error