• Home
  • Raw
  • Download

Lines Matching refs:nested

106 static bool __read_mostly nested = 0;  variable
107 module_param(nested, bool, S_IRUGO);
617 struct nested_vmx nested; member
887 return to_vmx(vcpu)->nested.cached_vmcs12; in get_vmcs12()
2689 return nested && guest_cpuid_has_vmx(vcpu); in nested_vmx_allowed()
2721 vmx->nested.nested_vmx_pinbased_ctls_low, in nested_vmx_setup_ctls_msrs()
2722 vmx->nested.nested_vmx_pinbased_ctls_high); in nested_vmx_setup_ctls_msrs()
2723 vmx->nested.nested_vmx_pinbased_ctls_low |= in nested_vmx_setup_ctls_msrs()
2725 vmx->nested.nested_vmx_pinbased_ctls_high &= in nested_vmx_setup_ctls_msrs()
2729 vmx->nested.nested_vmx_pinbased_ctls_high |= in nested_vmx_setup_ctls_msrs()
2733 vmx->nested.nested_vmx_pinbased_ctls_high |= in nested_vmx_setup_ctls_msrs()
2738 vmx->nested.nested_vmx_exit_ctls_low, in nested_vmx_setup_ctls_msrs()
2739 vmx->nested.nested_vmx_exit_ctls_high); in nested_vmx_setup_ctls_msrs()
2740 vmx->nested.nested_vmx_exit_ctls_low = in nested_vmx_setup_ctls_msrs()
2743 vmx->nested.nested_vmx_exit_ctls_high &= in nested_vmx_setup_ctls_msrs()
2748 vmx->nested.nested_vmx_exit_ctls_high |= in nested_vmx_setup_ctls_msrs()
2754 vmx->nested.nested_vmx_exit_ctls_high |= VM_EXIT_CLEAR_BNDCFGS; in nested_vmx_setup_ctls_msrs()
2757 vmx->nested.nested_vmx_true_exit_ctls_low = in nested_vmx_setup_ctls_msrs()
2758 vmx->nested.nested_vmx_exit_ctls_low & in nested_vmx_setup_ctls_msrs()
2763 vmx->nested.nested_vmx_entry_ctls_low, in nested_vmx_setup_ctls_msrs()
2764 vmx->nested.nested_vmx_entry_ctls_high); in nested_vmx_setup_ctls_msrs()
2765 vmx->nested.nested_vmx_entry_ctls_low = in nested_vmx_setup_ctls_msrs()
2767 vmx->nested.nested_vmx_entry_ctls_high &= in nested_vmx_setup_ctls_msrs()
2772 vmx->nested.nested_vmx_entry_ctls_high |= in nested_vmx_setup_ctls_msrs()
2775 vmx->nested.nested_vmx_entry_ctls_high |= VM_ENTRY_LOAD_BNDCFGS; in nested_vmx_setup_ctls_msrs()
2778 vmx->nested.nested_vmx_true_entry_ctls_low = in nested_vmx_setup_ctls_msrs()
2779 vmx->nested.nested_vmx_entry_ctls_low & in nested_vmx_setup_ctls_msrs()
2784 vmx->nested.nested_vmx_procbased_ctls_low, in nested_vmx_setup_ctls_msrs()
2785 vmx->nested.nested_vmx_procbased_ctls_high); in nested_vmx_setup_ctls_msrs()
2786 vmx->nested.nested_vmx_procbased_ctls_low = in nested_vmx_setup_ctls_msrs()
2788 vmx->nested.nested_vmx_procbased_ctls_high &= in nested_vmx_setup_ctls_msrs()
2808 vmx->nested.nested_vmx_procbased_ctls_high |= in nested_vmx_setup_ctls_msrs()
2813 vmx->nested.nested_vmx_true_procbased_ctls_low = in nested_vmx_setup_ctls_msrs()
2814 vmx->nested.nested_vmx_procbased_ctls_low & in nested_vmx_setup_ctls_msrs()
2819 vmx->nested.nested_vmx_secondary_ctls_low, in nested_vmx_setup_ctls_msrs()
2820 vmx->nested.nested_vmx_secondary_ctls_high); in nested_vmx_setup_ctls_msrs()
2821 vmx->nested.nested_vmx_secondary_ctls_low = 0; in nested_vmx_setup_ctls_msrs()
2822 vmx->nested.nested_vmx_secondary_ctls_high &= in nested_vmx_setup_ctls_msrs()
2834 vmx->nested.nested_vmx_secondary_ctls_high |= in nested_vmx_setup_ctls_msrs()
2836 vmx->nested.nested_vmx_ept_caps = VMX_EPT_PAGE_WALK_4_BIT | in nested_vmx_setup_ctls_msrs()
2840 vmx->nested.nested_vmx_ept_caps |= in nested_vmx_setup_ctls_msrs()
2842 vmx->nested.nested_vmx_ept_caps &= vmx_capability.ept; in nested_vmx_setup_ctls_msrs()
2843 vmx->nested.nested_vmx_ept_caps |= VMX_EPT_EXTENT_GLOBAL_BIT | in nested_vmx_setup_ctls_msrs()
2846 vmx->nested.nested_vmx_ept_caps = 0; in nested_vmx_setup_ctls_msrs()
2855 vmx->nested.nested_vmx_vpid_caps = VMX_VPID_INVVPID_BIT | in nested_vmx_setup_ctls_msrs()
2858 vmx->nested.nested_vmx_vpid_caps = 0; in nested_vmx_setup_ctls_msrs()
2861 vmx->nested.nested_vmx_secondary_ctls_high |= in nested_vmx_setup_ctls_msrs()
2866 vmx->nested.nested_vmx_misc_low, in nested_vmx_setup_ctls_msrs()
2867 vmx->nested.nested_vmx_misc_high); in nested_vmx_setup_ctls_msrs()
2868 vmx->nested.nested_vmx_misc_low &= VMX_MISC_SAVE_EFER_LMA; in nested_vmx_setup_ctls_msrs()
2869 vmx->nested.nested_vmx_misc_low |= in nested_vmx_setup_ctls_msrs()
2872 vmx->nested.nested_vmx_misc_high = 0; in nested_vmx_setup_ctls_msrs()
2910 vmx->nested.nested_vmx_pinbased_ctls_low, in vmx_get_vmx_msr()
2911 vmx->nested.nested_vmx_pinbased_ctls_high); in vmx_get_vmx_msr()
2915 vmx->nested.nested_vmx_true_procbased_ctls_low, in vmx_get_vmx_msr()
2916 vmx->nested.nested_vmx_procbased_ctls_high); in vmx_get_vmx_msr()
2920 vmx->nested.nested_vmx_procbased_ctls_low, in vmx_get_vmx_msr()
2921 vmx->nested.nested_vmx_procbased_ctls_high); in vmx_get_vmx_msr()
2925 vmx->nested.nested_vmx_true_exit_ctls_low, in vmx_get_vmx_msr()
2926 vmx->nested.nested_vmx_exit_ctls_high); in vmx_get_vmx_msr()
2930 vmx->nested.nested_vmx_exit_ctls_low, in vmx_get_vmx_msr()
2931 vmx->nested.nested_vmx_exit_ctls_high); in vmx_get_vmx_msr()
2935 vmx->nested.nested_vmx_true_entry_ctls_low, in vmx_get_vmx_msr()
2936 vmx->nested.nested_vmx_entry_ctls_high); in vmx_get_vmx_msr()
2940 vmx->nested.nested_vmx_entry_ctls_low, in vmx_get_vmx_msr()
2941 vmx->nested.nested_vmx_entry_ctls_high); in vmx_get_vmx_msr()
2945 vmx->nested.nested_vmx_misc_low, in vmx_get_vmx_msr()
2946 vmx->nested.nested_vmx_misc_high); in vmx_get_vmx_msr()
2972 vmx->nested.nested_vmx_secondary_ctls_low, in vmx_get_vmx_msr()
2973 vmx->nested.nested_vmx_secondary_ctls_high); in vmx_get_vmx_msr()
2976 *pdata = vmx->nested.nested_vmx_ept_caps | in vmx_get_vmx_msr()
2977 ((u64)vmx->nested.nested_vmx_vpid_caps << 32); in vmx_get_vmx_msr()
4151 if (to_vmx(vcpu)->nested.vmxon && in vmx_set_cr4()
4915 if (!vmx->nested.pi_desc || !vmx->nested.pi_pending) in vmx_complete_nested_posted_interrupt()
4918 vmx->nested.pi_pending = false; in vmx_complete_nested_posted_interrupt()
4919 if (!pi_test_and_clear_on(vmx->nested.pi_desc)) in vmx_complete_nested_posted_interrupt()
4922 max_irr = find_last_bit((unsigned long *)vmx->nested.pi_desc->pir, 256); in vmx_complete_nested_posted_interrupt()
4924 vapic_page = kmap(vmx->nested.virtual_apic_page); in vmx_complete_nested_posted_interrupt()
4925 __kvm_apic_update_irr(vmx->nested.pi_desc->pir, vapic_page); in vmx_complete_nested_posted_interrupt()
4926 kunmap(vmx->nested.virtual_apic_page); in vmx_complete_nested_posted_interrupt()
4982 vector == vmx->nested.posted_intr_nv) { in vmx_deliver_nested_posted_interrupt()
4987 vmx->nested.pi_pending = true; in vmx_deliver_nested_posted_interrupt()
5546 if (to_vmx(vcpu)->nested.nested_run_pending) in vmx_nmi_allowed()
5559 return (!to_vmx(vcpu)->nested.nested_run_pending && in vmx_interrupt_allowed()
5824 if (to_vmx(vcpu)->nested.nested_vmx_secondary_ctls_high & in nested_cr0_valid()
5857 if (to_vmx(vcpu)->nested.vmxon && in handle_set_cr0()
6766 if (to_vmx(vcpu)->nested.current_vmptr == -1ull) { in nested_vmx_failValid()
6795 container_of(timer, struct vcpu_vmx, nested.preemption_timer); in vmx_preemption_timer_fn()
6797 vmx->nested.preemption_timer_expired = true; in vmx_preemption_timer_fn()
6961 vmx->nested.vmxon_ptr = vmptr; in nested_vmx_check_vmptr()
6971 if (vmptr == vmx->nested.vmxon_ptr) { in nested_vmx_check_vmptr()
6986 if (vmptr == vmx->nested.vmxon_ptr) { in nested_vmx_check_vmptr()
7045 if (vmx->nested.vmxon) { in handle_vmon()
7057 r = alloc_loaded_vmcs(&vmx->nested.vmcs02); in handle_vmon()
7061 vmx->nested.cached_vmcs12 = kmalloc(VMCS12_SIZE, GFP_KERNEL); in handle_vmon()
7062 if (!vmx->nested.cached_vmcs12) in handle_vmon()
7076 hrtimer_init(&vmx->nested.preemption_timer, CLOCK_MONOTONIC, in handle_vmon()
7078 vmx->nested.preemption_timer.function = vmx_preemption_timer_fn; in handle_vmon()
7080 vmx->nested.vmxon = true; in handle_vmon()
7087 kfree(vmx->nested.cached_vmcs12); in handle_vmon()
7090 free_loaded_vmcs(&vmx->nested.vmcs02); in handle_vmon()
7106 if (!vmx->nested.vmxon) { in nested_vmx_check_permission()
7128 if (vmx->nested.current_vmptr == -1ull) in nested_release_vmcs12()
7132 if (WARN_ON(vmx->nested.current_vmcs12 == NULL)) in nested_release_vmcs12()
7139 vmx->nested.sync_shadow_vmcs = false; in nested_release_vmcs12()
7144 vmx->nested.posted_intr_nv = -1; in nested_release_vmcs12()
7147 memcpy(vmx->nested.current_vmcs12, vmx->nested.cached_vmcs12, in nested_release_vmcs12()
7150 kunmap(vmx->nested.current_vmcs12_page); in nested_release_vmcs12()
7151 nested_release_page(vmx->nested.current_vmcs12_page); in nested_release_vmcs12()
7152 vmx->nested.current_vmptr = -1ull; in nested_release_vmcs12()
7153 vmx->nested.current_vmcs12 = NULL; in nested_release_vmcs12()
7162 if (!vmx->nested.vmxon) in free_nested()
7165 vmx->nested.vmxon = false; in free_nested()
7166 free_vpid(vmx->nested.vpid02); in free_nested()
7173 kfree(vmx->nested.cached_vmcs12); in free_nested()
7175 if (vmx->nested.apic_access_page) { in free_nested()
7176 nested_release_page(vmx->nested.apic_access_page); in free_nested()
7177 vmx->nested.apic_access_page = NULL; in free_nested()
7179 if (vmx->nested.virtual_apic_page) { in free_nested()
7180 nested_release_page(vmx->nested.virtual_apic_page); in free_nested()
7181 vmx->nested.virtual_apic_page = NULL; in free_nested()
7183 if (vmx->nested.pi_desc_page) { in free_nested()
7184 kunmap(vmx->nested.pi_desc_page); in free_nested()
7185 nested_release_page(vmx->nested.pi_desc_page); in free_nested()
7186 vmx->nested.pi_desc_page = NULL; in free_nested()
7187 vmx->nested.pi_desc = NULL; in free_nested()
7190 free_loaded_vmcs(&vmx->nested.vmcs02); in free_nested()
7217 if (vmptr == vmx->nested.current_vmptr) in handle_vmclear()
7422 if (vmx->nested.current_vmptr == -1ull) { in nested_vmx_check_vmcs12()
7538 if (vmx->nested.current_vmptr != vmptr) { in handle_vmptrld()
7558 vmx->nested.current_vmptr = vmptr; in handle_vmptrld()
7559 vmx->nested.current_vmcs12 = new_vmcs12; in handle_vmptrld()
7560 vmx->nested.current_vmcs12_page = page; in handle_vmptrld()
7565 memcpy(vmx->nested.cached_vmcs12, in handle_vmptrld()
7566 vmx->nested.current_vmcs12, VMCS12_SIZE); in handle_vmptrld()
7573 vmx->nested.sync_shadow_vmcs = true; in handle_vmptrld()
7598 (void *)&to_vmx(vcpu)->nested.current_vmptr, in handle_vmptrst()
7620 if (!(vmx->nested.nested_vmx_secondary_ctls_high & in handle_invept()
7622 !(vmx->nested.nested_vmx_ept_caps & VMX_EPT_INVEPT_BIT)) { in handle_invept()
7638 types = (vmx->nested.nested_vmx_ept_caps >> VMX_EPT_EXTENT_SHIFT) & 6; in handle_invept()
7688 if (!(vmx->nested.nested_vmx_secondary_ctls_high & in handle_invvpid()
7690 !(vmx->nested.nested_vmx_vpid_caps & VMX_VPID_INVVPID_BIT)) { in handle_invvpid()
7701 types = (vmx->nested.nested_vmx_vpid_caps & in handle_invvpid()
7742 __vmx_flush_tlb(vcpu, vmx->nested.vpid02); in handle_invvpid()
8033 if (vmx->nested.nested_run_pending) in nested_vmx_exit_handled()
8502 to_vmx(vcpu)->nested.change_vmcs01_virtual_x2apic_mode = true; in vmx_set_virtual_x2apic_mode()
8880 if (vmx->nested.sync_shadow_vmcs) { in vmx_vcpu_run()
8882 vmx->nested.sync_shadow_vmcs = false; in vmx_vcpu_run()
9112 if (vmx->nested.nested_run_pending) in vmx_vcpu_run()
9115 vmx->nested.nested_run_pending = 0; in vmx_vcpu_run()
9247 if (nested) { in vmx_create_vcpu()
9249 vmx->nested.vpid02 = allocate_vpid(); in vmx_create_vcpu()
9252 vmx->nested.posted_intr_nv = -1; in vmx_create_vcpu()
9253 vmx->nested.current_vmptr = -1ull; in vmx_create_vcpu()
9254 vmx->nested.current_vmcs12 = NULL; in vmx_create_vcpu()
9268 free_vpid(vmx->nested.vpid02); in vmx_create_vcpu()
9382 if (nested) { in vmx_cpuid_update()
9384 vmx->nested.nested_vmx_secondary_ctls_high |= in vmx_cpuid_update()
9387 vmx->nested.nested_vmx_secondary_ctls_high &= in vmx_cpuid_update()
9416 if (func == 1 && nested) in vmx_set_supported_cpuid()
9446 to_vmx(vcpu)->nested.nested_vmx_ept_caps & in nested_ept_init_mmu_context()
9504 if (vmx->nested.apic_access_page) /* shouldn't happen */ in nested_get_vmcs12_pages()
9505 nested_release_page(vmx->nested.apic_access_page); in nested_get_vmcs12_pages()
9506 vmx->nested.apic_access_page = in nested_get_vmcs12_pages()
9515 if (vmx->nested.virtual_apic_page) /* shouldn't happen */ in nested_get_vmcs12_pages()
9516 nested_release_page(vmx->nested.virtual_apic_page); in nested_get_vmcs12_pages()
9517 vmx->nested.virtual_apic_page = in nested_get_vmcs12_pages()
9530 if (!vmx->nested.virtual_apic_page) in nested_get_vmcs12_pages()
9539 if (vmx->nested.pi_desc_page) { /* shouldn't happen */ in nested_get_vmcs12_pages()
9540 kunmap(vmx->nested.pi_desc_page); in nested_get_vmcs12_pages()
9541 nested_release_page(vmx->nested.pi_desc_page); in nested_get_vmcs12_pages()
9543 vmx->nested.pi_desc_page = in nested_get_vmcs12_pages()
9545 if (!vmx->nested.pi_desc_page) in nested_get_vmcs12_pages()
9548 vmx->nested.pi_desc = in nested_get_vmcs12_pages()
9549 (struct pi_desc *)kmap(vmx->nested.pi_desc_page); in nested_get_vmcs12_pages()
9550 if (!vmx->nested.pi_desc) { in nested_get_vmcs12_pages()
9551 nested_release_page_clean(vmx->nested.pi_desc_page); in nested_get_vmcs12_pages()
9554 vmx->nested.pi_desc = in nested_get_vmcs12_pages()
9555 (struct pi_desc *)((void *)vmx->nested.pi_desc + in nested_get_vmcs12_pages()
9574 vmx_preemption_timer_fn(&vmx->nested.preemption_timer); in vmx_start_preemption_timer()
9581 hrtimer_start(&vmx->nested.preemption_timer, in vmx_start_preemption_timer()
9617 unsigned long *msr_bitmap_l0 = to_vmx(vcpu)->nested.vmcs02.msr_bitmap; in nested_vmx_merge_msr_bitmap()
9943 vmcs_write64(GUEST_IA32_DEBUGCTL, vmx->nested.vmcs01_debugctl); in prepare_vmcs02()
9978 vmx->nested.posted_intr_nv = vmcs12->posted_intr_nv; in prepare_vmcs02()
9979 vmx->nested.pi_pending = false; in prepare_vmcs02()
9982 page_to_phys(vmx->nested.pi_desc_page) + in prepare_vmcs02()
9990 vmx->nested.preemption_timer_expired = false; in prepare_vmcs02()
10038 if (!vmx->nested.apic_access_page) in prepare_vmcs02()
10043 page_to_phys(vmx->nested.apic_access_page)); in prepare_vmcs02()
10093 page_to_phys(vmx->nested.virtual_apic_page)); in prepare_vmcs02()
10161 vmcs_write64(MSR_BITMAP, __pa(vmx->nested.vmcs02.msr_bitmap)); in prepare_vmcs02()
10172 if (nested_cpu_has_vpid(vmcs12) && vmx->nested.vpid02) { in prepare_vmcs02()
10173 vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->nested.vpid02); in prepare_vmcs02()
10174 if (vmcs12->virtual_processor_id != vmx->nested.last_vpid) { in prepare_vmcs02()
10175 vmx->nested.last_vpid = vmcs12->virtual_processor_id; in prepare_vmcs02()
10176 __vmx_flush_tlb(vcpu, to_vmx(vcpu)->nested.vpid02); in prepare_vmcs02()
10315 vmx->nested.nested_vmx_true_procbased_ctls_low, in nested_vmx_run()
10316 vmx->nested.nested_vmx_procbased_ctls_high) || in nested_vmx_run()
10318 vmx->nested.nested_vmx_secondary_ctls_low, in nested_vmx_run()
10319 vmx->nested.nested_vmx_secondary_ctls_high) || in nested_vmx_run()
10321 vmx->nested.nested_vmx_pinbased_ctls_low, in nested_vmx_run()
10322 vmx->nested.nested_vmx_pinbased_ctls_high) || in nested_vmx_run()
10324 vmx->nested.nested_vmx_true_exit_ctls_low, in nested_vmx_run()
10325 vmx->nested.nested_vmx_exit_ctls_high) || in nested_vmx_run()
10327 vmx->nested.nested_vmx_true_entry_ctls_low, in nested_vmx_run()
10328 vmx->nested.nested_vmx_entry_ctls_high)) in nested_vmx_run()
10400 vmx->nested.vmcs01_debugctl = vmcs_read64(GUEST_IA32_DEBUGCTL); in nested_vmx_run()
10403 vmx->loaded_vmcs = &vmx->nested.vmcs02; in nested_vmx_run()
10429 vmx->nested.nested_run_pending = 1; in nested_vmx_run()
10524 vmx->nested.preemption_timer_expired) { in vmx_check_nested_events()
10525 if (vmx->nested.nested_run_pending) in vmx_check_nested_events()
10532 if (vmx->nested.nested_run_pending || in vmx_check_nested_events()
10549 if (vmx->nested.nested_run_pending) in vmx_check_nested_events()
10562 hrtimer_get_remaining(&to_vmx(vcpu)->nested.preemption_timer); in vmx_get_preemption_timer_value()
10647 hrtimer_cancel(&to_vmx(vcpu)->nested.preemption_timer); in prepare_vmcs12()
10886 WARN_ON_ONCE(vmx->nested.nested_run_pending); in nested_vmx_vmexit()
10930 if (vmx->nested.change_vmcs01_virtual_x2apic_mode) { in nested_vmx_vmexit()
10931 vmx->nested.change_vmcs01_virtual_x2apic_mode = false; in nested_vmx_vmexit()
10944 if (vmx->nested.apic_access_page) { in nested_vmx_vmexit()
10945 nested_release_page(vmx->nested.apic_access_page); in nested_vmx_vmexit()
10946 vmx->nested.apic_access_page = NULL; in nested_vmx_vmexit()
10948 if (vmx->nested.virtual_apic_page) { in nested_vmx_vmexit()
10949 nested_release_page(vmx->nested.virtual_apic_page); in nested_vmx_vmexit()
10950 vmx->nested.virtual_apic_page = NULL; in nested_vmx_vmexit()
10952 if (vmx->nested.pi_desc_page) { in nested_vmx_vmexit()
10953 kunmap(vmx->nested.pi_desc_page); in nested_vmx_vmexit()
10954 nested_release_page(vmx->nested.pi_desc_page); in nested_vmx_vmexit()
10955 vmx->nested.pi_desc_page = NULL; in nested_vmx_vmexit()
10956 vmx->nested.pi_desc = NULL; in nested_vmx_vmexit()
10976 vmx->nested.sync_shadow_vmcs = true; in nested_vmx_vmexit()
10988 to_vmx(vcpu)->nested.nested_run_pending = 0; in vmx_leave_nested()
11010 to_vmx(vcpu)->nested.sync_shadow_vmcs = true; in nested_vmx_entry_failure()