From owner-freebsd-hackers@freebsd.org Tue Mar 17 14:09:13 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77D9E267609; Tue, 17 Mar 2020 14:09:13 +0000 (UTC) (envelope-from wojtek@puchar.net) Received: from puchar.net (puchar.net [194.1.144.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48hZm72hPNz4TKF; Tue, 17 Mar 2020 14:09:11 +0000 (UTC) (envelope-from wojtek@puchar.net) Received: Received: from 127.0.0.1 (localhost [127.0.0.1]) by puchar.net (8.15.2/8.15.2) with ESMTPS id 02HE95qe075562 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 17 Mar 2020 15:09:05 +0100 (CET) (envelope-from puchar-wojtek@puchar.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=puchar.net; s=default; t=1584454146; bh=OHZRyhMFKdfNaSH6Csjd9xMwhMtnGlyUz/nAwZ+3mTU=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=Vtq8AnXXHRfG9gLhar4AACeL52WttAnVEB3qjFx5a/Z2zxoVfg4ZPMm/cPuAXxZab SB1j+l4uib6poNxGQij2mx5j5z3pr3U7Q8f5/dG49JdVMkGzyz1lzi7c1dSYwTQYWD z/G8HV/PtDulh7nAQBRbDMTprHKVuAV18pW7HK00= Received: from localhost (puchar-wojtek@localhost) by puchar.net (8.15.2/8.15.2/Submit) with ESMTP id 02HE95OY075559; Tue, 17 Mar 2020 15:09:05 +0100 (CET) (envelope-from puchar-wojtek@puchar.net) Date: Tue, 17 Mar 2020 15:09:04 +0100 (CET) From: Wojciech Puchar To: Daniel Nicolescu cc: freebsd-virtualization@freebsd.org, freebsd-hackers@freebsd.org, patrascu.naina14@gmail.com, Mihai Carabas Subject: Re: USB device passthrough implementation In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 48hZm72hPNz4TKF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=fail (rsa verify failed) header.d=puchar.net header.s=default header.b=Vtq8AnXX; dmarc=none; spf=pass (mx1.freebsd.org: domain of wojtek@puchar.net designates 194.1.144.90 as permitted sender) smtp.mailfrom=wojtek@puchar.net X-Spamd-Result: default: False [-2.29 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.924,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_DKIM_REJECT(1.00)[puchar.net:s=default]; R_SPF_ALLOW(-0.20)[+mx]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[puchar.net]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[puchar.net:-]; RCVD_IN_DNSWL_NONE(0.00)[90.144.1.194.list.dnswl.org : 127.0.10.0]; IP_SCORE(-2.57)[ip: (-6.78), ipnet: 194.1.144.0/24(-3.39), asn: 43476(-2.71), country: PL(0.06)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:43476, ipnet:194.1.144.0/24, country:PL]; MID_RHS_MATCH_FROM(0.00)[]; SUSPICIOUS_RECIPS(1.50)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2020 14:09:13 -0000 > We want to implement the USB pass through feature for bhyve so that users > will be able to pass through individual USB devices like in QEMU. We are i want to be your beta tester. > trying to emulate the USB controller and pass to the virtual machine only > one port. > > * We need to disconnect the USB device from host: we are currently not very > familiar with the kernel API to perform this in most cases you actually don't have to. just use /dev/ugen/* devices simply make it as a parameter for bhyve usbpassthrough=a/device where a is virtual USB device number (i don't think you want to emulate more than one bus - one xhci is already done in bhyve), and device would be like /dev/ugenX.Y