From owner-freebsd-bugs@freebsd.org Mon Jan 27 01:43:16 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC0E722B999 for ; Mon, 27 Jan 2020 01:43:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 485XZX5PD3z3FwD for ; Mon, 27 Jan 2020 01:43:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id B8D7422B998; Mon, 27 Jan 2020 01:43:16 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B89B422B997 for ; Mon, 27 Jan 2020 01:43:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::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.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485XZX5Fbpz3FwC for ; Mon, 27 Jan 2020 01:43:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEE5A267A for ; Mon, 27 Jan 2020 01:43:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 00R1hGrM053742 for ; Mon, 27 Jan 2020 01:43:16 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 00R1hGL4053741 for bugs@FreeBSD.org; Mon, 27 Jan 2020 01:43:16 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 243640] QEMU / KVM Q35 V4.X PCIe Virtual and Physical (Passthrough) Devices not detected Date: Mon, 27 Jan 2020 01:43:16 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: drum@graphica.com.au X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: 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, 27 Jan 2020 01:43:16 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D243640 Bug ID: 243640 Summary: QEMU / KVM Q35 V4.X PCIe Virtual and Physical (Passthrough) Devices not detected Product: Base System Version: 12.1-STABLE Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: drum@graphica.com.au Bug / Defect: PCIe attached devices are not detected on when running FreeBSD 12.1 on QEMU= Q35 V 4.x Virtual Machines. This bug affects the following PCIe based devices: VirtIO - All em - When using e1000e QEMU emulator (PCIe attached Intel 1GbE NIC ix - PCI Passthrough Intel X550 10GbE NIC Likely all other PCIe devices whether via emulation or PCI Passthrough Issues was discovered while testing: Q35 with VirtIO: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236922 Q35 / OVMF with SCSI and Network Devices: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D241774 Also appears to be root cause of defect raised with Q35 V4 and PCI Passthro= ugh: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D241581 Observed Behaviour: Running QEMU/KVM VM - Q35 V4.x / OVMF / SATA / VirtIO / e1000e / e1000 / vmxnet3 / PCI Passthrough to Intel X550 10GbE / FreeBSD 12.1 with recompiled kernel to disable netmap ("dev netmap") sys/amd64/conf/GENERIC to address f= ound bug with Q35 + netmap devices (see above reported and resolved bugs). SATA - disk found VirtIO - disk not found e1000e - PCIe NIC not found e1000 - Legacy PCI NIC found as em0 vmxnet3 - PCI connected NIC found as vmx0 X550 10GbE - not found. Get the following: dmesg errors <> ... pcib2: mem 0xc8b87000-0xc8b87fff irq 22 at device 2.1 on p= ci0 pcib2: Failed to allocate interrupt for PCI-e events pcib3: mem 0xc8b86000-0xc8b86fff irq 22 at device 2.2 on p= ci0 pcib3: Failed to allocate interrupt for PCI-e events pcib4: mem 0xc8b85000-0xc8b85fff irq 22 at device 2.3 on p= ci0 pcib4: Failed to allocate interrupt for PCI-e events pcib5: mem 0xc8b84000-0xc8b84fff irq 22 at device 2.4 on p= ci0 pcib5: Failed to allocate interrupt for PCI-e events ... <> ifconfig <> # ifconfig -a lo0: flags=3D8049 metric 0 mtu 16384 options=3D680003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 inet 127.0.0.1 netmask 0xff000000 groups: lo nd6 options=3D21 vmx0: flags=3D8843 metric 0 mtu 1500 =20=20=20=20=20=20=20 options=3De403bb ether 52:53:01:17:15:aa inet XX.XXX.XXX.53 netmask 0xffffff80 broadcast 203.XXX.XXX.127 media: Ethernet autoselect status: active nd6 options=3D29 em0: flags=3D8802 metric 0 mtu 1500 =20=20=20=20=20=20=20 options=3D81209b ether 52:54:00:a4:13:df media: Ethernet autoselect (1000baseT ) status: active nd6 options=3D29 <> Expected Behaviour: Should get all NIC visible:=20 m0 (e1000), em1 (e1000e), ix0 (X550 10GbE PCI Passthrough), vmx0 (vmxnet3) Should get: -- SATA - /dev/adaNpN storage devices -- SCSI - /dev/daNpN VirtIO SCSI devices I then retested with except with QEMU Q35 V3.1: Storage" SATA - OK VirtIO SCSI - only ok when built with new VirtIO sub-system as per https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236922 Networking: e1000 - ok comes up as em0 e1000e - ok comes up as em1 vmxnet3 - ok comes up as vmx0 X550 10GbE - ok comes up as ix0 ifconfig <> # ifconfig -a vmx0: flags=3D8843 metric 0 mtu 1500 =20=20=20=20=20=20=20 options=3De403bb ether 52:53:01:17:15:aa inet XXX.XXX.XXX.53 netmask 0xffffff80 broadcast XXX.XXX.XXX.127 media: Ethernet autoselect status: active nd6 options=3D29 em0: flags=3D8802 metric 0 mtu 1500 =20=20=20=20=20=20=20 options=3D81209b ether 52:54:00:a4:13:df media: Ethernet autoselect (1000baseT ) status: active nd6 options=3D29 ix0: flags=3D8802 metric 0 mtu 1500 =20=20=20=20=20=20=20 options=3De53fbb ether b4:96:91:21:4a:ce media: Ethernet autoselect status: no carrier nd6 options=3D29 em1: flags=3D8802 metric 0 mtu 1500 =20=20=20=20=20=20=20 options=3D81249b ether 52:54:00:f8:3b:94 media: Ethernet autoselect (1000baseT ) status: active nd6 options=3D29 lo0: flags=3D8049 metric 0 mtu 16384 options=3D680003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 inet 127.0.0.1 netmask 0xff000000 groups: lo nd6 options=3D21 <> Here is QEMU Q35 V3.1 with PCI passthrough XML snippet: <> virsh dumpxml test-freebsd-12.1=20 test-freebsd-12.1 a50005d7-7425-435f-82e9-e76f18784693 4194304 4194304 2 /machine hvm /usr/share/OVMF/OVMF_CODE.fd /home/XXX/DIR/OVMF_VARS.fd Broadwell-IBRS Intel destroy restart destroy /usr/bin/qemu-system-x86_64
... ...
... ...
... ... <> Diagnosis: Considerable testing and diagnosis as been done as part of find and resolvi= ng VirtIO and netmap issues. This has found how to replicate and work around the issues Q35 V4.X (Issue)= and Q35 V31 (work around). So problem appears to be within PCI device driver and relates to Q35 V4.x u= sing PCIe GEN4 specification aligned emulation. Tommy P has done considerable work to pin point likely source of issues: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D241774#c74 I quote: "Starting with the Q35 QEMU 4.0 machine type, generic pcie-root-po= rt will default to the maximum PCIe link speed (16GT/s) and width (x32) provid= ed by the PCIe 4.0 specification." This now needs to be confirmed by FreeBSD PCI core team for resolution. Please advise if you need additional testing or diagnostic information. Cheers, John Hartley. --=20 You are receiving this mail because: You are the assignee for the bug.=