The XHCI spec says nothing about this as its nothing to do with XHCI.
This depends entirely on your chipset or your board implementation. You need to check the documentation for the system to work out how to switch the multiplexor ("mux") to switch the ports over.
When the port is switched to the companion controller, the XHCI just doesn't see anything plugged into it, so the XHCI is irrelevant at this point.
In the systems I've worked on, the chipset implemented a mux on some ports, and there were PCI config space writes needed to switch them from one controller to the other. The chipset didn't have muxes on some of the other ports, so there was an external mux layed down on the board, that was controlled by GPIOs. Neither of these muxes really had anything to do with the XHCI, so they would properly be handled by the chipset or board init functions.