From nobody Wed Aug 11 10:30:06 2021 X-Original-To: freebsd-hackers@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 A7E071750D97 for ; Wed, 11 Aug 2021 10:30:19 +0000 (UTC) (envelope-from patrascu.naina14@gmail.com) Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gl5gG52GSz4mCC for ; Wed, 11 Aug 2021 10:30:18 +0000 (UTC) (envelope-from patrascu.naina14@gmail.com) Received: by mail-pl1-x62d.google.com with SMTP id e19so2043834pla.10 for ; Wed, 11 Aug 2021 03:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=z43TzR/5xF5Jd7ylXbuvMMsWYKAE8k/V9iblZk5iffY=; b=IvPTE07H6ZyqmDnsCxjY3As5lc/8uLGV/PQ/LI9ZsCdT5C7J9PHnvQ79Zdius7krrE wrTeLjNk1gD8cwo9yyvFH6/YRxeE9pvoxXoSGgavEMKYch1z4EbOPnmDb0f4ULQ6yTXX g6z4a4tTCxOHUlx5R8Xw7M/1L08tIG89OogmeV+MPzqISCSThWk6e4sBqnsMMnWNzwUo pso/kFbluj/NVnlI8LCCHWatxmazZdi/pDmmjYYWfr8jTtUCjm7Xbrfalqb9kLpB3EAh cdNgILiBnwYeX17CtzDDEs+9WBiei58RwDTaveWQTy7xgSam+xCivEiT0qrUQW3Rwhcx Atjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=z43TzR/5xF5Jd7ylXbuvMMsWYKAE8k/V9iblZk5iffY=; b=Wg6vkkdIs08ssFRsNEiH3/kp+Q+qL5dTC/8WKKK/0tVYH828UgrLyRxAvH8UGXO8vo Xi8XwULdP21qi1y7LeWfGTqS/wfgekqrqixpolZnhk1ZPQmOP3NfgWg2DUC9fXubOzdS jNjhsoZwQV9REdyVN+pDzWjTYsUlejbsAskNWSkM9CZWMy3mIg93nPb4MJUhTur57IBh lSbOpFJUEWXUoBbmMjIpWXdP2bggUIHhheL7qEEjFwwxCN3exGayPlql5CEykoCifRwu Iwo586OjHj0vhJzUxukLESVLDQTle7i6A7mZGlN+3ZkgkyXyH83IxwP+f5AVPYJU1ckX C7mg== X-Gm-Message-State: AOAM532+tjepDG4EB7coP3+QHtPGYkScW29ceyrVE7v0Zb8lhKxJ++XG GZXi0FysPYypHwTBdytpepmHuQSFAiynV1Durqx0SpSZ X-Google-Smtp-Source: ABdhPJxhXZYnH/oKs3/xx+ha6b9lwl8Cy6kOdk5R84cCnrVLMwrvPFBlQkEccm/6Puxi9W3ZT4QTIwGR2yAn3anBA90= X-Received: by 2002:a17:90a:c3:: with SMTP id v3mr9907071pjd.76.1628677817452; Wed, 11 Aug 2021 03:30:17 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 From: Naina Patrascu Date: Wed, 11 Aug 2021 13:30:06 +0300 Message-ID: Subject: USB passthrough in bhyve, USB keyboard disconnected To: freebsd-hackers@freebsd.org Cc: lucian_ioan.popescu@stud.acs.upb.ro, Elena Mihailescu Content-Type: multipart/alternative; boundary="000000000000c34b2a05c9461a16" X-Rspamd-Queue-Id: 4Gl5gG52GSz4mCC X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=IvPTE07H; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of patrascunaina14@gmail.com designates 2607:f8b0:4864:20::62d as permitted sender) smtp.mailfrom=patrascunaina14@gmail.com X-Spamd-Result: default: False [-3.80 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.80)[-0.795]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::62d:from]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_CC(0.00)[stud.acs.upb.ro,gmail.com]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: Y --000000000000c34b2a05c9461a16 Content-Type: text/plain; charset="UTF-8" Hello, We are working on the USB passthrough functionality for bhyve and we are currently focusing on the passthrough of a USB keyboard. We implemented the enumeration process and it seems to work properly, as we can see the information about the USB keyboard inside the virtual machine through the 'usbconfig' command: (guest) $ usbconfig (guest) ugen0.2: at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA) But at some point during the boot of the guest virtual machine, the USB keyboard is powered off: any LED from the keyboard is turned off and pressing any key does not generate logs in the guest or in the host. We tried multiple commands to display the information about the USB device: usbconfig, devinfo. We compared the outputs from the host and guest and the attachment to the guest looks correct. To inspect the transfers, we used the command below, but nothing is displayed on the guest: usbdump -i usbusX -f Y -s 65536 -vvv In the logs we see the steps of the enumeration successfully executed, and then some timeout errors, as we cannot execute any transfer with the keyboard, which seems disconnected. Could you help us find out why this disconnection happens? Could you give us a path for investigating this problem? We used multiple work environments: - the FreeBSD host started in QEMU kvm; nested virtualization enabled to create guest machine - FreeBSD host directly on a PC The behavior of our feature is the same. If you want to take a look, [1] is the repo containing our implementation; here [2] you can find iso files from our sources, and here [3] is a tutorial, describing the steps we use to create, run and destroy a virtual machine. Thank you! [1] https://github.com/FreeBSD-UPB/freebsd-src/tree/projects/bhyve_usb_passthrough [2] https://drive.google.com/drive/folders/17xUlbWSZ-wn6xT2ouv-M6miHV_LDeIEw?usp=sharing [3] https://github.com/FreeBSD-UPB/freebsd-src/wiki/Working-with-virtual-machines-in-bhyve-for-USB-passthrough --000000000000c34b2a05c9461a16--