From owner-freebsd-bugs@freebsd.org Mon Apr 1 06:54:46 2019 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A316A1588953 for ; Mon, 1 Apr 2019 06:54:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 5A58F87210 for ; Mon, 1 Apr 2019 06:54:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 1647E158894C; Mon, 1 Apr 2019 06:54:46 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E31481588949 for ; Mon, 1 Apr 2019 06:54:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82DEF87208 for ; Mon, 1 Apr 2019 06:54:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id B0FE7136AD for ; Mon, 1 Apr 2019 06:54:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x316siir053090 for ; Mon, 1 Apr 2019 06:54:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x316si0x053089 for bugs@FreeBSD.org; Mon, 1 Apr 2019 06:54:44 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f 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 Date: Mon, 01 Apr 2019 06:54:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.0-RELEASE X-Bugzilla-Keywords: needs-qa X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: tommyhp2@gmail.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Apr 2019 06:54:46 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236922 --- Comment #5 from Tommy P --- 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.=