Embodiments of apparatuses, methods, and systems for virtualizing performance counters are disclosed. In one embodiment, an apparatus includes a counter, a counter enable storage location, counter enable logic, and virtual machine control logic. The counter enable storage location is store a counter
Embodiments of apparatuses, methods, and systems for virtualizing performance counters are disclosed. In one embodiment, an apparatus includes a counter, a counter enable storage location, counter enable logic, and virtual machine control logic. The counter enable storage location is store a counter enable indicator. The counter enable logic is to enable the counter, based on the counter enable indicator. The virtual machine control logic is to transfer control of the apparatus to a guest. The virtual machine control logic includes guest state load logic to cause a guest value from a virtual machine control structure to be loaded into the counter enable storage location in connection with a transfer of control of the apparatus to a guest.
대표청구항▼
1. An apparatus comprising a processor, the processor further comprising: a plurality of counters;counter enable storage locations to store a plurality of counter enable bits, each counter enable bit uniquely corresponding to one of the plurality of counters;counter enable logic to enable a first co
1. An apparatus comprising a processor, the processor further comprising: a plurality of counters;counter enable storage locations to store a plurality of counter enable bits, each counter enable bit uniquely corresponding to one of the plurality of counters;counter enable logic to enable a first counter of the plurality of counters responsive to a first counter enable bit being set, the first counter enable bit uniquely associated with the first counter, and to enable a second counter of the plurality of counters responsive to a second counter enable bit being set, the second counter enable bit uniquely associated with the second counter; andvirtual machine control logic to transfer control of the apparatus to a guest, including guest state load logic to cause a guest value from a virtual machine control structure to be loaded into a particular counter enable storage location of the counter enable storage locations in connection with a transfer of control to the guest. 2. The apparatus of claim 1, wherein the first counter is to count cache misses and the second counter is to count cache hits. 3. The apparatus of claim 1, wherein the virtual machine control logic is also to transfer control of the apparatus from the guest to a host, and also includes host state load logic to cause a host value from the virtual machine control structure to be loaded into the particular counter enable storage location in connection with a transfer of control from the guest to the host. 4. The apparatus of claim 3, wherein the virtual machine control logic also includes guest state store logic to cause contents of the particular counter enable storage location to be stored in the virtual machine control structure in connection with the transfer of control from the guest to the host. 5. The apparatus of claim 1, wherein the virtual machine control logic also includes virtual machine entry logic to enable the guest state load logic based on a guest state load enable indicator in the virtual machine control structure. 6. The apparatus of claim 3, wherein the virtual machine control logic also includes virtual machine exit logic to enable the host state load logic based on a host state load enable indicator in the virtual machine control structure. 7. The apparatus of claim 4, wherein the virtual machine control logic also includes virtual machine exit logic to enable the guest state store logic based on a guest state store enable indicator in the virtual machine control structure. 8. The apparatus of claim 1, further comprising a global enable storage location to store a global enable indicator, wherein if the global enable indicator has a disable value the plurality of counters are disabled. 9. The system of claim 1, wherein the first counter is to increment for each instance of a clock cycle during a selected event. 10. A method comprising: configuring a first counter in a processor to count occurrences of a first event associated with execution of instructions in a virtualized computational environment;configuring a second counter in the processor to count occurrences of a second event associated with execution of the instructions in the virtualized computational environment;initiating a transfer of control of the processor from a host to a guest;loading a first and a second guest value from a virtual machine control structure into a first and a second counter enable bit storage location;completing the transfer of control of the processor to the guest;determining whether to change a count of the first counter based on contents of the first counter enable bit storage location that is uniquely associated with the first counter and operative to enable the first counter, and based on a first occurrence of the first event; anddetermining whether to change a count of the second counter based on contents of the second counter enable bit storage location that is uniquely associated with the second counter and operative to enable the second counter, and based on a first occurrence of the second event. 11. The method of claim 10, further comprising: initiating a transfer of control of the processor from the guest to the host;loading a first host value and a second host value from the virtual machine control structure into the first and second counter enable bit storage locations;completing the transfer of control of the processor from the guest to the host;determining whether to change the count of the first counter based on the contents of the first counter enable bit storage location and based on a second occurrence of the first event; anddetermining whether to change the count of the second counter based on the contents of the second counter enable bit storage location and based on a second occurrence of the second event. 12. The method of claim 11, further comprising storing the contents of the first and the second counter enable bit storage locations in the virtual machine control structure after initiating the transfer of control of the processor from the guest to the host. 13. The method of claim 10, further comprising enabling the processor to load the first and the second guest values based on a guest state load enable indicator in the virtual machine control structure. 14. The method of claim 11, further comprising enabling the processor to load the first host value and the second host value based on a host state load enable indicator in the virtual machine control structure. 15. The method of claim 11, further comprising enabling the processor to store the contents of the first counter enable bit storage location and the second counter enable bit storage location based on a guest state store enable indicator in the virtual machine control structure. 16. The method of claim 10, wherein determining whether to change the count of the first counter is further based on whether a match exists between contents of a counter identifier storage location in the processor and contents of a counter identifier field in the virtual machine control structure. 17. A system comprising: a memory to store a data structure to control a virtual machine; anda processor including: a plurality of counters;a counter enable storage location to store a plurality of counter enable bits;counter enable logic to: enable a first counter to count occurrences of a first event type associated with execution of instructions in a virtualized computational environment responsive to a first counter enable bit being set, the first counter enable bit uniquely associated with the first counter;enable a second counter to count occurrences of a second event type associated with the execution of the instructions in the virtualized computational environment responsive to a second counter enable bit being set, the second counter enable bit uniquely associated with the second counter; andvirtual machine control logic to transfer control of the processor to a guest, including guest state load logic to cause a guest value from the data structure to be loaded into the counter enable storage location in connection with a transfer of control to the guest. 18. The system of claim 17, wherein the plurality of counters are to log performance monitoring information. 19. The system of claim 17, wherein the memory is dynamic random access memory. 20. The system of claim 17, wherein the processor includes a global counter enable storage location to store a global counter enable indicator, wherein the first counter and the second counter are disabled responsive to the global enable indicator having a disable value.
연구과제 타임라인
LOADING...
LOADING...
LOADING...
LOADING...
LOADING...
이 특허에 인용된 특허 (4)
DeWitt, Jr.,Jimmie Earl; Levine,Frank Eliot; Richardson,Christopher Michael; Urquhart,Robert John, Method and apparatus for autonomically initiating measurement of secondary metrics based on hardware counter values for primary metrics.
※ AI-Helper는 부적절한 답변을 할 수 있습니다.