From owner-freebsd-virtualization@freebsd.org Mon Jan 14 09:40:06 2019 Return-Path: Delivered-To: freebsd-virtualization@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 8C88514999B1 for ; Mon, 14 Jan 2019 09:40:06 +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 23C2C80953 for ; Mon, 14 Jan 2019 09:40:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id DB6F114999B0; Mon, 14 Jan 2019 09:40:05 +0000 (UTC) Delivered-To: virtualization@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 A074A14999AF for ; Mon, 14 Jan 2019 09:40:05 +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 220B180951 for ; Mon, 14 Jan 2019 09:40:05 +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 6FC0311137 for ; Mon, 14 Jan 2019 09:40:04 +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 x0E9e45D042449 for ; Mon, 14 Jan 2019 09:40:04 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x0E9e4FJ042448 for virtualization@FreeBSD.org; Mon, 14 Jan 2019 09:40:04 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: virtualization@FreeBSD.org Subject: [Bug 222996] FreeBSD 11.1-12 on Hyper-V with PCI Express Pass Through Date: Mon, 14 Jan 2019 09:40:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin 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: virtualization@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-virtualization@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2019 09:40:06 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D222996 --- Comment #16 from Wei Hu --- There are two issues.=20 1. For FreeBSD R12 and current head branch, the passthrough support on Hype= r-V Gen VM was broken by commit r330113. No devices work on these releases. I h= ave informed Andrew@freebsd.org to take a look of this problem. 2. On 11.2 and earlier releases, passthrough generally works on Gen 2 FreeB= SD VMs. I have checked one Intel NIC with using ig driver which works fine. However, Dmitry reported it doesn't work with Intel 82583v NIC, which uses = em driver on FreeBSD. I don't have such NIC so I am using a VM that that Dmitry provided to debug this issue. Looks it fails in the routine reading NIC's M= DI control register: /** * e1000_read_phy_reg_mdic - Read MDI control register * @hw: pointer to the HW structure * @offset: register offset to be read * @data: pointer to the read data * * Reads the MDI control register in the PHY at offset and stores the * information read to data. **/ s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data) { struct e1000_phy_info *phy =3D &hw->phy; u32 i, mdic =3D 0; ... /* Poll the ready bit to see if the MDI read completed * Increasing the time out as testing showed failures with * the lower time out */ for (i =3D 0; i < (E1000_GEN_POLL_TIMEOUT * 10); i++) { usec_delay_irq(50); mdic =3D E1000_READ_REG(hw, E1000_MDIC); if (mdic & E1000_MDIC_READY) break; } if (!(mdic & E1000_MDIC_READY)) { DEBUGOUT("MDI Read did not complete\n"); <--- saw th= is message when driver's debug flag is on. return -E1000_ERR_PHY; } ... } Looks the register status never turned ready. Here is some dmesg output when the debug flag is on: em0: Lazy allocation of 0x20000 bytes rid 0x10 type 3 at 0xf8000000 em0: in em_allocate_pci_resource, bus tag is 0x1, handle is 0xfffff800f8000= 000 e1000_set_mac_type e1000_init_mac_ops_generic e1000_init_phy_ops_generic e1000_init_nvm_ops_generic e1000_init_function_pointers_82571 e1000_init_mac_params_82571 e1000_init_nvm_params_82571 e1000_init_phy_params_82571 e1000_get_phy_id_82571 e1000_read_phy_reg_bm2 e1000_get_hw_semaphore_82574 e1000_get_hw_semaphore_82573 e1000_read_phy_reg_mdic MDI Read did not complete <--=20 e1000_put_hw_semaphore_82574 e1000_put_hw_semaphore_82573 Error getting PHY ID Will update more. --=20 You are receiving this mail because: You are the assignee for the bug.=