84 | | Since, however, nearly all operating systems in use today only make use of ring-0 and ring-3, and since context switching between root mode and non-root mode is very expensive, !VirtualBox does not use VMX entirely as intended by Intel. Instead, we make partial use of it -- only where it makes sense and where it helps us to improve performance. |
| 84 | In non-root mode, the processor will automatically cause VM exits for certain privileged instructions and events. For some of these instructions, it is even configurable whether VM exits should occur. |
| 85 | |
| 86 | Since, however, nearly all operating systems in use today only make use of ring-0 and ring-3, and since a lot of operations in non-root mode are very expensive, !VirtualBox does not use VMX exactly as intended by Intel. Instead, we make partial use of it -- only where it makes sense and where it helps us to improve performance. So, as said above, our hypervisor, on non-VMX machines, lives in ring 0 of the guest context, below the guest ring-0 code that is actually run in ring 1. When VMX is enabled, the hypervisor can safely live in ring 0 ''host'' context and gets activated automatically by use of the new VM exits. |