We currently use flat real mode wherever real mode is required. This guarantees that we will not surprise some unsuspecting external caller which has carefully set up flat real mode by suddenly reducing the segment limits to 64kB. However, operating in flat real mode imposes a severe performance penalty in some virtualisation environments, since some CPUs cannot fully virtualise flat real mode and so the hypervisor must fall back to emulation. In particular, operating under KVM on a pre-Westmere Intel CPU will be at least an order of magnitude slower, to the point that there is a visible teletype effect when printing anything to the BIOS console. (Older versions of KVM used to cheat and ignore the "flat" part of flat real mode, which masked the problem.) Switch (back) to using genuine real mode with 64kB segment limits instead of flat real mode. Hopefully this won't break anything. Add an explicit switch to flat real mode before returning to the BIOS from the ROM prefix, since we know that a PMM BIOS will call the ROM initialisation point (and potentially the BEV) in flat real mode. As noted in previous commit messages, it is not possible to restore the real-mode segment limits after a transition to protected mode, since there is no way to know which protected-mode segment descriptor was originally used to initialise the limit portion of the segment register. Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
754 |
|
754 |
|
755 |
|
755 |
|
756 |
|
756 |
|
|
757 |
|
|
|
758 |
|
|
|
759 |
|
|
757 |
|
760 |
|
758 |
|
761 |
|
759 |
|
762 |
|
|
|
||
66 |
|
66 |
|
67 |
|
67 |
|
68 |
|
68 |
|
69 |
|
|
|
|
69 |
|
|
70 |
|
70 |
|
71 |
|
|
|
|
71 |
|
|
72 |
|
72 |
|
73 |
|
73 |
|
74 |
|
|
|
|
74 |
|
|
75 |
|
75 |
|
76 |
|
|
|
77 |
|
|
|
|
76 |
|
|
|
77 |
|
|
78 |
|
78 |
|
79 |
|
79 |
|
80 |
|
80 |
|
|
|
||
506 |
|
506 |
|
507 |
|
507 |
|
508 |
|
508 |
|
|
509 |
|
|
|
510 |
|
|
|
511 |
|
|
|
512 |
|
|
|
513 |
|
|
|
514 |
|
|
|
515 |
|
|
|
516 |
|
|
|
517 |
|
|
|
518 |
|
|
|
519 |
|
|
|
520 |
|
|
|
521 |
|
|
|
522 |
|
|
|
523 |
|
|
|
524 |
|
|
|
525 |
|
|
|
526 |
|
|
|
527 |
|
|
|
528 |
|
|
|
529 |
|
|
|
530 |
|
|
|
531 |
|
|
|
532 |
|
|
|
533 |
|
|
|
534 |
|
|
|
535 |
|
|
|
536 |
|
|
|
537 |
|
|
|
538 |
|
|
509 |
|
539 |
|
510 |
|
540 |
|
511 |
|
541 |
|