Few instructions make difference in virtualization

Anthony Liguori posted an interesting note about instructions that impact on virtualization performances:

One surprising thing about x86 virtualization is that while there is a small number of instructions that require special effort (around 17 depending on what you count), there are an even smaller number that make 95% of all the calls to these instructions.

These four instructions are cli, sti, pushf, popf (which probably isn’t all that surprising). An interesting result of this is that you only really have to focus on making these instructions fast…