background image

Vol. 3C 24-25

VIRTUAL MACHINE CONTROL STRUCTURES

Writing to a VMCS with an ordinary memory write is not guaranteed to have a deterministic effect on the VMCS. 
Doing so may cause the VMCS to become corrupted (see below).

(Software can avoid these hazards by removing any linear-address mappings to a VMCS region before executing a 
VMPTRLD for that region and by not remapping it until after executing VMCLEAR for that region.)
If a logical processor leaves VMX operation, any VMCSs active on that logical processor may be corrupted (see 
below). To prevent such corruption of a VMCS that may be used either after a return to VMX operation or on 
another logical processor, software should execute VMCLEAR for that VMCS before executing the VMXOFF instruc-
tion or removing power from the processor (e.g., as part of a transition to the S3 and S4 power states).
This section has identified operations that may cause a VMCS to become corrupted. These operations may cause 
the VMCS’s data to become undefined. Behavior may be unpredictable if that VMCS used subsequently on any 
logical processor. The following items detail some hazards of VMCS corruption:

VM entries may fail for unexplained reasons or may load undesired processor state.

The processor may not correctly support VMX non-root operation as documented in Chapter 27 and may 
generate unexpected VM exits.

VM exits may load undesired processor state, save incorrect state into the VMCS, or cause the logical processor 
to transition to a shutdown state.

24.11.2  VMREAD, VMWRITE, and Encodings of VMCS Fields

Every field of the VMCS is associated with a 32-bit value that is its encoding. The encoding is provided in an 
operand to VMREAD and VMWRITE when software wishes to read or write that field. These instructions fail if given, 
in 64-bit mode, an operand that sets an encoding bit beyond bit 32. See Chapter 30 for a description of these 
instructions.
The structure of the 32-bit encodings of the VMCS components is determined principally by the width of the fields 
and their function in the VMCS. See Table 24-17.

The following items detail the meaning of the bits in each encoding:

Field width. Bits 14:13 encode the width of the field.
— A value of 0 indicates a 16-bit field.
— A value of 1 indicates a 64-bit field.

Table 24-17.  Structure of VMCS Component Encoding

Bit Position(s)

Contents

0

Access type (0 = full; 1 = high); must be full for 16-bit, 32-bit, and natural-width fields

9:1

Index

11:10

Type:

0: control

1: VM-exit information

2: guest state

3: host state

12

Reserved (must be 0)

14:13

Width:

0: 16-bit

1: 64-bit

2: 32-bit

3: natural-width

31:15

Reserved (must be 0)