FS#44573 - [linux] 4.0 no longer detects virtio devices in QEMU VM

Attached to Project: Arch Linux
Opened by Marti (intgr) - Monday, 13 April 2015, 16:13 GMT
Last edited by Tobias Powalowski (tpowa) - Tuesday, 14 April 2015, 06:56 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description: I'm using libvirt to run a QEMU virtual machine with Arch Linux testing inside. After upgrading to kernel 4.0, the machine no longer detects any virtio devices. First the machine failed to boot with a virtio disk and dropped me into the initrd shell. After changing the disk bus from virtio to IDE, it booted successfully, but no longer recognized the virtual NIC ('ip link' shows no devices, nor dmesg).

Downgrading the kernel makes both work again.

Additional info:
* package version(s)
* config and/or log files etc.

mkinitcpio.conf has:
MODULES="virtio-pci virtio-blk"
HOOKS="base udev autodetect block filesystems keyboard"

There's a new suspicious message in the 4.0's dmesg buffer:
[ 0.276307] virtio-pci 0000:00:03.0: virtio_pci: leaving for legacy driver

Both dmesg outputs are attached, as well as libvirt domain XML.
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Tuesday, 14 April 2015, 06:56 GMT
Reason for closing:  Fixed
Additional comments about closing:  4.0.0-2
Comment by Peter Wu (Lekensteyn) - Monday, 13 April 2015, 20:08 GMT
Confirmed, noticed that my virtio storage would not become visible. It looks like CONFIG_VIRTIO_PCI_LEGACY=y is needed.
Comment by Peter Wu (Lekensteyn) - Monday, 13 April 2015, 20:15 GMT
@tpowa Do you have flying cars? ;)

config VIRTIO_PCI_LEGACY
bool "Support for legacy virtio draft 0.9.X and older devices"
default y
depends on VIRTIO_PCI
---help---
Virtio PCI Card 0.9.X Draft (circa 2014) and older device support.

This option enables building a transitional driver, supporting
both devices conforming to Virtio 1 specification, and legacy devices.
If disabled, you get a slightly smaller, non-transitional driver,
with no legacy compatibility.

So look out into your driveway. Do you have a flying car? If
so, you can happily disable this option and virtio will not
break. Otherwise, leave it set. Unless you're testing what
life will be like in The Future.

If unsure, say Y.
Comment by Peter Wu (Lekensteyn) - Monday, 13 April 2015, 21:09 GMT
Besides enabling this option, the virtio_pci.force_legacy=1 module option needs to be set (can be passed as boot param or via modprobe conf). As a stop-gap measure I rebuild virtio modules with the config option enabled and this patch applied (to avoid having to set the module option):

--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -19,7 +19,7 @@

#include "virtio_pci_common.h"

-static bool force_legacy = false;
+static bool force_legacy = true;

#if CONFIG_VIRTIO_PCI_LEGACY
module_param(force_legacy, bool, 0444);
Comment by Tobias Powalowski (tpowa) - Tuesday, 14 April 2015, 06:42 GMT
CONFIG_VIRTIO_PCI_LEGACY=y added to configs.

Loading...