background image

25-12 Vol. 3C

VMX NON-ROOT OPERATION

If the default treatment of SMIs and SMM (see Section 34.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 25.2).

If the dual-monitor treatment of SMIs and SMM (see Section 34.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 34.15.2 and Section 34.15.4 detail some 
differences.

25.5.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 MTF VM exits. An MTF VM exit may occur on an instruction 
boundary in VMX non-root operation as follows:

If the “monitor trap flag” VM-execution control is 1 and VM entry is injecting a vectored event (see Section 
26.5.1), 
an MTF VM exit is pending on the instruction boundary before the first instruction following the 
VM entry.

If VM entry is injecting a pending MTF VM exit (see Section 26.5.2), an MTF VM exit is pending on the 
instruction boundary before the first instruction following the VM entry. This is the case even if the “monitor 
trap flag” VM-execution control is 0.

If the “monitor trap flag” VM-execution control is 1, VM entry is not injecting an event, and a pending event 
(e.g., debug exception or interrupt) is delivered before an instruction can execute, an MTF VM exit is pending 
on the instruction boundary following delivery of the event (or any nested exception).

Suppose that the “monitor trap flag” VM-execution control is 1, VM entry is not injecting an event, and the first 
instruction following VM entry is a REP-prefixed string instruction:
— If the first iteration of the instruction causes a fault, an MTF VM exit is pending on the instruction boundary 

following delivery of the fault (or any nested exception).

— If the first iteration of the instruction does not cause a fault, an MTF VM exit is pending on the instruction 

boundary after that iteration.

Suppose that the “monitor trap flag” VM-execution control is 1, VM entry is not injecting an event, and the first 
instruction following VM entry is the XBEGIN instruction. In this case, an MTF VM exit is pending at the fallback 
instruction address of the XBEGIN instruction. This behavior applies regardless of whether advanced debugging 
of RTM transactional regions has been enabled (see Section 16.3.7, “RTM-Enabled Debugger Support,” of 
Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 1).

Suppose that the “monitor trap flag” VM-execution control is 1, VM entry is not injecting an event, and the first 
instruction following VM entry is neither a REP-prefixed string instruction or the XBEGIN instruction:
— If the instruction causes a fault, an MTF VM exit is pending on the instruction boundary following delivery of 

the fault (or any nested exception).

1

— If the instruction does not cause a fault, an MTF VM exit is pending on the instruction boundary following 

execution of that instruction. If the instruction is INT3 or INTO, this boundary follows delivery of any 
software exception. If the instruction is INT n, this boundary follows delivery of a software interrupt. If the 
instruction is HLT, the MTF VM exit will be from the HLT activity state.

No MTF VM exit occurs if another VM exit occurs before reaching the instruction boundary on which an MTF VM exit 
would be pending (e.g., due to an exception or triple fault).
An MTF VM exit occurs on the instruction boundary on which it is pending unless a higher priority event takes 
precedence or the MTF VM exit is blocked due to the activity state:

System-management interrupts (SMIs), INIT signals, and higher priority events take priority over MTF 
VM exits. MTF VM exits take priority over debug-trap exceptions and lower priority events.

1. This item includes the cases of an invalid opcode exception—#UD— generated by the UD2 instruction and a BOUND-range exceeded 

exception—#BR—generated by the BOUND instruction.