From nobody Sat Dec 28 02:10:46 2024 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YKm9b2lfYz5jkFm for ; Sat, 28 Dec 2024 02:13:07 +0000 (UTC) (envelope-from freebsdlouisville@gmail.com) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YKm9Z1wgBz4KHj for ; Sat, 28 Dec 2024 02:13:06 +0000 (UTC) (envelope-from freebsdlouisville@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=MiaobqCz; spf=pass (mx1.freebsd.org: domain of freebsdlouisville@gmail.com designates 2607:f8b0:4864:20::733 as permitted sender) smtp.mailfrom=freebsdlouisville@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7b6fc3e9e4aso672473485a.2 for ; Fri, 27 Dec 2024 18:13:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735351984; x=1735956784; darn=freebsd.org; h=in-reply-to:to:references:content-language:subject:user-agent :mime-version:date:message-id:from:from:to:cc:subject:date :message-id:reply-to; bh=QCQlSHBj3R4IbSmOF2++eHYbfiK0RdrNF+xNP0ACWwk=; b=MiaobqCzEdtClFCZq3ESPajcXgrvmpN660AINOcrL/blU3wJDxyPNU8MAw2DZDtLYk wfsBObnfhPYMt5AeViU+JU5nVlQCCErVUmw3o83oYVmY04LyPD/rYFCqtFtmBuR3MfNf uYejCSJdDr+pM+b4ajzReTey0nevDLgUSbweRkY2xzMd7M58/lwSdZ9YwMn7WyVC+2yd aMMvD6f6ba5HBXR8eqzkUFAIcAv9KKkZNAwyHqVSVxK9fjWcAIihpnD04LPK4R+JjWrO gIjJgYSOdbD2KIKZG27dEPMOs4VFiP1bN78Ys97EmJFut2rbm+kpTRTkfA24nEKkOzhW wYwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735351984; x=1735956784; h=in-reply-to:to:references:content-language:subject:user-agent :mime-version:date:message-id:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QCQlSHBj3R4IbSmOF2++eHYbfiK0RdrNF+xNP0ACWwk=; b=Kf8FeP6LQHi2o1/e9OZxSrxuqmQZoiiQgCqhgRv03NtPfjbGbRSwAcac0AjMNVqLPo ZddWYDYpC6G2QA1aMTepzlI3chZbQWEQTdK71nGIpnMSMzuyqX3IJNQyT6FD5VnoY/DS lGgIk7/a6nKbE/a/sGOVAeG9/puSjCmLa0NOiSIZ02m9yb7YUuFwEn0mKU0+caYGHOh6 9s2DlkgNnMfNDVhNYBf26vtyjRvtc25MibMYqf0mR984DtjKrP4Dm6Z+3K6LxUcVawzV hJA2XfVyPxK0geDUvjCHm/a4Q9iEVVOLNj87TUTWwCos37VFa4gkLACFI4ssZFcgW6aH ihTw== X-Gm-Message-State: AOJu0YxsFA14foSEDYgEaA13r/zsEIOSCR/brHpX4P64RVk+J1l9vl03 4jhzB2gmvZ/4nJp8mWV7lNWgJZDoim8doccgB85EO+kmpSv9p+DJcthcZQ== X-Gm-Gg: ASbGnctG8MJsJWUKQF3EJKjXK6IqHrFpbAQejA9oM+CwqGY4eMnG0WHyi7ps0iTCbdX nl4V6ks0+9659vi4cAAFIgF02ge0XDEd6B8l84dSULJYuXfclvni3k44rwvvzESU0vL5zfkiLOu 7nmK/x/1CHSOEev4YyjiNYcW9Fj27G45f08WWVF0WyRfL5mhvMajXj1gpfCRd9M5qsJjNyJsArh beEPiGUIH2kupuQInLS2OQ+mJRX4VI2fBZYEyydHIjbGRaGL+gfNDxdXqE6DynJhPpBz7/iYUAS XZA5WRE/sZgAVyF2YqDX X-Google-Smtp-Source: AGHT+IE/OvyAmsCh0eJHKlyh9V2mKhkTeGvV3qcZBsEO150UIvdHDljHcmT+qnsBPPiUatfjVXcQLw== X-Received: by 2002:a05:620a:2a09:b0:7b6:d1e1:a22e with SMTP id af79cd13be357-7b9ba79c0f8mr4130706685a.29.1735351984480; Fri, 27 Dec 2024 18:13:04 -0800 (PST) Received: from [192.168.1.4] (16.sub-97-184-158.myvzw.com. [97.184.158.16]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b9ac2df40bsm745165985a.39.2024.12.27.18.13.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Dec 2024 18:13:03 -0800 (PST) From: Steven Friedrich X-Google-Original-From: Steven Friedrich Content-Type: multipart/alternative; boundary="------------5Ft0IJWG0bfMxH5LyjdMg8Zj" Message-ID: <5cd601ba-560d-4252-9f17-7c450cf5d66d@gmail.com> Date: Fri, 27 Dec 2024 21:10:46 -0500 List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: usb devices passthrough in bhyve Content-Language: en-US References: <7dabef84-a572-4ded-a676-c73011b37e3c@gmail.com> To: freebsd-virtualization@freebsd.org In-Reply-To: <7dabef84-a572-4ded-a676-c73011b37e3c@gmail.com> X-Forwarded-Message-Id: <7dabef84-a572-4ded-a676-c73011b37e3c@gmail.com> X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; XM_UA_NO_VERSION(0.01)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-virtualization@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::733:from] X-Rspamd-Queue-Id: 4YKm9Z1wgBz4KHj X-Spamd-Bar: --- This is a multi-part message in MIME format. --------------5Ft0IJWG0bfMxH5LyjdMg8Zj Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit I have an HP Envy running FreeBSD 14.2. I am a bhyve noob, but I am able to create a bhyve guest, and installed freebsd 14.2 on it. Here's my host pci devices: xhci1@pci0:0:20:0:      class=0x0c0330 rev=0x00 hdr=0x00 vendor=0x8086 device=0x06ed subvendor=0x103c subdevice=0x8767     vendor     = 'Intel Corporation'     device     = 'Comet Lake USB 3.1 xHCI Host Controller'     class      = serial bus     subclass   = USB xhci0@pci0:1:0:0:       class=0x0c0330 rev=0x00 hdr=0x00 vendor=0x1b21 device=0x3242 subvendor=0x1b21 subdevice=0x3242     vendor     = 'ASMedia Technology Inc.'     device     = 'ASM3242 USB 3.2 Host Controller'     class      = serial bus     subclass   = USB Here's my usbconfig: usbconfig ugen1.1: at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA) ugen0.1: <(0x1b21) XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA) ugen0.2: at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA) ugen1.2: at usbus1, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA) ugen1.3: at usbus1, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA) ugen1.4: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA) ugen0.3: at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (126mA) ugen0.4: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (100mA) Originally, my PNY flash drive was on usbus1, but when I added pptdevs="0/20/0" to /boot/loader.conf, I lost my mouse and keyboard. Fortunately, I recently added a pcie card supporting usb 20 gbps rates. So I changed /boot/loader.conf to  pptdevs="1/0/0" But I don't know how to see the PNY flash drive in the guest.  I was hoping I could use gpart show -l and see a /dev/da0 or /dev/da1 drive, but I don't. In the guest, usbconfig: usbconfig No device match or lack of permissions. and pciconf -v -l: pciconf -v -l hostb0@pci0:0:0:0:      class=0x060000 rev=0x00 hdr=0x00 vendor=0x1275 device=0x1275 subvendor=0x0000 subdevice=0x0000     vendor     = 'Network Appliance Corporation'     class      = bridge     subclass   = HOST-PCI isab0@pci0:0:1:0:       class=0x060100 rev=0x00 hdr=0x00 vendor=0x8086 device=0x7000 subvendor=0x0000 subdevice=0x0000     vendor     = 'Intel Corporation'     device     = '82371SB PIIX3 ISA [Natoma/Triton II]'     class      = bridge     subclass   = PCI-ISA virtio_pci0@pci0:0:2:0: class=0x020000 rev=0x00 hdr=0x00 vendor=0x1af4 device=0x1000 subvendor=0x1af4 subdevice=0x0001     vendor     = 'Red Hat, Inc.'     device     = 'Virtio network device'     class      = network     subclass   = ethernet virtio_pci1@pci0:0:3:0: class=0x010000 rev=0x00 hdr=0x00 vendor=0x1af4 device=0x1001 subvendor=0x1af4 subdevice=0x0002     vendor     = 'Red Hat, Inc.'     device     = 'Virtio block device'     class      = mass storage     subclass   = SCSI How do I fix this? --------------5Ft0IJWG0bfMxH5LyjdMg8Zj Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

I have an HP Envy running FreeBSD 14.2.

I am a bhyve noob, but I am able to create a bhyve guest, and installed freebsd 14.2 on it.

Here's my host pci devices:

xhci1@pci0:0:20:0:      class=0x0c0330 rev=0x00 hdr=0x00 vendor=0x8086 device=0x06ed subvendor=0x103c subdevice=0x8767
    vendor     = 'Intel Corporation'
    device     = 'Comet Lake USB 3.1 xHCI Host Controller'
    class      = serial bus
    subclass   = USB

xhci0@pci0:1:0:0:       class=0x0c0330 rev=0x00 hdr=0x00 vendor=0x1b21 device=0x3242 subvendor=0x1b21 subdevice=0x3242
    vendor     = 'ASMedia Technology Inc.'
    device     = 'ASM3242 USB 3.2 Host Controller'
    class      = serial bus
    subclass   = USB

Here's my usbconfig:

usbconfig
ugen1.1: <Intel XHCI root HUB> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.1: <(0x1b21) XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.2: <Hub Genesys Logic, Inc.> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen1.2: <PixArt HP USB Optical Mouse> at usbus1, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)
ugen1.3: <Chicony HP USB Keyboard> at usbus1, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)
ugen1.4: <Realtek Bluetooth Radio> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA)
ugen0.3: <PNY USB 3.2.1 FD> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (126mA)
ugen0.4: <Hub Genesys Logic, Inc.> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (100mA)

Originally, my
PNY flash drive was on usbus1, but when I added pptdevs="0/20/0" to  /boot/loader.conf, I lost my mouse and keyboard.

Fortunately, I recently added a pcie card supporting usb 20 gbps rates.

So I changed /boot/loader.conf to  pptdevs="1/0/0"

But I don't know how to see the PNY flash drive in the guest.  I was hoping I could use gpart show -l and see a /dev/da0 or /dev/da1 drive, but I don't.

In the guest, usbconfig:

usbconfig
No device match or lack of permissions.

and pciconf -v -l:

pciconf -v -l
hostb0@pci0:0:0:0:      class=0x060000 rev=0x00 hdr=0x00 vendor=0x1275 device=0x1275 subvendor=0x0000 subdevice=0x0000
    vendor     = 'Network Appliance Corporation'
    class      = bridge
    subclass   = HOST-PCI
isab0@pci0:0:1:0:       class=0x060100 rev=0x00 hdr=0x00 vendor=0x8086 device=0x7000 subvendor=0x0000 subdevice=0x0000
    vendor     = 'Intel Corporation'
    device     = '82371SB PIIX3 ISA [Natoma/Triton II]'
    class      = bridge
    subclass   = PCI-ISA
virtio_pci0@pci0:0:2:0: class=0x020000 rev=0x00 hdr=0x00 vendor=0x1af4 device=0x1000 subvendor=0x1af4 subdevice=0x0001
    vendor     = 'Red Hat, Inc.'
    device     = 'Virtio network device'
    class      = network
    subclass   = ethernet
virtio_pci1@pci0:0:3:0: class=0x010000 rev=0x00 hdr=0x00 vendor=0x1af4 device=0x1001 subvendor=0x1af4 subdevice=0x0002
    vendor     = 'Red Hat, Inc.'
    device     = 'Virtio block device'
    class      = mass storage
    subclass   = SCSI

How do I fix this?

--------------5Ft0IJWG0bfMxH5LyjdMg8Zj--