Patent ID: 9027003
Filing Date: 2015-05-05
Classification: G06F

Abstract:
1. A method for counting guest branch instructions in a virtualized computer system having a virtualization layer, the method comprising: entering direct execution mode of the virtualized computer system from the virtualization layer; executing guest instructions in the direct execution mode of the virtualized computer system, the direct execution mode operating according to a first privilege level, the first privilege level having a lower privilege than a second privilege level according to which the virtualization layer operates; maintaining a first privilege level branch count of executed first privilege level branch instructions while executing the guest instructions in the direct execution mode; and upon a first interrupt that is transparent to the virtualization layer occurring and being processed by a first interrupt handler at a privilege level higher than the first privilege level and returning from the first interrupt handler to execute the guest instructions in the direct execution mode, triggering a second interrupt, which is processed in a second interrupt handler to adjust the first privilege level branch count, wherein adjusting the first privilege level branch count includes determining a number of previously executed first privilege level branch instruction caused by control transfers to the direct execution mode, and decrementing the first privilege level branch count by the determined number of previously executed first privilege level branch instructions.