Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / x86 / kvm / vmx_shadow_fields.h
blobcd0c75f6d037a9781f8cc2d8cbead08368662529
1 #ifndef SHADOW_FIELD_RO
2 #define SHADOW_FIELD_RO(x)
3 #endif
4 #ifndef SHADOW_FIELD_RW
5 #define SHADOW_FIELD_RW(x)
6 #endif
8 /*
9 * We do NOT shadow fields that are modified when L0
10 * traps and emulates any vmx instruction (e.g. VMPTRLD,
11 * VMXON...) executed by L1.
12 * For example, VM_INSTRUCTION_ERROR is read
13 * by L1 if a vmx instruction fails (part of the error path).
14 * Note the code assumes this logic. If for some reason
15 * we start shadowing these fields then we need to
16 * force a shadow sync when L0 emulates vmx instructions
17 * (e.g. force a sync if VM_INSTRUCTION_ERROR is modified
18 * by nested_vmx_failValid)
20 * When adding or removing fields here, note that shadowed
21 * fields must always be synced by prepare_vmcs02, not just
22 * prepare_vmcs02_full.
26 * Keeping the fields ordered by size is an attempt at improving
27 * branch prediction in vmcs_read_any and vmcs_write_any.
30 /* 16-bits */
31 SHADOW_FIELD_RW(GUEST_CS_SELECTOR)
32 SHADOW_FIELD_RW(GUEST_INTR_STATUS)
33 SHADOW_FIELD_RW(GUEST_PML_INDEX)
34 SHADOW_FIELD_RW(HOST_FS_SELECTOR)
35 SHADOW_FIELD_RW(HOST_GS_SELECTOR)
37 /* 32-bits */
38 SHADOW_FIELD_RO(VM_EXIT_REASON)
39 SHADOW_FIELD_RO(VM_EXIT_INTR_INFO)
40 SHADOW_FIELD_RO(VM_EXIT_INSTRUCTION_LEN)
41 SHADOW_FIELD_RO(IDT_VECTORING_INFO_FIELD)
42 SHADOW_FIELD_RO(IDT_VECTORING_ERROR_CODE)
43 SHADOW_FIELD_RO(VM_EXIT_INTR_ERROR_CODE)
44 SHADOW_FIELD_RW(CPU_BASED_VM_EXEC_CONTROL)
45 SHADOW_FIELD_RW(EXCEPTION_BITMAP)
46 SHADOW_FIELD_RW(VM_ENTRY_EXCEPTION_ERROR_CODE)
47 SHADOW_FIELD_RW(VM_ENTRY_INTR_INFO_FIELD)
48 SHADOW_FIELD_RW(VM_ENTRY_INSTRUCTION_LEN)
49 SHADOW_FIELD_RW(TPR_THRESHOLD)
50 SHADOW_FIELD_RW(GUEST_CS_LIMIT)
51 SHADOW_FIELD_RW(GUEST_CS_AR_BYTES)
52 SHADOW_FIELD_RW(GUEST_INTERRUPTIBILITY_INFO)
53 SHADOW_FIELD_RW(VMX_PREEMPTION_TIMER_VALUE)
55 /* Natural width */
56 SHADOW_FIELD_RO(EXIT_QUALIFICATION)
57 SHADOW_FIELD_RO(GUEST_LINEAR_ADDRESS)
58 SHADOW_FIELD_RW(GUEST_RIP)
59 SHADOW_FIELD_RW(GUEST_RSP)
60 SHADOW_FIELD_RW(GUEST_CR0)
61 SHADOW_FIELD_RW(GUEST_CR3)
62 SHADOW_FIELD_RW(GUEST_CR4)
63 SHADOW_FIELD_RW(GUEST_RFLAGS)
64 SHADOW_FIELD_RW(GUEST_CS_BASE)
65 SHADOW_FIELD_RW(GUEST_ES_BASE)
66 SHADOW_FIELD_RW(CR0_GUEST_HOST_MASK)
67 SHADOW_FIELD_RW(CR0_READ_SHADOW)
68 SHADOW_FIELD_RW(CR4_READ_SHADOW)
69 SHADOW_FIELD_RW(HOST_FS_BASE)
70 SHADOW_FIELD_RW(HOST_GS_BASE)
72 /* 64-bit */
73 SHADOW_FIELD_RO(GUEST_PHYSICAL_ADDRESS)
74 SHADOW_FIELD_RO(GUEST_PHYSICAL_ADDRESS_HIGH)
76 #undef SHADOW_FIELD_RO
77 #undef SHADOW_FIELD_RW