xHCI (and EHCI) nominally provide a mechanism for releasing ownership of the host controller back to the BIOS, which can then potentially restore legacy USB keyboard functionality. This is a rarely used code path, since most operating systems claim ownership and never attempt to later return to the BIOS. On some systems (observed with a Lenovo X1 Carbon), this code path leads to obscure and interesting bugs: if the xHCI and EHCI controllers are both claimed and later released back to the BIOS, then a subsequent call to INT 16,0305 to set the keyboard repeat rate to a non-default value will lock the system. Obscure though this sequence of operations may sound, it is exactly what happens when using iPXE to boot a Linux kernel via a USB network card. There is old and probably unwanted code in Linux's arch/x86/boot/main.c which sets the keyboard repeat rate (with the accompanying comment "Set keyboard repeat rate (why?)"). When booting Linux via a USB network card on a Lenovo X1 Carbon, the system therefore locks up immediately after jumping to the kernel's entry point. Work around this problem by preventing the release of ownership back to the BIOS if it is known that we are shutting down to boot an OS. This should allow legacy USB keyboard functionality to be restored if the user chooses to exit iPXE, while avoiding the rarely used code paths (and corresponding BIOS bugs) if the user chooses instead to boot an OS. Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
34 |
|
34 |
|
35 |
|
35 |
|
36 |
|
36 |
|
|
37 |
|
|
37 |
|
38 |
|
38 |
|
39 |
|
39 |
|
40 |
|
|
|
||
521 |
|
522 |
|
522 |
|
523 |
|
523 |
|
524 |
|
|
525 |
|
|
|
526 |
|
|
|
527 |
|
|
524 |
|
528 |
|
525 |
|
529 |
|
526 |
|
530 |
|
|
|
||
610 |
|
614 |
|
611 |
|
615 |
|
612 |
|
616 |
|
|
617 |
|
|
|
618 |
|
|
|
619 |
|
|
|
620 |
|
|
|
621 |
|
|
|
622 |
|
|
613 |
|
623 |
|
614 |
|
624 |
|
615 |
|
625 |
|
|
|
||
3190 |
|
3200 |
|
3191 |
|
3201 |
|
3192 |
|
3202 |
|
|
3203 |
|
|
|
3204 |
|
|
|
3205 |
|
|
|
3206 |
|
|
|
3207 |
|
|
|
3208 |
|
|
|
3209 |
|
|
|
3210 |
|
|
|
3211 |
|
|
|
3212 |
|
|
|
3213 |
|
|
|
3214 |
|
|
|
3215 |
|
|
|
3216 |
|
|
|
3217 |
|
|
|
3218 |
|
|
|
3219 |
|