Opened 3 years ago
Last modified 3 years ago
#20442 new defect
XHCI has wrong PCI config space and runtime register settings
| Reported by: | lerdmann | Owned by: | |
|---|---|---|---|
| Component: | USB | Version: | VirtualBox 6.1.22 |
| Keywords: | Cc: | ||
| Guest type: | other | Host type: | Windows |
Description
host: Win-10, guest: OS/2
These PCI config space registers contain incorrect values (without being touched by any driver): SBRN: is=0x20 should be=0x30 (only allowed value) FLADJ: is=0x00 should be=0x20 (default value)
Additionally, runtime register MFINDEX is upcounting and wrapping even though the operational USBCMD register does not have the "R/S" bit set ("run").
This is according to XHCI spec. I am not enough of a virtual machine expert to know if it is the USB HW that is not working according to spec or if it is the virtualization.
I have tried to get XHCI working with the corresponding XHCI driver (for OS/2) but it would not work. Not sure if that's the HW/virtualization or the HC driver doing the wrong thing.
Change History (4)
comment:1 by , 3 years ago
comment:2 by , 3 years ago
Ok, here is what I can say:
1) I now have a proper VM set up to use XHCI. Where can I attach that ? It's fairly big 1.2 GB in size. Is there a way to make that smaller ?
2) What I can also say and I have no clue if this is a HW or Virtualization problem but it cannot be a HC driver problem: I am reported ports 1 to 8 being USB2 protocol ports and ports 9 to 14 being USB 3 protocol ports (on the XHCI root hub). And yes, the two USB ports on the right of my notebook are USB2 protocol ports and the two USB ports on the left of my notebook are USB3 protocol ports (I had a look at the xhci extended caps supported protocol capability regs). The real odd thing is this: both left USB ports wire to the very same port status and control register (the 9 th port register) and both right USB ports wire to the very same port status and control register (the 1st port register).
I checked this by directly looking at the port status and control register block and then plugging in the USB device into the different ports.
comment:3 by , 3 years ago
as to 2)
Never mind, looks like there is no (or not necessarily) static connection between a physical USB port and a port number (and therefore, port status register). The first USB 3.0 device attached to a USB 3 protocol port will use port 9 and the second USB 3.0 device attached to the other USB 3 protocol port will use port 10. Of course, if I only attach 1 USB 3.0 device and change between the 2 ports, it will always go to port 9.
I found that surprising and it's certainly different from UHCI,OHCI,EHCI.
comment:4 by , 3 years ago
From what I can tell, the port status and control registers show sensible values if I attach a device (device speed, connection state etc.). For a USB2 protocol port, the enable bit (PED) will never switch to 1. I guess that's a HC driver problem (for some reason it does not initiate the necessary USB2 sequence to enable a port). For USB3 protocol port, the PED bit will switch to 1 but that is done in HW (according to XHCI spec), without involvement of the HC driver. Unfortunately, in both cases, the port link state (PLS) will always stay at 5 ("RxDetect"). It appears as if the port enabling sequence is not performed, for whatever reason.


I guess you've shown that no typical OS (Windows, Linux, Solaris, BSD, etc. etc.) looks at those PCI config registers. Interesting to know, probably not that useful.
"It would not work" won't get us anywhere. Either you have to tell us what exactly is the problem with the VirtualBox emulation, or provide a VM for testing so that we can have a look.