Intel 64 and IA-32 Architectures Software Developers Manual Volume 3B, System Programming Guide Part 2

Table Of Contents
21-26 Vol. 3
VMX NON-ROOT OPERATION
21.7 FEATURES SPECIFIC TO VMX NON-ROOT OPERATION
Some VM-execution controls cause VM exits using features that are specific to VMX
non-root operation. These are the VMX-preemption timer (Section 21.7.1) and the
monitor trap flag (Section 21.7.2).
21.7.1 VMX-Preemption Timer
If the last VM entry was performed with the 1-setting of “activate VMX-preemption
timer” VM-execution control, the VMX-preemption timer counts down (from the
value loaded by VM entry; see Section 22.6.4) in VMX non-root operation. When the
timer counts down to zero, it stops counting down and a VM exit occurs (see Section
21.3).
The VMX-preemption timer counts down at rate proportional to that of the timestamp
counter (TSC). Specifically, the timer counts down by 1 every time bit X in the TSC
changes due to a TSC increment. The value of X is in the range 0–31 and can be
determined by consulting the VMX capability MSR IA32_VMX_MISC (see Appendix
G.6).
The VMX-preemption timer operates only in the C-states C0, C1, and C2. If the timer
counts down to zero in C1 or C2, the logical processor transitions to the C0 C-state
and causes a VM exit. Outside the C-states C0, C1, and C2, the timer is not decre-
mented and does not cause VM exits.
Treatment of the timer in the case of system management interrupts (SMIs) and
system-management mode (SMM) depends on whether the treatment of SMIs and
SMM:
If the default treatment of SMIs and SMM (see Section 25.14) is active, the VMX-
preemption timer counts across an SMI to VMX non-root operation, subsequent
execution in SMM, and the return from SMM via the RSM instruction. However,
the timer can cause a VM exit only from VMX non-root operation. If the timer
expires during SMI, in SMM, or during RSM, a timer-induced VM exit occurs
immediately after RSM with its normal priority unless it is blocked based on
activity state (Section 21.3).
If the dual-monitor treatment of SMIs and SMM (see Section 25.15) is active,
transitions into and out of SMM are VM exits and VM entries, respectively. The
treatment of the VMX-preemption timer by those transitions is mostly the same
as for ordinary VM exits and VM entries; Section 25.15.2 and Section 25.15.4
detail some differences.
21.7.2 Monitor Trap Flag
The monitor trap flag is a debugging feature that causes VM exits to occur on
certain instruction boundaries in VMX non-root operation. Such VM exits are called