Lines Matching refs:nested
106 static bool __read_mostly nested = 0; variable
107 module_param(nested, bool, S_IRUGO);
799 struct nested_vmx nested; member
1071 return to_vmx(vcpu)->nested.cached_vmcs12; in get_vmcs12()
1509 return vmx_misc_cr3_count(to_vmx(vcpu)->nested.nested_vmx_misc_low); in nested_cpu_vmx_misc_cr3_count()
2890 return nested && guest_cpuid_has(vcpu, X86_FEATURE_VMX); in nested_vmx_allowed()
2922 vmx->nested.nested_vmx_pinbased_ctls_low, in nested_vmx_setup_ctls_msrs()
2923 vmx->nested.nested_vmx_pinbased_ctls_high); in nested_vmx_setup_ctls_msrs()
2924 vmx->nested.nested_vmx_pinbased_ctls_low |= in nested_vmx_setup_ctls_msrs()
2926 vmx->nested.nested_vmx_pinbased_ctls_high &= in nested_vmx_setup_ctls_msrs()
2930 vmx->nested.nested_vmx_pinbased_ctls_high |= in nested_vmx_setup_ctls_msrs()
2934 vmx->nested.nested_vmx_pinbased_ctls_high |= in nested_vmx_setup_ctls_msrs()
2939 vmx->nested.nested_vmx_exit_ctls_low, in nested_vmx_setup_ctls_msrs()
2940 vmx->nested.nested_vmx_exit_ctls_high); in nested_vmx_setup_ctls_msrs()
2941 vmx->nested.nested_vmx_exit_ctls_low = in nested_vmx_setup_ctls_msrs()
2944 vmx->nested.nested_vmx_exit_ctls_high &= in nested_vmx_setup_ctls_msrs()
2949 vmx->nested.nested_vmx_exit_ctls_high |= in nested_vmx_setup_ctls_msrs()
2955 vmx->nested.nested_vmx_exit_ctls_high |= VM_EXIT_CLEAR_BNDCFGS; in nested_vmx_setup_ctls_msrs()
2958 vmx->nested.nested_vmx_exit_ctls_low &= ~VM_EXIT_SAVE_DEBUG_CONTROLS; in nested_vmx_setup_ctls_msrs()
2962 vmx->nested.nested_vmx_entry_ctls_low, in nested_vmx_setup_ctls_msrs()
2963 vmx->nested.nested_vmx_entry_ctls_high); in nested_vmx_setup_ctls_msrs()
2964 vmx->nested.nested_vmx_entry_ctls_low = in nested_vmx_setup_ctls_msrs()
2966 vmx->nested.nested_vmx_entry_ctls_high &= in nested_vmx_setup_ctls_msrs()
2971 vmx->nested.nested_vmx_entry_ctls_high |= in nested_vmx_setup_ctls_msrs()
2974 vmx->nested.nested_vmx_entry_ctls_high |= VM_ENTRY_LOAD_BNDCFGS; in nested_vmx_setup_ctls_msrs()
2977 vmx->nested.nested_vmx_entry_ctls_low &= ~VM_ENTRY_LOAD_DEBUG_CONTROLS; in nested_vmx_setup_ctls_msrs()
2981 vmx->nested.nested_vmx_procbased_ctls_low, in nested_vmx_setup_ctls_msrs()
2982 vmx->nested.nested_vmx_procbased_ctls_high); in nested_vmx_setup_ctls_msrs()
2983 vmx->nested.nested_vmx_procbased_ctls_low = in nested_vmx_setup_ctls_msrs()
2985 vmx->nested.nested_vmx_procbased_ctls_high &= in nested_vmx_setup_ctls_msrs()
3005 vmx->nested.nested_vmx_procbased_ctls_high |= in nested_vmx_setup_ctls_msrs()
3010 vmx->nested.nested_vmx_procbased_ctls_low &= in nested_vmx_setup_ctls_msrs()
3018 vmx->nested.nested_vmx_secondary_ctls_low, in nested_vmx_setup_ctls_msrs()
3019 vmx->nested.nested_vmx_secondary_ctls_high); in nested_vmx_setup_ctls_msrs()
3020 vmx->nested.nested_vmx_secondary_ctls_low = 0; in nested_vmx_setup_ctls_msrs()
3021 vmx->nested.nested_vmx_secondary_ctls_high &= in nested_vmx_setup_ctls_msrs()
3031 vmx->nested.nested_vmx_secondary_ctls_high |= in nested_vmx_setup_ctls_msrs()
3033 vmx->nested.nested_vmx_ept_caps = VMX_EPT_PAGE_WALK_4_BIT | in nested_vmx_setup_ctls_msrs()
3036 vmx->nested.nested_vmx_ept_caps |= in nested_vmx_setup_ctls_msrs()
3038 vmx->nested.nested_vmx_ept_caps &= vmx_capability.ept; in nested_vmx_setup_ctls_msrs()
3039 vmx->nested.nested_vmx_ept_caps |= VMX_EPT_EXTENT_GLOBAL_BIT | in nested_vmx_setup_ctls_msrs()
3043 vmx->nested.nested_vmx_secondary_ctls_high |= in nested_vmx_setup_ctls_msrs()
3045 vmx->nested.nested_vmx_ept_caps |= VMX_EPT_AD_BIT; in nested_vmx_setup_ctls_msrs()
3048 vmx->nested.nested_vmx_ept_caps = 0; in nested_vmx_setup_ctls_msrs()
3051 vmx->nested.nested_vmx_secondary_ctls_high |= in nested_vmx_setup_ctls_msrs()
3058 vmx->nested.nested_vmx_vmfunc_controls = in nested_vmx_setup_ctls_msrs()
3069 vmx->nested.nested_vmx_secondary_ctls_high |= in nested_vmx_setup_ctls_msrs()
3071 vmx->nested.nested_vmx_vpid_caps = VMX_VPID_INVVPID_BIT | in nested_vmx_setup_ctls_msrs()
3074 vmx->nested.nested_vmx_vpid_caps = 0; in nested_vmx_setup_ctls_msrs()
3077 vmx->nested.nested_vmx_secondary_ctls_high |= in nested_vmx_setup_ctls_msrs()
3082 vmx->nested.nested_vmx_misc_low, in nested_vmx_setup_ctls_msrs()
3083 vmx->nested.nested_vmx_misc_high); in nested_vmx_setup_ctls_msrs()
3084 vmx->nested.nested_vmx_misc_low &= VMX_MISC_SAVE_EFER_LMA; in nested_vmx_setup_ctls_msrs()
3085 vmx->nested.nested_vmx_misc_low |= in nested_vmx_setup_ctls_msrs()
3088 vmx->nested.nested_vmx_misc_high = 0; in nested_vmx_setup_ctls_msrs()
3096 vmx->nested.nested_vmx_basic = in nested_vmx_setup_ctls_msrs()
3103 vmx->nested.nested_vmx_basic |= VMX_BASIC_INOUT; in nested_vmx_setup_ctls_msrs()
3112 vmx->nested.nested_vmx_cr0_fixed0 = VMXON_CR0_ALWAYSON; in nested_vmx_setup_ctls_msrs()
3113 vmx->nested.nested_vmx_cr4_fixed0 = VMXON_CR4_ALWAYSON; in nested_vmx_setup_ctls_msrs()
3116 rdmsrl(MSR_IA32_VMX_CR0_FIXED1, vmx->nested.nested_vmx_cr0_fixed1); in nested_vmx_setup_ctls_msrs()
3117 rdmsrl(MSR_IA32_VMX_CR4_FIXED1, vmx->nested.nested_vmx_cr4_fixed1); in nested_vmx_setup_ctls_msrs()
3120 vmx->nested.nested_vmx_vmcs_enum = 0x2e; in nested_vmx_setup_ctls_msrs()
3157 u64 vmx_basic = vmx->nested.nested_vmx_basic; in vmx_restore_vmx_basic()
3176 vmx->nested.nested_vmx_basic = data; in vmx_restore_vmx_basic()
3188 lowp = &vmx->nested.nested_vmx_pinbased_ctls_low; in vmx_restore_control_msr()
3189 highp = &vmx->nested.nested_vmx_pinbased_ctls_high; in vmx_restore_control_msr()
3192 lowp = &vmx->nested.nested_vmx_procbased_ctls_low; in vmx_restore_control_msr()
3193 highp = &vmx->nested.nested_vmx_procbased_ctls_high; in vmx_restore_control_msr()
3196 lowp = &vmx->nested.nested_vmx_exit_ctls_low; in vmx_restore_control_msr()
3197 highp = &vmx->nested.nested_vmx_exit_ctls_high; in vmx_restore_control_msr()
3200 lowp = &vmx->nested.nested_vmx_entry_ctls_low; in vmx_restore_control_msr()
3201 highp = &vmx->nested.nested_vmx_entry_ctls_high; in vmx_restore_control_msr()
3204 lowp = &vmx->nested.nested_vmx_secondary_ctls_low; in vmx_restore_control_msr()
3205 highp = &vmx->nested.nested_vmx_secondary_ctls_high; in vmx_restore_control_msr()
3236 vmx_misc = vmx_control_msr(vmx->nested.nested_vmx_misc_low, in vmx_restore_vmx_misc()
3237 vmx->nested.nested_vmx_misc_high); in vmx_restore_vmx_misc()
3242 if ((vmx->nested.nested_vmx_pinbased_ctls_high & in vmx_restore_vmx_misc()
3257 vmx->nested.nested_vmx_misc_low = data; in vmx_restore_vmx_misc()
3258 vmx->nested.nested_vmx_misc_high = data >> 32; in vmx_restore_vmx_misc()
3266 vmx_ept_vpid_cap = vmx_control_msr(vmx->nested.nested_vmx_ept_caps, in vmx_restore_vmx_ept_vpid_cap()
3267 vmx->nested.nested_vmx_vpid_caps); in vmx_restore_vmx_ept_vpid_cap()
3273 vmx->nested.nested_vmx_ept_caps = data; in vmx_restore_vmx_ept_vpid_cap()
3274 vmx->nested.nested_vmx_vpid_caps = data >> 32; in vmx_restore_vmx_ept_vpid_cap()
3284 msr = &vmx->nested.nested_vmx_cr0_fixed0; in vmx_restore_fixed0_msr()
3287 msr = &vmx->nested.nested_vmx_cr4_fixed0; in vmx_restore_fixed0_msr()
3351 vmx->nested.nested_vmx_vmcs_enum = data; in vmx_set_vmx_msr()
3368 *pdata = vmx->nested.nested_vmx_basic; in vmx_get_vmx_msr()
3373 vmx->nested.nested_vmx_pinbased_ctls_low, in vmx_get_vmx_msr()
3374 vmx->nested.nested_vmx_pinbased_ctls_high); in vmx_get_vmx_msr()
3381 vmx->nested.nested_vmx_procbased_ctls_low, in vmx_get_vmx_msr()
3382 vmx->nested.nested_vmx_procbased_ctls_high); in vmx_get_vmx_msr()
3389 vmx->nested.nested_vmx_exit_ctls_low, in vmx_get_vmx_msr()
3390 vmx->nested.nested_vmx_exit_ctls_high); in vmx_get_vmx_msr()
3397 vmx->nested.nested_vmx_entry_ctls_low, in vmx_get_vmx_msr()
3398 vmx->nested.nested_vmx_entry_ctls_high); in vmx_get_vmx_msr()
3404 vmx->nested.nested_vmx_misc_low, in vmx_get_vmx_msr()
3405 vmx->nested.nested_vmx_misc_high); in vmx_get_vmx_msr()
3408 *pdata = vmx->nested.nested_vmx_cr0_fixed0; in vmx_get_vmx_msr()
3411 *pdata = vmx->nested.nested_vmx_cr0_fixed1; in vmx_get_vmx_msr()
3414 *pdata = vmx->nested.nested_vmx_cr4_fixed0; in vmx_get_vmx_msr()
3417 *pdata = vmx->nested.nested_vmx_cr4_fixed1; in vmx_get_vmx_msr()
3420 *pdata = vmx->nested.nested_vmx_vmcs_enum; in vmx_get_vmx_msr()
3424 vmx->nested.nested_vmx_secondary_ctls_low, in vmx_get_vmx_msr()
3425 vmx->nested.nested_vmx_secondary_ctls_high); in vmx_get_vmx_msr()
3428 *pdata = vmx->nested.nested_vmx_ept_caps | in vmx_get_vmx_msr()
3429 ((u64)vmx->nested.nested_vmx_vpid_caps << 32); in vmx_get_vmx_msr()
3432 *pdata = vmx->nested.nested_vmx_vmfunc_controls; in vmx_get_vmx_msr()
4498 u64 fixed0 = to_vmx(vcpu)->nested.nested_vmx_cr0_fixed0; in nested_guest_cr0_valid()
4499 u64 fixed1 = to_vmx(vcpu)->nested.nested_vmx_cr0_fixed1; in nested_guest_cr0_valid()
4502 if (to_vmx(vcpu)->nested.nested_vmx_secondary_ctls_high & in nested_guest_cr0_valid()
4512 u64 fixed0 = to_vmx(vcpu)->nested.nested_vmx_cr0_fixed0; in nested_host_cr0_valid()
4513 u64 fixed1 = to_vmx(vcpu)->nested.nested_vmx_cr0_fixed1; in nested_host_cr0_valid()
4520 u64 fixed0 = to_vmx(vcpu)->nested.nested_vmx_cr4_fixed0; in nested_cr4_valid()
4521 u64 fixed1 = to_vmx(vcpu)->nested.nested_vmx_cr4_fixed1; in nested_cr4_valid()
4666 if (to_vmx(vcpu)->nested.vmxon && !nested_cr4_valid(vcpu, cr4)) in vmx_set_cr4()
5454 if (!vmx->nested.pi_desc || !vmx->nested.pi_pending) in vmx_complete_nested_posted_interrupt()
5457 vmx->nested.pi_pending = false; in vmx_complete_nested_posted_interrupt()
5458 if (!pi_test_and_clear_on(vmx->nested.pi_desc)) in vmx_complete_nested_posted_interrupt()
5461 max_irr = find_last_bit((unsigned long *)vmx->nested.pi_desc->pir, 256); in vmx_complete_nested_posted_interrupt()
5463 vapic_page = kmap(vmx->nested.virtual_apic_page); in vmx_complete_nested_posted_interrupt()
5464 __kvm_apic_update_irr(vmx->nested.pi_desc->pir, vapic_page); in vmx_complete_nested_posted_interrupt()
5465 kunmap(vmx->nested.virtual_apic_page); in vmx_complete_nested_posted_interrupt()
5479 bool nested) in kvm_vcpu_trigger_posted_interrupt() argument
5482 int pi_vec = nested ? POSTED_INTR_NESTED_VECTOR : POSTED_INTR_VECTOR; in kvm_vcpu_trigger_posted_interrupt()
5523 vector == vmx->nested.posted_intr_nv) { in vmx_deliver_nested_posted_interrupt()
5528 vmx->nested.pi_pending = true; in vmx_deliver_nested_posted_interrupt()
5749 if (nested) { in vmx_compute_secondary_exec_control()
5751 vmx->nested.nested_vmx_secondary_ctls_high |= in vmx_compute_secondary_exec_control()
5754 vmx->nested.nested_vmx_secondary_ctls_high &= in vmx_compute_secondary_exec_control()
5764 if (nested) { in vmx_compute_secondary_exec_control()
5766 vmx->nested.nested_vmx_secondary_ctls_high |= in vmx_compute_secondary_exec_control()
5769 vmx->nested.nested_vmx_secondary_ctls_high &= in vmx_compute_secondary_exec_control()
5785 if (nested) { in vmx_compute_secondary_exec_control()
5787 vmx->nested.nested_vmx_secondary_ctls_high |= in vmx_compute_secondary_exec_control()
5790 vmx->nested.nested_vmx_secondary_ctls_high &= in vmx_compute_secondary_exec_control()
5800 if (nested) { in vmx_compute_secondary_exec_control()
5802 vmx->nested.nested_vmx_secondary_ctls_high |= in vmx_compute_secondary_exec_control()
5805 vmx->nested.nested_vmx_secondary_ctls_high &= in vmx_compute_secondary_exec_control()
5815 if (nested) { in vmx_compute_secondary_exec_control()
5817 vmx->nested.nested_vmx_secondary_ctls_high |= in vmx_compute_secondary_exec_control()
5820 vmx->nested.nested_vmx_secondary_ctls_high &= in vmx_compute_secondary_exec_control()
6187 if (to_vmx(vcpu)->nested.nested_run_pending) in vmx_nmi_allowed()
6201 return (!to_vmx(vcpu)->nested.nested_run_pending && in vmx_interrupt_allowed()
6481 if (to_vmx(vcpu)->nested.vmxon && in handle_set_cr0()
7374 if (to_vmx(vcpu)->nested.current_vmptr == -1ull) { in nested_vmx_failValid()
7403 container_of(timer, struct vcpu_vmx, nested.preemption_timer); in vmx_preemption_timer_fn()
7405 vmx->nested.preemption_timer_expired = true; in vmx_preemption_timer_fn()
7563 r = alloc_loaded_vmcs(&vmx->nested.vmcs02); in enter_vmx_operation()
7567 vmx->nested.cached_vmcs12 = kmalloc(VMCS12_SIZE, GFP_KERNEL); in enter_vmx_operation()
7568 if (!vmx->nested.cached_vmcs12) in enter_vmx_operation()
7582 hrtimer_init(&vmx->nested.preemption_timer, CLOCK_MONOTONIC, in enter_vmx_operation()
7584 vmx->nested.preemption_timer.function = vmx_preemption_timer_fn; in enter_vmx_operation()
7586 vmx->nested.vpid02 = allocate_vpid(); in enter_vmx_operation()
7588 vmx->nested.vmxon = true; in enter_vmx_operation()
7592 kfree(vmx->nested.cached_vmcs12); in enter_vmx_operation()
7595 free_loaded_vmcs(&vmx->nested.vmcs02); in enter_vmx_operation()
7638 if (vmx->nested.vmxon) { in handle_vmon()
7679 vmx->nested.vmxon_ptr = vmptr; in handle_vmon()
7702 if (!to_vmx(vcpu)->nested.vmxon) { in nested_vmx_check_permission()
7713 vmx->nested.sync_shadow_vmcs = false; in vmx_disable_shadow_vmcs()
7718 if (vmx->nested.current_vmptr == -1ull) in nested_release_vmcs12()
7727 vmx->nested.posted_intr_nv = -1; in nested_release_vmcs12()
7731 vmx->nested.current_vmptr >> PAGE_SHIFT, in nested_release_vmcs12()
7732 vmx->nested.cached_vmcs12, 0, VMCS12_SIZE); in nested_release_vmcs12()
7734 vmx->nested.current_vmptr = -1ull; in nested_release_vmcs12()
7743 if (!vmx->nested.vmxon) in free_nested()
7746 hrtimer_cancel(&vmx->nested.preemption_timer); in free_nested()
7747 vmx->nested.vmxon = false; in free_nested()
7748 free_vpid(vmx->nested.vpid02); in free_nested()
7749 vmx->nested.posted_intr_nv = -1; in free_nested()
7750 vmx->nested.current_vmptr = -1ull; in free_nested()
7757 kfree(vmx->nested.cached_vmcs12); in free_nested()
7759 if (vmx->nested.apic_access_page) { in free_nested()
7760 kvm_release_page_dirty(vmx->nested.apic_access_page); in free_nested()
7761 vmx->nested.apic_access_page = NULL; in free_nested()
7763 if (vmx->nested.virtual_apic_page) { in free_nested()
7764 kvm_release_page_dirty(vmx->nested.virtual_apic_page); in free_nested()
7765 vmx->nested.virtual_apic_page = NULL; in free_nested()
7767 if (vmx->nested.pi_desc_page) { in free_nested()
7768 kunmap(vmx->nested.pi_desc_page); in free_nested()
7769 kvm_release_page_dirty(vmx->nested.pi_desc_page); in free_nested()
7770 vmx->nested.pi_desc_page = NULL; in free_nested()
7771 vmx->nested.pi_desc = NULL; in free_nested()
7774 free_loaded_vmcs(&vmx->nested.vmcs02); in free_nested()
7805 if (vmptr == vmx->nested.vmxon_ptr) { in handle_vmclear()
7810 if (vmptr == vmx->nested.current_vmptr) in handle_vmclear()
8001 if (vmx->nested.current_vmptr == -1ull) { in nested_vmx_check_vmcs12()
8110 vmx->nested.current_vmptr = vmptr; in set_current_vmptr()
8116 vmx->nested.sync_shadow_vmcs = true; in set_current_vmptr()
8137 if (vmptr == vmx->nested.vmxon_ptr) { in handle_vmptrld()
8142 if (vmx->nested.current_vmptr != vmptr) { in handle_vmptrld()
8164 memcpy(vmx->nested.cached_vmcs12, new_vmcs12, VMCS12_SIZE); in handle_vmptrld()
8180 gpa_t current_vmptr = to_vmx(vcpu)->nested.current_vmptr; in handle_vmptrst()
8211 if (!(vmx->nested.nested_vmx_secondary_ctls_high & in handle_invept()
8213 !(vmx->nested.nested_vmx_ept_caps & VMX_EPT_INVEPT_BIT)) { in handle_invept()
8224 types = (vmx->nested.nested_vmx_ept_caps >> VMX_EPT_EXTENT_SHIFT) & 6; in handle_invept()
8274 if (!(vmx->nested.nested_vmx_secondary_ctls_high & in handle_invvpid()
8276 !(vmx->nested.nested_vmx_vpid_caps & VMX_VPID_INVVPID_BIT)) { in handle_invvpid()
8287 types = (vmx->nested.nested_vmx_vpid_caps & in handle_invvpid()
8335 __vmx_flush_tlb(vcpu, vmx->nested.vpid02, true); in handle_invvpid()
8380 if (!(vmx->nested.nested_vmx_ept_caps & VMX_EPTP_UC_BIT)) in valid_ept_address()
8384 if (!(vmx->nested.nested_vmx_ept_caps & VMX_EPTP_WB_BIT)) in valid_ept_address()
8401 if (!(vmx->nested.nested_vmx_ept_caps & VMX_EPT_AD_BIT)) in valid_ept_address()
8719 if (vmx->nested.nested_run_pending) in nested_vmx_exit_reflected()
9319 to_vmx(vcpu)->nested.change_vmcs01_virtual_apic_mode = true; in vmx_set_virtual_apic_mode()
9757 if (vmx->nested.sync_shadow_vmcs) { in vmx_vcpu_run()
9759 vmx->nested.sync_shadow_vmcs = false; in vmx_vcpu_run()
9994 if (vmx->nested.nested_run_pending) in vmx_vcpu_run()
9997 vmx->nested.nested_run_pending = 0; in vmx_vcpu_run()
10134 if (nested) in vmx_create_vcpu()
10137 vmx->nested.posted_intr_nv = -1; in vmx_create_vcpu()
10138 vmx->nested.current_vmptr = -1ull; in vmx_create_vcpu()
10289 vmx->nested.nested_vmx_cr0_fixed1 = 0xffffffff; in nested_vmx_cr_fixed1_bits_update()
10290 vmx->nested.nested_vmx_cr4_fixed1 = X86_CR4_PCE; in nested_vmx_cr_fixed1_bits_update()
10294 vmx->nested.nested_vmx_cr4_fixed1 |= (_cr4_mask); \ in nested_vmx_cr_fixed1_bits_update()
10346 if (func == 1 && nested) in vmx_set_supported_cpuid()
10358 if (vmx->nested.pml_full) { in nested_ept_inject_page_fault()
10360 vmx->nested.pml_full = false; in nested_ept_inject_page_fault()
10392 to_vmx(vcpu)->nested.nested_vmx_ept_caps & in nested_ept_init_mmu_context()
10428 !to_vmx(vcpu)->nested.nested_run_pending) { in vmx_inject_page_fault_nested()
10456 if (vmx->nested.apic_access_page) { /* shouldn't happen */ in nested_get_vmcs12_pages()
10457 kvm_release_page_dirty(vmx->nested.apic_access_page); in nested_get_vmcs12_pages()
10458 vmx->nested.apic_access_page = NULL; in nested_get_vmcs12_pages()
10468 vmx->nested.apic_access_page = page; in nested_get_vmcs12_pages()
10469 hpa = page_to_phys(vmx->nested.apic_access_page); in nested_get_vmcs12_pages()
10483 if (vmx->nested.virtual_apic_page) { /* shouldn't happen */ in nested_get_vmcs12_pages()
10484 kvm_release_page_dirty(vmx->nested.virtual_apic_page); in nested_get_vmcs12_pages()
10485 vmx->nested.virtual_apic_page = NULL; in nested_get_vmcs12_pages()
10503 vmx->nested.virtual_apic_page = page; in nested_get_vmcs12_pages()
10504 hpa = page_to_phys(vmx->nested.virtual_apic_page); in nested_get_vmcs12_pages()
10510 if (vmx->nested.pi_desc_page) { /* shouldn't happen */ in nested_get_vmcs12_pages()
10511 kunmap(vmx->nested.pi_desc_page); in nested_get_vmcs12_pages()
10512 kvm_release_page_dirty(vmx->nested.pi_desc_page); in nested_get_vmcs12_pages()
10513 vmx->nested.pi_desc_page = NULL; in nested_get_vmcs12_pages()
10514 vmx->nested.pi_desc = NULL; in nested_get_vmcs12_pages()
10520 vmx->nested.pi_desc_page = page; in nested_get_vmcs12_pages()
10521 vmx->nested.pi_desc = kmap(vmx->nested.pi_desc_page); in nested_get_vmcs12_pages()
10522 vmx->nested.pi_desc = in nested_get_vmcs12_pages()
10523 (struct pi_desc *)((void *)vmx->nested.pi_desc + in nested_get_vmcs12_pages()
10527 page_to_phys(vmx->nested.pi_desc_page) + in nested_get_vmcs12_pages()
10552 vmx_preemption_timer_fn(&vmx->nested.preemption_timer); in vmx_start_preemption_timer()
10559 hrtimer_start(&vmx->nested.preemption_timer, in vmx_start_preemption_timer()
10610 unsigned long *msr_bitmap_l0 = to_vmx(vcpu)->nested.vmcs02.msr_bitmap; in nested_vmx_merge_msr_bitmap()
11008 vmcs_write64(GUEST_IA32_DEBUGCTL, vmx->nested.vmcs01_debugctl); in prepare_vmcs02()
11045 vmx->nested.posted_intr_nv = vmcs12->posted_intr_nv; in prepare_vmcs02()
11046 vmx->nested.pi_pending = false; in prepare_vmcs02()
11054 vmx->nested.preemption_timer_expired = false; in prepare_vmcs02()
11225 vmcs_write64(MSR_BITMAP, __pa(vmx->nested.vmcs02.msr_bitmap)); in prepare_vmcs02()
11236 if (nested_cpu_has_vpid(vmcs12) && vmx->nested.vpid02) { in prepare_vmcs02()
11237 vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->nested.vpid02); in prepare_vmcs02()
11238 if (vmcs12->virtual_processor_id != vmx->nested.last_vpid) { in prepare_vmcs02()
11239 vmx->nested.last_vpid = vmcs12->virtual_processor_id; in prepare_vmcs02()
11240 __vmx_flush_tlb(vcpu, to_vmx(vcpu)->nested.vpid02, true); in prepare_vmcs02()
11348 vmx->nested.nested_vmx_procbased_ctls_low, in check_vmentry_prereqs()
11349 vmx->nested.nested_vmx_procbased_ctls_high) || in check_vmentry_prereqs()
11352 vmx->nested.nested_vmx_secondary_ctls_low, in check_vmentry_prereqs()
11353 vmx->nested.nested_vmx_secondary_ctls_high)) || in check_vmentry_prereqs()
11355 vmx->nested.nested_vmx_pinbased_ctls_low, in check_vmentry_prereqs()
11356 vmx->nested.nested_vmx_pinbased_ctls_high) || in check_vmentry_prereqs()
11358 vmx->nested.nested_vmx_exit_ctls_low, in check_vmentry_prereqs()
11359 vmx->nested.nested_vmx_exit_ctls_high) || in check_vmentry_prereqs()
11361 vmx->nested.nested_vmx_entry_ctls_low, in check_vmentry_prereqs()
11362 vmx->nested.nested_vmx_entry_ctls_high)) in check_vmentry_prereqs()
11367 ~vmx->nested.nested_vmx_vmfunc_controls) in check_vmentry_prereqs()
11414 if (to_vmx(vcpu)->nested.nested_run_pending && in check_vmentry_postreqs()
11452 vmx->nested.vmcs01_debugctl = vmcs_read64(GUEST_IA32_DEBUGCTL); in enter_vmx_non_root_mode()
11454 vmx_switch_vmcs(vcpu, &vmx->nested.vmcs02); in enter_vmx_non_root_mode()
11575 vmx->nested.nested_run_pending = 1; in nested_vmx_run()
11667 vmx->nested.nested_run_pending || kvm_event_needs_reinjection(vcpu); in vmx_check_nested_events()
11678 vmx->nested.preemption_timer_expired) { in vmx_check_nested_events()
11715 hrtimer_get_remaining(&to_vmx(vcpu)->nested.preemption_timer); in vmx_get_preemption_timer_value()
11792 hrtimer_cancel(&to_vmx(vcpu)->nested.preemption_timer); in sync_vmcs12()
12177 WARN_ON_ONCE(vmx->nested.nested_run_pending); in nested_vmx_vmexit()
12216 if (vmx->nested.change_vmcs01_virtual_apic_mode) { in nested_vmx_vmexit()
12217 vmx->nested.change_vmcs01_virtual_apic_mode = false; in nested_vmx_vmexit()
12229 if (vmx->nested.apic_access_page) { in nested_vmx_vmexit()
12230 kvm_release_page_dirty(vmx->nested.apic_access_page); in nested_vmx_vmexit()
12231 vmx->nested.apic_access_page = NULL; in nested_vmx_vmexit()
12233 if (vmx->nested.virtual_apic_page) { in nested_vmx_vmexit()
12234 kvm_release_page_dirty(vmx->nested.virtual_apic_page); in nested_vmx_vmexit()
12235 vmx->nested.virtual_apic_page = NULL; in nested_vmx_vmexit()
12237 if (vmx->nested.pi_desc_page) { in nested_vmx_vmexit()
12238 kunmap(vmx->nested.pi_desc_page); in nested_vmx_vmexit()
12239 kvm_release_page_dirty(vmx->nested.pi_desc_page); in nested_vmx_vmexit()
12240 vmx->nested.pi_desc_page = NULL; in nested_vmx_vmexit()
12241 vmx->nested.pi_desc = NULL; in nested_vmx_vmexit()
12251 vmx->nested.sync_shadow_vmcs = true; in nested_vmx_vmexit()
12318 to_vmx(vcpu)->nested.nested_run_pending = 0; in vmx_leave_nested()
12340 to_vmx(vcpu)->nested.sync_shadow_vmcs = true; in nested_vmx_entry_failure()
12517 WARN_ON_ONCE(vmx->nested.pml_full); in vmx_write_pml_buffer()
12529 vmx->nested.pml_full = true; in vmx_write_pml_buffer()