[34] | 1 | Domain firmware support |
---|
| 2 | ----------------------- |
---|
| 3 | |
---|
| 4 | One of the key advantages of full virtualization hardware support (such |
---|
| 5 | as Intel's VT or AMD's SVM extensions) is the ability to run unmodified |
---|
| 6 | guest operating systems. However, since most OSes rely on BIOS support |
---|
| 7 | during their early bringup, we need to provide a surrogate ROMBIOS and |
---|
| 8 | VGABIOS firmware layer. |
---|
| 9 | |
---|
| 10 | What's more, we need to support real-mode which is required by |
---|
| 11 | the firmware and bootstrap loaders. Real-mode support is especially |
---|
| 12 | challenging for Intel's VMX (VT) enabled CPUs where there is no real-mode |
---|
| 13 | support for VMX guest partitions. In this case you either have to do full |
---|
| 14 | emulation (full real-mode emulator; more complete but potentially slower) |
---|
| 15 | or partial emulation (use the VM8086 extensions, emulate only those |
---|
| 16 | instructions that are missing; faster, but potentially incomplete). The |
---|
| 17 | vmxassist code in this subdirectory uses the later approach because it |
---|
| 18 | is smaller and faster. |
---|
| 19 | |
---|
| 20 | The approach is relatively straight forward. Vmxloader contains three |
---|
| 21 | payloads (rombios, vgabios and vmxassist) and it is bootstrapped as any |
---|
| 22 | other 32-bit OS. Vmxloader copies its payloads to the addresses below |
---|
| 23 | and transfers control to vmxassist. |
---|
| 24 | |
---|
| 25 | vgabios VGABIOS (standard and Cirrus). |
---|
| 26 | Resides at C000:0000. |
---|
| 27 | |
---|
| 28 | vmxassist VMXAssist VM86 realmode emulator for VMX. |
---|
| 29 | Resides at D000:0000. |
---|
| 30 | |
---|
| 31 | rombios ROMBIOS code. Derived from Bochs. |
---|
| 32 | Resides at F000:0000 |
---|
| 33 | |
---|
| 34 | Vmxassist first sets up it own world (GDT, IDT, TR, etc), enables |
---|
| 35 | VM8086 and then transfers control to F000:FFF0 and executes 16-bit |
---|
| 36 | code. Unsupported instructions cause a general protection failure at |
---|
| 37 | which point vmxassist kicks in and emulates the offending instruction. |
---|
| 38 | Whever the emulated code transitions to 32-bit protected mode, vmxassist |
---|
| 39 | will go away. Whenever 32-bit protected code transitions to real-mode, |
---|
| 40 | Xen/VMX will detect this and transfer control to vmxassist. |
---|
| 41 | |
---|
| 42 | Most of the vmxassist complexity comes from properly handling the |
---|
| 43 | real to protected mode and protected to real mode transitions and |
---|
| 44 | the proper emulation of the segment registers. Even though the Intel |
---|
| 45 | manual clearly states that you should immediately perform a jmp far |
---|
| 46 | after a mode transition, many operating systems execute additional |
---|
| 47 | instructions and some even refer to segment selectors and pop data |
---|
| 48 | from the stack. Vmxassist contains a number of work arounds for these |
---|
| 49 | OSes. |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | Acknowledgements |
---|
| 53 | ---------------- |
---|
| 54 | |
---|
| 55 | The rombios was taken (largely unmodified) from Bochs, which was written |
---|
| 56 | by Kevin Lawton. The VGABIOS was written by Christophe Bothamy. Arun Sharma, |
---|
| 57 | Asit Mallick and Nitin Kamble (Intel) provided the E820 patches and lots |
---|
| 58 | of useful feedback. |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | Contact |
---|
| 62 | ------- |
---|
| 63 | |
---|
| 64 | Leendert van Doorn |
---|
| 65 | IBM T.J. Watson Research Center |
---|
| 66 | 19 Skyline Drive |
---|
| 67 | Hawthorne, NY 10532 |
---|
| 68 | leendert@watson.ibm.com |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | Tested Operating Systems |
---|
| 72 | ------------------------ |
---|
| 73 | |
---|
| 74 | Since vmxassist uses partial emulation, it may always miss opcodes |
---|
| 75 | that are required by a particular OS. The table below lists the OSes |
---|
| 76 | I have tried. The Install column indicates a full CD/DVD install into |
---|
| 77 | a VMX partition. The Disk column indicates booting from prefabricated |
---|
| 78 | disk image. |
---|
| 79 | |
---|
| 80 | Operating System Install Disk |
---|
| 81 | ------------------------------------------------------------ |
---|
| 82 | RedHat Enterprise Linux (RHEL3_U5) Yes Yes |
---|
| 83 | Fedora Code (FC3) (-) Yes |
---|
| 84 | FreeBSD 5.3 (-) Yes |
---|
| 85 | MS-DOS 5.0 (-) Yes |
---|
| 86 | |
---|
| 87 | (-) not tried yet |
---|
| 88 | |
---|