| 91 | As mentioned before, we try to execute all guest code directly and only fallback to the recompiler in very rare situations. However, when executing guest ring 0 code in ring 1, a lot of additional instruction faults occur. This is because ring 1 is not allowed to execute privileged instructions. Every time we fault, the VMM steps in and emulates the desired behavior. This works perfectly well but the resulting performance will be very poor because CPU faults tend to be very expensive and there will be thousands of them per second. For raw ring 3, this is not a major problem as the number of faults generally does not increase by a large factor (unless the guest allows port I/O from ring 3, something we cannot do as we don't want the guest to be able to access real ports). In addition to excessive faults, there are also occasional compatibility problems because some system instructions do not fault when called in ring 1 but just behave differently (one of the design flaws of IA32/AMD64 that were never addressed). Such instructions have to be found and replaced. |