On newer linux versions the guest may fail to use xhci,tablet device. The issues exists in 13.2 and 14.0 with the latest debian installer image and latest ubuntu 22.04. bhyve logs the following errors: ``` pci_xhci: portregs_write to unpowered port 1 ``` I've found an illumos bug [1] fixing the same issue. Unfortunately, the illumos fix causes the warning to disappear but the issue still exists. [1] https://www.illumos.org/issues/14623
Created attachment 247042 [details] ubuntu boot bhyve log I've enabled xhci_debug in bhyve and attached the log.
Hello, I can confirm that the same issue happens in Fedora 39 and Ubuntu 23.10 Live media bhyve guests. I spoke to someone on IRC about this and they suggested opening a bug report for it; looks like you beat me to it. I'll be happy to help test. Thank you
Created attachment 247158 [details] xhci mouse proposed fix Would you be able to try this patch ? Works on Ubuntu 23.10, and doesn't break anything on Ubuntu 22.04 and Windows 10. As a side-effect it also fixes the error messages about port-power. The USB3 spec mandates that the endpoint size for super-speed devices is 512, so the size field has to be 9, not 8. Linux only recently started checking this.
(In reply to Peter Grehan from comment #3) This patch did the trick for my Gentoo VM running Linux 6.1.66 on 13.2-RELEASE-p8. No more errors in the dmesg and the mouse is working. Thank you!
(In reply to Peter Grehan from comment #3) Thanks much, this patch also works for me. It fixes an Ubuntu 22.04 VM whose mouse stopped working after a kernel upgrade a week or so ago.
(In reply to Peter Grehan from comment #3) The patch is working for me on Fedora 39. Thank you very much Peter!
It's working for me too! Thanks! Reviewed-by: corvink
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=0c243cd4a3671bf728f33378ac593c08d8367bc2 commit 0c243cd4a3671bf728f33378ac593c08d8367bc2 Author: Peter Grehan <grehan@FreeBSD.org> AuthorDate: 2024-01-14 11:27:12 +0000 Commit: Peter Grehan <grehan@FreeBSD.org> CommitDate: 2024-01-14 11:38:55 +0000 Fix issue with Linux guest XHCI tablet probing. The USB3 spec mandates that the device-descriptor max packet size be 512 bytes, which requires a field size of 9 since it is a power-of-2. Linux kernels recently started validating this field, resulting in the table not being probed and the cursor not working in bhyve VNC. Reviewed by: corvink PR: 275760 MFC after: 1 week usr.sbin/bhyve/usb_mouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
I just ran into this problem. I saw the patch was just an 08→09 byte change. I found this byte on line 19170 in emacs hexl mode and changed it so: % cmp -xl bhyve.orig bhyve 0001917b 08 09 Now the mouse is working with xhci_mouse="yes" using the vm-bhyve pkg the VM is Ubuntu 22.04.3 LTS
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=2ee407b6068a994bba45597c995c5ea76eec9cf3 commit 2ee407b6068a994bba45597c995c5ea76eec9cf3 Author: Peter Grehan <grehan@FreeBSD.org> AuthorDate: 2024-01-14 11:27:12 +0000 Commit: Peter Grehan <grehan@FreeBSD.org> CommitDate: 2024-01-28 09:01:49 +0000 Fix issue with Linux guest XHCI tablet probing. The USB3 spec mandates that the device-descriptor max packet size be 512 bytes, which requires a field size of 9 since it is a power-of-2. Linux kernels recently started validating this field, resulting in the table not being probed and the cursor not working in bhyve VNC. PR: 275760 (cherry picked from commit 0c243cd4a3671bf728f33378ac593c08d8367bc2) usr.sbin/bhyve/usb_mouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=48214dfab80155c03b9b22aca9f9810774c151e9 commit 48214dfab80155c03b9b22aca9f9810774c151e9 Author: Peter Grehan <grehan@FreeBSD.org> AuthorDate: 2024-01-14 11:27:12 +0000 Commit: Peter Grehan <grehan@FreeBSD.org> CommitDate: 2024-01-28 09:03:25 +0000 Fix issue with Linux guest XHCI tablet probing. The USB3 spec mandates that the device-descriptor max packet size be 512 bytes, which requires a field size of 9 since it is a power-of-2. Linux kernels recently started validating this field, resulting in the table not being probed and the cursor not working in bhyve VNC. PR: 275760 (cherry picked from commit 0c243cd4a3671bf728f33378ac593c08d8367bc2) usr.sbin/bhyve/usb_mouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)