Date: Wed, 20 Feb 2019 06:46:15 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 235876] ACPI related commit r330133 broke Microsoft Hyper-V passthrough device on Generation 2 FreeBSD VM Message-ID: <bug-235876-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235876 Bug ID: 235876 Summary: ACPI related commit r330133 broke Microsoft Hyper-V passthrough device on Generation 2 FreeBSD VM Product: Base System Version: 12.0-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: weh@microsoft.com Created attachment 202178 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D202178&action= =3Dedit Acpidump collected on FreeBSD 12 Guest OS running as a Gen 2 VM on Microsoft Hyper-V On HyperV Generation 2 VMs, all passthrough devices are attached to pcib0 b= us. Upon guest OS boot, pcib0 bus as a device asks to resource 0x2000 byte MMIO memory address space. With the Commit r330133, the request was rejected by nexus_alloc_resource(). Further debugging shows with this commit, the addre= ss range requested has been reserved by unknown device much earlier than pcib0= =E2=80=99s request. And almost all good addresses were reserved by this =E2=80=98unkno= wn=E2=80=99 device. I put some debug print in the code. Following is the dmesg output: ---- OS boot =E2=80=A6 nexus0: &&&in nexus_alloc_resource, check 10, child request range (0xfe0000000-0xfffffffff), count 0x20000000 =EF=83=9F A request to reser= ve this amount of memory address in the range. unknown: &&&in nexus_alloc_resource, check 20, this is the child, needactiv= ate =3D 0 =EF=83=9F requesting child is unknown because the name of device_t = is empty. nexus0: &&&in nexus_alloc_resource, after calling rman_reserve_resource, rv return Not NULL =EF=83=9F memory addr successfully reserved for th= is unknown device =E2=80=A6 nexus0: &&&in nexus_alloc_resource, check 10, this is the request bus, range (0xf8000000-0xffdfffff), count 0x7e00000 =EF=83=9F once again request anot= her chunk of memory address unknown: &&&in nexus_alloc_resource, check 20, this is the child, needactiv= ate =3D 0 =EF=83=9F requesting child is unknown because the name of device_= t is empty. nexus0: &&&in nexus_alloc_resource, after calling rman_reserve_resource, rv return Not NULL =EF=83=9F memory addr successfully reserved again for thi= s unknown device =E2=80=A6 =E2=80=A6 nexus0: &&&in nexus_alloc_resource, check 10, this is the request bus, range (0xfe0000000-0xfffffffff), count 0x2000 =EF=83=9F A request to reserve 0x= 2000 byte in this address range pcib0: &&&in nexus_alloc_resource, check 20, this is the child, needactivat= e =3D 2 =EF=83=9F the requestor is pcib0 vmbus0: ***in pcib_host_res_alloc, after calling bus_generic_alloc_resource= , r =3D NULL =EF=83=9F request failed =E2=80=A6 nexus0: &&&in nexus_alloc_resource, check 10, this is the request bus, range (0xf8000000-0xfed3ffff), count 0x2000 =EF=83=9F Pcib0 tries again in a di= fferent address range. pcib0: &&&in nexus_alloc_resource, check 20, this is the child, needactivat= e =3D 2 =EF=83=9F the requestor is pcib0 vmbus0: ***in pcib_host_res_alloc, after calling bus_generic_alloc_resource= , r =3D NULL =EF=83=9F failed again because both of the address ranges were= already reserved by =E2=80=98unknown=E2=80=99 device =E2=80=A6 pcib0: failed to get resource for cfg window =EF=83=9F picb0 failed to at= tach, and hence all passthrough devices attached under this bus fail to attach and lo= ad. ---- I did a long binary search on head branch and finally narrow down to this commit r330113. The commit was not in 11 branch so passthrough on 11.2 VM s= till works fine. However 12 release got affected. I suspect this tiny change in = ACPI causes the device address interpretation changed.=20 Attached is acpidump output I did on a Hyper-V Gen 2 VM with one NIC config= ured to pass through to the VM. --=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-235876-227>