Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 01 Apr 2019 06:54:44 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 236922] Virtio fails as QEMU-KVM guest with Q35 chipset on Ubuntu 18.04.2 LTS
Message-ID:  <bug-236922-227-bvpePxqShk@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-236922-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-236922-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236922

--- Comment #5 from Tommy P <tommyhp2@gmail.com> ---
I think I may found the bug...  Please correct me if I'm wrong since it's b=
een
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 dete=
cted
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@pci0:0:7:0: class=3D0x010000 card=3D0x00081af4 chip=3D0x10041af=
4 rev=3D0x00
hdr=3D0x00
    vendor     =3D 'Red Hat, Inc.'
    device     =3D 'Virtio SCSI'
    class      =3D mass storage
    subclass   =3D SCSI
    cap 11[98] =3D MSI-X supports 4 messages, enabled
                 Table in map 0x14[0x0], PBA in map 0x14[0x800]
    cap 09[84] =3D vendor (length 20)
    cap 09[70] =3D vendor (length 20)
    cap 09[60] =3D vendor (length 16)
    cap 09[50] =3D vendor (length 16)
    cap 09[40] =3D vendor (length 16)

and when boot with Q35 chipset:

none1@pci0:1:0:0:       class=3D0x010000 card=3D0x11001af4 chip=3D0x10481af=
4 rev=3D0x01
hdr=3D0x00
    vendor     =3D 'Red Hat, Inc.'
    device     =3D 'Virtio SCSI'
    class      =3D mass storage
    subclass   =3D SCSI
    cap 11[dc] =3D MSI-X supports 4 messages
                 Table in map 0x14[0x0], PBA in map 0x14[0x800]
    cap 09[c8] =3D vendor (length 20)
    cap 09[b4] =3D vendor (length 20)
    cap 09[a4] =3D vendor (length 16)
    cap 09[94] =3D vendor (length 16)
    cap 09[84] =3D vendor (length 16)
    cap 01[7c] =3D powerspec 3  supports D0 D3  current D0
    cap 10[40] =3D 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% =3D rhelscsi_inst,
PCI\VEN_1AF4&DEV_1004&SUBSYS_00081AF4&REV_00
%RHELScsi.DeviceDesc% =3D rhelscsi_inst,
PCI\VEN_1AF4&DEV_1048&SUBSYS_11001AF4&REV_01

from the virtio driver 0.1.126.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-236922-227-bvpePxqShk>