162306a36Sopenharmony_ci#if !defined(SHADOW_FIELD_RO) && !defined(SHADOW_FIELD_RW) 262306a36Sopenharmony_ciBUILD_BUG_ON(1) 362306a36Sopenharmony_ci#endif 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci#ifndef SHADOW_FIELD_RO 662306a36Sopenharmony_ci#define SHADOW_FIELD_RO(x, y) 762306a36Sopenharmony_ci#endif 862306a36Sopenharmony_ci#ifndef SHADOW_FIELD_RW 962306a36Sopenharmony_ci#define SHADOW_FIELD_RW(x, y) 1062306a36Sopenharmony_ci#endif 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci/* 1362306a36Sopenharmony_ci * We do NOT shadow fields that are modified when L0 1462306a36Sopenharmony_ci * traps and emulates any vmx instruction (e.g. VMPTRLD, 1562306a36Sopenharmony_ci * VMXON...) executed by L1. 1662306a36Sopenharmony_ci * For example, VM_INSTRUCTION_ERROR is read 1762306a36Sopenharmony_ci * by L1 if a vmx instruction fails (part of the error path). 1862306a36Sopenharmony_ci * Note the code assumes this logic. If for some reason 1962306a36Sopenharmony_ci * we start shadowing these fields then we need to 2062306a36Sopenharmony_ci * force a shadow sync when L0 emulates vmx instructions 2162306a36Sopenharmony_ci * (e.g. force a sync if VM_INSTRUCTION_ERROR is modified 2262306a36Sopenharmony_ci * by nested_vmx_failValid) 2362306a36Sopenharmony_ci * 2462306a36Sopenharmony_ci * When adding or removing fields here, note that shadowed 2562306a36Sopenharmony_ci * fields must always be synced by prepare_vmcs02, not just 2662306a36Sopenharmony_ci * prepare_vmcs02_rare. 2762306a36Sopenharmony_ci */ 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci/* 3062306a36Sopenharmony_ci * Keeping the fields ordered by size is an attempt at improving 3162306a36Sopenharmony_ci * branch prediction in vmcs12_read_any and vmcs12_write_any. 3262306a36Sopenharmony_ci */ 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci/* 16-bits */ 3562306a36Sopenharmony_ciSHADOW_FIELD_RW(GUEST_INTR_STATUS, guest_intr_status) 3662306a36Sopenharmony_ciSHADOW_FIELD_RW(GUEST_PML_INDEX, guest_pml_index) 3762306a36Sopenharmony_ciSHADOW_FIELD_RW(HOST_FS_SELECTOR, host_fs_selector) 3862306a36Sopenharmony_ciSHADOW_FIELD_RW(HOST_GS_SELECTOR, host_gs_selector) 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci/* 32-bits */ 4162306a36Sopenharmony_ciSHADOW_FIELD_RO(VM_EXIT_REASON, vm_exit_reason) 4262306a36Sopenharmony_ciSHADOW_FIELD_RO(VM_EXIT_INTR_INFO, vm_exit_intr_info) 4362306a36Sopenharmony_ciSHADOW_FIELD_RO(VM_EXIT_INSTRUCTION_LEN, vm_exit_instruction_len) 4462306a36Sopenharmony_ciSHADOW_FIELD_RO(IDT_VECTORING_INFO_FIELD, idt_vectoring_info_field) 4562306a36Sopenharmony_ciSHADOW_FIELD_RO(IDT_VECTORING_ERROR_CODE, idt_vectoring_error_code) 4662306a36Sopenharmony_ciSHADOW_FIELD_RO(VM_EXIT_INTR_ERROR_CODE, vm_exit_intr_error_code) 4762306a36Sopenharmony_ciSHADOW_FIELD_RO(GUEST_CS_AR_BYTES, guest_cs_ar_bytes) 4862306a36Sopenharmony_ciSHADOW_FIELD_RO(GUEST_SS_AR_BYTES, guest_ss_ar_bytes) 4962306a36Sopenharmony_ciSHADOW_FIELD_RW(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control) 5062306a36Sopenharmony_ciSHADOW_FIELD_RW(PIN_BASED_VM_EXEC_CONTROL, pin_based_vm_exec_control) 5162306a36Sopenharmony_ciSHADOW_FIELD_RW(EXCEPTION_BITMAP, exception_bitmap) 5262306a36Sopenharmony_ciSHADOW_FIELD_RW(VM_ENTRY_EXCEPTION_ERROR_CODE, vm_entry_exception_error_code) 5362306a36Sopenharmony_ciSHADOW_FIELD_RW(VM_ENTRY_INTR_INFO_FIELD, vm_entry_intr_info_field) 5462306a36Sopenharmony_ciSHADOW_FIELD_RW(VM_ENTRY_INSTRUCTION_LEN, vm_entry_instruction_len) 5562306a36Sopenharmony_ciSHADOW_FIELD_RW(TPR_THRESHOLD, tpr_threshold) 5662306a36Sopenharmony_ciSHADOW_FIELD_RW(GUEST_INTERRUPTIBILITY_INFO, guest_interruptibility_info) 5762306a36Sopenharmony_ciSHADOW_FIELD_RW(VMX_PREEMPTION_TIMER_VALUE, vmx_preemption_timer_value) 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_ci/* Natural width */ 6062306a36Sopenharmony_ciSHADOW_FIELD_RO(EXIT_QUALIFICATION, exit_qualification) 6162306a36Sopenharmony_ciSHADOW_FIELD_RO(GUEST_LINEAR_ADDRESS, guest_linear_address) 6262306a36Sopenharmony_ciSHADOW_FIELD_RW(GUEST_RIP, guest_rip) 6362306a36Sopenharmony_ciSHADOW_FIELD_RW(GUEST_RSP, guest_rsp) 6462306a36Sopenharmony_ciSHADOW_FIELD_RW(GUEST_CR0, guest_cr0) 6562306a36Sopenharmony_ciSHADOW_FIELD_RW(GUEST_CR3, guest_cr3) 6662306a36Sopenharmony_ciSHADOW_FIELD_RW(GUEST_CR4, guest_cr4) 6762306a36Sopenharmony_ciSHADOW_FIELD_RW(GUEST_RFLAGS, guest_rflags) 6862306a36Sopenharmony_ciSHADOW_FIELD_RW(CR0_GUEST_HOST_MASK, cr0_guest_host_mask) 6962306a36Sopenharmony_ciSHADOW_FIELD_RW(CR0_READ_SHADOW, cr0_read_shadow) 7062306a36Sopenharmony_ciSHADOW_FIELD_RW(CR4_READ_SHADOW, cr4_read_shadow) 7162306a36Sopenharmony_ciSHADOW_FIELD_RW(HOST_FS_BASE, host_fs_base) 7262306a36Sopenharmony_ciSHADOW_FIELD_RW(HOST_GS_BASE, host_gs_base) 7362306a36Sopenharmony_ci 7462306a36Sopenharmony_ci/* 64-bit */ 7562306a36Sopenharmony_ciSHADOW_FIELD_RO(GUEST_PHYSICAL_ADDRESS, guest_physical_address) 7662306a36Sopenharmony_ciSHADOW_FIELD_RO(GUEST_PHYSICAL_ADDRESS_HIGH, guest_physical_address) 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ci#undef SHADOW_FIELD_RO 7962306a36Sopenharmony_ci#undef SHADOW_FIELD_RW 80