Patent Document ID: 7500244
Application ID: 10881784
Patent Status: 1

Claim One:
1. A computer-implemented method comprising: calculating an exit-enter time (EET) to exit and enter a context and a save-restore time (SRT) to save and restore a machine state; executing a selective algorithm that saves and restores the machine state before passing control to a virtual machine (VM) only if unprivileged instructions allowing use of the machine state are available to the VM and accumulating statistics for an expected value for EET overhead and an expected value for SRT overhead while executing the selective algorithm; computing a cost of the selective algorithm using the expected value for EET overhead and the expected value for SRT overhead; comparing the cost of the selective algorithm to two times SRT which is the cost of an unconditional algorithm that always saves and restores the machine state on context changes; and selecting one of the selective algorithm or the unconditional algorithm having the least cost as a virtualization algorithm to virtualize context changes.