From owner-freebsd-virtualization@freebsd.org Wed Dec 23 05:07:31 2015 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12445A4FE9D for ; Wed, 23 Dec 2015 05:07:31 +0000 (UTC) (envelope-from sm@ara-ler.com) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C47861962 for ; Wed, 23 Dec 2015 05:07:30 +0000 (UTC) (envelope-from sm@ara-ler.com) Received: by mail-ig0-x235.google.com with SMTP id to4so73832351igc.0 for ; Tue, 22 Dec 2015 21:07:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ara-ler-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=k2WeZWlNkPbZzqwKWv1naub20XjJKvYdaDZNSUnobR4=; b=iaQ2lfP9CAusX05zPirWlGE4cq8tMa7FT1zAljEg9icc4IyqM58YkoTzArMHyYIvd5 7ztHYXBRt9sFWiCL9grV6fXRw9hsA2Z1h/gvpRZ7j6lRM/9W2d4TSNCjX1EAgFv2tWxx HUtcgK/jI8KT9HWuzOBhhGn4LNQojfFlcxKMDmh8cF+odQP5SSpOI8uyeWu2URbcwnve PgCZ512VKAD/a8kiCzKR/dxQUilMdSaDeX77k193pwam6cmwuHtg9IjyEMEGY/AMexkq aRFiStYWUYXUBIZlgjw1bQ4Bmn2ob9Rqu0t6bR4MR85wTgj9PMkS5AMbWjAkW04hN6cd ZKQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=k2WeZWlNkPbZzqwKWv1naub20XjJKvYdaDZNSUnobR4=; b=kKiNDEp9miu13qmZlwRhtF3k6ZFIWfRLClO0di3HFg38MJc3kBAzUPmKZ/OVubb0oS plTJyA03pIxvpdJTijPAJleG6+tNhpWrCw+vGXlxotjkhxbo58RC61x+8wC8ZA45ENGn BXRO5qBUQv/Sw+n2Tu9V858BbjOMqUNnt2q2/FBBtlZifDRTCRdhqubQez+XipO5C7dk D2tl3N+LstKPn3PwHN8IrtvVfU8+hs9rIBQcCiLp65pe9Bq+uG1hIH9L17UL7GTuJ7YY TeCxuX11CzZAikukF6LgbOxkSvScRKInFOcEm+o+QrrKntcSCCJG18FD9F5KYJ/F1H1Y ckeg== X-Gm-Message-State: ALoCoQkVywjDq9i7A8/wtXJLOuKhvScZjZ9LwkwHusTGgCXfzEGfMrXsJDTgsNPKBq5mn4TNt0Q+MfUoHp40QTGWPvGG9YNZMw== X-Received: by 10.50.183.7 with SMTP id ei7mr148488igc.17.1450847250224; Tue, 22 Dec 2015 21:07:30 -0800 (PST) Received: from dendrobates.araler.com (70-59-19-232.hlrn.qwest.net. [70.59.19.232]) by smtp.gmail.com with ESMTPSA id b10sm11489525igx.19.2015.12.22.21.07.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Dec 2015 21:07:29 -0800 (PST) Date: Tue, 22 Dec 2015 22:07:27 -0700 From: Sergey Manucharian To: FreeBSD virtualization Subject: Re: bhyve PCI pass-through to Linux guest Message-ID: <20151223050727.GB1450@dendrobates.araler.com> References: <20151220045821.GG22018@dendrobates.araler.com> <56763672.3090207@freebsd.org> <20151220051015.GH22018@dendrobates.araler.com> <56763A0B.8010802@freebsd.org> <20151220053644.GI22018@dendrobates.araler.com> <20151220215240.GB4064@dendrobates.araler.com> <5678BECC.7090200@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5678BECC.7090200@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 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: Wed, 23 Dec 2015 05:07:31 -0000 Excerpts from Peter Grehan's message from Tue 22-Dec-15 13:09: > > I pass trough a PCI device (USB controller) to a Linux guest. It works > > properly. Then I halt the VM, make sure that bhyve destroyed it and run > > Windows guest with the same PCI device passed-through. > > > > Windows device manager does show the device, however, e.g. a flash drive > > plugged in is not presented to Windows, instead it's being processed by > > FreeBSD. > > > > After that it does not work in Linux guest as well. Kernel module (vmm) > > unloading and reloading does not help. > > The flash drive being processed by FreeBSD would indicate that it has > ownership of the device. Would you be able to try a 'pciconf -vl' after > the Linux guest exists, and after the Windows guest exits ? First of all I found that I do not need to switch between guests. It is 100% reproducible with a single Linux VM. In freshly booted FreeBSD the USB ports (ones passed through) do not sense any device plugged in. When I boot Linux VM, it fully controls those ports, and I see the USB flash in Linux. As soon as I halt Linux, the flash drive appears in the host! Today I've checked out the latest sources and recompiled the whole system. Nothing has changed. Here is the corresponding output of pciconf iand devinfo after Linux exits: $ pciconf -vl .... ppt0@pci0:0:20:0: class=0x0c0330 card=0x21f317aa chip=0x1e318086 rev=0x04 hdr=0x00 vendor = 'Intel Corporation' device = '7 Series/C210 Series Chipset Family USB xHCI Host Controller' class = serial bus subclass = USB .... $ devinfo | grep -B15 mass .... pcib1 pci1 sdhci_pci0 pcib2 pci2 iwn0 pcib3 pci3 ehci1 usbus1 uhub1 uhub3 umass0 .... -- S.