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 7 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) 19 * 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. 23 */ 24 25 /* 26 * Keeping the fields ordered by size is an attempt at improving 27 * branch prediction in vmcs_read_any and vmcs_write_any. 28 */ 29 30 /* 16-bits */ 31 SHADOW_FIELD_RW(GUEST_INTR_STATUS) 32 SHADOW_FIELD_RW(GUEST_PML_INDEX) 33 SHADOW_FIELD_RW(HOST_FS_SELECTOR) 34 SHADOW_FIELD_RW(HOST_GS_SELECTOR) 35 36 /* 32-bits */ 37 SHADOW_FIELD_RO(VM_EXIT_REASON) 38 SHADOW_FIELD_RO(VM_EXIT_INTR_INFO) 39 SHADOW_FIELD_RO(VM_EXIT_INSTRUCTION_LEN) 40 SHADOW_FIELD_RO(IDT_VECTORING_INFO_FIELD) 41 SHADOW_FIELD_RO(IDT_VECTORING_ERROR_CODE) 42 SHADOW_FIELD_RO(VM_EXIT_INTR_ERROR_CODE) 43 SHADOW_FIELD_RW(CPU_BASED_VM_EXEC_CONTROL) 44 SHADOW_FIELD_RW(EXCEPTION_BITMAP) 45 SHADOW_FIELD_RW(VM_ENTRY_EXCEPTION_ERROR_CODE) 46 SHADOW_FIELD_RW(VM_ENTRY_INTR_INFO_FIELD) 47 SHADOW_FIELD_RW(VM_ENTRY_INSTRUCTION_LEN) 48 SHADOW_FIELD_RW(TPR_THRESHOLD) 49 SHADOW_FIELD_RW(GUEST_CS_AR_BYTES) 50 SHADOW_FIELD_RW(GUEST_SS_AR_BYTES) 51 SHADOW_FIELD_RW(GUEST_INTERRUPTIBILITY_INFO) 52 SHADOW_FIELD_RW(VMX_PREEMPTION_TIMER_VALUE) 53 54 /* Natural width */ 55 SHADOW_FIELD_RO(EXIT_QUALIFICATION) 56 SHADOW_FIELD_RO(GUEST_LINEAR_ADDRESS) 57 SHADOW_FIELD_RW(GUEST_RIP) 58 SHADOW_FIELD_RW(GUEST_RSP) 59 SHADOW_FIELD_RW(GUEST_CR0) 60 SHADOW_FIELD_RW(GUEST_CR3) 61 SHADOW_FIELD_RW(GUEST_CR4) 62 SHADOW_FIELD_RW(GUEST_RFLAGS) 63 SHADOW_FIELD_RW(CR0_GUEST_HOST_MASK) 64 SHADOW_FIELD_RW(CR0_READ_SHADOW) 65 SHADOW_FIELD_RW(CR4_READ_SHADOW) 66 SHADOW_FIELD_RW(HOST_FS_BASE) 67 SHADOW_FIELD_RW(HOST_GS_BASE) 68 69 /* 64-bit */ 70 SHADOW_FIELD_RO(GUEST_PHYSICAL_ADDRESS) 71 SHADOW_FIELD_RO(GUEST_PHYSICAL_ADDRESS_HIGH) 72 73 #undef SHADOW_FIELD_RO 74 #undef SHADOW_FIELD_RW 75