From nobody Tue Jun 01 10:28:04 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 9751FDFB99D for ; Tue, 1 Jun 2021 10:28:17 +0000 (UTC) (envelope-from patrascu.naina14@gmail.com) Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (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 4FvSzh4SwWz4fZH for ; Tue, 1 Jun 2021 10:28:16 +0000 (UTC) (envelope-from patrascu.naina14@gmail.com) Received: by mail-pj1-x102f.google.com with SMTP id k22-20020a17090aef16b0290163512accedso1329742pjz.0 for ; Tue, 01 Jun 2021 03:28:16 -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=L6Khtr49uZyNgrg4Nnc4eeIyrAI4y+XmDrBB+3Ytq6A=; b=XMF/rzbJ8vXDG2p6aXHW0/vNRMM27PRjq6HRe7olANggAS5BncwmKxGtIFnAkwBlD8 Sn/5+OpJmw70deIO7c12VnLsmwgvJeyouaYEB8zO4xXVH9OJxX2RO+Lt4wOllt634HbK YyEpLUrfeDoJ+Z4RP1W/aXTi2JND0a4KVhoBTMS7OfAZIEKYKHni30IRcJBaMmZlHXYJ 5/8BcyOumT600YhWUP1pScUfk3SP1Sve49DyZyAGPiIrdqSOeNJQGuM6VHEEwFb+PxXl TEmvVEhjVWPrK4qBD8kn/sqvkdoNfnVHZzK2SOikSnCZmYMusk6eo3I5uALkKwZ4Eovt tWAQ== 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=L6Khtr49uZyNgrg4Nnc4eeIyrAI4y+XmDrBB+3Ytq6A=; b=KegqFsGjjaEquMBbDkU9W9b/Ukmq3LtMVHCXr0N02wR3kMEUo4fbYxGNsSndcW5iEE +2SEPKYz77cQQXRztbZTvn7z773JXOrxLb760coWtzXEB5nPIgQkhUm00ms6BqKKretq a74+IX7j/Df3nCeOolyJYNHhCymoRH6m5z967SIgNFNhznLgZGgBbL3O2uzQ8ggt9GDH /24iwN3z1U6AvjMkMlBJG6ylFqvAZxyIRpKNl2GYpuOBHkYAT7XcZ02HyjHKvhUea8aZ 1EkOGvkp34OC4Y4BhOttLbHVkbbuSpTq1AdoiJe9S6YmNoVMUcRM2fnY9K44cCLteqS/ 42ug== X-Gm-Message-State: AOAM531hTou++9QIOmrIWZy2vNzGpzsA48yROmb5Zim3CUiCmVpMQUN0 a9HP6QJ3LQ8KdXPj44kYVNQuG5UhD6lDVEHJLTtlUmzIs3FUTw== X-Google-Smtp-Source: ABdhPJyO/vvIwZQtPkCPqJBE3QkWGWQKkvIQKuRgwJKj81S3/+3eK5Bz4ia59DophlZvlSj2RIomcr7B+RJdzm51/cM= X-Received: by 2002:a17:902:9885:b029:f5:fc21:7837 with SMTP id s5-20020a1709029885b02900f5fc217837mr25512117plp.60.1622543294880; Tue, 01 Jun 2021 03:28:14 -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: Tue, 1 Jun 2021 13:28:04 +0300 Message-ID: Subject: Timeout errors when trying to passthrough a USB keyboard To: freebsd-hackers@freebsd.org Cc: lucian_ioan.popescu@stud.acs.upb.ro, Elena Mihailescu Content-Type: multipart/alternative; boundary="000000000000b95ed405c3b1cc8d" X-Rspamd-Queue-Id: 4FvSzh4SwWz4fZH X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=XMF/rzbJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of patrascunaina14@gmail.com designates 2607:f8b0:4864:20::102f as permitted sender) smtp.mailfrom=patrascunaina14@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::102f:from]; 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]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::102f:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::102f:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers]; FREEMAIL_CC(0.00)[stud.acs.upb.ro,gmail.com] X-ThisMailContainsUnwantedMimeParts: Y --000000000000b95ed405c3b1cc8d Content-Type: text/plain; charset="UTF-8" Hello, We are working on the USB passthrough functionality for bhyve. We are currently focusing on the passthrough of a USB keyboard, as we ran into some issues with the USB stick. The first part of the enumeration process 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) However, when pressing any key, we do not see any log in the guest or in the host. The keyboard seems to be turned off (any LED from the keyboard is turned off during the booting of the guest). We use libusb_detach_kernel_driver function from libusb library to detach the device from the host [1]. Here [2] it is a snippet from /var/log/messages file from the guest virtual machine. We noticed a timeout in the communication (lines 46, 47 in the log file [2]): xhci_timeout: xfer=0xfffff800052a4148 usbd_transfer_done: err=USB_ERR_TIMEOUT Could you help us understand where these timeout errors are coming from? Do you think it is necessary to implement first the Boot Protocol for the USB HID [3]? In this case, can you provide us some documentation that could help us? Thank you! [1] https://github.com/FreeBSD-UPB/freebsd-src/blob/a861e57e10512c0e3406762ffba2249bbd786492/usr.sbin/bhyve/usb_pmapper.c#L601 [2] https://gist.github.com/nainapatrascu/6903e421d64190f616c7becfe6c84991 [3] https://wiki.osdev.org/USB_Human_Interface_Devices --000000000000b95ed405c3b1cc8d--