From owner-freebsd-bugs@freebsd.org Wed Feb 20 06:46:17 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 8F9B214E7FDD for ; Wed, 20 Feb 2019 06:46:17 +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 243738F7AA for ; Wed, 20 Feb 2019 06:46:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id D5D1514E7FDC; Wed, 20 Feb 2019 06:46:16 +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 95D9F14E7FDB for ; Wed, 20 Feb 2019 06:46:16 +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 2B2638F7A7 for ; Wed, 20 Feb 2019 06:46:16 +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 4FE3CA577 for ; Wed, 20 Feb 2019 06:46:15 +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 x1K6kF6M065698 for ; Wed, 20 Feb 2019 06:46:15 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x1K6kFc8065697 for bugs@FreeBSD.org; Wed, 20 Feb 2019 06:46:15 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 235876] ACPI related commit r330133 broke Microsoft Hyper-V passthrough device on Generation 2 FreeBSD VM Date: Wed, 20 Feb 2019 06:46:15 +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.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: weh@microsoft.com 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 attachments.created 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: Wed, 20 Feb 2019 06:46:17 -0000 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.=