Lines Matching refs:vmcs12

59 #define SHADOW_FIELD_RO(x, y) { x, offsetof(struct vmcs12, y) },
66 #define SHADOW_FIELD_RW(x, y) { x, offsetof(struct vmcs12, y) },
336 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_ept_inject_page_fault() local
351 vmcs12->guest_physical_address = fault->address; in nested_ept_inject_page_fault()
377 static bool nested_vmx_is_page_fault_vmexit(struct vmcs12 *vmcs12, in nested_vmx_is_page_fault_vmexit() argument
382 bit = (vmcs12->exception_bitmap & (1u << PF_VECTOR)) != 0; in nested_vmx_is_page_fault_vmexit()
384 (error_code & vmcs12->page_fault_error_code_mask) != in nested_vmx_is_page_fault_vmexit()
385 vmcs12->page_fault_error_code_match; in nested_vmx_is_page_fault_vmexit()
396 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_check_exception() local
406 if (nested_vmx_is_page_fault_vmexit(vmcs12, in nested_vmx_check_exception()
411 } else if (vmcs12->exception_bitmap & (1u << nr)) { in nested_vmx_check_exception()
431 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in vmx_inject_page_fault_nested() local
435 if (nested_vmx_is_page_fault_vmexit(vmcs12, fault->error_code) && in vmx_inject_page_fault_nested()
437 vmcs12->vm_exit_intr_error_code = fault->error_code; in vmx_inject_page_fault_nested()
448 struct vmcs12 *vmcs12) in nested_vmx_check_io_bitmap_controls() argument
450 if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) in nested_vmx_check_io_bitmap_controls()
453 if (CC(!page_address_valid(vcpu, vmcs12->io_bitmap_a)) || in nested_vmx_check_io_bitmap_controls()
454 CC(!page_address_valid(vcpu, vmcs12->io_bitmap_b))) in nested_vmx_check_io_bitmap_controls()
461 struct vmcs12 *vmcs12) in nested_vmx_check_msr_bitmap_controls() argument
463 if (!nested_cpu_has(vmcs12, CPU_BASED_USE_MSR_BITMAPS)) in nested_vmx_check_msr_bitmap_controls()
466 if (CC(!page_address_valid(vcpu, vmcs12->msr_bitmap))) in nested_vmx_check_msr_bitmap_controls()
473 struct vmcs12 *vmcs12) in nested_vmx_check_tpr_shadow_controls() argument
475 if (!nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW)) in nested_vmx_check_tpr_shadow_controls()
478 if (CC(!page_address_valid(vcpu, vmcs12->virtual_apic_page_addr))) in nested_vmx_check_tpr_shadow_controls()
565 struct vmcs12 *vmcs12) in nested_vmx_prepare_msr_bitmap() argument
574 !nested_cpu_has(vmcs12, CPU_BASED_USE_MSR_BITMAPS)) in nested_vmx_prepare_msr_bitmap()
577 if (kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->msr_bitmap), map)) in nested_vmx_prepare_msr_bitmap()
589 if (nested_cpu_has_virt_x2apic_mode(vmcs12)) { in nested_vmx_prepare_msr_bitmap()
590 if (nested_cpu_has_apic_reg_virt(vmcs12)) { in nested_vmx_prepare_msr_bitmap()
609 if (nested_cpu_has_vid(vmcs12)) { in nested_vmx_prepare_msr_bitmap()
664 struct vmcs12 *vmcs12) in nested_cache_shadow_vmcs12() argument
667 struct vmcs12 *shadow; in nested_cache_shadow_vmcs12()
669 if (!nested_cpu_has_shadow_vmcs(vmcs12) || in nested_cache_shadow_vmcs12()
670 vmcs12->vmcs_link_pointer == -1ull) in nested_cache_shadow_vmcs12()
675 if (kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->vmcs_link_pointer), &map)) in nested_cache_shadow_vmcs12()
683 struct vmcs12 *vmcs12) in nested_flush_cached_shadow_vmcs12() argument
687 if (!nested_cpu_has_shadow_vmcs(vmcs12) || in nested_flush_cached_shadow_vmcs12()
688 vmcs12->vmcs_link_pointer == -1ull) in nested_flush_cached_shadow_vmcs12()
691 kvm_write_guest(vmx->vcpu.kvm, vmcs12->vmcs_link_pointer, in nested_flush_cached_shadow_vmcs12()
706 struct vmcs12 *vmcs12) in nested_vmx_check_apic_access_controls() argument
708 if (nested_cpu_has2(vmcs12, SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES) && in nested_vmx_check_apic_access_controls()
709 CC(!page_address_valid(vcpu, vmcs12->apic_access_addr))) in nested_vmx_check_apic_access_controls()
716 struct vmcs12 *vmcs12) in nested_vmx_check_apicv_controls() argument
718 if (!nested_cpu_has_virt_x2apic_mode(vmcs12) && in nested_vmx_check_apicv_controls()
719 !nested_cpu_has_apic_reg_virt(vmcs12) && in nested_vmx_check_apicv_controls()
720 !nested_cpu_has_vid(vmcs12) && in nested_vmx_check_apicv_controls()
721 !nested_cpu_has_posted_intr(vmcs12)) in nested_vmx_check_apicv_controls()
728 if (CC(nested_cpu_has_virt_x2apic_mode(vmcs12) && in nested_vmx_check_apicv_controls()
729 nested_cpu_has2(vmcs12, SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES))) in nested_vmx_check_apicv_controls()
736 if (CC(nested_cpu_has_vid(vmcs12) && !nested_exit_on_intr(vcpu))) in nested_vmx_check_apicv_controls()
746 if (nested_cpu_has_posted_intr(vmcs12) && in nested_vmx_check_apicv_controls()
747 (CC(!nested_cpu_has_vid(vmcs12)) || in nested_vmx_check_apicv_controls()
749 CC((vmcs12->posted_intr_nv & 0xff00)) || in nested_vmx_check_apicv_controls()
750 CC((vmcs12->posted_intr_desc_addr & 0x3f)) || in nested_vmx_check_apicv_controls()
751 CC((vmcs12->posted_intr_desc_addr >> cpuid_maxphyaddr(vcpu))))) in nested_vmx_check_apicv_controls()
755 if (CC(!nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW))) in nested_vmx_check_apicv_controls()
777 struct vmcs12 *vmcs12) in nested_vmx_check_exit_msr_switch_controls() argument
780 vmcs12->vm_exit_msr_load_count, in nested_vmx_check_exit_msr_switch_controls()
781 vmcs12->vm_exit_msr_load_addr)) || in nested_vmx_check_exit_msr_switch_controls()
783 vmcs12->vm_exit_msr_store_count, in nested_vmx_check_exit_msr_switch_controls()
784 vmcs12->vm_exit_msr_store_addr))) in nested_vmx_check_exit_msr_switch_controls()
791 struct vmcs12 *vmcs12) in nested_vmx_check_entry_msr_switch_controls() argument
794 vmcs12->vm_entry_msr_load_count, in nested_vmx_check_entry_msr_switch_controls()
795 vmcs12->vm_entry_msr_load_addr))) in nested_vmx_check_entry_msr_switch_controls()
802 struct vmcs12 *vmcs12) in nested_vmx_check_pml_controls() argument
804 if (!nested_cpu_has_pml(vmcs12)) in nested_vmx_check_pml_controls()
807 if (CC(!nested_cpu_has_ept(vmcs12)) || in nested_vmx_check_pml_controls()
808 CC(!page_address_valid(vcpu, vmcs12->pml_address))) in nested_vmx_check_pml_controls()
815 struct vmcs12 *vmcs12) in nested_vmx_check_unrestricted_guest_controls() argument
817 if (CC(nested_cpu_has2(vmcs12, SECONDARY_EXEC_UNRESTRICTED_GUEST) && in nested_vmx_check_unrestricted_guest_controls()
818 !nested_cpu_has_ept(vmcs12))) in nested_vmx_check_unrestricted_guest_controls()
824 struct vmcs12 *vmcs12) in nested_vmx_check_mode_based_ept_exec_controls() argument
826 if (CC(nested_cpu_has2(vmcs12, SECONDARY_EXEC_MODE_BASED_EPT_EXEC) && in nested_vmx_check_mode_based_ept_exec_controls()
827 !nested_cpu_has_ept(vmcs12))) in nested_vmx_check_mode_based_ept_exec_controls()
833 struct vmcs12 *vmcs12) in nested_vmx_check_shadow_vmcs_controls() argument
835 if (!nested_cpu_has_shadow_vmcs(vmcs12)) in nested_vmx_check_shadow_vmcs_controls()
838 if (CC(!page_address_valid(vcpu, vmcs12->vmread_bitmap)) || in nested_vmx_check_shadow_vmcs_controls()
839 CC(!page_address_valid(vcpu, vmcs12->vmwrite_bitmap))) in nested_vmx_check_shadow_vmcs_controls()
1016 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_msr_store_list_has_msr() local
1017 u32 count = vmcs12->vm_exit_msr_store_count; in nested_msr_store_list_has_msr()
1018 u64 gpa = vmcs12->vm_exit_msr_store_addr; in nested_msr_store_list_has_msr()
1183 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_has_guest_tlb_tag() local
1186 (nested_cpu_has_vpid(vmcs12) && to_vmx(vcpu)->nested.vpid02); in nested_has_guest_tlb_tag()
1190 struct vmcs12 *vmcs12, in nested_vmx_transition_tlb_flush() argument
1222 if (!nested_cpu_has_vpid(vmcs12)) { in nested_vmx_transition_tlb_flush()
1227 vmcs12->virtual_processor_id != vmx->nested.last_vpid) { in nested_vmx_transition_tlb_flush()
1228 vmx->nested.last_vpid = vmcs12->virtual_processor_id; in nested_vmx_transition_tlb_flush()
1558 struct vmcs12 *vmcs12 = get_vmcs12(&vmx->vcpu); in copy_shadow_to_vmcs12() local
1573 vmcs12_write_any(vmcs12, field.encoding, field.offset, val); in copy_shadow_to_vmcs12()
1593 struct vmcs12 *vmcs12 = get_vmcs12(&vmx->vcpu); in copy_vmcs12_to_shadow() local
1606 val = vmcs12_read_any(vmcs12, field.encoding, in copy_vmcs12_to_shadow()
1618 struct vmcs12 *vmcs12 = vmx->nested.cached_vmcs12; in copy_enlightened_to_vmcs12() local
1622 vmcs12->tpr_threshold = evmcs->tpr_threshold; in copy_enlightened_to_vmcs12()
1623 vmcs12->guest_rip = evmcs->guest_rip; in copy_enlightened_to_vmcs12()
1627 vmcs12->guest_rsp = evmcs->guest_rsp; in copy_enlightened_to_vmcs12()
1628 vmcs12->guest_rflags = evmcs->guest_rflags; in copy_enlightened_to_vmcs12()
1629 vmcs12->guest_interruptibility_info = in copy_enlightened_to_vmcs12()
1635 vmcs12->cpu_based_vm_exec_control = in copy_enlightened_to_vmcs12()
1641 vmcs12->exception_bitmap = evmcs->exception_bitmap; in copy_enlightened_to_vmcs12()
1646 vmcs12->vm_entry_controls = evmcs->vm_entry_controls; in copy_enlightened_to_vmcs12()
1651 vmcs12->vm_entry_intr_info_field = in copy_enlightened_to_vmcs12()
1653 vmcs12->vm_entry_exception_error_code = in copy_enlightened_to_vmcs12()
1655 vmcs12->vm_entry_instruction_len = in copy_enlightened_to_vmcs12()
1661 vmcs12->host_ia32_pat = evmcs->host_ia32_pat; in copy_enlightened_to_vmcs12()
1662 vmcs12->host_ia32_efer = evmcs->host_ia32_efer; in copy_enlightened_to_vmcs12()
1663 vmcs12->host_cr0 = evmcs->host_cr0; in copy_enlightened_to_vmcs12()
1664 vmcs12->host_cr3 = evmcs->host_cr3; in copy_enlightened_to_vmcs12()
1665 vmcs12->host_cr4 = evmcs->host_cr4; in copy_enlightened_to_vmcs12()
1666 vmcs12->host_ia32_sysenter_esp = evmcs->host_ia32_sysenter_esp; in copy_enlightened_to_vmcs12()
1667 vmcs12->host_ia32_sysenter_eip = evmcs->host_ia32_sysenter_eip; in copy_enlightened_to_vmcs12()
1668 vmcs12->host_rip = evmcs->host_rip; in copy_enlightened_to_vmcs12()
1669 vmcs12->host_ia32_sysenter_cs = evmcs->host_ia32_sysenter_cs; in copy_enlightened_to_vmcs12()
1670 vmcs12->host_es_selector = evmcs->host_es_selector; in copy_enlightened_to_vmcs12()
1671 vmcs12->host_cs_selector = evmcs->host_cs_selector; in copy_enlightened_to_vmcs12()
1672 vmcs12->host_ss_selector = evmcs->host_ss_selector; in copy_enlightened_to_vmcs12()
1673 vmcs12->host_ds_selector = evmcs->host_ds_selector; in copy_enlightened_to_vmcs12()
1674 vmcs12->host_fs_selector = evmcs->host_fs_selector; in copy_enlightened_to_vmcs12()
1675 vmcs12->host_gs_selector = evmcs->host_gs_selector; in copy_enlightened_to_vmcs12()
1676 vmcs12->host_tr_selector = evmcs->host_tr_selector; in copy_enlightened_to_vmcs12()
1681 vmcs12->pin_based_vm_exec_control = in copy_enlightened_to_vmcs12()
1683 vmcs12->vm_exit_controls = evmcs->vm_exit_controls; in copy_enlightened_to_vmcs12()
1684 vmcs12->secondary_vm_exec_control = in copy_enlightened_to_vmcs12()
1690 vmcs12->io_bitmap_a = evmcs->io_bitmap_a; in copy_enlightened_to_vmcs12()
1691 vmcs12->io_bitmap_b = evmcs->io_bitmap_b; in copy_enlightened_to_vmcs12()
1696 vmcs12->msr_bitmap = evmcs->msr_bitmap; in copy_enlightened_to_vmcs12()
1701 vmcs12->guest_es_base = evmcs->guest_es_base; in copy_enlightened_to_vmcs12()
1702 vmcs12->guest_cs_base = evmcs->guest_cs_base; in copy_enlightened_to_vmcs12()
1703 vmcs12->guest_ss_base = evmcs->guest_ss_base; in copy_enlightened_to_vmcs12()
1704 vmcs12->guest_ds_base = evmcs->guest_ds_base; in copy_enlightened_to_vmcs12()
1705 vmcs12->guest_fs_base = evmcs->guest_fs_base; in copy_enlightened_to_vmcs12()
1706 vmcs12->guest_gs_base = evmcs->guest_gs_base; in copy_enlightened_to_vmcs12()
1707 vmcs12->guest_ldtr_base = evmcs->guest_ldtr_base; in copy_enlightened_to_vmcs12()
1708 vmcs12->guest_tr_base = evmcs->guest_tr_base; in copy_enlightened_to_vmcs12()
1709 vmcs12->guest_gdtr_base = evmcs->guest_gdtr_base; in copy_enlightened_to_vmcs12()
1710 vmcs12->guest_idtr_base = evmcs->guest_idtr_base; in copy_enlightened_to_vmcs12()
1711 vmcs12->guest_es_limit = evmcs->guest_es_limit; in copy_enlightened_to_vmcs12()
1712 vmcs12->guest_cs_limit = evmcs->guest_cs_limit; in copy_enlightened_to_vmcs12()
1713 vmcs12->guest_ss_limit = evmcs->guest_ss_limit; in copy_enlightened_to_vmcs12()
1714 vmcs12->guest_ds_limit = evmcs->guest_ds_limit; in copy_enlightened_to_vmcs12()
1715 vmcs12->guest_fs_limit = evmcs->guest_fs_limit; in copy_enlightened_to_vmcs12()
1716 vmcs12->guest_gs_limit = evmcs->guest_gs_limit; in copy_enlightened_to_vmcs12()
1717 vmcs12->guest_ldtr_limit = evmcs->guest_ldtr_limit; in copy_enlightened_to_vmcs12()
1718 vmcs12->guest_tr_limit = evmcs->guest_tr_limit; in copy_enlightened_to_vmcs12()
1719 vmcs12->guest_gdtr_limit = evmcs->guest_gdtr_limit; in copy_enlightened_to_vmcs12()
1720 vmcs12->guest_idtr_limit = evmcs->guest_idtr_limit; in copy_enlightened_to_vmcs12()
1721 vmcs12->guest_es_ar_bytes = evmcs->guest_es_ar_bytes; in copy_enlightened_to_vmcs12()
1722 vmcs12->guest_cs_ar_bytes = evmcs->guest_cs_ar_bytes; in copy_enlightened_to_vmcs12()
1723 vmcs12->guest_ss_ar_bytes = evmcs->guest_ss_ar_bytes; in copy_enlightened_to_vmcs12()
1724 vmcs12->guest_ds_ar_bytes = evmcs->guest_ds_ar_bytes; in copy_enlightened_to_vmcs12()
1725 vmcs12->guest_fs_ar_bytes = evmcs->guest_fs_ar_bytes; in copy_enlightened_to_vmcs12()
1726 vmcs12->guest_gs_ar_bytes = evmcs->guest_gs_ar_bytes; in copy_enlightened_to_vmcs12()
1727 vmcs12->guest_ldtr_ar_bytes = evmcs->guest_ldtr_ar_bytes; in copy_enlightened_to_vmcs12()
1728 vmcs12->guest_tr_ar_bytes = evmcs->guest_tr_ar_bytes; in copy_enlightened_to_vmcs12()
1729 vmcs12->guest_es_selector = evmcs->guest_es_selector; in copy_enlightened_to_vmcs12()
1730 vmcs12->guest_cs_selector = evmcs->guest_cs_selector; in copy_enlightened_to_vmcs12()
1731 vmcs12->guest_ss_selector = evmcs->guest_ss_selector; in copy_enlightened_to_vmcs12()
1732 vmcs12->guest_ds_selector = evmcs->guest_ds_selector; in copy_enlightened_to_vmcs12()
1733 vmcs12->guest_fs_selector = evmcs->guest_fs_selector; in copy_enlightened_to_vmcs12()
1734 vmcs12->guest_gs_selector = evmcs->guest_gs_selector; in copy_enlightened_to_vmcs12()
1735 vmcs12->guest_ldtr_selector = evmcs->guest_ldtr_selector; in copy_enlightened_to_vmcs12()
1736 vmcs12->guest_tr_selector = evmcs->guest_tr_selector; in copy_enlightened_to_vmcs12()
1741 vmcs12->tsc_offset = evmcs->tsc_offset; in copy_enlightened_to_vmcs12()
1742 vmcs12->virtual_apic_page_addr = evmcs->virtual_apic_page_addr; in copy_enlightened_to_vmcs12()
1743 vmcs12->xss_exit_bitmap = evmcs->xss_exit_bitmap; in copy_enlightened_to_vmcs12()
1748 vmcs12->cr0_guest_host_mask = evmcs->cr0_guest_host_mask; in copy_enlightened_to_vmcs12()
1749 vmcs12->cr4_guest_host_mask = evmcs->cr4_guest_host_mask; in copy_enlightened_to_vmcs12()
1750 vmcs12->cr0_read_shadow = evmcs->cr0_read_shadow; in copy_enlightened_to_vmcs12()
1751 vmcs12->cr4_read_shadow = evmcs->cr4_read_shadow; in copy_enlightened_to_vmcs12()
1752 vmcs12->guest_cr0 = evmcs->guest_cr0; in copy_enlightened_to_vmcs12()
1753 vmcs12->guest_cr3 = evmcs->guest_cr3; in copy_enlightened_to_vmcs12()
1754 vmcs12->guest_cr4 = evmcs->guest_cr4; in copy_enlightened_to_vmcs12()
1755 vmcs12->guest_dr7 = evmcs->guest_dr7; in copy_enlightened_to_vmcs12()
1760 vmcs12->host_fs_base = evmcs->host_fs_base; in copy_enlightened_to_vmcs12()
1761 vmcs12->host_gs_base = evmcs->host_gs_base; in copy_enlightened_to_vmcs12()
1762 vmcs12->host_tr_base = evmcs->host_tr_base; in copy_enlightened_to_vmcs12()
1763 vmcs12->host_gdtr_base = evmcs->host_gdtr_base; in copy_enlightened_to_vmcs12()
1764 vmcs12->host_idtr_base = evmcs->host_idtr_base; in copy_enlightened_to_vmcs12()
1765 vmcs12->host_rsp = evmcs->host_rsp; in copy_enlightened_to_vmcs12()
1770 vmcs12->ept_pointer = evmcs->ept_pointer; in copy_enlightened_to_vmcs12()
1771 vmcs12->virtual_processor_id = evmcs->virtual_processor_id; in copy_enlightened_to_vmcs12()
1776 vmcs12->vmcs_link_pointer = evmcs->vmcs_link_pointer; in copy_enlightened_to_vmcs12()
1777 vmcs12->guest_ia32_debugctl = evmcs->guest_ia32_debugctl; in copy_enlightened_to_vmcs12()
1778 vmcs12->guest_ia32_pat = evmcs->guest_ia32_pat; in copy_enlightened_to_vmcs12()
1779 vmcs12->guest_ia32_efer = evmcs->guest_ia32_efer; in copy_enlightened_to_vmcs12()
1780 vmcs12->guest_pdptr0 = evmcs->guest_pdptr0; in copy_enlightened_to_vmcs12()
1781 vmcs12->guest_pdptr1 = evmcs->guest_pdptr1; in copy_enlightened_to_vmcs12()
1782 vmcs12->guest_pdptr2 = evmcs->guest_pdptr2; in copy_enlightened_to_vmcs12()
1783 vmcs12->guest_pdptr3 = evmcs->guest_pdptr3; in copy_enlightened_to_vmcs12()
1784 vmcs12->guest_pending_dbg_exceptions = in copy_enlightened_to_vmcs12()
1786 vmcs12->guest_sysenter_esp = evmcs->guest_sysenter_esp; in copy_enlightened_to_vmcs12()
1787 vmcs12->guest_sysenter_eip = evmcs->guest_sysenter_eip; in copy_enlightened_to_vmcs12()
1788 vmcs12->guest_bndcfgs = evmcs->guest_bndcfgs; in copy_enlightened_to_vmcs12()
1789 vmcs12->guest_activity_state = evmcs->guest_activity_state; in copy_enlightened_to_vmcs12()
1790 vmcs12->guest_sysenter_cs = evmcs->guest_sysenter_cs; in copy_enlightened_to_vmcs12()
1834 struct vmcs12 *vmcs12 = vmx->nested.cached_vmcs12; in copy_vmcs12_to_enlightened() local
1901 evmcs->guest_es_selector = vmcs12->guest_es_selector; in copy_vmcs12_to_enlightened()
1902 evmcs->guest_cs_selector = vmcs12->guest_cs_selector; in copy_vmcs12_to_enlightened()
1903 evmcs->guest_ss_selector = vmcs12->guest_ss_selector; in copy_vmcs12_to_enlightened()
1904 evmcs->guest_ds_selector = vmcs12->guest_ds_selector; in copy_vmcs12_to_enlightened()
1905 evmcs->guest_fs_selector = vmcs12->guest_fs_selector; in copy_vmcs12_to_enlightened()
1906 evmcs->guest_gs_selector = vmcs12->guest_gs_selector; in copy_vmcs12_to_enlightened()
1907 evmcs->guest_ldtr_selector = vmcs12->guest_ldtr_selector; in copy_vmcs12_to_enlightened()
1908 evmcs->guest_tr_selector = vmcs12->guest_tr_selector; in copy_vmcs12_to_enlightened()
1910 evmcs->guest_es_limit = vmcs12->guest_es_limit; in copy_vmcs12_to_enlightened()
1911 evmcs->guest_cs_limit = vmcs12->guest_cs_limit; in copy_vmcs12_to_enlightened()
1912 evmcs->guest_ss_limit = vmcs12->guest_ss_limit; in copy_vmcs12_to_enlightened()
1913 evmcs->guest_ds_limit = vmcs12->guest_ds_limit; in copy_vmcs12_to_enlightened()
1914 evmcs->guest_fs_limit = vmcs12->guest_fs_limit; in copy_vmcs12_to_enlightened()
1915 evmcs->guest_gs_limit = vmcs12->guest_gs_limit; in copy_vmcs12_to_enlightened()
1916 evmcs->guest_ldtr_limit = vmcs12->guest_ldtr_limit; in copy_vmcs12_to_enlightened()
1917 evmcs->guest_tr_limit = vmcs12->guest_tr_limit; in copy_vmcs12_to_enlightened()
1918 evmcs->guest_gdtr_limit = vmcs12->guest_gdtr_limit; in copy_vmcs12_to_enlightened()
1919 evmcs->guest_idtr_limit = vmcs12->guest_idtr_limit; in copy_vmcs12_to_enlightened()
1921 evmcs->guest_es_ar_bytes = vmcs12->guest_es_ar_bytes; in copy_vmcs12_to_enlightened()
1922 evmcs->guest_cs_ar_bytes = vmcs12->guest_cs_ar_bytes; in copy_vmcs12_to_enlightened()
1923 evmcs->guest_ss_ar_bytes = vmcs12->guest_ss_ar_bytes; in copy_vmcs12_to_enlightened()
1924 evmcs->guest_ds_ar_bytes = vmcs12->guest_ds_ar_bytes; in copy_vmcs12_to_enlightened()
1925 evmcs->guest_fs_ar_bytes = vmcs12->guest_fs_ar_bytes; in copy_vmcs12_to_enlightened()
1926 evmcs->guest_gs_ar_bytes = vmcs12->guest_gs_ar_bytes; in copy_vmcs12_to_enlightened()
1927 evmcs->guest_ldtr_ar_bytes = vmcs12->guest_ldtr_ar_bytes; in copy_vmcs12_to_enlightened()
1928 evmcs->guest_tr_ar_bytes = vmcs12->guest_tr_ar_bytes; in copy_vmcs12_to_enlightened()
1930 evmcs->guest_es_base = vmcs12->guest_es_base; in copy_vmcs12_to_enlightened()
1931 evmcs->guest_cs_base = vmcs12->guest_cs_base; in copy_vmcs12_to_enlightened()
1932 evmcs->guest_ss_base = vmcs12->guest_ss_base; in copy_vmcs12_to_enlightened()
1933 evmcs->guest_ds_base = vmcs12->guest_ds_base; in copy_vmcs12_to_enlightened()
1934 evmcs->guest_fs_base = vmcs12->guest_fs_base; in copy_vmcs12_to_enlightened()
1935 evmcs->guest_gs_base = vmcs12->guest_gs_base; in copy_vmcs12_to_enlightened()
1936 evmcs->guest_ldtr_base = vmcs12->guest_ldtr_base; in copy_vmcs12_to_enlightened()
1937 evmcs->guest_tr_base = vmcs12->guest_tr_base; in copy_vmcs12_to_enlightened()
1938 evmcs->guest_gdtr_base = vmcs12->guest_gdtr_base; in copy_vmcs12_to_enlightened()
1939 evmcs->guest_idtr_base = vmcs12->guest_idtr_base; in copy_vmcs12_to_enlightened()
1941 evmcs->guest_ia32_pat = vmcs12->guest_ia32_pat; in copy_vmcs12_to_enlightened()
1942 evmcs->guest_ia32_efer = vmcs12->guest_ia32_efer; in copy_vmcs12_to_enlightened()
1944 evmcs->guest_pdptr0 = vmcs12->guest_pdptr0; in copy_vmcs12_to_enlightened()
1945 evmcs->guest_pdptr1 = vmcs12->guest_pdptr1; in copy_vmcs12_to_enlightened()
1946 evmcs->guest_pdptr2 = vmcs12->guest_pdptr2; in copy_vmcs12_to_enlightened()
1947 evmcs->guest_pdptr3 = vmcs12->guest_pdptr3; in copy_vmcs12_to_enlightened()
1950 vmcs12->guest_pending_dbg_exceptions; in copy_vmcs12_to_enlightened()
1951 evmcs->guest_sysenter_esp = vmcs12->guest_sysenter_esp; in copy_vmcs12_to_enlightened()
1952 evmcs->guest_sysenter_eip = vmcs12->guest_sysenter_eip; in copy_vmcs12_to_enlightened()
1954 evmcs->guest_activity_state = vmcs12->guest_activity_state; in copy_vmcs12_to_enlightened()
1955 evmcs->guest_sysenter_cs = vmcs12->guest_sysenter_cs; in copy_vmcs12_to_enlightened()
1957 evmcs->guest_cr0 = vmcs12->guest_cr0; in copy_vmcs12_to_enlightened()
1958 evmcs->guest_cr3 = vmcs12->guest_cr3; in copy_vmcs12_to_enlightened()
1959 evmcs->guest_cr4 = vmcs12->guest_cr4; in copy_vmcs12_to_enlightened()
1960 evmcs->guest_dr7 = vmcs12->guest_dr7; in copy_vmcs12_to_enlightened()
1962 evmcs->guest_physical_address = vmcs12->guest_physical_address; in copy_vmcs12_to_enlightened()
1964 evmcs->vm_instruction_error = vmcs12->vm_instruction_error; in copy_vmcs12_to_enlightened()
1965 evmcs->vm_exit_reason = vmcs12->vm_exit_reason; in copy_vmcs12_to_enlightened()
1966 evmcs->vm_exit_intr_info = vmcs12->vm_exit_intr_info; in copy_vmcs12_to_enlightened()
1967 evmcs->vm_exit_intr_error_code = vmcs12->vm_exit_intr_error_code; in copy_vmcs12_to_enlightened()
1968 evmcs->idt_vectoring_info_field = vmcs12->idt_vectoring_info_field; in copy_vmcs12_to_enlightened()
1969 evmcs->idt_vectoring_error_code = vmcs12->idt_vectoring_error_code; in copy_vmcs12_to_enlightened()
1970 evmcs->vm_exit_instruction_len = vmcs12->vm_exit_instruction_len; in copy_vmcs12_to_enlightened()
1971 evmcs->vmx_instruction_info = vmcs12->vmx_instruction_info; in copy_vmcs12_to_enlightened()
1973 evmcs->exit_qualification = vmcs12->exit_qualification; in copy_vmcs12_to_enlightened()
1975 evmcs->guest_linear_address = vmcs12->guest_linear_address; in copy_vmcs12_to_enlightened()
1976 evmcs->guest_rsp = vmcs12->guest_rsp; in copy_vmcs12_to_enlightened()
1977 evmcs->guest_rflags = vmcs12->guest_rflags; in copy_vmcs12_to_enlightened()
1980 vmcs12->guest_interruptibility_info; in copy_vmcs12_to_enlightened()
1981 evmcs->cpu_based_vm_exec_control = vmcs12->cpu_based_vm_exec_control; in copy_vmcs12_to_enlightened()
1982 evmcs->vm_entry_controls = vmcs12->vm_entry_controls; in copy_vmcs12_to_enlightened()
1983 evmcs->vm_entry_intr_info_field = vmcs12->vm_entry_intr_info_field; in copy_vmcs12_to_enlightened()
1985 vmcs12->vm_entry_exception_error_code; in copy_vmcs12_to_enlightened()
1986 evmcs->vm_entry_instruction_len = vmcs12->vm_entry_instruction_len; in copy_vmcs12_to_enlightened()
1988 evmcs->guest_rip = vmcs12->guest_rip; in copy_vmcs12_to_enlightened()
1990 evmcs->guest_bndcfgs = vmcs12->guest_bndcfgs; in copy_vmcs12_to_enlightened()
2064 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_handle_enlightened_vmptrld() local
2065 memset(vmcs12, 0, sizeof(*vmcs12)); in nested_vmx_handle_enlightened_vmptrld()
2066 vmcs12->hdr.revision_id = VMCS12_REVISION; in nested_vmx_handle_enlightened_vmptrld()
2113 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in vmx_calc_preemption_timer_value() local
2120 vmcs12->vmx_preemption_timer_value + l1_scaled_tsc; in vmx_calc_preemption_timer_value()
2151 static u64 nested_vmx_calc_efer(struct vcpu_vmx *vmx, struct vmcs12 *vmcs12) in nested_vmx_calc_efer() argument
2154 (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_EFER)) in nested_vmx_calc_efer()
2155 return vmcs12->guest_ia32_efer; in nested_vmx_calc_efer()
2156 else if (vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) in nested_vmx_calc_efer()
2221 struct vmcs12 *vmcs12) in prepare_vmcs02_early_rare() argument
2228 if (nested_cpu_has_vpid(vmcs12) && vmx->nested.vpid02) in prepare_vmcs02_early_rare()
2236 struct vmcs12 *vmcs12) in prepare_vmcs02_early() argument
2239 u64 guest_efer = nested_vmx_calc_efer(vmx, vmcs12); in prepare_vmcs02_early()
2242 prepare_vmcs02_early_rare(vmx, vmcs12); in prepare_vmcs02_early()
2248 exec_control |= (vmcs12->pin_based_vm_exec_control & in prepare_vmcs02_early()
2253 if (nested_cpu_has_posted_intr(vmcs12)) in prepare_vmcs02_early()
2254 vmx->nested.posted_intr_nv = vmcs12->posted_intr_nv; in prepare_vmcs02_early()
2266 exec_control |= vmcs12->cpu_based_vm_exec_control; in prepare_vmcs02_early()
2270 vmcs_write32(TPR_THRESHOLD, vmcs12->tpr_threshold); in prepare_vmcs02_early()
2313 if (nested_cpu_has(vmcs12, in prepare_vmcs02_early()
2315 vmcs12_exec_ctrl = vmcs12->secondary_vm_exec_control & in prepare_vmcs02_early()
2328 (vmcs12->guest_cr4 & X86_CR4_UMIP)) in prepare_vmcs02_early()
2333 vmcs12->guest_intr_status); in prepare_vmcs02_early()
2335 if (!nested_cpu_has2(vmcs12, SECONDARY_EXEC_UNRESTRICTED_GUEST)) in prepare_vmcs02_early()
2354 exec_control |= (vmcs12->vm_entry_controls & in prepare_vmcs02_early()
2384 vmcs12->vm_entry_intr_info_field); in prepare_vmcs02_early()
2386 vmcs12->vm_entry_exception_error_code); in prepare_vmcs02_early()
2388 vmcs12->vm_entry_instruction_len); in prepare_vmcs02_early()
2390 vmcs12->guest_interruptibility_info); in prepare_vmcs02_early()
2392 !(vmcs12->guest_interruptibility_info & GUEST_INTR_STATE_NMI); in prepare_vmcs02_early()
2398 static void prepare_vmcs02_rare(struct vcpu_vmx *vmx, struct vmcs12 *vmcs12) in prepare_vmcs02_rare() argument
2404 vmcs_write16(GUEST_ES_SELECTOR, vmcs12->guest_es_selector); in prepare_vmcs02_rare()
2405 vmcs_write16(GUEST_CS_SELECTOR, vmcs12->guest_cs_selector); in prepare_vmcs02_rare()
2406 vmcs_write16(GUEST_SS_SELECTOR, vmcs12->guest_ss_selector); in prepare_vmcs02_rare()
2407 vmcs_write16(GUEST_DS_SELECTOR, vmcs12->guest_ds_selector); in prepare_vmcs02_rare()
2408 vmcs_write16(GUEST_FS_SELECTOR, vmcs12->guest_fs_selector); in prepare_vmcs02_rare()
2409 vmcs_write16(GUEST_GS_SELECTOR, vmcs12->guest_gs_selector); in prepare_vmcs02_rare()
2410 vmcs_write16(GUEST_LDTR_SELECTOR, vmcs12->guest_ldtr_selector); in prepare_vmcs02_rare()
2411 vmcs_write16(GUEST_TR_SELECTOR, vmcs12->guest_tr_selector); in prepare_vmcs02_rare()
2412 vmcs_write32(GUEST_ES_LIMIT, vmcs12->guest_es_limit); in prepare_vmcs02_rare()
2413 vmcs_write32(GUEST_CS_LIMIT, vmcs12->guest_cs_limit); in prepare_vmcs02_rare()
2414 vmcs_write32(GUEST_SS_LIMIT, vmcs12->guest_ss_limit); in prepare_vmcs02_rare()
2415 vmcs_write32(GUEST_DS_LIMIT, vmcs12->guest_ds_limit); in prepare_vmcs02_rare()
2416 vmcs_write32(GUEST_FS_LIMIT, vmcs12->guest_fs_limit); in prepare_vmcs02_rare()
2417 vmcs_write32(GUEST_GS_LIMIT, vmcs12->guest_gs_limit); in prepare_vmcs02_rare()
2418 vmcs_write32(GUEST_LDTR_LIMIT, vmcs12->guest_ldtr_limit); in prepare_vmcs02_rare()
2419 vmcs_write32(GUEST_TR_LIMIT, vmcs12->guest_tr_limit); in prepare_vmcs02_rare()
2420 vmcs_write32(GUEST_GDTR_LIMIT, vmcs12->guest_gdtr_limit); in prepare_vmcs02_rare()
2421 vmcs_write32(GUEST_IDTR_LIMIT, vmcs12->guest_idtr_limit); in prepare_vmcs02_rare()
2422 vmcs_write32(GUEST_CS_AR_BYTES, vmcs12->guest_cs_ar_bytes); in prepare_vmcs02_rare()
2423 vmcs_write32(GUEST_SS_AR_BYTES, vmcs12->guest_ss_ar_bytes); in prepare_vmcs02_rare()
2424 vmcs_write32(GUEST_ES_AR_BYTES, vmcs12->guest_es_ar_bytes); in prepare_vmcs02_rare()
2425 vmcs_write32(GUEST_DS_AR_BYTES, vmcs12->guest_ds_ar_bytes); in prepare_vmcs02_rare()
2426 vmcs_write32(GUEST_FS_AR_BYTES, vmcs12->guest_fs_ar_bytes); in prepare_vmcs02_rare()
2427 vmcs_write32(GUEST_GS_AR_BYTES, vmcs12->guest_gs_ar_bytes); in prepare_vmcs02_rare()
2428 vmcs_write32(GUEST_LDTR_AR_BYTES, vmcs12->guest_ldtr_ar_bytes); in prepare_vmcs02_rare()
2429 vmcs_write32(GUEST_TR_AR_BYTES, vmcs12->guest_tr_ar_bytes); in prepare_vmcs02_rare()
2430 vmcs_writel(GUEST_ES_BASE, vmcs12->guest_es_base); in prepare_vmcs02_rare()
2431 vmcs_writel(GUEST_CS_BASE, vmcs12->guest_cs_base); in prepare_vmcs02_rare()
2432 vmcs_writel(GUEST_SS_BASE, vmcs12->guest_ss_base); in prepare_vmcs02_rare()
2433 vmcs_writel(GUEST_DS_BASE, vmcs12->guest_ds_base); in prepare_vmcs02_rare()
2434 vmcs_writel(GUEST_FS_BASE, vmcs12->guest_fs_base); in prepare_vmcs02_rare()
2435 vmcs_writel(GUEST_GS_BASE, vmcs12->guest_gs_base); in prepare_vmcs02_rare()
2436 vmcs_writel(GUEST_LDTR_BASE, vmcs12->guest_ldtr_base); in prepare_vmcs02_rare()
2437 vmcs_writel(GUEST_TR_BASE, vmcs12->guest_tr_base); in prepare_vmcs02_rare()
2438 vmcs_writel(GUEST_GDTR_BASE, vmcs12->guest_gdtr_base); in prepare_vmcs02_rare()
2439 vmcs_writel(GUEST_IDTR_BASE, vmcs12->guest_idtr_base); in prepare_vmcs02_rare()
2446 vmcs_write32(GUEST_SYSENTER_CS, vmcs12->guest_sysenter_cs); in prepare_vmcs02_rare()
2448 vmcs12->guest_pending_dbg_exceptions); in prepare_vmcs02_rare()
2449 vmcs_writel(GUEST_SYSENTER_ESP, vmcs12->guest_sysenter_esp); in prepare_vmcs02_rare()
2450 vmcs_writel(GUEST_SYSENTER_EIP, vmcs12->guest_sysenter_eip); in prepare_vmcs02_rare()
2457 vmcs_write64(GUEST_PDPTR0, vmcs12->guest_pdptr0); in prepare_vmcs02_rare()
2458 vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1); in prepare_vmcs02_rare()
2459 vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2); in prepare_vmcs02_rare()
2460 vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3); in prepare_vmcs02_rare()
2464 (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS)) in prepare_vmcs02_rare()
2465 vmcs_write64(GUEST_BNDCFGS, vmcs12->guest_bndcfgs); in prepare_vmcs02_rare()
2468 if (nested_cpu_has_xsaves(vmcs12)) in prepare_vmcs02_rare()
2469 vmcs_write64(XSS_EXIT_BITMAP, vmcs12->xss_exit_bitmap); in prepare_vmcs02_rare()
2492 vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, vmcs12->page_fault_error_code_mask); in prepare_vmcs02_rare()
2493 vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, vmcs12->page_fault_error_code_match); in prepare_vmcs02_rare()
2497 vmcs_write64(EOI_EXIT_BITMAP0, vmcs12->eoi_exit_bitmap0); in prepare_vmcs02_rare()
2498 vmcs_write64(EOI_EXIT_BITMAP1, vmcs12->eoi_exit_bitmap1); in prepare_vmcs02_rare()
2499 vmcs_write64(EOI_EXIT_BITMAP2, vmcs12->eoi_exit_bitmap2); in prepare_vmcs02_rare()
2500 vmcs_write64(EOI_EXIT_BITMAP3, vmcs12->eoi_exit_bitmap3); in prepare_vmcs02_rare()
2527 static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, in prepare_vmcs02() argument
2535 prepare_vmcs02_rare(vmx, vmcs12); in prepare_vmcs02()
2544 (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS)) { in prepare_vmcs02()
2545 kvm_set_dr(vcpu, 7, vmcs12->guest_dr7); in prepare_vmcs02()
2546 vmcs_write64(GUEST_IA32_DEBUGCTL, vmcs12->guest_ia32_debugctl); in prepare_vmcs02()
2552 !(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS))) in prepare_vmcs02()
2554 vmx_set_rflags(vcpu, vmcs12->guest_rflags); in prepare_vmcs02()
2561 vcpu->arch.cr0_guest_owned_bits &= ~vmcs12->cr0_guest_host_mask; in prepare_vmcs02()
2565 (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_PAT)) { in prepare_vmcs02()
2566 vmcs_write64(GUEST_IA32_PAT, vmcs12->guest_ia32_pat); in prepare_vmcs02()
2567 vcpu->arch.pat = vmcs12->guest_ia32_pat; in prepare_vmcs02()
2577 nested_vmx_transition_tlb_flush(vcpu, vmcs12, true); in prepare_vmcs02()
2579 if (nested_cpu_has_ept(vmcs12)) in prepare_vmcs02()
2590 vmx_set_cr0(vcpu, vmcs12->guest_cr0); in prepare_vmcs02()
2591 vmcs_writel(CR0_READ_SHADOW, nested_read_cr0(vmcs12)); in prepare_vmcs02()
2593 vmx_set_cr4(vcpu, vmcs12->guest_cr4); in prepare_vmcs02()
2594 vmcs_writel(CR4_READ_SHADOW, nested_read_cr4(vmcs12)); in prepare_vmcs02()
2596 vcpu->arch.efer = nested_vmx_calc_efer(vmx, vmcs12); in prepare_vmcs02()
2611 if (nested_vmx_load_cr3(vcpu, vmcs12->guest_cr3, nested_cpu_has_ept(vmcs12), in prepare_vmcs02()
2623 vmcs_writel(GUEST_CR3, vmcs12->guest_cr3); in prepare_vmcs02()
2626 if (load_guest_pdptrs_vmcs12 && nested_cpu_has_ept(vmcs12) && in prepare_vmcs02()
2628 vmcs_write64(GUEST_PDPTR0, vmcs12->guest_pdptr0); in prepare_vmcs02()
2629 vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1); in prepare_vmcs02()
2630 vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2); in prepare_vmcs02()
2631 vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3); in prepare_vmcs02()
2637 if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL) && in prepare_vmcs02()
2639 vmcs12->guest_ia32_perf_global_ctrl))) { in prepare_vmcs02()
2644 kvm_rsp_write(vcpu, vmcs12->guest_rsp); in prepare_vmcs02()
2645 kvm_rip_write(vcpu, vmcs12->guest_rip); in prepare_vmcs02()
2649 static int nested_vmx_check_nmi_controls(struct vmcs12 *vmcs12) in nested_vmx_check_nmi_controls() argument
2651 if (CC(!nested_cpu_has_nmi_exiting(vmcs12) && in nested_vmx_check_nmi_controls()
2652 nested_cpu_has_virtual_nmis(vmcs12))) in nested_vmx_check_nmi_controls()
2655 if (CC(!nested_cpu_has_virtual_nmis(vmcs12) && in nested_vmx_check_nmi_controls()
2656 nested_cpu_has(vmcs12, CPU_BASED_NMI_WINDOW_EXITING))) in nested_vmx_check_nmi_controls()
2712 struct vmcs12 *vmcs12) in nested_check_vm_execution_controls() argument
2716 if (CC(!vmx_control_verify(vmcs12->pin_based_vm_exec_control, in nested_check_vm_execution_controls()
2719 CC(!vmx_control_verify(vmcs12->cpu_based_vm_exec_control, in nested_check_vm_execution_controls()
2724 if (nested_cpu_has(vmcs12, CPU_BASED_ACTIVATE_SECONDARY_CONTROLS) && in nested_check_vm_execution_controls()
2725 CC(!vmx_control_verify(vmcs12->secondary_vm_exec_control, in nested_check_vm_execution_controls()
2730 if (CC(vmcs12->cr3_target_count > nested_cpu_vmx_misc_cr3_count(vcpu)) || in nested_check_vm_execution_controls()
2731 nested_vmx_check_io_bitmap_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2732 nested_vmx_check_msr_bitmap_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2733 nested_vmx_check_tpr_shadow_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2734 nested_vmx_check_apic_access_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2735 nested_vmx_check_apicv_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2736 nested_vmx_check_nmi_controls(vmcs12) || in nested_check_vm_execution_controls()
2737 nested_vmx_check_pml_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2738 nested_vmx_check_unrestricted_guest_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2739 nested_vmx_check_mode_based_ept_exec_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2740 nested_vmx_check_shadow_vmcs_controls(vcpu, vmcs12) || in nested_check_vm_execution_controls()
2741 CC(nested_cpu_has_vpid(vmcs12) && !vmcs12->virtual_processor_id)) in nested_check_vm_execution_controls()
2744 if (!nested_cpu_has_preemption_timer(vmcs12) && in nested_check_vm_execution_controls()
2745 nested_cpu_has_save_preemption_timer(vmcs12)) in nested_check_vm_execution_controls()
2748 if (nested_cpu_has_ept(vmcs12) && in nested_check_vm_execution_controls()
2749 CC(!nested_vmx_check_eptp(vcpu, vmcs12->ept_pointer))) in nested_check_vm_execution_controls()
2752 if (nested_cpu_has_vmfunc(vmcs12)) { in nested_check_vm_execution_controls()
2753 if (CC(vmcs12->vm_function_control & in nested_check_vm_execution_controls()
2757 if (nested_cpu_has_eptp_switching(vmcs12)) { in nested_check_vm_execution_controls()
2758 if (CC(!nested_cpu_has_ept(vmcs12)) || in nested_check_vm_execution_controls()
2759 CC(!page_address_valid(vcpu, vmcs12->eptp_list_address))) in nested_check_vm_execution_controls()
2771 struct vmcs12 *vmcs12) in nested_check_vm_exit_controls() argument
2775 if (CC(!vmx_control_verify(vmcs12->vm_exit_controls, in nested_check_vm_exit_controls()
2778 CC(nested_vmx_check_exit_msr_switch_controls(vcpu, vmcs12))) in nested_check_vm_exit_controls()
2788 struct vmcs12 *vmcs12) in nested_check_vm_entry_controls() argument
2792 if (CC(!vmx_control_verify(vmcs12->vm_entry_controls, in nested_check_vm_entry_controls()
2803 if (vmcs12->vm_entry_intr_info_field & INTR_INFO_VALID_MASK) { in nested_check_vm_entry_controls()
2804 u32 intr_info = vmcs12->vm_entry_intr_info_field; in nested_check_vm_entry_controls()
2809 bool urg = nested_cpu_has2(vmcs12, in nested_check_vm_entry_controls()
2811 bool prot_mode = !urg || vmcs12->guest_cr0 & X86_CR0_PE; in nested_check_vm_entry_controls()
2834 vmcs12->vm_entry_exception_error_code & GENMASK(31, 16))) in nested_check_vm_entry_controls()
2846 if (CC(vmcs12->vm_entry_instruction_len > 15) || in nested_check_vm_entry_controls()
2847 CC(vmcs12->vm_entry_instruction_len == 0 && in nested_check_vm_entry_controls()
2853 if (nested_vmx_check_entry_msr_switch_controls(vcpu, vmcs12)) in nested_check_vm_entry_controls()
2860 struct vmcs12 *vmcs12) in nested_vmx_check_controls() argument
2862 if (nested_check_vm_execution_controls(vcpu, vmcs12) || in nested_vmx_check_controls()
2863 nested_check_vm_exit_controls(vcpu, vmcs12) || in nested_vmx_check_controls()
2864 nested_check_vm_entry_controls(vcpu, vmcs12)) in nested_vmx_check_controls()
2868 return nested_evmcs_check_controls(vmcs12); in nested_vmx_check_controls()
2874 struct vmcs12 *vmcs12) in nested_vmx_check_address_space_size() argument
2877 if (CC(!!(vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE) != in nested_vmx_check_address_space_size()
2885 struct vmcs12 *vmcs12) in nested_vmx_check_host_state() argument
2889 if (CC(!nested_host_cr0_valid(vcpu, vmcs12->host_cr0)) || in nested_vmx_check_host_state()
2890 CC(!nested_host_cr4_valid(vcpu, vmcs12->host_cr4)) || in nested_vmx_check_host_state()
2891 CC(!nested_cr3_valid(vcpu, vmcs12->host_cr3))) in nested_vmx_check_host_state()
2894 if (CC(is_noncanonical_address(vmcs12->host_ia32_sysenter_esp, vcpu)) || in nested_vmx_check_host_state()
2895 CC(is_noncanonical_address(vmcs12->host_ia32_sysenter_eip, vcpu))) in nested_vmx_check_host_state()
2898 if ((vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_PAT) && in nested_vmx_check_host_state()
2899 CC(!kvm_pat_valid(vmcs12->host_ia32_pat))) in nested_vmx_check_host_state()
2902 if ((vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL) && in nested_vmx_check_host_state()
2904 vmcs12->host_ia32_perf_global_ctrl))) in nested_vmx_check_host_state()
2908 ia32e = !!(vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE); in nested_vmx_check_host_state()
2914 if (CC(!(vmcs12->host_cr4 & X86_CR4_PAE))) in nested_vmx_check_host_state()
2917 if (CC(vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) || in nested_vmx_check_host_state()
2918 CC(vmcs12->host_cr4 & X86_CR4_PCIDE) || in nested_vmx_check_host_state()
2919 CC((vmcs12->host_rip) >> 32)) in nested_vmx_check_host_state()
2923 if (CC(vmcs12->host_cs_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2924 CC(vmcs12->host_ss_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2925 CC(vmcs12->host_ds_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2926 CC(vmcs12->host_es_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2927 CC(vmcs12->host_fs_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2928 CC(vmcs12->host_gs_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2929 CC(vmcs12->host_tr_selector & (SEGMENT_RPL_MASK | SEGMENT_TI_MASK)) || in nested_vmx_check_host_state()
2930 CC(vmcs12->host_cs_selector == 0) || in nested_vmx_check_host_state()
2931 CC(vmcs12->host_tr_selector == 0) || in nested_vmx_check_host_state()
2932 CC(vmcs12->host_ss_selector == 0 && !ia32e)) in nested_vmx_check_host_state()
2935 if (CC(is_noncanonical_address(vmcs12->host_fs_base, vcpu)) || in nested_vmx_check_host_state()
2936 CC(is_noncanonical_address(vmcs12->host_gs_base, vcpu)) || in nested_vmx_check_host_state()
2937 CC(is_noncanonical_address(vmcs12->host_gdtr_base, vcpu)) || in nested_vmx_check_host_state()
2938 CC(is_noncanonical_address(vmcs12->host_idtr_base, vcpu)) || in nested_vmx_check_host_state()
2939 CC(is_noncanonical_address(vmcs12->host_tr_base, vcpu)) || in nested_vmx_check_host_state()
2940 CC(is_noncanonical_address(vmcs12->host_rip, vcpu))) in nested_vmx_check_host_state()
2949 if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_EFER) { in nested_vmx_check_host_state()
2950 if (CC(!kvm_valid_efer(vcpu, vmcs12->host_ia32_efer)) || in nested_vmx_check_host_state()
2951 CC(ia32e != !!(vmcs12->host_ia32_efer & EFER_LMA)) || in nested_vmx_check_host_state()
2952 CC(ia32e != !!(vmcs12->host_ia32_efer & EFER_LME))) in nested_vmx_check_host_state()
2960 struct vmcs12 *vmcs12) in nested_vmx_check_vmcs_link_ptr() argument
2963 struct vmcs12 *shadow; in nested_vmx_check_vmcs_link_ptr()
2966 if (vmcs12->vmcs_link_pointer == -1ull) in nested_vmx_check_vmcs_link_ptr()
2969 if (CC(!page_address_valid(vcpu, vmcs12->vmcs_link_pointer))) in nested_vmx_check_vmcs_link_ptr()
2972 if (CC(kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->vmcs_link_pointer), &map))) in nested_vmx_check_vmcs_link_ptr()
2978 CC(shadow->hdr.shadow_vmcs != nested_cpu_has_shadow_vmcs(vmcs12))) in nested_vmx_check_vmcs_link_ptr()
2988 static int nested_check_guest_non_reg_state(struct vmcs12 *vmcs12) in nested_check_guest_non_reg_state() argument
2990 if (CC(vmcs12->guest_activity_state != GUEST_ACTIVITY_ACTIVE && in nested_check_guest_non_reg_state()
2991 vmcs12->guest_activity_state != GUEST_ACTIVITY_HLT)) in nested_check_guest_non_reg_state()
2998 struct vmcs12 *vmcs12, in nested_vmx_check_guest_state() argument
3005 if (CC(!nested_guest_cr0_valid(vcpu, vmcs12->guest_cr0)) || in nested_vmx_check_guest_state()
3006 CC(!nested_guest_cr4_valid(vcpu, vmcs12->guest_cr4))) in nested_vmx_check_guest_state()
3009 if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS) && in nested_vmx_check_guest_state()
3010 CC(!kvm_dr7_valid(vmcs12->guest_dr7))) in nested_vmx_check_guest_state()
3013 if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_PAT) && in nested_vmx_check_guest_state()
3014 CC(!kvm_pat_valid(vmcs12->guest_ia32_pat))) in nested_vmx_check_guest_state()
3017 if (nested_vmx_check_vmcs_link_ptr(vcpu, vmcs12)) { in nested_vmx_check_guest_state()
3022 if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL) && in nested_vmx_check_guest_state()
3024 vmcs12->guest_ia32_perf_global_ctrl))) in nested_vmx_check_guest_state()
3037 (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_EFER)) { in nested_vmx_check_guest_state()
3038 ia32e = (vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) != 0; in nested_vmx_check_guest_state()
3039 if (CC(!kvm_valid_efer(vcpu, vmcs12->guest_ia32_efer)) || in nested_vmx_check_guest_state()
3040 CC(ia32e != !!(vmcs12->guest_ia32_efer & EFER_LMA)) || in nested_vmx_check_guest_state()
3041 CC(((vmcs12->guest_cr0 & X86_CR0_PG) && in nested_vmx_check_guest_state()
3042 ia32e != !!(vmcs12->guest_ia32_efer & EFER_LME)))) in nested_vmx_check_guest_state()
3046 if ((vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS) && in nested_vmx_check_guest_state()
3047 (CC(is_noncanonical_address(vmcs12->guest_bndcfgs & PAGE_MASK, vcpu)) || in nested_vmx_check_guest_state()
3048 CC((vmcs12->guest_bndcfgs & MSR_IA32_BNDCFGS_RSVD)))) in nested_vmx_check_guest_state()
3051 if (nested_check_guest_non_reg_state(vmcs12)) in nested_vmx_check_guest_state()
3158 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_get_vmcs12_pages() local
3164 if (nested_cpu_has2(vmcs12, SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) { in nested_get_vmcs12_pages()
3175 page = kvm_vcpu_gpa_to_page(vcpu, vmcs12->apic_access_addr); in nested_get_vmcs12_pages()
3191 if (nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW)) { in nested_get_vmcs12_pages()
3194 if (!kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->virtual_apic_page_addr), map)) { in nested_get_vmcs12_pages()
3196 } else if (nested_cpu_has(vmcs12, CPU_BASED_CR8_LOAD_EXITING) && in nested_get_vmcs12_pages()
3197 nested_cpu_has(vmcs12, CPU_BASED_CR8_STORE_EXITING) && in nested_get_vmcs12_pages()
3198 !nested_cpu_has2(vmcs12, SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) { in nested_get_vmcs12_pages()
3217 if (nested_cpu_has_posted_intr(vmcs12)) { in nested_get_vmcs12_pages()
3220 if (!kvm_vcpu_map(vcpu, gpa_to_gfn(vmcs12->posted_intr_desc_addr), map)) { in nested_get_vmcs12_pages()
3223 offset_in_page(vmcs12->posted_intr_desc_addr)); in nested_get_vmcs12_pages()
3225 pfn_to_hpa(map->pfn) + offset_in_page(vmcs12->posted_intr_desc_addr)); in nested_get_vmcs12_pages()
3228 if (nested_vmx_prepare_msr_bitmap(vcpu, vmcs12)) in nested_get_vmcs12_pages()
3257 struct vmcs12 *vmcs12; in nested_vmx_write_pml_buffer() local
3271 vmcs12 = get_vmcs12(vcpu); in nested_vmx_write_pml_buffer()
3272 if (!nested_cpu_has_pml(vmcs12)) in nested_vmx_write_pml_buffer()
3275 if (vmcs12->guest_pml_index >= PML_ENTITY_NUM) { in nested_vmx_write_pml_buffer()
3281 dst = vmcs12->pml_address + sizeof(u64) * vmcs12->guest_pml_index; in nested_vmx_write_pml_buffer()
3287 vmcs12->guest_pml_index--; in nested_vmx_write_pml_buffer()
3323 struct vmcs12 *vmcs12);
3339 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_enter_non_root_mode() local
3357 !(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS)) in nested_vmx_enter_non_root_mode()
3361 !(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS))) in nested_vmx_enter_non_root_mode()
3385 prepare_vmcs02_early(vmx, &vmx->vmcs01, vmcs12); in nested_vmx_enter_non_root_mode()
3398 if (nested_vmx_check_guest_state(vcpu, vmcs12, in nested_vmx_enter_non_root_mode()
3401 vmcs12->exit_qualification = entry_failure_code; in nested_vmx_enter_non_root_mode()
3407 if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETTING) in nested_vmx_enter_non_root_mode()
3408 vcpu->arch.tsc_offset += vmcs12->tsc_offset; in nested_vmx_enter_non_root_mode()
3410 if (prepare_vmcs02(vcpu, vmcs12, &entry_failure_code)) { in nested_vmx_enter_non_root_mode()
3412 vmcs12->exit_qualification = entry_failure_code; in nested_vmx_enter_non_root_mode()
3418 vmcs12->vm_entry_msr_load_addr, in nested_vmx_enter_non_root_mode()
3419 vmcs12->vm_entry_msr_load_count); in nested_vmx_enter_non_root_mode()
3422 vmcs12->exit_qualification = failed_index; in nested_vmx_enter_non_root_mode()
3459 if (nested_cpu_has_preemption_timer(vmcs12)) { in nested_vmx_enter_non_root_mode()
3478 if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETTING) in nested_vmx_enter_non_root_mode()
3479 vcpu->arch.tsc_offset -= vmcs12->tsc_offset; in nested_vmx_enter_non_root_mode()
3488 load_vmcs12_host_state(vcpu, vmcs12); in nested_vmx_enter_non_root_mode()
3489 vmcs12->vm_exit_reason = exit_reason.full; in nested_vmx_enter_non_root_mode()
3501 struct vmcs12 *vmcs12; in nested_vmx_run() local
3521 vmcs12 = get_vmcs12(vcpu); in nested_vmx_run()
3529 if (CC(vmcs12->hdr.shadow_vmcs)) in nested_vmx_run()
3535 vmcs12->launch_state = !launch; in nested_vmx_run()
3553 if (CC(vmcs12->launch_state == launch)) in nested_vmx_run()
3558 if (nested_vmx_check_controls(vcpu, vmcs12)) in nested_vmx_run()
3561 if (nested_vmx_check_address_space_size(vcpu, vmcs12)) in nested_vmx_run()
3564 if (nested_vmx_check_host_state(vcpu, vmcs12)) in nested_vmx_run()
3578 if (nested_cpu_has_posted_intr(vmcs12) && in nested_vmx_run()
3598 nested_cache_shadow_vmcs12(vcpu, vmcs12); in nested_vmx_run()
3605 if ((vmcs12->guest_activity_state == GUEST_ACTIVITY_HLT) && in nested_vmx_run()
3606 !(vmcs12->vm_entry_intr_info_field & INTR_INFO_VALID_MASK) && in nested_vmx_run()
3607 !(vmcs12->cpu_based_vm_exec_control & CPU_BASED_NMI_WINDOW_EXITING) && in nested_vmx_run()
3608 !((vmcs12->cpu_based_vm_exec_control & CPU_BASED_INTR_WINDOW_EXITING) && in nested_vmx_run()
3609 (vmcs12->guest_rflags & X86_EFLAGS_IF))) { in nested_vmx_run()
3643 vmcs12_guest_cr0(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) in vmcs12_guest_cr0() argument
3647 /*2*/ (vmcs12->guest_cr0 & vmcs12->cr0_guest_host_mask) | in vmcs12_guest_cr0()
3648 /*3*/ (vmcs_readl(CR0_READ_SHADOW) & ~(vmcs12->cr0_guest_host_mask | in vmcs12_guest_cr0()
3653 vmcs12_guest_cr4(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) in vmcs12_guest_cr4() argument
3657 /*2*/ (vmcs12->guest_cr4 & vmcs12->cr4_guest_host_mask) | in vmcs12_guest_cr4()
3658 /*3*/ (vmcs_readl(CR4_READ_SHADOW) & ~(vmcs12->cr4_guest_host_mask | in vmcs12_guest_cr4()
3663 struct vmcs12 *vmcs12, in vmcs12_save_pending_event() argument
3689 vmcs12->idt_vectoring_info_field = 0; in vmcs12_save_pending_event()
3695 vmcs12->vm_exit_instruction_len = in vmcs12_save_pending_event()
3703 vmcs12->idt_vectoring_error_code = in vmcs12_save_pending_event()
3707 vmcs12->idt_vectoring_info_field = idt_vectoring; in vmcs12_save_pending_event()
3709 vmcs12->idt_vectoring_info_field = in vmcs12_save_pending_event()
3717 vmcs12->vm_entry_instruction_len = in vmcs12_save_pending_event()
3722 vmcs12->idt_vectoring_info_field = idt_vectoring; in vmcs12_save_pending_event()
3724 vmcs12->idt_vectoring_info_field = 0; in vmcs12_save_pending_event()
3731 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_mark_vmcs12_pages_dirty() local
3739 if (nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW)) { in nested_mark_vmcs12_pages_dirty()
3740 gfn = vmcs12->virtual_apic_page_addr >> PAGE_SHIFT; in nested_mark_vmcs12_pages_dirty()
3744 if (nested_cpu_has_posted_intr(vmcs12)) { in nested_mark_vmcs12_pages_dirty()
3745 gfn = vmcs12->posted_intr_desc_addr >> PAGE_SHIFT; in nested_mark_vmcs12_pages_dirty()
3786 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_inject_exception_vmexit() local
3800 vmcs12->vm_exit_intr_error_code = (u16)vcpu->arch.exception.error_code; in nested_vmx_inject_exception_vmexit()
3809 if (!(vmcs12->idt_vectoring_info_field & VECTORING_INFO_VALID_MASK) && in nested_vmx_inject_exception_vmexit()
4011 struct vmcs12 *vmcs12) in sync_vmcs02_to_vmcs12_rare() argument
4015 vmcs12->guest_es_selector = vmcs_read16(GUEST_ES_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
4016 vmcs12->guest_cs_selector = vmcs_read16(GUEST_CS_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
4017 vmcs12->guest_ss_selector = vmcs_read16(GUEST_SS_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
4018 vmcs12->guest_ds_selector = vmcs_read16(GUEST_DS_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
4019 vmcs12->guest_fs_selector = vmcs_read16(GUEST_FS_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
4020 vmcs12->guest_gs_selector = vmcs_read16(GUEST_GS_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
4021 vmcs12->guest_ldtr_selector = vmcs_read16(GUEST_LDTR_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
4022 vmcs12->guest_tr_selector = vmcs_read16(GUEST_TR_SELECTOR); in sync_vmcs02_to_vmcs12_rare()
4023 vmcs12->guest_es_limit = vmcs_read32(GUEST_ES_LIMIT); in sync_vmcs02_to_vmcs12_rare()
4024 vmcs12->guest_cs_limit = vmcs_read32(GUEST_CS_LIMIT); in sync_vmcs02_to_vmcs12_rare()
4025 vmcs12->guest_ss_limit = vmcs_read32(GUEST_SS_LIMIT); in sync_vmcs02_to_vmcs12_rare()
4026 vmcs12->guest_ds_limit = vmcs_read32(GUEST_DS_LIMIT); in sync_vmcs02_to_vmcs12_rare()
4027 vmcs12->guest_fs_limit = vmcs_read32(GUEST_FS_LIMIT); in sync_vmcs02_to_vmcs12_rare()
4028 vmcs12->guest_gs_limit = vmcs_read32(GUEST_GS_LIMIT); in sync_vmcs02_to_vmcs12_rare()
4029 vmcs12->guest_ldtr_limit = vmcs_read32(GUEST_LDTR_LIMIT); in sync_vmcs02_to_vmcs12_rare()
4030 vmcs12->guest_tr_limit = vmcs_read32(GUEST_TR_LIMIT); in sync_vmcs02_to_vmcs12_rare()
4031 vmcs12->guest_gdtr_limit = vmcs_read32(GUEST_GDTR_LIMIT); in sync_vmcs02_to_vmcs12_rare()
4032 vmcs12->guest_idtr_limit = vmcs_read32(GUEST_IDTR_LIMIT); in sync_vmcs02_to_vmcs12_rare()
4033 vmcs12->guest_es_ar_bytes = vmcs_read32(GUEST_ES_AR_BYTES); in sync_vmcs02_to_vmcs12_rare()
4034 vmcs12->guest_ds_ar_bytes = vmcs_read32(GUEST_DS_AR_BYTES); in sync_vmcs02_to_vmcs12_rare()
4035 vmcs12->guest_fs_ar_bytes = vmcs_read32(GUEST_FS_AR_BYTES); in sync_vmcs02_to_vmcs12_rare()
4036 vmcs12->guest_gs_ar_bytes = vmcs_read32(GUEST_GS_AR_BYTES); in sync_vmcs02_to_vmcs12_rare()
4037 vmcs12->guest_ldtr_ar_bytes = vmcs_read32(GUEST_LDTR_AR_BYTES); in sync_vmcs02_to_vmcs12_rare()
4038 vmcs12->guest_tr_ar_bytes = vmcs_read32(GUEST_TR_AR_BYTES); in sync_vmcs02_to_vmcs12_rare()
4039 vmcs12->guest_es_base = vmcs_readl(GUEST_ES_BASE); in sync_vmcs02_to_vmcs12_rare()
4040 vmcs12->guest_cs_base = vmcs_readl(GUEST_CS_BASE); in sync_vmcs02_to_vmcs12_rare()
4041 vmcs12->guest_ss_base = vmcs_readl(GUEST_SS_BASE); in sync_vmcs02_to_vmcs12_rare()
4042 vmcs12->guest_ds_base = vmcs_readl(GUEST_DS_BASE); in sync_vmcs02_to_vmcs12_rare()
4043 vmcs12->guest_fs_base = vmcs_readl(GUEST_FS_BASE); in sync_vmcs02_to_vmcs12_rare()
4044 vmcs12->guest_gs_base = vmcs_readl(GUEST_GS_BASE); in sync_vmcs02_to_vmcs12_rare()
4045 vmcs12->guest_ldtr_base = vmcs_readl(GUEST_LDTR_BASE); in sync_vmcs02_to_vmcs12_rare()
4046 vmcs12->guest_tr_base = vmcs_readl(GUEST_TR_BASE); in sync_vmcs02_to_vmcs12_rare()
4047 vmcs12->guest_gdtr_base = vmcs_readl(GUEST_GDTR_BASE); in sync_vmcs02_to_vmcs12_rare()
4048 vmcs12->guest_idtr_base = vmcs_readl(GUEST_IDTR_BASE); in sync_vmcs02_to_vmcs12_rare()
4049 vmcs12->guest_pending_dbg_exceptions = in sync_vmcs02_to_vmcs12_rare()
4052 vmcs12->guest_bndcfgs = vmcs_read64(GUEST_BNDCFGS); in sync_vmcs02_to_vmcs12_rare()
4058 struct vmcs12 *vmcs12) in copy_vmcs02_to_vmcs12_rare() argument
4073 sync_vmcs02_to_vmcs12_rare(vcpu, vmcs12); in copy_vmcs02_to_vmcs12_rare()
4086 static void sync_vmcs02_to_vmcs12(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) in sync_vmcs02_to_vmcs12() argument
4091 sync_vmcs02_to_vmcs12_rare(vcpu, vmcs12); in sync_vmcs02_to_vmcs12()
4095 vmcs12->guest_cr0 = vmcs12_guest_cr0(vcpu, vmcs12); in sync_vmcs02_to_vmcs12()
4096 vmcs12->guest_cr4 = vmcs12_guest_cr4(vcpu, vmcs12); in sync_vmcs02_to_vmcs12()
4098 vmcs12->guest_rsp = kvm_rsp_read(vcpu); in sync_vmcs02_to_vmcs12()
4099 vmcs12->guest_rip = kvm_rip_read(vcpu); in sync_vmcs02_to_vmcs12()
4100 vmcs12->guest_rflags = vmcs_readl(GUEST_RFLAGS); in sync_vmcs02_to_vmcs12()
4102 vmcs12->guest_cs_ar_bytes = vmcs_read32(GUEST_CS_AR_BYTES); in sync_vmcs02_to_vmcs12()
4103 vmcs12->guest_ss_ar_bytes = vmcs_read32(GUEST_SS_AR_BYTES); in sync_vmcs02_to_vmcs12()
4105 vmcs12->guest_interruptibility_info = in sync_vmcs02_to_vmcs12()
4109 vmcs12->guest_activity_state = GUEST_ACTIVITY_HLT; in sync_vmcs02_to_vmcs12()
4111 vmcs12->guest_activity_state = GUEST_ACTIVITY_ACTIVE; in sync_vmcs02_to_vmcs12()
4113 if (nested_cpu_has_preemption_timer(vmcs12) && in sync_vmcs02_to_vmcs12()
4114 vmcs12->vm_exit_controls & VM_EXIT_SAVE_VMX_PREEMPTION_TIMER && in sync_vmcs02_to_vmcs12()
4116 vmcs12->vmx_preemption_timer_value = in sync_vmcs02_to_vmcs12()
4128 vmcs12->guest_cr3 = vmcs_readl(GUEST_CR3); in sync_vmcs02_to_vmcs12()
4129 if (nested_cpu_has_ept(vmcs12) && is_pae_paging(vcpu)) { in sync_vmcs02_to_vmcs12()
4130 vmcs12->guest_pdptr0 = vmcs_read64(GUEST_PDPTR0); in sync_vmcs02_to_vmcs12()
4131 vmcs12->guest_pdptr1 = vmcs_read64(GUEST_PDPTR1); in sync_vmcs02_to_vmcs12()
4132 vmcs12->guest_pdptr2 = vmcs_read64(GUEST_PDPTR2); in sync_vmcs02_to_vmcs12()
4133 vmcs12->guest_pdptr3 = vmcs_read64(GUEST_PDPTR3); in sync_vmcs02_to_vmcs12()
4137 vmcs12->guest_linear_address = vmcs_readl(GUEST_LINEAR_ADDRESS); in sync_vmcs02_to_vmcs12()
4139 if (nested_cpu_has_vid(vmcs12)) in sync_vmcs02_to_vmcs12()
4140 vmcs12->guest_intr_status = vmcs_read16(GUEST_INTR_STATUS); in sync_vmcs02_to_vmcs12()
4142 vmcs12->vm_entry_controls = in sync_vmcs02_to_vmcs12()
4143 (vmcs12->vm_entry_controls & ~VM_ENTRY_IA32E_MODE) | in sync_vmcs02_to_vmcs12()
4146 if (vmcs12->vm_exit_controls & VM_EXIT_SAVE_DEBUG_CONTROLS) in sync_vmcs02_to_vmcs12()
4147 kvm_get_dr(vcpu, 7, (unsigned long *)&vmcs12->guest_dr7); in sync_vmcs02_to_vmcs12()
4149 if (vmcs12->vm_exit_controls & VM_EXIT_SAVE_IA32_EFER) in sync_vmcs02_to_vmcs12()
4150 vmcs12->guest_ia32_efer = vcpu->arch.efer; in sync_vmcs02_to_vmcs12()
4164 static void prepare_vmcs12(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, in prepare_vmcs12() argument
4169 vmcs12->vm_exit_reason = vm_exit_reason; in prepare_vmcs12()
4170 vmcs12->exit_qualification = exit_qualification; in prepare_vmcs12()
4177 if (!(vmcs12->vm_exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY)) { in prepare_vmcs12()
4178 vmcs12->launch_state = 1; in prepare_vmcs12()
4182 vmcs12->vm_entry_intr_info_field &= ~INTR_INFO_VALID_MASK; in prepare_vmcs12()
4188 vmcs12_save_pending_event(vcpu, vmcs12, in prepare_vmcs12()
4191 vmcs12->vm_exit_intr_info = exit_intr_info; in prepare_vmcs12()
4192 vmcs12->vm_exit_instruction_len = vmcs_read32(VM_EXIT_INSTRUCTION_LEN); in prepare_vmcs12()
4193 vmcs12->vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO); in prepare_vmcs12()
4202 vmcs12->vm_exit_msr_store_addr, in prepare_vmcs12()
4203 vmcs12->vm_exit_msr_store_count)) in prepare_vmcs12()
4219 struct vmcs12 *vmcs12) in load_vmcs12_host_state() argument
4224 if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_EFER) in load_vmcs12_host_state()
4225 vcpu->arch.efer = vmcs12->host_ia32_efer; in load_vmcs12_host_state()
4226 else if (vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE) in load_vmcs12_host_state()
4232 kvm_rsp_write(vcpu, vmcs12->host_rsp); in load_vmcs12_host_state()
4233 kvm_rip_write(vcpu, vmcs12->host_rip); in load_vmcs12_host_state()
4245 vmx_set_cr0(vcpu, vmcs12->host_cr0); in load_vmcs12_host_state()
4249 vmx_set_cr4(vcpu, vmcs12->host_cr4); in load_vmcs12_host_state()
4257 if (nested_vmx_load_cr3(vcpu, vmcs12->host_cr3, false, &ignored)) in load_vmcs12_host_state()
4263 nested_vmx_transition_tlb_flush(vcpu, vmcs12, false); in load_vmcs12_host_state()
4265 vmcs_write32(GUEST_SYSENTER_CS, vmcs12->host_ia32_sysenter_cs); in load_vmcs12_host_state()
4266 vmcs_writel(GUEST_SYSENTER_ESP, vmcs12->host_ia32_sysenter_esp); in load_vmcs12_host_state()
4267 vmcs_writel(GUEST_SYSENTER_EIP, vmcs12->host_ia32_sysenter_eip); in load_vmcs12_host_state()
4268 vmcs_writel(GUEST_IDTR_BASE, vmcs12->host_idtr_base); in load_vmcs12_host_state()
4269 vmcs_writel(GUEST_GDTR_BASE, vmcs12->host_gdtr_base); in load_vmcs12_host_state()
4274 if (vmcs12->vm_exit_controls & VM_EXIT_CLEAR_BNDCFGS) in load_vmcs12_host_state()
4277 if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_PAT) { in load_vmcs12_host_state()
4278 vmcs_write64(GUEST_IA32_PAT, vmcs12->host_ia32_pat); in load_vmcs12_host_state()
4279 vcpu->arch.pat = vmcs12->host_ia32_pat; in load_vmcs12_host_state()
4281 if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL) in load_vmcs12_host_state()
4283 vmcs12->host_ia32_perf_global_ctrl)); in load_vmcs12_host_state()
4290 .selector = vmcs12->host_cs_selector, in load_vmcs12_host_state()
4296 if (vmcs12->vm_exit_controls & VM_EXIT_HOST_ADDR_SPACE_SIZE) in load_vmcs12_host_state()
4310 seg.selector = vmcs12->host_ds_selector; in load_vmcs12_host_state()
4312 seg.selector = vmcs12->host_es_selector; in load_vmcs12_host_state()
4314 seg.selector = vmcs12->host_ss_selector; in load_vmcs12_host_state()
4316 seg.selector = vmcs12->host_fs_selector; in load_vmcs12_host_state()
4317 seg.base = vmcs12->host_fs_base; in load_vmcs12_host_state()
4319 seg.selector = vmcs12->host_gs_selector; in load_vmcs12_host_state()
4320 seg.base = vmcs12->host_gs_base; in load_vmcs12_host_state()
4323 .base = vmcs12->host_tr_base, in load_vmcs12_host_state()
4325 .selector = vmcs12->host_tr_selector, in load_vmcs12_host_state()
4337 if (nested_vmx_load_msr(vcpu, vmcs12->vm_exit_msr_load_addr, in load_vmcs12_host_state()
4338 vmcs12->vm_exit_msr_load_count)) in load_vmcs12_host_state()
4367 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_restore_host_state() local
4375 if (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS) { in nested_vmx_restore_host_state()
4429 for (i = 0; i < vmcs12->vm_entry_msr_load_count; i++) { in nested_vmx_restore_host_state()
4430 gpa = vmcs12->vm_entry_msr_load_addr + (i * sizeof(g)); in nested_vmx_restore_host_state()
4438 for (j = 0; j < vmcs12->vm_exit_msr_load_count; j++) { in nested_vmx_restore_host_state()
4439 gpa = vmcs12->vm_exit_msr_load_addr + (j * sizeof(h)); in nested_vmx_restore_host_state()
4482 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_vmexit() local
4511 if (nested_cpu_has_preemption_timer(vmcs12)) in nested_vmx_vmexit()
4514 if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETTING) in nested_vmx_vmexit()
4515 vcpu->arch.tsc_offset -= vmcs12->tsc_offset; in nested_vmx_vmexit()
4518 sync_vmcs02_to_vmcs12(vcpu, vmcs12); in nested_vmx_vmexit()
4521 prepare_vmcs12(vcpu, vmcs12, vm_exit_reason, in nested_vmx_vmexit()
4533 nested_flush_cached_shadow_vmcs12(vcpu, vmcs12); in nested_vmx_vmexit()
4600 vmcs12->vm_exit_intr_info = irq | in nested_vmx_vmexit()
4605 trace_kvm_nested_vmexit_inject(vmcs12->vm_exit_reason, in nested_vmx_vmexit()
4606 vmcs12->exit_qualification, in nested_vmx_vmexit()
4607 vmcs12->idt_vectoring_info_field, in nested_vmx_vmexit()
4608 vmcs12->vm_exit_intr_info, in nested_vmx_vmexit()
4609 vmcs12->vm_exit_intr_error_code, in nested_vmx_vmexit()
4612 load_vmcs12_host_state(vcpu, vmcs12); in nested_vmx_vmexit()
5041 vmptr + offsetof(struct vmcs12, in handle_vmclear()
5064 struct vmcs12 *vmcs12 = is_guest_mode(vcpu) ? get_shadow_vmcs12(vcpu) in handle_vmread() local
5096 copy_vmcs02_to_vmcs12_rare(vcpu, vmcs12); in handle_vmread()
5099 value = vmcs12_read_any(vmcs12, field, offset); in handle_vmread()
5148 struct vmcs12 *vmcs12 = is_guest_mode(vcpu) ? get_shadow_vmcs12(vcpu) in handle_vmwrite() local
5211 copy_vmcs02_to_vmcs12_rare(vcpu, vmcs12); in handle_vmwrite()
5224 vmcs12_write_any(vmcs12, field, offset, value); in handle_vmwrite()
5290 struct vmcs12 *new_vmcs12; in handle_vmptrld()
5534 struct vmcs12 *vmcs12) in nested_vmx_eptp_switching() argument
5539 if (!nested_cpu_has_eptp_switching(vmcs12) || in nested_vmx_eptp_switching()
5540 !nested_cpu_has_ept(vmcs12)) in nested_vmx_eptp_switching()
5546 if (kvm_vcpu_read_guest_page(vcpu, vmcs12->eptp_list_address >> PAGE_SHIFT, in nested_vmx_eptp_switching()
5554 if (vmcs12->ept_pointer != new_eptp) { in nested_vmx_eptp_switching()
5558 vmcs12->ept_pointer = new_eptp; in nested_vmx_eptp_switching()
5569 struct vmcs12 *vmcs12; in handle_vmfunc() local
5582 vmcs12 = get_vmcs12(vcpu); in handle_vmfunc()
5583 if (!(vmcs12->vm_function_control & BIT_ULL(function))) in handle_vmfunc()
5588 if (nested_vmx_eptp_switching(vcpu, vmcs12)) in handle_vmfunc()
5615 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_check_io_bitmaps() local
5624 bitmap = vmcs12->io_bitmap_a; in nested_vmx_check_io_bitmaps()
5626 bitmap = vmcs12->io_bitmap_b; in nested_vmx_check_io_bitmaps()
5646 struct vmcs12 *vmcs12) in nested_vmx_exit_handled_io() argument
5652 if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) in nested_vmx_exit_handled_io()
5653 return nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING); in nested_vmx_exit_handled_io()
5670 struct vmcs12 *vmcs12, in nested_vmx_exit_handled_msr() argument
5676 if (!nested_cpu_has(vmcs12, CPU_BASED_USE_MSR_BITMAPS)) in nested_vmx_exit_handled_msr()
5684 bitmap = vmcs12->msr_bitmap; in nested_vmx_exit_handled_msr()
5708 struct vmcs12 *vmcs12) in nested_vmx_exit_handled_cr() argument
5721 if (vmcs12->cr0_guest_host_mask & in nested_vmx_exit_handled_cr()
5722 (val ^ vmcs12->cr0_read_shadow)) in nested_vmx_exit_handled_cr()
5726 if (nested_cpu_has(vmcs12, CPU_BASED_CR3_LOAD_EXITING)) in nested_vmx_exit_handled_cr()
5730 if (vmcs12->cr4_guest_host_mask & in nested_vmx_exit_handled_cr()
5731 (vmcs12->cr4_read_shadow ^ val)) in nested_vmx_exit_handled_cr()
5735 if (nested_cpu_has(vmcs12, CPU_BASED_CR8_LOAD_EXITING)) in nested_vmx_exit_handled_cr()
5741 if ((vmcs12->cr0_guest_host_mask & X86_CR0_TS) && in nested_vmx_exit_handled_cr()
5742 (vmcs12->cr0_read_shadow & X86_CR0_TS)) in nested_vmx_exit_handled_cr()
5748 if (vmcs12->cpu_based_vm_exec_control & in nested_vmx_exit_handled_cr()
5753 if (vmcs12->cpu_based_vm_exec_control & in nested_vmx_exit_handled_cr()
5765 if (vmcs12->cr0_guest_host_mask & 0xe & in nested_vmx_exit_handled_cr()
5766 (val ^ vmcs12->cr0_read_shadow)) in nested_vmx_exit_handled_cr()
5768 if ((vmcs12->cr0_guest_host_mask & 0x1) && in nested_vmx_exit_handled_cr()
5769 !(vmcs12->cr0_read_shadow & 0x1) && in nested_vmx_exit_handled_cr()
5778 struct vmcs12 *vmcs12, gpa_t bitmap) in nested_vmx_exit_handled_vmcs_access() argument
5784 if (!nested_cpu_has_shadow_vmcs(vmcs12)) in nested_vmx_exit_handled_vmcs_access()
5801 static bool nested_vmx_exit_handled_mtf(struct vmcs12 *vmcs12) in nested_vmx_exit_handled_mtf() argument
5803 u32 entry_intr_info = vmcs12->vm_entry_intr_info_field; in nested_vmx_exit_handled_mtf()
5805 if (nested_cpu_has_mtf(vmcs12)) in nested_vmx_exit_handled_mtf()
5890 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_l1_wants_exit() local
5900 return vmcs12->exception_bitmap & in nested_vmx_l1_wants_exit()
5907 return nested_cpu_has(vmcs12, CPU_BASED_INTR_WINDOW_EXITING); in nested_vmx_l1_wants_exit()
5909 return nested_cpu_has(vmcs12, CPU_BASED_NMI_WINDOW_EXITING); in nested_vmx_l1_wants_exit()
5915 return nested_cpu_has(vmcs12, CPU_BASED_HLT_EXITING); in nested_vmx_l1_wants_exit()
5919 return nested_cpu_has(vmcs12, CPU_BASED_INVLPG_EXITING); in nested_vmx_l1_wants_exit()
5921 return nested_cpu_has(vmcs12, CPU_BASED_RDPMC_EXITING); in nested_vmx_l1_wants_exit()
5923 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDRAND_EXITING); in nested_vmx_l1_wants_exit()
5925 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDSEED_EXITING); in nested_vmx_l1_wants_exit()
5927 return nested_cpu_has(vmcs12, CPU_BASED_RDTSC_EXITING); in nested_vmx_l1_wants_exit()
5929 return nested_vmx_exit_handled_vmcs_access(vcpu, vmcs12, in nested_vmx_l1_wants_exit()
5930 vmcs12->vmread_bitmap); in nested_vmx_l1_wants_exit()
5932 return nested_vmx_exit_handled_vmcs_access(vcpu, vmcs12, in nested_vmx_l1_wants_exit()
5933 vmcs12->vmwrite_bitmap); in nested_vmx_l1_wants_exit()
5945 return nested_vmx_exit_handled_cr(vcpu, vmcs12); in nested_vmx_l1_wants_exit()
5947 return nested_cpu_has(vmcs12, CPU_BASED_MOV_DR_EXITING); in nested_vmx_l1_wants_exit()
5949 return nested_vmx_exit_handled_io(vcpu, vmcs12); in nested_vmx_l1_wants_exit()
5951 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_DESC); in nested_vmx_l1_wants_exit()
5954 return nested_vmx_exit_handled_msr(vcpu, vmcs12, exit_reason); in nested_vmx_l1_wants_exit()
5958 return nested_cpu_has(vmcs12, CPU_BASED_MWAIT_EXITING); in nested_vmx_l1_wants_exit()
5960 return nested_vmx_exit_handled_mtf(vmcs12); in nested_vmx_l1_wants_exit()
5962 return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_EXITING); in nested_vmx_l1_wants_exit()
5964 return nested_cpu_has(vmcs12, CPU_BASED_PAUSE_EXITING) || in nested_vmx_l1_wants_exit()
5965 nested_cpu_has2(vmcs12, in nested_vmx_l1_wants_exit()
5970 return nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW); in nested_vmx_l1_wants_exit()
5982 nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_INVPCID) && in nested_vmx_l1_wants_exit()
5983 nested_cpu_has(vmcs12, CPU_BASED_INVLPG_EXITING); in nested_vmx_l1_wants_exit()
5985 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_WBINVD_EXITING); in nested_vmx_l1_wants_exit()
5995 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_XSAVES); in nested_vmx_l1_wants_exit()
5998 return nested_cpu_has2(vmcs12, in nested_vmx_l1_wants_exit()
6049 struct vmcs12 *vmcs12 = get_vmcs12(vcpu); in nested_vmx_reflect_vmexit() local
6051 vmcs12->vm_exit_intr_error_code = in nested_vmx_reflect_vmexit()
6066 struct vmcs12 *vmcs12; in vmx_get_nested_state() local
6083 vmcs12 = get_vmcs12(vcpu); in vmx_get_nested_state()
6091 kvm_state.size += sizeof(user_vmx_nested_state->vmcs12); in vmx_get_nested_state()
6097 nested_cpu_has_shadow_vmcs(vmcs12) && in vmx_get_nested_state()
6098 vmcs12->vmcs_link_pointer != -1ull) in vmx_get_nested_state()
6117 if (nested_cpu_has_preemption_timer(vmcs12) && in vmx_get_nested_state()
6144 sync_vmcs02_to_vmcs12(vcpu, vmcs12); in vmx_get_nested_state()
6145 sync_vmcs02_to_vmcs12_rare(vcpu, vmcs12); in vmx_get_nested_state()
6156 BUILD_BUG_ON(sizeof(user_vmx_nested_state->vmcs12) < VMCS12_SIZE); in vmx_get_nested_state()
6163 if (copy_to_user(user_vmx_nested_state->vmcs12, vmcs12, VMCS12_SIZE)) in vmx_get_nested_state()
6166 if (nested_cpu_has_shadow_vmcs(vmcs12) && in vmx_get_nested_state()
6167 vmcs12->vmcs_link_pointer != -1ull) { in vmx_get_nested_state()
6193 struct vmcs12 *vmcs12; in vmx_set_nested_state() local
6269 if (kvm_state->size < sizeof(*kvm_state) + sizeof(*vmcs12)) { in vmx_set_nested_state()
6305 vmcs12 = get_vmcs12(vcpu); in vmx_set_nested_state()
6306 if (copy_from_user(vmcs12, user_vmx_nested_state->vmcs12, sizeof(*vmcs12))) in vmx_set_nested_state()
6309 if (vmcs12->hdr.revision_id != VMCS12_REVISION) in vmx_set_nested_state()
6322 if (nested_cpu_has_shadow_vmcs(vmcs12) && in vmx_set_nested_state()
6323 vmcs12->vmcs_link_pointer != -1ull) { in vmx_set_nested_state()
6324 struct vmcs12 *shadow_vmcs12 = get_shadow_vmcs12(vcpu); in vmx_set_nested_state()
6328 sizeof(user_vmx_nested_state->vmcs12) + sizeof(*shadow_vmcs12)) in vmx_set_nested_state()
6350 if (nested_vmx_check_controls(vcpu, vmcs12) || in vmx_set_nested_state()
6351 nested_vmx_check_host_state(vcpu, vmcs12) || in vmx_set_nested_state()
6352 nested_vmx_check_guest_state(vcpu, vmcs12, &ignored)) in vmx_set_nested_state()