From owner-freebsd-virtualization@freebsd.org Tue Dec 22 05:48:02 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 B3B36A4E726 for ; Tue, 22 Dec 2015 05:48:02 +0000 (UTC) (envelope-from akgupt3@gmail.com) Received: from mail-vk0-x235.google.com (mail-vk0-x235.google.com [IPv6:2607:f8b0:400c: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 A12381A06 for ; Tue, 22 Dec 2015 05:48:01 +0000 (UTC) (envelope-from akgupt3@gmail.com) Received: by mail-vk0-x235.google.com with SMTP id a189so112601186vkh.2 for ; Mon, 21 Dec 2015 21:48:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VSpB+kp/gaa2iy2yVybLk0+8fo9MkgKP0GmDBFcaB1Y=; b=K0eJZWaeuwmjkv1Jd3ANKK30TDVuSzJ2f0pEkMN5k6Z+zIiFpd/UGoD+8djM5u3yul iJQznC1+MlAnqQ0SUDqdvvjVEgXPzz70ERKVYzGXiJ99grJn655GsDdp2x77XZh6bSYT auxwkJBICRn+JtiXOhok/J5aqz6Zh8W2AficLZz3FE4l+wfOWPHDXUsMFL21+LSJRyR+ /0c27InUub4F2mV1/Cav0X/vRhZQ7ZbXtp62dtyWdveljbgSV5V9G983iRzGS5+CltwA v/+jWjnpWJ6WnzftwBZp+k3+Eob6IRrNARH36U63OXOZUlqRVfp0Iid6yheFJJcIx8wC jNlA== MIME-Version: 1.0 X-Received: by 10.31.163.197 with SMTP id m188mr14874759vke.89.1450763280660; Mon, 21 Dec 2015 21:48:00 -0800 (PST) Received: by 10.31.163.135 with HTTP; Mon, 21 Dec 2015 21:48:00 -0800 (PST) In-Reply-To: <20151222034457.GA40078@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> <20151222034457.GA40078@dendrobates.araler.com> Date: Mon, 21 Dec 2015 21:48:00 -0800 Message-ID: Subject: Re: bhyve PCI pass-through to Linux guest From: Anish To: Sergey Manucharian Cc: FreeBSD virtualization Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Tue, 22 Dec 2015 05:48:02 -0000 >ppt0@pci0:0:20:0: class=0x0c0330 card=0x21f317aa chip=0x1e318086 Passthrough stub driver, part of vmm, controls the USB controller. Can you share output of /usr/sbin/devinfo from FreeBSD host, highlighting the usb mass/flash device in tree? Regards, Anish On Mon, Dec 21, 2015 at 7:44 PM, Sergey Manucharian wrote: > Excerpts from Peter Grehan's message from Tue 22-Dec-15 13:09: > > Hi Sergey, > > > > > This is pretty reproducible: > > > > > > 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 ? > > OK, I've experimented more and found that even with the same Linux VM > after halting it once, the pass-through device doesn't work when that > Linux guest is restarted again. > > It looks that both host and guest report exactly the same data before and > after restarting the guest: > > Linux - first run: > ================= > $ lspci -v > 00:07.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset > Family USB xHCI Host Controller (rev 04) (prog-if 30 [XHCI]) > Subsystem: Lenovo Device 21f3 > Flags: bus master, medium devsel, latency 0, IRQ 24 > Memory at c0010000 (64-bit, prefetchable) [size=64K] > Capabilities: [70] Power Management version 2 > Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+ > Kernel driver in use: xhci_hcd > > $ lsusb > Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub > Bus 001 Device 002: ID 0781:5530 SanDisk Corp. Cruzer > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > FreeBSD when Linux is running first time: > ========================================= > $ pciconf -v > 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 > > Linux - second run: > =================== > $ lspci -v > 00:07.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset > Family USB xHCI Host Controller (rev 04) (prog-if 30 [XHCI]) > Subsystem: Lenovo Device 21f3 > Flags: bus master, medium devsel, latency 0, IRQ 24 > Memory at c0010000 (64-bit, prefetchable) [size=64K] > Capabilities: [70] Power Management version 2 > Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+ > Kernel driver in use: xhci_hcd > > FreeBSD when Linux is running second time: > ========================================== > $ pciconf -lv > 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 > > > -- > Thanks, > Sergey > > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to " > freebsd-virtualization-unsubscribe@freebsd.org" >