[Bug 236922] Virtio fails as QEMU-KVM guest with Q35 chipset on Ubuntu 18.04.2 LTS

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Apr 1 06:54:46 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236922

--- Comment #5 from Tommy P <tommyhp2 at gmail.com> ---
I think I may found the bug...  Please correct me if I'm wrong since it's been
a very long time since I've dealt with C/C++ :(

File src/sys/dev/virtio/pci/virtio_pci.h  has this:

/* VirtIO PCI vendor/device ID. */
#define VIRTIO_PCI_VENDORID     0x1AF4
#define VIRTIO_PCI_DEVICEID_MIN 0x1000
#define VIRTIO_PCI_DEVICEID_MAX 0x103F

When the detected device ID is as follow for 12.0-RELEASE when booted with Q35
chipset:

VirtIO SCSI:            0x1048
VirtIO console:         0x1043
VirtIO memory balloon:  0x1045
VirtIO network device:  0x1041
VirtIO block device:    0x1042

All those IDs are beyond the defined range.  Thus, the controllers are detected
since they match the vendor ID but the drivers are not loaded.  As
verification, I've modified the source code to:

#define VIRTIO_PCI_DEVICEID_MAX 0x104F

and rebuilt the kernel. The drivers still didn't load.  Here's the pciconf for
the SCSI when boot with i440FX chipset:

virtio_pci2 at pci0:0:7:0: class=0x010000 card=0x00081af4 chip=0x10041af4 rev=0x00
hdr=0x00
    vendor     = 'Red Hat, Inc.'
    device     = 'Virtio SCSI'
    class      = mass storage
    subclass   = SCSI
    cap 11[98] = MSI-X supports 4 messages, enabled
                 Table in map 0x14[0x0], PBA in map 0x14[0x800]
    cap 09[84] = vendor (length 20)
    cap 09[70] = vendor (length 20)
    cap 09[60] = vendor (length 16)
    cap 09[50] = vendor (length 16)
    cap 09[40] = vendor (length 16)

and when boot with Q35 chipset:

none1 at pci0:1:0:0:       class=0x010000 card=0x11001af4 chip=0x10481af4 rev=0x01
hdr=0x00
    vendor     = 'Red Hat, Inc.'
    device     = 'Virtio SCSI'
    class      = mass storage
    subclass   = SCSI
    cap 11[dc] = MSI-X supports 4 messages
                 Table in map 0x14[0x0], PBA in map 0x14[0x800]
    cap 09[c8] = vendor (length 20)
    cap 09[b4] = vendor (length 20)
    cap 09[a4] = vendor (length 16)
    cap 09[94] = vendor (length 16)
    cap 09[84] = vendor (length 16)
    cap 01[7c] = powerspec 3  supports D0 D3  current D0
    cap 10[40] = PCI-Express 2 endpoint max data 128(128)
                 link x1(x1) speed 2.5(2.5) ASPM disabled(L0s)

Aside from the device ID changes, looks like there's a revision (?) change from
0x00 to 0x01.  Both match the Windows' SCSI INF driver definition:

%RHELScsi.DeviceDesc% = rhelscsi_inst,
PCI\VEN_1AF4&DEV_1004&SUBSYS_00081AF4&REV_00
%RHELScsi.DeviceDesc% = rhelscsi_inst,
PCI\VEN_1AF4&DEV_1048&SUBSYS_11001AF4&REV_01

from the virtio driver 0.1.126.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list