Lines Matching refs:vmcs12
58 #define SHADOW_FIELD_RO(x, y) { x, offsetof(struct vmcs12, y) },
65 #define SHADOW_FIELD_RW(x, y) { x, offsetof(struct vmcs12, y) },
335 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_ept_inject_page_fault() local
350 vmcs12->guest_physical_address = fault->address; in nested_ept_inject_page_fault()
376 static bool nested_vmx_is_page_fault_vmexit(struct vmcs12 *vmcs12, in nested_vmx_is_page_fault_vmexit() argument
381 bit = (vmcs12->exception_bitmap & (1u << PF_VECTOR)) != 0; in nested_vmx_is_page_fault_vmexit()
383 (error_code & vmcs12->page_fault_error_code_mask) != in nested_vmx_is_page_fault_vmexit()
384 vmcs12->page_fault_error_code_match; in nested_vmx_is_page_fault_vmexit()
395 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_check_exception() local
405 if (nested_vmx_is_page_fault_vmexit(vmcs12, in nested_vmx_check_exception()
410 } else if (vmcs12->exception_bitmap & (1u << nr)) { in nested_vmx_check_exception()
430 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in vmx_inject_page_fault_nested() local
434 if (nested_vmx_is_page_fault_vmexit(vmcs12, fault->error_code) && in vmx_inject_page_fault_nested()
436 vmcs12->vm_exit_intr_error_code = fault->error_code; in vmx_inject_page_fault_nested()
447 struct vmcs12 *vmcs12) in nested_vmx_check_io_bitmap_controls() argument
449 if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) in nested_vmx_check_io_bitmap_controls()
452 if (CC(!page_address_valid(vcpu, vmcs12->io_bitmap_a)) || in nested_vmx_check_io_bitmap_controls()
453 CC(!page_address_valid(vcpu, vmcs12->io_bitmap_b))) in nested_vmx_check_io_bitmap_controls()
460 struct vmcs12 *vmcs12) in nested_vmx_check_msr_bitmap_controls() argument
462 if (!nested_cpu_has(vmcs12, CPU_BASED_USE_MSR_BITMAPS)) in nested_vmx_check_msr_bitmap_controls()
465 if (CC(!page_address_valid(vcpu, vmcs12->msr_bitmap))) in nested_vmx_check_msr_bitmap_controls()
472 struct vmcs12 *vmcs12) in nested_vmx_check_tpr_shadow_controls() argument
474 if (!nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW)) in nested_vmx_check_tpr_shadow_controls()
477 if (CC(!page_address_valid(vcpu, vmcs12->virtual_apic_page_addr))) in nested_vmx_check_tpr_shadow_controls()
564 struct vmcs12 *vmcs12) in nested_vmx_prepare_msr_bitmap() argument
573 !nested_cpu_has(vmcs12, CPU_BASED_USE_MSR_BITMAPS)) in nested_vmx_prepare_msr_bitmap()
576 if (kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->msr_bitmap), map)) in nested_vmx_prepare_msr_bitmap()
588 if (nested_cpu_has_virt_x2apic_mode(vmcs12)) { in nested_vmx_prepare_msr_bitmap()
589 if (nested_cpu_has_apic_reg_virt(vmcs12)) { in nested_vmx_prepare_msr_bitmap()
608 if (nested_cpu_has_vid(vmcs12)) { in nested_vmx_prepare_msr_bitmap()
661 struct vmcs12 *vmcs12) in nested_cache_shadow_vmcs12() argument
664 struct vmcs12 *shadow; in nested_cache_shadow_vmcs12()
666 if (!nested_cpu_has_shadow_vmcs(vmcs12) || in nested_cache_shadow_vmcs12()
667 vmcs12->vmcs_link_pointer == -1ull) in nested_cache_shadow_vmcs12()
672 if (kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->vmcs_link_pointer), &map)) in nested_cache_shadow_vmcs12()
680 struct vmcs12 *vmcs12) in nested_flush_cached_shadow_vmcs12() argument
684 if (!nested_cpu_has_shadow_vmcs(vmcs12) || in nested_flush_cached_shadow_vmcs12()
685 vmcs12->vmcs_link_pointer == -1ull) in nested_flush_cached_shadow_vmcs12()
688 kvm_write_guest(vmx->vcpu.kvm, vmcs12->vmcs_link_pointer, in nested_flush_cached_shadow_vmcs12()
703 struct vmcs12 *vmcs12) in nested_vmx_check_apic_access_controls() argument
705 if (nested_cpu_has2(vmcs12, SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES) && in nested_vmx_check_apic_access_controls()
706 CC(!page_address_valid(vcpu, vmcs12->apic_access_addr))) in nested_vmx_check_apic_access_controls()
713 struct vmcs12 *vmcs12) in nested_vmx_check_apicv_controls() argument
715 if (!nested_cpu_has_virt_x2apic_mode(vmcs12) && in nested_vmx_check_apicv_controls()
716 !nested_cpu_has_apic_reg_virt(vmcs12) && in nested_vmx_check_apicv_controls()
717 !nested_cpu_has_vid(vmcs12) && in nested_vmx_check_apicv_controls()
718 !nested_cpu_has_posted_intr(vmcs12)) in nested_vmx_check_apicv_controls()
725 if (CC(nested_cpu_has_virt_x2apic_mode(vmcs12) && in nested_vmx_check_apicv_controls()
726 nested_cpu_has2(vmcs12, SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES))) in nested_vmx_check_apicv_controls()
733 if (CC(nested_cpu_has_vid(vmcs12) && !nested_exit_on_intr(vcpu))) in nested_vmx_check_apicv_controls()
743 if (nested_cpu_has_posted_intr(vmcs12) && in nested_vmx_check_apicv_controls()
744 (CC(!nested_cpu_has_vid(vmcs12)) || in nested_vmx_check_apicv_controls()
746 CC((vmcs12->posted_intr_nv & 0xff00)) || in nested_vmx_check_apicv_controls()
747 CC((vmcs12->posted_intr_desc_addr & 0x3f)) || in nested_vmx_check_apicv_controls()
748 CC((vmcs12->posted_intr_desc_addr >> cpuid_maxphyaddr(vcpu))))) in nested_vmx_check_apicv_controls()
752 if (CC(!nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW))) in nested_vmx_check_apicv_controls()
774 struct vmcs12 *vmcs12) in nested_vmx_check_exit_msr_switch_controls() argument
777 vmcs12->vm_exit_msr_load_count, in nested_vmx_check_exit_msr_switch_controls()
778 vmcs12->vm_exit_msr_load_addr)) || in nested_vmx_check_exit_msr_switch_controls()
780 vmcs12->vm_exit_msr_store_count, in nested_vmx_check_exit_msr_switch_controls()
781 vmcs12->vm_exit_msr_store_addr))) in nested_vmx_check_exit_msr_switch_controls()
788 struct vmcs12 *vmcs12) in nested_vmx_check_entry_msr_switch_controls() argument
791 vmcs12->vm_entry_msr_load_count, in nested_vmx_check_entry_msr_switch_controls()
792 vmcs12->vm_entry_msr_load_addr))) in nested_vmx_check_entry_msr_switch_controls()
799 struct vmcs12 *vmcs12) in nested_vmx_check_pml_controls() argument
801 if (!nested_cpu_has_pml(vmcs12)) in nested_vmx_check_pml_controls()
804 if (CC(!nested_cpu_has_ept(vmcs12)) || in nested_vmx_check_pml_controls()
805 CC(!page_address_valid(vcpu, vmcs12->pml_address))) in nested_vmx_check_pml_controls()
812 struct vmcs12 *vmcs12) in nested_vmx_check_unrestricted_guest_controls() argument
814 if (CC(nested_cpu_has2(vmcs12, SECONDARY_EXEC_UNRESTRICTED_GUEST) && in nested_vmx_check_unrestricted_guest_controls()
815 !nested_cpu_has_ept(vmcs12))) in nested_vmx_check_unrestricted_guest_controls()
821 struct vmcs12 *vmcs12) in nested_vmx_check_mode_based_ept_exec_controls() argument
823 if (CC(nested_cpu_has2(vmcs12, SECONDARY_EXEC_MODE_BASED_EPT_EXEC) && in nested_vmx_check_mode_based_ept_exec_controls()
824 !nested_cpu_has_ept(vmcs12))) in nested_vmx_check_mode_based_ept_exec_controls()
830 struct vmcs12 *vmcs12) in nested_vmx_check_shadow_vmcs_controls() argument
832 if (!nested_cpu_has_shadow_vmcs(vmcs12)) in nested_vmx_check_shadow_vmcs_controls()
835 if (CC(!page_address_valid(vcpu, vmcs12->vmread_bitmap)) || in nested_vmx_check_shadow_vmcs_controls()
836 CC(!page_address_valid(vcpu, vmcs12->vmwrite_bitmap))) in nested_vmx_check_shadow_vmcs_controls()
1013 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_msr_store_list_has_msr() local
1014 u32 count = vmcs12->vm_exit_msr_store_count; in nested_msr_store_list_has_msr()
1015 u64 gpa = vmcs12->vm_exit_msr_store_addr; in nested_msr_store_list_has_msr()
1173 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_has_guest_tlb_tag() local
1176 (nested_cpu_has_vpid(vmcs12) && to_vmx(vcpu)->nested.vpid02); in nested_has_guest_tlb_tag()
1180 struct vmcs12 *vmcs12, in nested_vmx_transition_tlb_flush() argument
1212 if (!nested_cpu_has_vpid(vmcs12)) { in nested_vmx_transition_tlb_flush()
1217 vmcs12->virtual_processor_id != vmx->nested.last_vpid) { in nested_vmx_transition_tlb_flush()
1218 vmx->nested.last_vpid = vmcs12->virtual_processor_id; in nested_vmx_transition_tlb_flush()
1544 struct vmcs12 *vmcs12 = get_vmcs12(&vmx->vcpu); in copy_shadow_to_vmcs12() local
1559 vmcs12_write_any(vmcs12, field.encoding, field.offset, val); in copy_shadow_to_vmcs12()
1579 struct vmcs12 *vmcs12 = get_vmcs12(&vmx->vcpu); in copy_vmcs12_to_shadow() local
1592 val = vmcs12_read_any(vmcs12, field.encoding, in copy_vmcs12_to_shadow()
1604 struct vmcs12 *vmcs12 = vmx->nested.cached_vmcs12; in copy_enlightened_to_vmcs12() local
1608 vmcs12->tpr_threshold = evmcs->tpr_threshold; in copy_enlightened_to_vmcs12()
1609 vmcs12->guest_rip = evmcs->guest_rip; in copy_enlightened_to_vmcs12()
1613 vmcs12->guest_rsp = evmcs->guest_rsp; in copy_enlightened_to_vmcs12()
1614 vmcs12->guest_rflags = evmcs->guest_rflags; in copy_enlightened_to_vmcs12()
1615 vmcs12->guest_interruptibility_info = in copy_enlightened_to_vmcs12()
1621 vmcs12->cpu_based_vm_exec_control = in copy_enlightened_to_vmcs12()
1627 vmcs12->exception_bitmap = evmcs->exception_bitmap; in copy_enlightened_to_vmcs12()
1632 vmcs12->vm_entry_controls = evmcs->vm_entry_controls; in copy_enlightened_to_vmcs12()
1637 vmcs12->vm_entry_intr_info_field = in copy_enlightened_to_vmcs12()
1639 vmcs12->vm_entry_exception_error_code = in copy_enlightened_to_vmcs12()
1641 vmcs12->vm_entry_instruction_len = in copy_enlightened_to_vmcs12()
1647 vmcs12->host_ia32_pat = evmcs->host_ia32_pat; in copy_enlightened_to_vmcs12()
1648 vmcs12->host_ia32_efer = evmcs->host_ia32_efer; in copy_enlightened_to_vmcs12()
1649 vmcs12->host_cr0 = evmcs->host_cr0; in copy_enlightened_to_vmcs12()
1650 vmcs12->host_cr3 = evmcs->host_cr3; in copy_enlightened_to_vmcs12()
1651 vmcs12->host_cr4 = evmcs->host_cr4; in copy_enlightened_to_vmcs12()
1652 vmcs12->host_ia32_sysenter_esp = evmcs->host_ia32_sysenter_esp; in copy_enlightened_to_vmcs12()
1653 vmcs12->host_ia32_sysenter_eip = evmcs->host_ia32_sysenter_eip; in copy_enlightened_to_vmcs12()
1654 vmcs12->host_rip = evmcs->host_rip; in copy_enlightened_to_vmcs12()
1655 vmcs12->host_ia32_sysenter_cs = evmcs->host_ia32_sysenter_cs; in copy_enlightened_to_vmcs12()
1656 vmcs12->host_es_selector = evmcs->host_es_selector; in copy_enlightened_to_vmcs12()
1657 vmcs12->host_cs_selector = evmcs->host_cs_selector; in copy_enlightened_to_vmcs12()
1658 vmcs12->host_ss_selector = evmcs->host_ss_selector; in copy_enlightened_to_vmcs12()
1659 vmcs12->host_ds_selector = evmcs->host_ds_selector; in copy_enlightened_to_vmcs12()
1660 vmcs12->host_fs_selector = evmcs->host_fs_selector; in copy_enlightened_to_vmcs12()
1661 vmcs12->host_gs_selector = evmcs->host_gs_selector; in copy_enlightened_to_vmcs12()
1662 vmcs12->host_tr_selector = evmcs->host_tr_selector; in copy_enlightened_to_vmcs12()
1667 vmcs12->pin_based_vm_exec_control = in copy_enlightened_to_vmcs12()
1669 vmcs12->vm_exit_controls = evmcs->vm_exit_controls; in copy_enlightened_to_vmcs12()
1670 vmcs12->secondary_vm_exec_control = in copy_enlightened_to_vmcs12()
1676 vmcs12->io_bitmap_a = evmcs->io_bitmap_a; in copy_enlightened_to_vmcs12()
1677 vmcs12->io_bitmap_b = evmcs->io_bitmap_b; in copy_enlightened_to_vmcs12()
1682 vmcs12->msr_bitmap = evmcs->msr_bitmap; in copy_enlightened_to_vmcs12()
1687 vmcs12->guest_es_base = evmcs->guest_es_base; in copy_enlightened_to_vmcs12()
1688 vmcs12->guest_cs_base = evmcs->guest_cs_base; in copy_enlightened_to_vmcs12()
1689 vmcs12->guest_ss_base = evmcs->guest_ss_base; in copy_enlightened_to_vmcs12()
1690 vmcs12->guest_ds_base = evmcs->guest_ds_base; in copy_enlightened_to_vmcs12()
1691 vmcs12->guest_fs_base = evmcs->guest_fs_base; in copy_enlightened_to_vmcs12()
1692 vmcs12->guest_gs_base = evmcs->guest_gs_base; in copy_enlightened_to_vmcs12()
1693 vmcs12->guest_ldtr_base = evmcs->guest_ldtr_base; in copy_enlightened_to_vmcs12()
1694 vmcs12->guest_tr_base = evmcs->guest_tr_base; in copy_enlightened_to_vmcs12()
1695 vmcs12->guest_gdtr_base = evmcs->guest_gdtr_base; in copy_enlightened_to_vmcs12()
1696 vmcs12->guest_idtr_base = evmcs->guest_idtr_base; in copy_enlightened_to_vmcs12()
1697 vmcs12->guest_es_limit = evmcs->guest_es_limit; in copy_enlightened_to_vmcs12()
1698 vmcs12->guest_cs_limit = evmcs->guest_cs_limit; in copy_enlightened_to_vmcs12()
1699 vmcs12->guest_ss_limit = evmcs->guest_ss_limit; in copy_enlightened_to_vmcs12()
1700 vmcs12->guest_ds_limit = evmcs->guest_ds_limit; in copy_enlightened_to_vmcs12()
1701 vmcs12->guest_fs_limit = evmcs->guest_fs_limit; in copy_enlightened_to_vmcs12()
1702 vmcs12->guest_gs_limit = evmcs->guest_gs_limit; in copy_enlightened_to_vmcs12()
1703 vmcs12->guest_ldtr_limit = evmcs->guest_ldtr_limit; in copy_enlightened_to_vmcs12()
1704 vmcs12->guest_tr_limit = evmcs->guest_tr_limit; in copy_enlightened_to_vmcs12()
1705 vmcs12->guest_gdtr_limit = evmcs->guest_gdtr_limit; in copy_enlightened_to_vmcs12()
1706 vmcs12->guest_idtr_limit = evmcs->guest_idtr_limit; in copy_enlightened_to_vmcs12()
1707 vmcs12->guest_es_ar_bytes = evmcs->guest_es_ar_bytes; in copy_enlightened_to_vmcs12()
1708 vmcs12->guest_cs_ar_bytes = evmcs->guest_cs_ar_bytes; in copy_enlightened_to_vmcs12()
1709 vmcs12->guest_ss_ar_bytes = evmcs->guest_ss_ar_bytes; in copy_enlightened_to_vmcs12()
1710 vmcs12->guest_ds_ar_bytes = evmcs->guest_ds_ar_bytes; in copy_enlightened_to_vmcs12()
1711 vmcs12->guest_fs_ar_bytes = evmcs->guest_fs_ar_bytes; in copy_enlightened_to_vmcs12()
1712 vmcs12->guest_gs_ar_bytes = evmcs->guest_gs_ar_bytes; in copy_enlightened_to_vmcs12()
1713 vmcs12->guest_ldtr_ar_bytes = evmcs->guest_ldtr_ar_bytes; in copy_enlightened_to_vmcs12()
1714 vmcs12->guest_tr_ar_bytes = evmcs->guest_tr_ar_bytes; in copy_enlightened_to_vmcs12()
1715 vmcs12->guest_es_selector = evmcs->guest_es_selector; in copy_enlightened_to_vmcs12()
1716 vmcs12->guest_cs_selector = evmcs->guest_cs_selector; in copy_enlightened_to_vmcs12()
1717 vmcs12->guest_ss_selector = evmcs->guest_ss_selector; in copy_enlightened_to_vmcs12()
1718 vmcs12->guest_ds_selector = evmcs->guest_ds_selector; in copy_enlightened_to_vmcs12()
1719 vmcs12->guest_fs_selector = evmcs->guest_fs_selector; in copy_enlightened_to_vmcs12()
1720 vmcs12->guest_gs_selector = evmcs->guest_gs_selector; in copy_enlightened_to_vmcs12()
1721 vmcs12->guest_ldtr_selector = evmcs->guest_ldtr_selector; in copy_enlightened_to_vmcs12()
1722 vmcs12->guest_tr_selector = evmcs->guest_tr_selector; in copy_enlightened_to_vmcs12()
1727 vmcs12->tsc_offset = evmcs->tsc_offset; in copy_enlightened_to_vmcs12()
1728 vmcs12->virtual_apic_page_addr = evmcs->virtual_apic_page_addr; in copy_enlightened_to_vmcs12()
1729 vmcs12->xss_exit_bitmap = evmcs->xss_exit_bitmap; in copy_enlightened_to_vmcs12()
1734 vmcs12->cr0_guest_host_mask = evmcs->cr0_guest_host_mask; in copy_enlightened_to_vmcs12()
1735 vmcs12->cr4_guest_host_mask = evmcs->cr4_guest_host_mask; in copy_enlightened_to_vmcs12()
1736 vmcs12->cr0_read_shadow = evmcs->cr0_read_shadow; in copy_enlightened_to_vmcs12()
1737 vmcs12->cr4_read_shadow = evmcs->cr4_read_shadow; in copy_enlightened_to_vmcs12()
1738 vmcs12->guest_cr0 = evmcs->guest_cr0; in copy_enlightened_to_vmcs12()
1739 vmcs12->guest_cr3 = evmcs->guest_cr3; in copy_enlightened_to_vmcs12()
1740 vmcs12->guest_cr4 = evmcs->guest_cr4; in copy_enlightened_to_vmcs12()
1741 vmcs12->guest_dr7 = evmcs->guest_dr7; in copy_enlightened_to_vmcs12()
1746 vmcs12->host_fs_base = evmcs->host_fs_base; in copy_enlightened_to_vmcs12()
1747 vmcs12->host_gs_base = evmcs->host_gs_base; in copy_enlightened_to_vmcs12()
1748 vmcs12->host_tr_base = evmcs->host_tr_base; in copy_enlightened_to_vmcs12()
1749 vmcs12->host_gdtr_base = evmcs->host_gdtr_base; in copy_enlightened_to_vmcs12()
1750 vmcs12->host_idtr_base = evmcs->host_idtr_base; in copy_enlightened_to_vmcs12()
1751 vmcs12->host_rsp = evmcs->host_rsp; in copy_enlightened_to_vmcs12()
1756 vmcs12->ept_pointer = evmcs->ept_pointer; in copy_enlightened_to_vmcs12()
1757 vmcs12->virtual_processor_id = evmcs->virtual_processor_id; in copy_enlightened_to_vmcs12()
1762 vmcs12->vmcs_link_pointer = evmcs->vmcs_link_pointer; in copy_enlightened_to_vmcs12()
1763 vmcs12->guest_ia32_debugctl = evmcs->guest_ia32_debugctl; in copy_enlightened_to_vmcs12()
1764 vmcs12->guest_ia32_pat = evmcs->guest_ia32_pat; in copy_enlightened_to_vmcs12()
1765 vmcs12->guest_ia32_efer = evmcs->guest_ia32_efer; in copy_enlightened_to_vmcs12()
1766 vmcs12->guest_pdptr0 = evmcs->guest_pdptr0; in copy_enlightened_to_vmcs12()
1767 vmcs12->guest_pdptr1 = evmcs->guest_pdptr1; in copy_enlightened_to_vmcs12()
1768 vmcs12->guest_pdptr2 = evmcs->guest_pdptr2; in copy_enlightened_to_vmcs12()
1769 vmcs12->guest_pdptr3 = evmcs->guest_pdptr3; in copy_enlightened_to_vmcs12()
1770 vmcs12->guest_pending_dbg_exceptions = in copy_enlightened_to_vmcs12()
1772 vmcs12->guest_sysenter_esp = evmcs->guest_sysenter_esp; in copy_enlightened_to_vmcs12()
1773 vmcs12->guest_sysenter_eip = evmcs->guest_sysenter_eip; in copy_enlightened_to_vmcs12()
1774 vmcs12->guest_bndcfgs = evmcs->guest_bndcfgs; in copy_enlightened_to_vmcs12()
1775 vmcs12->guest_activity_state = evmcs->guest_activity_state; in copy_enlightened_to_vmcs12()
1776 vmcs12->guest_sysenter_cs = evmcs->guest_sysenter_cs; in copy_enlightened_to_vmcs12()
1820 struct vmcs12 *vmcs12 = vmx->nested.cached_vmcs12; in copy_vmcs12_to_enlightened() local
1887 evmcs->guest_es_selector = vmcs12->guest_es_selector; in copy_vmcs12_to_enlightened()
1888 evmcs->guest_cs_selector = vmcs12->guest_cs_selector; in copy_vmcs12_to_enlightened()
1889 evmcs->guest_ss_selector = vmcs12->guest_ss_selector; in copy_vmcs12_to_enlightened()
1890 evmcs->guest_ds_selector = vmcs12->guest_ds_selector; in copy_vmcs12_to_enlightened()
1891 evmcs->guest_fs_selector = vmcs12->guest_fs_selector; in copy_vmcs12_to_enlightened()
1892 evmcs->guest_gs_selector = vmcs12->guest_gs_selector; in copy_vmcs12_to_enlightened()
1893 evmcs->guest_ldtr_selector = vmcs12->guest_ldtr_selector; in copy_vmcs12_to_enlightened()
1894 evmcs->guest_tr_selector = vmcs12->guest_tr_selector; in copy_vmcs12_to_enlightened()
1896 evmcs->guest_es_limit = vmcs12->guest_es_limit; in copy_vmcs12_to_enlightened()
1897 evmcs->guest_cs_limit = vmcs12->guest_cs_limit; in copy_vmcs12_to_enlightened()
1898 evmcs->guest_ss_limit = vmcs12->guest_ss_limit; in copy_vmcs12_to_enlightened()
1899 evmcs->guest_ds_limit = vmcs12->guest_ds_limit; in copy_vmcs12_to_enlightened()
1900 evmcs->guest_fs_limit = vmcs12->guest_fs_limit; in copy_vmcs12_to_enlightened()
1901 evmcs->guest_gs_limit = vmcs12->guest_gs_limit; in copy_vmcs12_to_enlightened()
1902 evmcs->guest_ldtr_limit = vmcs12->guest_ldtr_limit; in copy_vmcs12_to_enlightened()
1903 evmcs->guest_tr_limit = vmcs12->guest_tr_limit; in copy_vmcs12_to_enlightened()
1904 evmcs->guest_gdtr_limit = vmcs12->guest_gdtr_limit; in copy_vmcs12_to_enlightened()
1905 evmcs->guest_idtr_limit = vmcs12->guest_idtr_limit; in copy_vmcs12_to_enlightened()
1907 evmcs->guest_es_ar_bytes = vmcs12->guest_es_ar_bytes; in copy_vmcs12_to_enlightened()
1908 evmcs->guest_cs_ar_bytes = vmcs12->guest_cs_ar_bytes; in copy_vmcs12_to_enlightened()
1909 evmcs->guest_ss_ar_bytes = vmcs12->guest_ss_ar_bytes; in copy_vmcs12_to_enlightened()
1910 evmcs->guest_ds_ar_bytes = vmcs12->guest_ds_ar_bytes; in copy_vmcs12_to_enlightened()
1911 evmcs->guest_fs_ar_bytes = vmcs12->guest_fs_ar_bytes; in copy_vmcs12_to_enlightened()
1912 evmcs->guest_gs_ar_bytes = vmcs12->guest_gs_ar_bytes; in copy_vmcs12_to_enlightened()
1913 evmcs->guest_ldtr_ar_bytes = vmcs12->guest_ldtr_ar_bytes; in copy_vmcs12_to_enlightened()
1914 evmcs->guest_tr_ar_bytes = vmcs12->guest_tr_ar_bytes; in copy_vmcs12_to_enlightened()
1916 evmcs->guest_es_base = vmcs12->guest_es_base; in copy_vmcs12_to_enlightened()
1917 evmcs->guest_cs_base = vmcs12->guest_cs_base; in copy_vmcs12_to_enlightened()
1918 evmcs->guest_ss_base = vmcs12->guest_ss_base; in copy_vmcs12_to_enlightened()
1919 evmcs->guest_ds_base = vmcs12->guest_ds_base; in copy_vmcs12_to_enlightened()
1920 evmcs->guest_fs_base = vmcs12->guest_fs_base; in copy_vmcs12_to_enlightened()
1921 evmcs->guest_gs_base = vmcs12->guest_gs_base; in copy_vmcs12_to_enlightened()
1922 evmcs->guest_ldtr_base = vmcs12->guest_ldtr_base; in copy_vmcs12_to_enlightened()
1923 evmcs->guest_tr_base = vmcs12->guest_tr_base; in copy_vmcs12_to_enlightened()
1924 evmcs->guest_gdtr_base = vmcs12->guest_gdtr_base; in copy_vmcs12_to_enlightened()
1925 evmcs->guest_idtr_base = vmcs12->guest_idtr_base; in copy_vmcs12_to_enlightened()
1927 evmcs->guest_ia32_pat = vmcs12->guest_ia32_pat; in copy_vmcs12_to_enlightened()
1928 evmcs->guest_ia32_efer = vmcs12->guest_ia32_efer; in copy_vmcs12_to_enlightened()
1930 evmcs->guest_pdptr0 = vmcs12->guest_pdptr0; in copy_vmcs12_to_enlightened()
1931 evmcs->guest_pdptr1 = vmcs12->guest_pdptr1; in copy_vmcs12_to_enlightened()
1932 evmcs->guest_pdptr2 = vmcs12->guest_pdptr2; in copy_vmcs12_to_enlightened()
1933 evmcs->guest_pdptr3 = vmcs12->guest_pdptr3; in copy_vmcs12_to_enlightened()
1936 vmcs12->guest_pending_dbg_exceptions; in copy_vmcs12_to_enlightened()
1937 evmcs->guest_sysenter_esp = vmcs12->guest_sysenter_esp; in copy_vmcs12_to_enlightened()
1938 evmcs->guest_sysenter_eip = vmcs12->guest_sysenter_eip; in copy_vmcs12_to_enlightened()
1940 evmcs->guest_activity_state = vmcs12->guest_activity_state; in copy_vmcs12_to_enlightened()
1941 evmcs->guest_sysenter_cs = vmcs12->guest_sysenter_cs; in copy_vmcs12_to_enlightened()
1943 evmcs->guest_cr0 = vmcs12->guest_cr0; in copy_vmcs12_to_enlightened()
1944 evmcs->guest_cr3 = vmcs12->guest_cr3; in copy_vmcs12_to_enlightened()
1945 evmcs->guest_cr4 = vmcs12->guest_cr4; in copy_vmcs12_to_enlightened()
1946 evmcs->guest_dr7 = vmcs12->guest_dr7; in copy_vmcs12_to_enlightened()
1948 evmcs->guest_physical_address = vmcs12->guest_physical_address; in copy_vmcs12_to_enlightened()
1950 evmcs->vm_instruction_error = vmcs12->vm_instruction_error; in copy_vmcs12_to_enlightened()
1951 evmcs->vm_exit_reason = vmcs12->vm_exit_reason; in copy_vmcs12_to_enlightened()
1952 evmcs->vm_exit_intr_info = vmcs12->vm_exit_intr_info; in copy_vmcs12_to_enlightened()
1953 evmcs->vm_exit_intr_error_code = vmcs12->vm_exit_intr_error_code; in copy_vmcs12_to_enlightened()
1954 evmcs->idt_vectoring_info_field = vmcs12->idt_vectoring_info_field; in copy_vmcs12_to_enlightened()
1955 evmcs->idt_vectoring_error_code = vmcs12->idt_vectoring_error_code; in copy_vmcs12_to_enlightened()
1956 evmcs->vm_exit_instruction_len = vmcs12->vm_exit_instruction_len; in copy_vmcs12_to_enlightened()
1957 evmcs->vmx_instruction_info = vmcs12->vmx_instruction_info; in copy_vmcs12_to_enlightened()
1959 evmcs->exit_qualification = vmcs12->exit_qualification; in copy_vmcs12_to_enlightened()
1961 evmcs->guest_linear_address = vmcs12->guest_linear_address; in copy_vmcs12_to_enlightened()
1962 evmcs->guest_rsp = vmcs12->guest_rsp; in copy_vmcs12_to_enlightened()
1963 evmcs->guest_rflags = vmcs12->guest_rflags; in copy_vmcs12_to_enlightened()
1966 vmcs12->guest_interruptibility_info; in copy_vmcs12_to_enlightened()
1967 evmcs->cpu_based_vm_exec_control = vmcs12->cpu_based_vm_exec_control; in copy_vmcs12_to_enlightened()
1968 evmcs->vm_entry_controls = vmcs12->vm_entry_controls; in copy_vmcs12_to_enlightened()
1969 evmcs->vm_entry_intr_info_field = vmcs12->vm_entry_intr_info_field; in copy_vmcs12_to_enlightened()
1971 vmcs12->vm_entry_exception_error_code; in copy_vmcs12_to_enlightened()
1972 evmcs->vm_entry_instruction_len = vmcs12->vm_entry_instruction_len; in copy_vmcs12_to_enlightened()
1974 evmcs->guest_rip = vmcs12->guest_rip; in copy_vmcs12_to_enlightened()
1976 evmcs->guest_bndcfgs = vmcs12->guest_bndcfgs; in copy_vmcs12_to_enlightened()
2050 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_handle_enlightened_vmptrld() local
2051 memset(vmcs12, 0, sizeof(*vmcs12)); in nested_vmx_handle_enlightened_vmptrld()
2052 vmcs12->hdr.revision_id = VMCS12_REVISION; in nested_vmx_handle_enlightened_vmptrld()
2099 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in vmx_calc_preemption_timer_value() local
2106 vmcs12->vmx_preemption_timer_value + l1_scaled_tsc; in vmx_calc_preemption_timer_value()
2137 static u64 nested_vmx_calc_efer(struct vcpu_vmx *vmx, struct vmcs12 *vmcs12) in nested_vmx_calc_efer() argument
2140 (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_EFER)) in nested_vmx_calc_efer()
2141 return vmcs12->guest_ia32_efer; in nested_vmx_calc_efer()
2142 else if (vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) in nested_vmx_calc_efer()
2207 struct vmcs12 *vmcs12) in prepare_vmcs02_early_rare() argument
2214 if (nested_cpu_has_vpid(vmcs12) && vmx->nested.vpid02) in prepare_vmcs02_early_rare()
2221 static void prepare_vmcs02_early(struct vcpu_vmx *vmx, struct vmcs12 *vmcs12) in prepare_vmcs02_early() argument
2224 u64 guest_efer = nested_vmx_calc_efer(vmx, vmcs12); in prepare_vmcs02_early()
2227 prepare_vmcs02_early_rare(vmx, vmcs12); in prepare_vmcs02_early()
2233 exec_control |= (vmcs12->pin_based_vm_exec_control & in prepare_vmcs02_early()
2237 if (nested_cpu_has_posted_intr(vmcs12)) { in prepare_vmcs02_early()
2238 vmx->nested.posted_intr_nv = vmcs12->posted_intr_nv; in prepare_vmcs02_early()
2252 exec_control |= vmcs12->cpu_based_vm_exec_control; in prepare_vmcs02_early()
2256 vmcs_write32(TPR_THRESHOLD, vmcs12->tpr_threshold); in prepare_vmcs02_early()
2296 if (nested_cpu_has(vmcs12, in prepare_vmcs02_early()
2298 vmcs12_exec_ctrl = vmcs12->secondary_vm_exec_control & in prepare_vmcs02_early()
2311 (vmcs12->guest_cr4 & X86_CR4_UMIP)) in prepare_vmcs02_early()
2316 vmcs12->guest_intr_status); in prepare_vmcs02_early()
2318 if (!nested_cpu_has2(vmcs12, SECONDARY_EXEC_UNRESTRICTED_GUEST)) in prepare_vmcs02_early()
2332 exec_control = (vmcs12->vm_entry_controls | vmx_vmentry_ctrl()) & in prepare_vmcs02_early()
2359 vmcs12->vm_entry_intr_info_field); in prepare_vmcs02_early()
2361 vmcs12->vm_entry_exception_error_code); in prepare_vmcs02_early()
2363 vmcs12->vm_entry_instruction_len); in prepare_vmcs02_early()
2365 vmcs12->guest_interruptibility_info); in prepare_vmcs02_early()
2367 !(vmcs12->guest_interruptibility_info & GUEST_INTR_STATE_NMI); in prepare_vmcs02_early()
2373 static void prepare_vmcs02_rare(struct vcpu_vmx *vmx, struct vmcs12 *vmcs12) in prepare_vmcs02_rare() argument
2379 vmcs_write16(GUEST_ES_SELECTOR, vmcs12->guest_es_selector); in prepare_vmcs02_rare()
2380 vmcs_write16(GUEST_CS_SELECTOR, vmcs12->guest_cs_selector); in prepare_vmcs02_rare()
2381 vmcs_write16(GUEST_SS_SELECTOR, vmcs12->guest_ss_selector); in prepare_vmcs02_rare()
2382 vmcs_write16(GUEST_DS_SELECTOR, vmcs12->guest_ds_selector); in prepare_vmcs02_rare()
2383 vmcs_write16(GUEST_FS_SELECTOR, vmcs12->guest_fs_selector); in prepare_vmcs02_rare()
2384 vmcs_write16(GUEST_GS_SELECTOR, vmcs12->guest_gs_selector); in prepare_vmcs02_rare()
2385 vmcs_write16(GUEST_LDTR_SELECTOR, vmcs12->guest_ldtr_selector); in prepare_vmcs02_rare()
2386 vmcs_write16(GUEST_TR_SELECTOR, vmcs12->guest_tr_selector); in prepare_vmcs02_rare()
2387 vmcs_write32(GUEST_ES_LIMIT, vmcs12->guest_es_limit); in prepare_vmcs02_rare()
2388 vmcs_write32(GUEST_CS_LIMIT, vmcs12->guest_cs_limit); in prepare_vmcs02_rare()
2389 vmcs_write32(GUEST_SS_LIMIT, vmcs12->guest_ss_limit); in prepare_vmcs02_rare()
2390 vmcs_write32(GUEST_DS_LIMIT, vmcs12->guest_ds_limit); in prepare_vmcs02_rare()
2391 vmcs_write32(GUEST_FS_LIMIT, vmcs12->guest_fs_limit); in prepare_vmcs02_rare()
2392 vmcs_write32(GUEST_GS_LIMIT, vmcs12->guest_gs_limit); in prepare_vmcs02_rare()
2393 vmcs_write32(GUEST_LDTR_LIMIT, vmcs12->guest_ldtr_limit); in prepare_vmcs02_rare()
2394 vmcs_write32(GUEST_TR_LIMIT, vmcs12->guest_tr_limit); in prepare_vmcs02_rare()
2395 vmcs_write32(GUEST_GDTR_LIMIT, vmcs12->guest_gdtr_limit); in prepare_vmcs02_rare()
2396 vmcs_write32(GUEST_IDTR_LIMIT, vmcs12->guest_idtr_limit); in prepare_vmcs02_rare()
2397 vmcs_write32(GUEST_CS_AR_BYTES, vmcs12->guest_cs_ar_bytes); in prepare_vmcs02_rare()
2398 vmcs_write32(GUEST_SS_AR_BYTES, vmcs12->guest_ss_ar_bytes); in prepare_vmcs02_rare()
2399 vmcs_write32(GUEST_ES_AR_BYTES, vmcs12->guest_es_ar_bytes); in prepare_vmcs02_rare()
2400 vmcs_write32(GUEST_DS_AR_BYTES, vmcs12->guest_ds_ar_bytes); in prepare_vmcs02_rare()
2401 vmcs_write32(GUEST_FS_AR_BYTES, vmcs12->guest_fs_ar_bytes); in prepare_vmcs02_rare()
2402 vmcs_write32(GUEST_GS_AR_BYTES, vmcs12->guest_gs_ar_bytes); in prepare_vmcs02_rare()
2403 vmcs_write32(GUEST_LDTR_AR_BYTES, vmcs12->guest_ldtr_ar_bytes); in prepare_vmcs02_rare()
2404 vmcs_write32(GUEST_TR_AR_BYTES, vmcs12->guest_tr_ar_bytes); in prepare_vmcs02_rare()
2405 vmcs_writel(GUEST_ES_BASE, vmcs12->guest_es_base); in prepare_vmcs02_rare()
2406 vmcs_writel(GUEST_CS_BASE, vmcs12->guest_cs_base); in prepare_vmcs02_rare()
2407 vmcs_writel(GUEST_SS_BASE, vmcs12->guest_ss_base); in prepare_vmcs02_rare()
2408 vmcs_writel(GUEST_DS_BASE, vmcs12->guest_ds_base); in prepare_vmcs02_rare()
2409 vmcs_writel(GUEST_FS_BASE, vmcs12->guest_fs_base); in prepare_vmcs02_rare()
2410 vmcs_writel(GUEST_GS_BASE, vmcs12->guest_gs_base); in prepare_vmcs02_rare()
2411 vmcs_writel(GUEST_LDTR_BASE, vmcs12->guest_ldtr_base); in prepare_vmcs02_rare()
2412 vmcs_writel(GUEST_TR_BASE, vmcs12->guest_tr_base); in prepare_vmcs02_rare()
2413 vmcs_writel(GUEST_GDTR_BASE, vmcs12->guest_gdtr_base); in prepare_vmcs02_rare()
2414 vmcs_writel(GUEST_IDTR_BASE, vmcs12->guest_idtr_base); in prepare_vmcs02_rare()
2421 vmcs_write32(GUEST_SYSENTER_CS, vmcs12->guest_sysenter_cs); in prepare_vmcs02_rare()
2423 vmcs12->guest_pending_dbg_exceptions); in prepare_vmcs02_rare()
2424 vmcs_writel(GUEST_SYSENTER_ESP, vmcs12->guest_sysenter_esp); in prepare_vmcs02_rare()
2425 vmcs_writel(GUEST_SYSENTER_EIP, vmcs12->guest_sysenter_eip); in prepare_vmcs02_rare()
2432 vmcs_write64(GUEST_PDPTR0, vmcs12->guest_pdptr0); in prepare_vmcs02_rare()
2433 vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1); in prepare_vmcs02_rare()
2434 vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2); in prepare_vmcs02_rare()
2435 vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3); in prepare_vmcs02_rare()
2439 (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS)) in prepare_vmcs02_rare()
2440 vmcs_write64(GUEST_BNDCFGS, vmcs12->guest_bndcfgs); in prepare_vmcs02_rare()
2443 if (nested_cpu_has_xsaves(vmcs12)) in prepare_vmcs02_rare()
2444 vmcs_write64(XSS_EXIT_BITMAP, vmcs12->xss_exit_bitmap); in prepare_vmcs02_rare()
2467 vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, vmcs12->page_fault_error_code_mask); in prepare_vmcs02_rare()
2468 vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, vmcs12->page_fault_error_code_match); in prepare_vmcs02_rare()
2472 vmcs_write64(EOI_EXIT_BITMAP0, vmcs12->eoi_exit_bitmap0); in prepare_vmcs02_rare()
2473 vmcs_write64(EOI_EXIT_BITMAP1, vmcs12->eoi_exit_bitmap1); in prepare_vmcs02_rare()
2474 vmcs_write64(EOI_EXIT_BITMAP2, vmcs12->eoi_exit_bitmap2); in prepare_vmcs02_rare()
2475 vmcs_write64(EOI_EXIT_BITMAP3, vmcs12->eoi_exit_bitmap3); in prepare_vmcs02_rare()
2502 static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, in prepare_vmcs02() argument
2510 prepare_vmcs02_rare(vmx, vmcs12); in prepare_vmcs02()
2519 (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS)) { in prepare_vmcs02()
2520 kvm_set_dr(vcpu, 7, vmcs12->guest_dr7); in prepare_vmcs02()
2521 vmcs_write64(GUEST_IA32_DEBUGCTL, vmcs12->guest_ia32_debugctl); in prepare_vmcs02()
2527 !(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS))) in prepare_vmcs02()
2529 vmx_set_rflags(vcpu, vmcs12->guest_rflags); in prepare_vmcs02()
2536 vcpu->arch.cr0_guest_owned_bits &= ~vmcs12->cr0_guest_host_mask; in prepare_vmcs02()
2540 (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_PAT)) { in prepare_vmcs02()
2541 vmcs_write64(GUEST_IA32_PAT, vmcs12->guest_ia32_pat); in prepare_vmcs02()
2542 vcpu->arch.pat = vmcs12->guest_ia32_pat; in prepare_vmcs02()
2552 nested_vmx_transition_tlb_flush(vcpu, vmcs12, true); in prepare_vmcs02()
2554 if (nested_cpu_has_ept(vmcs12)) in prepare_vmcs02()
2565 vmx_set_cr0(vcpu, vmcs12->guest_cr0); in prepare_vmcs02()
2566 vmcs_writel(CR0_READ_SHADOW, nested_read_cr0(vmcs12)); in prepare_vmcs02()
2568 vmx_set_cr4(vcpu, vmcs12->guest_cr4); in prepare_vmcs02()
2569 vmcs_writel(CR4_READ_SHADOW, nested_read_cr4(vmcs12)); in prepare_vmcs02()
2571 vcpu->arch.efer = nested_vmx_calc_efer(vmx, vmcs12); in prepare_vmcs02()
2586 if (nested_vmx_load_cr3(vcpu, vmcs12->guest_cr3, nested_cpu_has_ept(vmcs12), in prepare_vmcs02()
2598 vmcs_writel(GUEST_CR3, vmcs12->guest_cr3); in prepare_vmcs02()
2601 if (load_guest_pdptrs_vmcs12 && nested_cpu_has_ept(vmcs12) && in prepare_vmcs02()
2603 vmcs_write64(GUEST_PDPTR0, vmcs12->guest_pdptr0); in prepare_vmcs02()
2604 vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1); in prepare_vmcs02()
2605 vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2); in prepare_vmcs02()
2606 vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3); in prepare_vmcs02()
2612 if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL) && in prepare_vmcs02()
2614 vmcs12->guest_ia32_perf_global_ctrl))) in prepare_vmcs02()
2617 kvm_rsp_write(vcpu, vmcs12->guest_rsp); in prepare_vmcs02()
2618 kvm_rip_write(vcpu, vmcs12->guest_rip); in prepare_vmcs02()
2622 static int nested_vmx_check_nmi_controls(struct vmcs12 *vmcs12) in nested_vmx_check_nmi_controls() argument
2624 if (CC(!nested_cpu_has_nmi_exiting(vmcs12) && in nested_vmx_check_nmi_controls()
2625 nested_cpu_has_virtual_nmis(vmcs12))) in nested_vmx_check_nmi_controls()
2628 if (CC(!nested_cpu_has_virtual_nmis(vmcs12) && in nested_vmx_check_nmi_controls()
2629 nested_cpu_has(vmcs12, CPU_BASED_NMI_WINDOW_EXITING))) in nested_vmx_check_nmi_controls()
2685 struct vmcs12 *vmcs12) in nested_check_vm_execution_controls() argument
2689 if (CC(!vmx_control_verify(vmcs12->pin_based_vm_exec_control, in nested_check_vm_execution_controls()
2692 CC(!vmx_control_verify(vmcs12->cpu_based_vm_exec_control, in nested_check_vm_execution_controls()
2697 if (nested_cpu_has(vmcs12, CPU_BASED_ACTIVATE_SECONDARY_CONTROLS) && in nested_check_vm_execution_controls()
2698 CC(!vmx_control_verify(vmcs12->secondary_vm_exec_control, in nested_check_vm_execution_controls()
2703 if (CC(vmcs12->cr3_target_count > nested_cpu_vmx_misc_cr3_count(vcpu)) || in nested_check_vm_execution_controls()
2704 nested_vmx_check_io_bitmap_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2705 nested_vmx_check_msr_bitmap_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2706 nested_vmx_check_tpr_shadow_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2707 nested_vmx_check_apic_access_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2708 nested_vmx_check_apicv_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2709 nested_vmx_check_nmi_controls(vmcs12) || in nested_check_vm_execution_controls()
2710 nested_vmx_check_pml_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2711 nested_vmx_check_unrestricted_guest_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2712 nested_vmx_check_mode_based_ept_exec_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2713 nested_vmx_check_shadow_vmcs_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2714 CC(nested_cpu_has_vpid(vmcs12) && !vmcs12->virtual_processor_id)) in nested_check_vm_execution_controls()
2717 if (!nested_cpu_has_preemption_timer(vmcs12) && in nested_check_vm_execution_controls()
2718 nested_cpu_has_save_preemption_timer(vmcs12)) in nested_check_vm_execution_controls()
2721 if (nested_cpu_has_ept(vmcs12) && in nested_check_vm_execution_controls()
2722 CC(!nested_vmx_check_eptp(vcpu, vmcs12->ept_pointer))) in nested_check_vm_execution_controls()
2725 if (nested_cpu_has_vmfunc(vmcs12)) { in nested_check_vm_execution_controls()
2726 if (CC(vmcs12->vm_function_control & in nested_check_vm_execution_controls()
2730 if (nested_cpu_has_eptp_switching(vmcs12)) { in nested_check_vm_execution_controls()
2731 if (CC(!nested_cpu_has_ept(vmcs12)) || in nested_check_vm_execution_controls()
2732 CC(!page_address_valid(vcpu, vmcs12->eptp_list_address))) in nested_check_vm_execution_controls()
2744 struct vmcs12 *vmcs12) in nested_check_vm_exit_controls() argument
2748 if (CC(!vmx_control_verify(vmcs12->vm_exit_controls, in nested_check_vm_exit_controls()
2751 CC(nested_vmx_check_exit_msr_switch_controls(vcpu, vmcs12))) in nested_check_vm_exit_controls()
2761 struct vmcs12 *vmcs12) in nested_check_vm_entry_controls() argument
2765 if (CC(!vmx_control_verify(vmcs12->vm_entry_controls, in nested_check_vm_entry_controls()
2776 if (vmcs12->vm_entry_intr_info_field & INTR_INFO_VALID_MASK) { in nested_check_vm_entry_controls()
2777 u32 intr_info = vmcs12->vm_entry_intr_info_field; in nested_check_vm_entry_controls()
2782 bool urg = nested_cpu_has2(vmcs12, in nested_check_vm_entry_controls()
2784 bool prot_mode = !urg || vmcs12->guest_cr0 & X86_CR0_PE; in nested_check_vm_entry_controls()
2807 vmcs12->vm_entry_exception_error_code & GENMASK(31, 16))) in nested_check_vm_entry_controls()
2819 if (CC(vmcs12->vm_entry_instruction_len > 15) || in nested_check_vm_entry_controls()
2820 CC(vmcs12->vm_entry_instruction_len == 0 && in nested_check_vm_entry_controls()
2826 if (nested_vmx_check_entry_msr_switch_controls(vcpu, vmcs12)) in nested_check_vm_entry_controls()
2833 struct vmcs12 *vmcs12) in nested_vmx_check_controls() argument
2835 if (nested_check_vm_execution_controls(vcpu, vmcs12) || in nested_vmx_check_controls()
2836 nested_check_vm_exit_controls(vcpu, vmcs12) || in nested_vmx_check_controls()
2837 nested_check_vm_entry_controls(vcpu, vmcs12)) in nested_vmx_check_controls()
2841 return nested_evmcs_check_controls(vmcs12); in nested_vmx_check_controls()
2847 struct vmcs12 *vmcs12) in nested_vmx_check_host_state() argument
2851 if (CC(!nested_host_cr0_valid(vcpu, vmcs12->host_cr0)) || in nested_vmx_check_host_state()
2852 CC(!nested_host_cr4_valid(vcpu, vmcs12->host_cr4)) || in nested_vmx_check_host_state()
2853 CC(!nested_cr3_valid(vcpu, vmcs12->host_cr3))) in nested_vmx_check_host_state()
2856 if (CC(is_noncanonical_address(vmcs12->host_ia32_sysenter_esp, vcpu)) || in nested_vmx_check_host_state()
2857 CC(is_noncanonical_address(vmcs12->host_ia32_sysenter_eip, vcpu))) in nested_vmx_check_host_state()
2860 if ((vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_PAT) && in nested_vmx_check_host_state()
2861 CC(!kvm_pat_valid(vmcs12->host_ia32_pat))) in nested_vmx_check_host_state()
2864 if ((vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL) && in nested_vmx_check_host_state()
2866 vmcs12->host_ia32_perf_global_ctrl))) in nested_vmx_check_host_state()
2876 if (CC(!(vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE)) || in nested_vmx_check_host_state()
2877 CC(!(vmcs12->host_cr4 & X86_CR4_PAE))) in nested_vmx_check_host_state()
2880 if (CC(vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE) || in nested_vmx_check_host_state()
2881 CC(vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) || in nested_vmx_check_host_state()
2882 CC(vmcs12->host_cr4 & X86_CR4_PCIDE) || in nested_vmx_check_host_state()
2883 CC((vmcs12->host_rip) >> 32)) in nested_vmx_check_host_state()
2887 if (CC(vmcs12->host_cs_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2888 CC(vmcs12->host_ss_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2889 CC(vmcs12->host_ds_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2890 CC(vmcs12->host_es_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2891 CC(vmcs12->host_fs_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2892 CC(vmcs12->host_gs_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2893 CC(vmcs12->host_tr_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2894 CC(vmcs12->host_cs_selector == 0) || in nested_vmx_check_host_state()
2895 CC(vmcs12->host_tr_selector == 0) || in nested_vmx_check_host_state()
2896 CC(vmcs12->host_ss_selector == 0 && !ia32e)) in nested_vmx_check_host_state()
2899 if (CC(is_noncanonical_address(vmcs12->host_fs_base, vcpu)) || in nested_vmx_check_host_state()
2900 CC(is_noncanonical_address(vmcs12->host_gs_base, vcpu)) || in nested_vmx_check_host_state()
2901 CC(is_noncanonical_address(vmcs12->host_gdtr_base, vcpu)) || in nested_vmx_check_host_state()
2902 CC(is_noncanonical_address(vmcs12->host_idtr_base, vcpu)) || in nested_vmx_check_host_state()
2903 CC(is_noncanonical_address(vmcs12->host_tr_base, vcpu)) || in nested_vmx_check_host_state()
2904 CC(is_noncanonical_address(vmcs12->host_rip, vcpu))) in nested_vmx_check_host_state()
2913 if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_EFER) { in nested_vmx_check_host_state()
2914 if (CC(!kvm_valid_efer(vcpu, vmcs12->host_ia32_efer)) || in nested_vmx_check_host_state()
2915 CC(ia32e != !!(vmcs12->host_ia32_efer & EFER_LMA)) || in nested_vmx_check_host_state()
2916 CC(ia32e != !!(vmcs12->host_ia32_efer & EFER_LME))) in nested_vmx_check_host_state()
2924 struct vmcs12 *vmcs12) in nested_vmx_check_vmcs_link_ptr() argument
2927 struct vmcs12 *shadow; in nested_vmx_check_vmcs_link_ptr()
2930 if (vmcs12->vmcs_link_pointer == -1ull) in nested_vmx_check_vmcs_link_ptr()
2933 if (CC(!page_address_valid(vcpu, vmcs12->vmcs_link_pointer))) in nested_vmx_check_vmcs_link_ptr()
2936 if (CC(kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->vmcs_link_pointer), &map))) in nested_vmx_check_vmcs_link_ptr()
2942 CC(shadow->hdr.shadow_vmcs != nested_cpu_has_shadow_vmcs(vmcs12))) in nested_vmx_check_vmcs_link_ptr()
2952 static int nested_check_guest_non_reg_state(struct vmcs12 *vmcs12) in nested_check_guest_non_reg_state() argument
2954 if (CC(vmcs12->guest_activity_state != GUEST_ACTIVITY_ACTIVE && in nested_check_guest_non_reg_state()
2955 vmcs12->guest_activity_state != GUEST_ACTIVITY_HLT)) in nested_check_guest_non_reg_state()
2962 struct vmcs12 *vmcs12, in nested_vmx_check_guest_state() argument
2969 if (CC(!nested_guest_cr0_valid(vcpu, vmcs12->guest_cr0)) || in nested_vmx_check_guest_state()
2970 CC(!nested_guest_cr4_valid(vcpu, vmcs12->guest_cr4))) in nested_vmx_check_guest_state()
2973 if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS) && in nested_vmx_check_guest_state()
2974 CC(!kvm_dr7_valid(vmcs12->guest_dr7))) in nested_vmx_check_guest_state()
2977 if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_PAT) && in nested_vmx_check_guest_state()
2978 CC(!kvm_pat_valid(vmcs12->guest_ia32_pat))) in nested_vmx_check_guest_state()
2981 if (nested_vmx_check_vmcs_link_ptr(vcpu, vmcs12)) { in nested_vmx_check_guest_state()
2986 if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL) && in nested_vmx_check_guest_state()
2988 vmcs12->guest_ia32_perf_global_ctrl))) in nested_vmx_check_guest_state()
3001 (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_EFER)) { in nested_vmx_check_guest_state()
3002 ia32e = (vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) != 0; in nested_vmx_check_guest_state()
3003 if (CC(!kvm_valid_efer(vcpu, vmcs12->guest_ia32_efer)) || in nested_vmx_check_guest_state()
3004 CC(ia32e != !!(vmcs12->guest_ia32_efer & EFER_LMA)) || in nested_vmx_check_guest_state()
3005 CC(((vmcs12->guest_cr0 & X86_CR0_PG) && in nested_vmx_check_guest_state()
3006 ia32e != !!(vmcs12->guest_ia32_efer & EFER_LME)))) in nested_vmx_check_guest_state()
3010 if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS) && in nested_vmx_check_guest_state()
3011 (CC(is_noncanonical_address(vmcs12->guest_bndcfgs & PAGE_MASK, vcpu)) || in nested_vmx_check_guest_state()
3012 CC((vmcs12->guest_bndcfgs & MSR_IA32_BNDCFGS_RSVD)))) in nested_vmx_check_guest_state()
3015 if (nested_check_guest_non_reg_state(vmcs12)) in nested_vmx_check_guest_state()
3128 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_get_vmcs12_pages() local
3155 if (nested_cpu_has2(vmcs12, SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) { in nested_get_vmcs12_pages()
3166 page = kvm_vcpu_gpa_to_page(vcpu, vmcs12->apic_access_addr); in nested_get_vmcs12_pages()
3182 if (nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW)) { in nested_get_vmcs12_pages()
3185 if (!kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->virtual_apic_page_addr), map)) { in nested_get_vmcs12_pages()
3187 } else if (nested_cpu_has(vmcs12, CPU_BASED_CR8_LOAD_EXITING) && in nested_get_vmcs12_pages()
3188 nested_cpu_has(vmcs12, CPU_BASED_CR8_STORE_EXITING) && in nested_get_vmcs12_pages()
3189 !nested_cpu_has2(vmcs12, SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) { in nested_get_vmcs12_pages()
3208 if (nested_cpu_has_posted_intr(vmcs12)) { in nested_get_vmcs12_pages()
3211 if (!kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->posted_intr_desc_addr), map)) { in nested_get_vmcs12_pages()
3214 offset_in_page(vmcs12->posted_intr_desc_addr)); in nested_get_vmcs12_pages()
3216 pfn_to_hpa(map->pfn) + offset_in_page(vmcs12->posted_intr_desc_addr)); in nested_get_vmcs12_pages()
3219 if (nested_vmx_prepare_msr_bitmap(vcpu, vmcs12)) in nested_get_vmcs12_pages()
3228 struct vmcs12 *vmcs12; in nested_vmx_write_pml_buffer() local
3242 vmcs12 = get_vmcs12(vcpu); in nested_vmx_write_pml_buffer()
3243 if (!nested_cpu_has_pml(vmcs12)) in nested_vmx_write_pml_buffer()
3246 if (vmcs12->guest_pml_index >= PML_ENTITY_NUM) { in nested_vmx_write_pml_buffer()
3252 dst = vmcs12->pml_address + sizeof(u64) * vmcs12->guest_pml_index; in nested_vmx_write_pml_buffer()
3258 vmcs12->guest_pml_index--; in nested_vmx_write_pml_buffer()
3294 struct vmcs12 *vmcs12);
3310 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_enter_non_root_mode() local
3323 if (!(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS)) in nested_vmx_enter_non_root_mode()
3326 !(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS)) in nested_vmx_enter_non_root_mode()
3350 prepare_vmcs02_early(vmx, vmcs12); in nested_vmx_enter_non_root_mode()
3363 if (nested_vmx_check_guest_state(vcpu, vmcs12, in nested_vmx_enter_non_root_mode()
3366 vmcs12->exit_qualification = entry_failure_code; in nested_vmx_enter_non_root_mode()
3372 if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETTING) in nested_vmx_enter_non_root_mode()
3373 vcpu->arch.tsc_offset += vmcs12->tsc_offset; in nested_vmx_enter_non_root_mode()
3375 if (prepare_vmcs02(vcpu, vmcs12, &entry_failure_code)) { in nested_vmx_enter_non_root_mode()
3377 vmcs12->exit_qualification = entry_failure_code; in nested_vmx_enter_non_root_mode()
3383 vmcs12->vm_entry_msr_load_addr, in nested_vmx_enter_non_root_mode()
3384 vmcs12->vm_entry_msr_load_count); in nested_vmx_enter_non_root_mode()
3387 vmcs12->exit_qualification = failed_index; in nested_vmx_enter_non_root_mode()
3424 if (nested_cpu_has_preemption_timer(vmcs12)) { in nested_vmx_enter_non_root_mode()
3443 if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETTING) in nested_vmx_enter_non_root_mode()
3444 vcpu->arch.tsc_offset -= vmcs12->tsc_offset; in nested_vmx_enter_non_root_mode()
3453 load_vmcs12_host_state(vcpu, vmcs12); in nested_vmx_enter_non_root_mode()
3454 vmcs12->vm_exit_reason = exit_reason | VMX_EXIT_REASONS_FAILED_VMENTRY; in nested_vmx_enter_non_root_mode()
3466 struct vmcs12 *vmcs12; in nested_vmx_run() local
3486 vmcs12 = get_vmcs12(vcpu); in nested_vmx_run()
3494 if (CC(vmcs12->hdr.shadow_vmcs)) in nested_vmx_run()
3500 vmcs12->launch_state = !launch; in nested_vmx_run()
3518 if (CC(vmcs12->launch_state == launch)) in nested_vmx_run()
3523 if (nested_vmx_check_controls(vcpu, vmcs12)) in nested_vmx_run()
3526 if (nested_vmx_check_host_state(vcpu, vmcs12)) in nested_vmx_run()
3540 if (nested_cpu_has_posted_intr(vmcs12) && in nested_vmx_run()
3560 nested_cache_shadow_vmcs12(vcpu, vmcs12); in nested_vmx_run()
3567 if ((vmcs12->guest_activity_state == GUEST_ACTIVITY_HLT) && in nested_vmx_run()
3568 !(vmcs12->vm_entry_intr_info_field & INTR_INFO_VALID_MASK) && in nested_vmx_run()
3569 !(vmcs12->cpu_based_vm_exec_control & CPU_BASED_NMI_WINDOW_EXITING) && in nested_vmx_run()
3570 !((vmcs12->cpu_based_vm_exec_control & CPU_BASED_INTR_WINDOW_EXITING) && in nested_vmx_run()
3571 (vmcs12->guest_rflags & X86_EFLAGS_IF))) { in nested_vmx_run()
3605 vmcs12_guest_cr0(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) in vmcs12_guest_cr0() argument
3609 /*2*/ (vmcs12->guest_cr0 & vmcs12->cr0_guest_host_mask) | in vmcs12_guest_cr0()
3610 /*3*/ (vmcs_readl(CR0_READ_SHADOW) & ~(vmcs12->cr0_guest_host_mask | in vmcs12_guest_cr0()
3615 vmcs12_guest_cr4(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) in vmcs12_guest_cr4() argument
3619 /*2*/ (vmcs12->guest_cr4 & vmcs12->cr4_guest_host_mask) | in vmcs12_guest_cr4()
3620 /*3*/ (vmcs_readl(CR4_READ_SHADOW) & ~(vmcs12->cr4_guest_host_mask | in vmcs12_guest_cr4()
3625 struct vmcs12 *vmcs12) in vmcs12_save_pending_event() argument
3635 vmcs12->vm_exit_instruction_len = in vmcs12_save_pending_event()
3643 vmcs12->idt_vectoring_error_code = in vmcs12_save_pending_event()
3647 vmcs12->idt_vectoring_info_field = idt_vectoring; in vmcs12_save_pending_event()
3649 vmcs12->idt_vectoring_info_field = in vmcs12_save_pending_event()
3657 vmcs12->vm_entry_instruction_len = in vmcs12_save_pending_event()
3662 vmcs12->idt_vectoring_info_field = idt_vectoring; in vmcs12_save_pending_event()
3669 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_mark_vmcs12_pages_dirty() local
3677 if (nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW)) { in nested_mark_vmcs12_pages_dirty()
3678 gfn = vmcs12->virtual_apic_page_addr >> PAGE_SHIFT; in nested_mark_vmcs12_pages_dirty()
3682 if (nested_cpu_has_posted_intr(vmcs12)) { in nested_mark_vmcs12_pages_dirty()
3683 gfn = vmcs12->posted_intr_desc_addr >> PAGE_SHIFT; in nested_mark_vmcs12_pages_dirty()
3724 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_inject_exception_vmexit() local
3729 vmcs12->vm_exit_intr_error_code = vcpu->arch.exception.error_code; in nested_vmx_inject_exception_vmexit()
3738 if (!(vmcs12->idt_vectoring_info_field & VECTORING_INFO_VALID_MASK) && in nested_vmx_inject_exception_vmexit()
3940 struct vmcs12 *vmcs12) in sync_vmcs02_to_vmcs12_rare() argument
3944 vmcs12->guest_es_selector = vmcs_read16(GUEST_ES_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
3945 vmcs12->guest_cs_selector = vmcs_read16(GUEST_CS_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
3946 vmcs12->guest_ss_selector = vmcs_read16(GUEST_SS_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
3947 vmcs12->guest_ds_selector = vmcs_read16(GUEST_DS_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
3948 vmcs12->guest_fs_selector = vmcs_read16(GUEST_FS_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
3949 vmcs12->guest_gs_selector = vmcs_read16(GUEST_GS_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
3950 vmcs12->guest_ldtr_selector = vmcs_read16(GUEST_LDTR_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
3951 vmcs12->guest_tr_selector = vmcs_read16(GUEST_TR_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
3952 vmcs12->guest_es_limit = vmcs_read32(GUEST_ES_LIMIT); in sync_vmcs02_to_vmcs12_rare()
3953 vmcs12->guest_cs_limit = vmcs_read32(GUEST_CS_LIMIT); in sync_vmcs02_to_vmcs12_rare()
3954 vmcs12->guest_ss_limit = vmcs_read32(GUEST_SS_LIMIT); in sync_vmcs02_to_vmcs12_rare()
3955 vmcs12->guest_ds_limit = vmcs_read32(GUEST_DS_LIMIT); in sync_vmcs02_to_vmcs12_rare()
3956 vmcs12->guest_fs_limit = vmcs_read32(GUEST_FS_LIMIT); in sync_vmcs02_to_vmcs12_rare()
3957 vmcs12->guest_gs_limit = vmcs_read32(GUEST_GS_LIMIT); in sync_vmcs02_to_vmcs12_rare()
3958 vmcs12->guest_ldtr_limit = vmcs_read32(GUEST_LDTR_LIMIT); in sync_vmcs02_to_vmcs12_rare()
3959 vmcs12->guest_tr_limit = vmcs_read32(GUEST_TR_LIMIT); in sync_vmcs02_to_vmcs12_rare()
3960 vmcs12->guest_gdtr_limit = vmcs_read32(GUEST_GDTR_LIMIT); in sync_vmcs02_to_vmcs12_rare()
3961 vmcs12->guest_idtr_limit = vmcs_read32(GUEST_IDTR_LIMIT); in sync_vmcs02_to_vmcs12_rare()
3962 vmcs12->guest_es_ar_bytes = vmcs_read32(GUEST_ES_AR_BYTES); in sync_vmcs02_to_vmcs12_rare()
3963 vmcs12->guest_ds_ar_bytes = vmcs_read32(GUEST_DS_AR_BYTES); in sync_vmcs02_to_vmcs12_rare()
3964 vmcs12->guest_fs_ar_bytes = vmcs_read32(GUEST_FS_AR_BYTES); in sync_vmcs02_to_vmcs12_rare()
3965 vmcs12->guest_gs_ar_bytes = vmcs_read32(GUEST_GS_AR_BYTES); in sync_vmcs02_to_vmcs12_rare()
3966 vmcs12->guest_ldtr_ar_bytes = vmcs_read32(GUEST_LDTR_AR_BYTES); in sync_vmcs02_to_vmcs12_rare()
3967 vmcs12->guest_tr_ar_bytes = vmcs_read32(GUEST_TR_AR_BYTES); in sync_vmcs02_to_vmcs12_rare()
3968 vmcs12->guest_es_base = vmcs_readl(GUEST_ES_BASE); in sync_vmcs02_to_vmcs12_rare()
3969 vmcs12->guest_cs_base = vmcs_readl(GUEST_CS_BASE); in sync_vmcs02_to_vmcs12_rare()
3970 vmcs12->guest_ss_base = vmcs_readl(GUEST_SS_BASE); in sync_vmcs02_to_vmcs12_rare()
3971 vmcs12->guest_ds_base = vmcs_readl(GUEST_DS_BASE); in sync_vmcs02_to_vmcs12_rare()
3972 vmcs12->guest_fs_base = vmcs_readl(GUEST_FS_BASE); in sync_vmcs02_to_vmcs12_rare()
3973 vmcs12->guest_gs_base = vmcs_readl(GUEST_GS_BASE); in sync_vmcs02_to_vmcs12_rare()
3974 vmcs12->guest_ldtr_base = vmcs_readl(GUEST_LDTR_BASE); in sync_vmcs02_to_vmcs12_rare()
3975 vmcs12->guest_tr_base = vmcs_readl(GUEST_TR_BASE); in sync_vmcs02_to_vmcs12_rare()
3976 vmcs12->guest_gdtr_base = vmcs_readl(GUEST_GDTR_BASE); in sync_vmcs02_to_vmcs12_rare()
3977 vmcs12->guest_idtr_base = vmcs_readl(GUEST_IDTR_BASE); in sync_vmcs02_to_vmcs12_rare()
3978 vmcs12->guest_pending_dbg_exceptions = in sync_vmcs02_to_vmcs12_rare()
3981 vmcs12->guest_bndcfgs = vmcs_read64(GUEST_BNDCFGS); in sync_vmcs02_to_vmcs12_rare()
3987 struct vmcs12 *vmcs12) in copy_vmcs02_to_vmcs12_rare() argument
4002 sync_vmcs02_to_vmcs12_rare(vcpu, vmcs12); in copy_vmcs02_to_vmcs12_rare()
4015 static void sync_vmcs02_to_vmcs12(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) in sync_vmcs02_to_vmcs12() argument
4020 sync_vmcs02_to_vmcs12_rare(vcpu, vmcs12); in sync_vmcs02_to_vmcs12()
4024 vmcs12->guest_cr0 = vmcs12_guest_cr0(vcpu, vmcs12); in sync_vmcs02_to_vmcs12()
4025 vmcs12->guest_cr4 = vmcs12_guest_cr4(vcpu, vmcs12); in sync_vmcs02_to_vmcs12()
4027 vmcs12->guest_rsp = kvm_rsp_read(vcpu); in sync_vmcs02_to_vmcs12()
4028 vmcs12->guest_rip = kvm_rip_read(vcpu); in sync_vmcs02_to_vmcs12()
4029 vmcs12->guest_rflags = vmcs_readl(GUEST_RFLAGS); in sync_vmcs02_to_vmcs12()
4031 vmcs12->guest_cs_ar_bytes = vmcs_read32(GUEST_CS_AR_BYTES); in sync_vmcs02_to_vmcs12()
4032 vmcs12->guest_ss_ar_bytes = vmcs_read32(GUEST_SS_AR_BYTES); in sync_vmcs02_to_vmcs12()
4034 vmcs12->guest_interruptibility_info = in sync_vmcs02_to_vmcs12()
4038 vmcs12->guest_activity_state = GUEST_ACTIVITY_HLT; in sync_vmcs02_to_vmcs12()
4040 vmcs12->guest_activity_state = GUEST_ACTIVITY_ACTIVE; in sync_vmcs02_to_vmcs12()
4042 if (nested_cpu_has_preemption_timer(vmcs12) && in sync_vmcs02_to_vmcs12()
4043 vmcs12->vm_exit_controls & VM_EXIT_SAVE_VMX_PREEMPTION_TIMER && in sync_vmcs02_to_vmcs12()
4045 vmcs12->vmx_preemption_timer_value = in sync_vmcs02_to_vmcs12()
4057 vmcs12->guest_cr3 = vmcs_readl(GUEST_CR3); in sync_vmcs02_to_vmcs12()
4058 if (nested_cpu_has_ept(vmcs12) && is_pae_paging(vcpu)) { in sync_vmcs02_to_vmcs12()
4059 vmcs12->guest_pdptr0 = vmcs_read64(GUEST_PDPTR0); in sync_vmcs02_to_vmcs12()
4060 vmcs12->guest_pdptr1 = vmcs_read64(GUEST_PDPTR1); in sync_vmcs02_to_vmcs12()
4061 vmcs12->guest_pdptr2 = vmcs_read64(GUEST_PDPTR2); in sync_vmcs02_to_vmcs12()
4062 vmcs12->guest_pdptr3 = vmcs_read64(GUEST_PDPTR3); in sync_vmcs02_to_vmcs12()
4066 vmcs12->guest_linear_address = vmcs_readl(GUEST_LINEAR_ADDRESS); in sync_vmcs02_to_vmcs12()
4068 if (nested_cpu_has_vid(vmcs12)) in sync_vmcs02_to_vmcs12()
4069 vmcs12->guest_intr_status = vmcs_read16(GUEST_INTR_STATUS); in sync_vmcs02_to_vmcs12()
4071 vmcs12->vm_entry_controls = in sync_vmcs02_to_vmcs12()
4072 (vmcs12->vm_entry_controls & ~VM_ENTRY_IA32E_MODE) | in sync_vmcs02_to_vmcs12()
4075 if (vmcs12->vm_exit_controls & VM_EXIT_SAVE_DEBUG_CONTROLS) in sync_vmcs02_to_vmcs12()
4076 kvm_get_dr(vcpu, 7, (unsigned long *)&vmcs12->guest_dr7); in sync_vmcs02_to_vmcs12()
4078 if (vmcs12->vm_exit_controls & VM_EXIT_SAVE_IA32_EFER) in sync_vmcs02_to_vmcs12()
4079 vmcs12->guest_ia32_efer = vcpu->arch.efer; in sync_vmcs02_to_vmcs12()
4093 static void prepare_vmcs12(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, in prepare_vmcs12() argument
4098 vmcs12->vm_exit_reason = vm_exit_reason; in prepare_vmcs12()
4099 vmcs12->exit_qualification = exit_qualification; in prepare_vmcs12()
4100 vmcs12->vm_exit_intr_info = exit_intr_info; in prepare_vmcs12()
4102 vmcs12->idt_vectoring_info_field = 0; in prepare_vmcs12()
4103 vmcs12->vm_exit_instruction_len = vmcs_read32(VM_EXIT_INSTRUCTION_LEN); in prepare_vmcs12()
4104 vmcs12->vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO); in prepare_vmcs12()
4106 if (!(vmcs12->vm_exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY)) { in prepare_vmcs12()
4107 vmcs12->launch_state = 1; in prepare_vmcs12()
4111 vmcs12->vm_entry_intr_info_field &= ~INTR_INFO_VALID_MASK; in prepare_vmcs12()
4117 vmcs12_save_pending_event(vcpu, vmcs12); in prepare_vmcs12()
4126 vmcs12->vm_exit_msr_store_addr, in prepare_vmcs12()
4127 vmcs12->vm_exit_msr_store_count)) in prepare_vmcs12()
4151 struct vmcs12 *vmcs12) in load_vmcs12_host_state() argument
4156 if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_EFER) in load_vmcs12_host_state()
4157 vcpu->arch.efer = vmcs12->host_ia32_efer; in load_vmcs12_host_state()
4158 else if (vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE) in load_vmcs12_host_state()
4164 kvm_rsp_write(vcpu, vmcs12->host_rsp); in load_vmcs12_host_state()
4165 kvm_rip_write(vcpu, vmcs12->host_rip); in load_vmcs12_host_state()
4177 vmx_set_cr0(vcpu, vmcs12->host_cr0); in load_vmcs12_host_state()
4181 vmx_set_cr4(vcpu, vmcs12->host_cr4); in load_vmcs12_host_state()
4189 if (nested_vmx_load_cr3(vcpu, vmcs12->host_cr3, false, &ignored)) in load_vmcs12_host_state()
4195 nested_vmx_transition_tlb_flush(vcpu, vmcs12, false); in load_vmcs12_host_state()
4197 vmcs_write32(GUEST_SYSENTER_CS, vmcs12->host_ia32_sysenter_cs); in load_vmcs12_host_state()
4198 vmcs_writel(GUEST_SYSENTER_ESP, vmcs12->host_ia32_sysenter_esp); in load_vmcs12_host_state()
4199 vmcs_writel(GUEST_SYSENTER_EIP, vmcs12->host_ia32_sysenter_eip); in load_vmcs12_host_state()
4200 vmcs_writel(GUEST_IDTR_BASE, vmcs12->host_idtr_base); in load_vmcs12_host_state()
4201 vmcs_writel(GUEST_GDTR_BASE, vmcs12->host_gdtr_base); in load_vmcs12_host_state()
4206 if (vmcs12->vm_exit_controls & VM_EXIT_CLEAR_BNDCFGS) in load_vmcs12_host_state()
4209 if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_PAT) { in load_vmcs12_host_state()
4210 vmcs_write64(GUEST_IA32_PAT, vmcs12->host_ia32_pat); in load_vmcs12_host_state()
4211 vcpu->arch.pat = vmcs12->host_ia32_pat; in load_vmcs12_host_state()
4213 if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL) in load_vmcs12_host_state()
4215 vmcs12->host_ia32_perf_global_ctrl)); in load_vmcs12_host_state()
4222 .selector = vmcs12->host_cs_selector, in load_vmcs12_host_state()
4228 if (vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE) in load_vmcs12_host_state()
4242 seg.selector = vmcs12->host_ds_selector; in load_vmcs12_host_state()
4244 seg.selector = vmcs12->host_es_selector; in load_vmcs12_host_state()
4246 seg.selector = vmcs12->host_ss_selector; in load_vmcs12_host_state()
4248 seg.selector = vmcs12->host_fs_selector; in load_vmcs12_host_state()
4249 seg.base = vmcs12->host_fs_base; in load_vmcs12_host_state()
4251 seg.selector = vmcs12->host_gs_selector; in load_vmcs12_host_state()
4252 seg.base = vmcs12->host_gs_base; in load_vmcs12_host_state()
4255 .base = vmcs12->host_tr_base, in load_vmcs12_host_state()
4257 .selector = vmcs12->host_tr_selector, in load_vmcs12_host_state()
4269 if (nested_vmx_load_msr(vcpu, vmcs12->vm_exit_msr_load_addr, in load_vmcs12_host_state()
4270 vmcs12->vm_exit_msr_load_count)) in load_vmcs12_host_state()
4299 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_restore_host_state() local
4307 if (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS) { in nested_vmx_restore_host_state()
4361 for (i = 0; i < vmcs12->vm_entry_msr_load_count; i++) { in nested_vmx_restore_host_state()
4362 gpa = vmcs12->vm_entry_msr_load_addr + (i * sizeof(g)); in nested_vmx_restore_host_state()
4370 for (j = 0; j < vmcs12->vm_exit_msr_load_count; j++) { in nested_vmx_restore_host_state()
4371 gpa = vmcs12->vm_exit_msr_load_addr + (j * sizeof(h)); in nested_vmx_restore_host_state()
4414 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_vmexit() local
4433 if (nested_cpu_has_preemption_timer(vmcs12)) in nested_vmx_vmexit()
4436 if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETTING) in nested_vmx_vmexit()
4437 vcpu->arch.tsc_offset -= vmcs12->tsc_offset; in nested_vmx_vmexit()
4440 sync_vmcs02_to_vmcs12(vcpu, vmcs12); in nested_vmx_vmexit()
4443 prepare_vmcs12(vcpu, vmcs12, vm_exit_reason, in nested_vmx_vmexit()
4455 nested_flush_cached_shadow_vmcs12(vcpu, vmcs12); in nested_vmx_vmexit()
4511 vmcs12->vm_exit_intr_info = irq | in nested_vmx_vmexit()
4516 trace_kvm_nested_vmexit_inject(vmcs12->vm_exit_reason, in nested_vmx_vmexit()
4517 vmcs12->exit_qualification, in nested_vmx_vmexit()
4518 vmcs12->idt_vectoring_info_field, in nested_vmx_vmexit()
4519 vmcs12->vm_exit_intr_info, in nested_vmx_vmexit()
4520 vmcs12->vm_exit_intr_error_code, in nested_vmx_vmexit()
4523 load_vmcs12_host_state(vcpu, vmcs12); in nested_vmx_vmexit()
4947 vmptr + offsetof(struct vmcs12, in handle_vmclear()
4970 struct vmcs12 *vmcs12 = is_guest_mode(vcpu) ? get_shadow_vmcs12(vcpu) in handle_vmread() local
5002 copy_vmcs02_to_vmcs12_rare(vcpu, vmcs12); in handle_vmread()
5005 value = vmcs12_read_any(vmcs12, field, offset); in handle_vmread()
5054 struct vmcs12 *vmcs12 = is_guest_mode(vcpu) ? get_shadow_vmcs12(vcpu) in handle_vmwrite() local
5117 copy_vmcs02_to_vmcs12_rare(vcpu, vmcs12); in handle_vmwrite()
5130 vmcs12_write_any(vmcs12, field, offset, value); in handle_vmwrite()
5196 struct vmcs12 *new_vmcs12; in handle_vmptrld()
5440 struct vmcs12 *vmcs12) in nested_vmx_eptp_switching() argument
5447 if (!nested_cpu_has_eptp_switching(vmcs12) || in nested_vmx_eptp_switching()
5448 !nested_cpu_has_ept(vmcs12)) in nested_vmx_eptp_switching()
5455 if (kvm_vcpu_read_guest_page(vcpu, vmcs12->eptp_list_address >> PAGE_SHIFT, in nested_vmx_eptp_switching()
5465 if (vmcs12->ept_pointer != new_eptp) { in nested_vmx_eptp_switching()
5472 vmcs12->ept_pointer = new_eptp; in nested_vmx_eptp_switching()
5487 struct vmcs12 *vmcs12; in handle_vmfunc() local
5500 vmcs12 = get_vmcs12(vcpu); in handle_vmfunc()
5501 if ((vmcs12->vm_function_control & (1 << function)) == 0) in handle_vmfunc()
5506 if (nested_vmx_eptp_switching(vcpu, vmcs12)) in handle_vmfunc()
5528 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_check_io_bitmaps() local
5537 bitmap = vmcs12->io_bitmap_a; in nested_vmx_check_io_bitmaps()
5539 bitmap = vmcs12->io_bitmap_b; in nested_vmx_check_io_bitmaps()
5559 struct vmcs12 *vmcs12) in nested_vmx_exit_handled_io() argument
5565 if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) in nested_vmx_exit_handled_io()
5566 return nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING); in nested_vmx_exit_handled_io()
5583 struct vmcs12 *vmcs12, u32 exit_reason) in nested_vmx_exit_handled_msr() argument
5588 if (!nested_cpu_has(vmcs12, CPU_BASED_USE_MSR_BITMAPS)) in nested_vmx_exit_handled_msr()
5596 bitmap = vmcs12->msr_bitmap; in nested_vmx_exit_handled_msr()
5620 struct vmcs12 *vmcs12) in nested_vmx_exit_handled_cr() argument
5633 if (vmcs12->cr0_guest_host_mask & in nested_vmx_exit_handled_cr()
5634 (val ^ vmcs12->cr0_read_shadow)) in nested_vmx_exit_handled_cr()
5638 if (nested_cpu_has(vmcs12, CPU_BASED_CR3_LOAD_EXITING)) in nested_vmx_exit_handled_cr()
5642 if (vmcs12->cr4_guest_host_mask & in nested_vmx_exit_handled_cr()
5643 (vmcs12->cr4_read_shadow ^ val)) in nested_vmx_exit_handled_cr()
5647 if (nested_cpu_has(vmcs12, CPU_BASED_CR8_LOAD_EXITING)) in nested_vmx_exit_handled_cr()
5653 if ((vmcs12->cr0_guest_host_mask & X86_CR0_TS) && in nested_vmx_exit_handled_cr()
5654 (vmcs12->cr0_read_shadow & X86_CR0_TS)) in nested_vmx_exit_handled_cr()
5660 if (vmcs12->cpu_based_vm_exec_control & in nested_vmx_exit_handled_cr()
5665 if (vmcs12->cpu_based_vm_exec_control & in nested_vmx_exit_handled_cr()
5677 if (vmcs12->cr0_guest_host_mask & 0xe & in nested_vmx_exit_handled_cr()
5678 (val ^ vmcs12->cr0_read_shadow)) in nested_vmx_exit_handled_cr()
5680 if ((vmcs12->cr0_guest_host_mask & 0x1) && in nested_vmx_exit_handled_cr()
5681 !(vmcs12->cr0_read_shadow & 0x1) && in nested_vmx_exit_handled_cr()
5690 struct vmcs12 *vmcs12, gpa_t bitmap) in nested_vmx_exit_handled_vmcs_access() argument
5696 if (!nested_cpu_has_shadow_vmcs(vmcs12)) in nested_vmx_exit_handled_vmcs_access()
5713 static bool nested_vmx_exit_handled_mtf(struct vmcs12 *vmcs12) in nested_vmx_exit_handled_mtf() argument
5715 u32 entry_intr_info = vmcs12->vm_entry_intr_info_field; in nested_vmx_exit_handled_mtf()
5717 if (nested_cpu_has_mtf(vmcs12)) in nested_vmx_exit_handled_mtf()
5796 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_l1_wants_exit() local
5806 return vmcs12->exception_bitmap & in nested_vmx_l1_wants_exit()
5813 return nested_cpu_has(vmcs12, CPU_BASED_INTR_WINDOW_EXITING); in nested_vmx_l1_wants_exit()
5815 return nested_cpu_has(vmcs12, CPU_BASED_NMI_WINDOW_EXITING); in nested_vmx_l1_wants_exit()
5821 return nested_cpu_has(vmcs12, CPU_BASED_HLT_EXITING); in nested_vmx_l1_wants_exit()
5825 return nested_cpu_has(vmcs12, CPU_BASED_INVLPG_EXITING); in nested_vmx_l1_wants_exit()
5827 return nested_cpu_has(vmcs12, CPU_BASED_RDPMC_EXITING); in nested_vmx_l1_wants_exit()
5829 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDRAND_EXITING); in nested_vmx_l1_wants_exit()
5831 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDSEED_EXITING); in nested_vmx_l1_wants_exit()
5833 return nested_cpu_has(vmcs12, CPU_BASED_RDTSC_EXITING); in nested_vmx_l1_wants_exit()
5835 return nested_vmx_exit_handled_vmcs_access(vcpu, vmcs12, in nested_vmx_l1_wants_exit()
5836 vmcs12->vmread_bitmap); in nested_vmx_l1_wants_exit()
5838 return nested_vmx_exit_handled_vmcs_access(vcpu, vmcs12, in nested_vmx_l1_wants_exit()
5839 vmcs12->vmwrite_bitmap); in nested_vmx_l1_wants_exit()
5851 return nested_vmx_exit_handled_cr(vcpu, vmcs12); in nested_vmx_l1_wants_exit()
5853 return nested_cpu_has(vmcs12, CPU_BASED_MOV_DR_EXITING); in nested_vmx_l1_wants_exit()
5855 return nested_vmx_exit_handled_io(vcpu, vmcs12); in nested_vmx_l1_wants_exit()
5857 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_DESC); in nested_vmx_l1_wants_exit()
5860 return nested_vmx_exit_handled_msr(vcpu, vmcs12, exit_reason); in nested_vmx_l1_wants_exit()
5864 return nested_cpu_has(vmcs12, CPU_BASED_MWAIT_EXITING); in nested_vmx_l1_wants_exit()
5866 return nested_vmx_exit_handled_mtf(vmcs12); in nested_vmx_l1_wants_exit()
5868 return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_EXITING); in nested_vmx_l1_wants_exit()
5870 return nested_cpu_has(vmcs12, CPU_BASED_PAUSE_EXITING) || in nested_vmx_l1_wants_exit()
5871 nested_cpu_has2(vmcs12, in nested_vmx_l1_wants_exit()
5876 return nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW); in nested_vmx_l1_wants_exit()
5888 nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_INVPCID) && in nested_vmx_l1_wants_exit()
5889 nested_cpu_has(vmcs12, CPU_BASED_INVLPG_EXITING); in nested_vmx_l1_wants_exit()
5891 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_WBINVD_EXITING); in nested_vmx_l1_wants_exit()
5901 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_XSAVES); in nested_vmx_l1_wants_exit()
5904 return nested_cpu_has2(vmcs12, in nested_vmx_l1_wants_exit()
5955 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_reflect_vmexit() local
5957 vmcs12->vm_exit_intr_error_code = in nested_vmx_reflect_vmexit()
5972 struct vmcs12 *vmcs12; in vmx_get_nested_state() local
5989 vmcs12 = get_vmcs12(vcpu); in vmx_get_nested_state()
5997 kvm_state.size += sizeof(user_vmx_nested_state->vmcs12); in vmx_get_nested_state()
6003 nested_cpu_has_shadow_vmcs(vmcs12) && in vmx_get_nested_state()
6004 vmcs12->vmcs_link_pointer != -1ull) in vmx_get_nested_state()
6023 if (nested_cpu_has_preemption_timer(vmcs12) && in vmx_get_nested_state()
6050 sync_vmcs02_to_vmcs12(vcpu, vmcs12); in vmx_get_nested_state()
6051 sync_vmcs02_to_vmcs12_rare(vcpu, vmcs12); in vmx_get_nested_state()
6059 BUILD_BUG_ON(sizeof(user_vmx_nested_state->vmcs12) < VMCS12_SIZE); in vmx_get_nested_state()
6066 if (copy_to_user(user_vmx_nested_state->vmcs12, vmcs12, VMCS12_SIZE)) in vmx_get_nested_state()
6069 if (nested_cpu_has_shadow_vmcs(vmcs12) && in vmx_get_nested_state()
6070 vmcs12->vmcs_link_pointer != -1ull) { in vmx_get_nested_state()
6096 struct vmcs12 *vmcs12; in vmx_set_nested_state() local
6172 if (kvm_state->size < sizeof(*kvm_state) + sizeof(*vmcs12)) { in vmx_set_nested_state()
6208 vmcs12 = get_vmcs12(vcpu); in vmx_set_nested_state()
6209 if (copy_from_user(vmcs12, user_vmx_nested_state->vmcs12, sizeof(*vmcs12))) in vmx_set_nested_state()
6212 if (vmcs12->hdr.revision_id != VMCS12_REVISION) in vmx_set_nested_state()
6225 if (nested_cpu_has_shadow_vmcs(vmcs12) && in vmx_set_nested_state()
6226 vmcs12->vmcs_link_pointer != -1ull) { in vmx_set_nested_state()
6227 struct vmcs12 *shadow_vmcs12 = get_shadow_vmcs12(vcpu); in vmx_set_nested_state()
6231 sizeof(user_vmx_nested_state->vmcs12) + sizeof(*shadow_vmcs12)) in vmx_set_nested_state()
6253 if (nested_vmx_check_controls(vcpu, vmcs12) || in vmx_set_nested_state()
6254 nested_vmx_check_host_state(vcpu, vmcs12) || in vmx_set_nested_state()
6255 nested_vmx_check_guest_state(vcpu, vmcs12, &ignored)) in vmx_set_nested_state()