Lines Matching refs:nested
110 static bool __read_mostly nested = 0; variable
111 module_param(nested, bool, S_IRUGO);
1017 struct nested_vmx nested; member
1262 return to_vmx(vcpu)->nested.cached_vmcs12; in get_vmcs12()
1267 return to_vmx(vcpu)->nested.cached_shadow_vmcs12; in get_shadow_vmcs12()
1331 struct nested_vmx_msrs nested; member
1941 return vmx_misc_cr3_count(to_vmx(vcpu)->nested.msrs.misc_low); in nested_cpu_vmx_misc_cr3_count()
1951 return to_vmx(vcpu)->nested.msrs.misc_low & in nested_cpu_has_vmwrite_any_field()
1957 return to_vmx(vcpu)->nested.msrs.misc_low & VMX_MISC_ZERO_LEN_INS; in nested_cpu_has_zero_length_injection()
1962 return to_vmx(vcpu)->nested.msrs.procbased_ctls_high & in nested_cpu_supports_monitor_trap_flag()
1968 return to_vmx(vcpu)->nested.msrs.secondary_ctls_high & in nested_cpu_has_vmx_shadow_vmcs()
3466 return nested && guest_cpuid_has(vcpu, X86_FEATURE_VMX); in nested_vmx_allowed()
3481 if (!nested) { in nested_vmx_setup_ctls_msrs()
3740 u64 vmx_basic = vmx->nested.msrs.basic; in vmx_restore_vmx_basic()
3759 vmx->nested.msrs.basic = data; in vmx_restore_vmx_basic()
3771 lowp = &vmx->nested.msrs.pinbased_ctls_low; in vmx_restore_control_msr()
3772 highp = &vmx->nested.msrs.pinbased_ctls_high; in vmx_restore_control_msr()
3775 lowp = &vmx->nested.msrs.procbased_ctls_low; in vmx_restore_control_msr()
3776 highp = &vmx->nested.msrs.procbased_ctls_high; in vmx_restore_control_msr()
3779 lowp = &vmx->nested.msrs.exit_ctls_low; in vmx_restore_control_msr()
3780 highp = &vmx->nested.msrs.exit_ctls_high; in vmx_restore_control_msr()
3783 lowp = &vmx->nested.msrs.entry_ctls_low; in vmx_restore_control_msr()
3784 highp = &vmx->nested.msrs.entry_ctls_high; in vmx_restore_control_msr()
3787 lowp = &vmx->nested.msrs.secondary_ctls_low; in vmx_restore_control_msr()
3788 highp = &vmx->nested.msrs.secondary_ctls_high; in vmx_restore_control_msr()
3819 vmx_misc = vmx_control_msr(vmx->nested.msrs.misc_low, in vmx_restore_vmx_misc()
3820 vmx->nested.msrs.misc_high); in vmx_restore_vmx_misc()
3825 if ((vmx->nested.msrs.pinbased_ctls_high & in vmx_restore_vmx_misc()
3840 vmx->nested.msrs.misc_low = data; in vmx_restore_vmx_misc()
3841 vmx->nested.msrs.misc_high = data >> 32; in vmx_restore_vmx_misc()
3858 vmx_ept_vpid_cap = vmx_control_msr(vmx->nested.msrs.ept_caps, in vmx_restore_vmx_ept_vpid_cap()
3859 vmx->nested.msrs.vpid_caps); in vmx_restore_vmx_ept_vpid_cap()
3865 vmx->nested.msrs.ept_caps = data; in vmx_restore_vmx_ept_vpid_cap()
3866 vmx->nested.msrs.vpid_caps = data >> 32; in vmx_restore_vmx_ept_vpid_cap()
3876 msr = &vmx->nested.msrs.cr0_fixed0; in vmx_restore_fixed0_msr()
3879 msr = &vmx->nested.msrs.cr4_fixed0; in vmx_restore_fixed0_msr()
3909 if (vmx->nested.vmxon) in vmx_set_vmx_msr()
3950 vmx->nested.msrs.vmcs_enum = data; in vmx_set_vmx_msr()
4050 if (!nested) in vmx_get_msr_feature()
4052 return vmx_get_vmx_msr(&vmcs_config.nested, msr->index, &msr->data); in vmx_get_msr_feature()
4126 return vmx_get_vmx_msr(&vmx->nested.msrs, msr_info->index, in vmx_get_msr()
5200 u64 fixed0 = to_vmx(vcpu)->nested.msrs.cr0_fixed0; in nested_guest_cr0_valid()
5201 u64 fixed1 = to_vmx(vcpu)->nested.msrs.cr0_fixed1; in nested_guest_cr0_valid()
5204 if (to_vmx(vcpu)->nested.msrs.secondary_ctls_high & in nested_guest_cr0_valid()
5214 u64 fixed0 = to_vmx(vcpu)->nested.msrs.cr0_fixed0; in nested_host_cr0_valid()
5215 u64 fixed1 = to_vmx(vcpu)->nested.msrs.cr0_fixed1; in nested_host_cr0_valid()
5222 u64 fixed0 = to_vmx(vcpu)->nested.msrs.cr4_fixed0; in nested_cr4_valid()
5223 u64 fixed1 = to_vmx(vcpu)->nested.msrs.cr4_fixed1; in nested_cr4_valid()
5391 if (to_vmx(vcpu)->nested.vmxon && !nested_cr4_valid(vcpu, cr4)) in vmx_set_cr4()
6144 if (!vmx->nested.pi_desc || !vmx->nested.pi_pending) in vmx_complete_nested_posted_interrupt()
6147 vmx->nested.pi_pending = false; in vmx_complete_nested_posted_interrupt()
6148 if (!pi_test_and_clear_on(vmx->nested.pi_desc)) in vmx_complete_nested_posted_interrupt()
6151 max_irr = find_last_bit((unsigned long *)vmx->nested.pi_desc->pir, 256); in vmx_complete_nested_posted_interrupt()
6153 vapic_page = kmap(vmx->nested.virtual_apic_page); in vmx_complete_nested_posted_interrupt()
6154 __kvm_apic_update_irr(vmx->nested.pi_desc->pir, in vmx_complete_nested_posted_interrupt()
6156 kunmap(vmx->nested.virtual_apic_page); in vmx_complete_nested_posted_interrupt()
6183 WARN_ON_ONCE(!vmx->nested.virtual_apic_page)) in vmx_guest_apic_has_interrupt()
6188 vapic_page = kmap(vmx->nested.virtual_apic_page); in vmx_guest_apic_has_interrupt()
6190 kunmap(vmx->nested.virtual_apic_page); in vmx_guest_apic_has_interrupt()
6196 bool nested) in kvm_vcpu_trigger_posted_interrupt() argument
6199 int pi_vec = nested ? POSTED_INTR_NESTED_VECTOR : POSTED_INTR_VECTOR; in kvm_vcpu_trigger_posted_interrupt()
6240 vector == vmx->nested.posted_intr_nv) { in vmx_deliver_nested_posted_interrupt()
6245 vmx->nested.pi_pending = true; in vmx_deliver_nested_posted_interrupt()
6474 if (nested) { in vmx_compute_secondary_exec_control()
6476 vmx->nested.msrs.secondary_ctls_high |= in vmx_compute_secondary_exec_control()
6479 vmx->nested.msrs.secondary_ctls_high &= in vmx_compute_secondary_exec_control()
6489 if (nested) { in vmx_compute_secondary_exec_control()
6491 vmx->nested.msrs.secondary_ctls_high |= in vmx_compute_secondary_exec_control()
6494 vmx->nested.msrs.secondary_ctls_high &= in vmx_compute_secondary_exec_control()
6510 if (nested) { in vmx_compute_secondary_exec_control()
6512 vmx->nested.msrs.secondary_ctls_high |= in vmx_compute_secondary_exec_control()
6515 vmx->nested.msrs.secondary_ctls_high &= in vmx_compute_secondary_exec_control()
6525 if (nested) { in vmx_compute_secondary_exec_control()
6527 vmx->nested.msrs.secondary_ctls_high |= in vmx_compute_secondary_exec_control()
6530 vmx->nested.msrs.secondary_ctls_high &= in vmx_compute_secondary_exec_control()
6540 if (nested) { in vmx_compute_secondary_exec_control()
6542 vmx->nested.msrs.secondary_ctls_high |= in vmx_compute_secondary_exec_control()
6545 vmx->nested.msrs.secondary_ctls_high &= in vmx_compute_secondary_exec_control()
6914 if (to_vmx(vcpu)->nested.nested_run_pending) in vmx_nmi_allowed()
6928 return (!to_vmx(vcpu)->nested.nested_run_pending && in vmx_interrupt_allowed()
7215 if (to_vmx(vcpu)->nested.vmxon && in handle_set_cr0()
7748 WARN_ON_ONCE(vmx->emulation_required && vmx->nested.nested_run_pending); in handle_invalid_guest_state()
7959 if (!nested) { in hardware_setup()
7998 nested_vmx_setup_ctls_msrs(&vmcs_config.nested, enable_apicv); in hardware_setup()
8091 if (to_vmx(vcpu)->nested.current_vmptr == -1ull) { in nested_vmx_failValid()
8120 container_of(timer, struct vcpu_vmx, nested.preemption_timer); in vmx_preemption_timer_fn()
8122 vmx->nested.preemption_timer_expired = true; in vmx_preemption_timer_fn()
8274 r = alloc_loaded_vmcs(&vmx->nested.vmcs02); in enter_vmx_operation()
8278 vmx->nested.cached_vmcs12 = kmalloc(VMCS12_SIZE, GFP_KERNEL); in enter_vmx_operation()
8279 if (!vmx->nested.cached_vmcs12) in enter_vmx_operation()
8282 vmx->nested.cached_shadow_vmcs12 = kmalloc(VMCS12_SIZE, GFP_KERNEL); in enter_vmx_operation()
8283 if (!vmx->nested.cached_shadow_vmcs12) in enter_vmx_operation()
8289 hrtimer_init(&vmx->nested.preemption_timer, CLOCK_MONOTONIC, in enter_vmx_operation()
8291 vmx->nested.preemption_timer.function = vmx_preemption_timer_fn; in enter_vmx_operation()
8293 vmx->nested.vpid02 = allocate_vpid(); in enter_vmx_operation()
8295 vmx->nested.vmxon = true; in enter_vmx_operation()
8299 kfree(vmx->nested.cached_shadow_vmcs12); in enter_vmx_operation()
8302 kfree(vmx->nested.cached_vmcs12); in enter_vmx_operation()
8305 free_loaded_vmcs(&vmx->nested.vmcs02); in enter_vmx_operation()
8348 if (vmx->nested.vmxon) { in handle_vmon()
8389 vmx->nested.vmxon_ptr = vmptr; in handle_vmon()
8407 if (!to_vmx(vcpu)->nested.vmxon) { in nested_vmx_check_permission()
8428 if (vmx->nested.current_vmptr == -1ull) in nested_release_vmcs12()
8435 vmx->nested.sync_shadow_vmcs = false; in nested_release_vmcs12()
8438 vmx->nested.posted_intr_nv = -1; in nested_release_vmcs12()
8442 vmx->nested.current_vmptr >> PAGE_SHIFT, in nested_release_vmcs12()
8443 vmx->nested.cached_vmcs12, 0, VMCS12_SIZE); in nested_release_vmcs12()
8445 vmx->nested.current_vmptr = -1ull; in nested_release_vmcs12()
8454 if (!vmx->nested.vmxon && !vmx->nested.smm.vmxon) in free_nested()
8457 vmx->nested.vmxon = false; in free_nested()
8458 vmx->nested.smm.vmxon = false; in free_nested()
8459 free_vpid(vmx->nested.vpid02); in free_nested()
8460 vmx->nested.posted_intr_nv = -1; in free_nested()
8461 vmx->nested.current_vmptr = -1ull; in free_nested()
8468 kfree(vmx->nested.cached_vmcs12); in free_nested()
8469 kfree(vmx->nested.cached_shadow_vmcs12); in free_nested()
8471 if (vmx->nested.apic_access_page) { in free_nested()
8472 kvm_release_page_dirty(vmx->nested.apic_access_page); in free_nested()
8473 vmx->nested.apic_access_page = NULL; in free_nested()
8475 if (vmx->nested.virtual_apic_page) { in free_nested()
8476 kvm_release_page_dirty(vmx->nested.virtual_apic_page); in free_nested()
8477 vmx->nested.virtual_apic_page = NULL; in free_nested()
8479 if (vmx->nested.pi_desc_page) { in free_nested()
8480 kunmap(vmx->nested.pi_desc_page); in free_nested()
8481 kvm_release_page_dirty(vmx->nested.pi_desc_page); in free_nested()
8482 vmx->nested.pi_desc_page = NULL; in free_nested()
8483 vmx->nested.pi_desc = NULL; in free_nested()
8486 free_loaded_vmcs(&vmx->nested.vmcs02); in free_nested()
8517 if (vmptr == vmx->nested.vmxon_ptr) { in handle_vmclear()
8522 if (vmptr == vmx->nested.current_vmptr) in handle_vmclear()
8693 if (vmx->nested.current_vmptr == -1ull) { in nested_vmx_check_vmcs12()
8844 vmx->nested.dirty_vmcs12 = true; in handle_vmwrite()
8855 vmx->nested.current_vmptr = vmptr; in set_current_vmptr()
8861 vmx->nested.sync_shadow_vmcs = true; in set_current_vmptr()
8863 vmx->nested.dirty_vmcs12 = true; in set_current_vmptr()
8883 if (vmptr == vmx->nested.vmxon_ptr) { in handle_vmptrld()
8888 if (vmx->nested.current_vmptr != vmptr) { in handle_vmptrld()
8912 memcpy(vmx->nested.cached_vmcs12, new_vmcs12, VMCS12_SIZE); in handle_vmptrld()
8928 gpa_t current_vmptr = to_vmx(vcpu)->nested.current_vmptr; in handle_vmptrst()
8959 if (!(vmx->nested.msrs.secondary_ctls_high & in handle_invept()
8961 !(vmx->nested.msrs.ept_caps & VMX_EPT_INVEPT_BIT)) { in handle_invept()
8972 types = (vmx->nested.msrs.ept_caps >> VMX_EPT_EXTENT_SHIFT) & 6; in handle_invept()
9022 if (!(vmx->nested.msrs.secondary_ctls_high & in handle_invvpid()
9024 !(vmx->nested.msrs.vpid_caps & VMX_VPID_INVVPID_BIT)) { in handle_invvpid()
9035 types = (vmx->nested.msrs.vpid_caps & in handle_invvpid()
9069 vmx->nested.vpid02) { in handle_invvpid()
9071 vmx->nested.vpid02, operand.gla); in handle_invvpid()
9073 __vmx_flush_tlb(vcpu, vmx->nested.vpid02, true); in handle_invvpid()
9082 __vmx_flush_tlb(vcpu, vmx->nested.vpid02, true); in handle_invvpid()
9085 __vmx_flush_tlb(vcpu, vmx->nested.vpid02, true); in handle_invvpid()
9236 if (!(vmx->nested.msrs.ept_caps & VMX_EPTP_UC_BIT)) in valid_ept_address()
9240 if (!(vmx->nested.msrs.ept_caps & VMX_EPTP_WB_BIT)) in valid_ept_address()
9257 if (!(vmx->nested.msrs.ept_caps & VMX_EPT_AD_BIT)) in valid_ept_address()
9620 if (vmx->nested.nested_run_pending) in nested_vmx_exit_reflected()
10236 to_vmx(vcpu)->nested.change_vmcs01_virtual_apic_mode = true; in vmx_set_virtual_apic_mode()
10679 if (vmx->nested.sync_shadow_vmcs) { in vmx_vcpu_run()
10681 vmx->nested.sync_shadow_vmcs = false; in vmx_vcpu_run()
10921 vmx->nested.nested_run_pending = 0; in vmx_vcpu_run()
11061 if (nested) in vmx_create_vcpu()
11062 nested_vmx_setup_ctls_msrs(&vmx->nested.msrs, in vmx_create_vcpu()
11065 vmx->nested.posted_intr_nv = -1; in vmx_create_vcpu()
11066 vmx->nested.current_vmptr = -1ull; in vmx_create_vcpu()
11136 nested_vmx_setup_ctls_msrs(&vmcs_conf.nested, enable_apicv); in vmx_check_processor_compat()
11224 vmx->nested.msrs.cr0_fixed1 = 0xffffffff; in nested_vmx_cr_fixed1_bits_update()
11225 vmx->nested.msrs.cr4_fixed1 = X86_CR4_PCE; in nested_vmx_cr_fixed1_bits_update()
11229 vmx->nested.msrs.cr4_fixed1 |= (_cr4_mask); \ in nested_vmx_cr_fixed1_bits_update()
11266 vmx->nested.msrs.entry_ctls_high |= VM_ENTRY_LOAD_BNDCFGS; in nested_vmx_entry_exit_ctls_update()
11267 vmx->nested.msrs.exit_ctls_high |= VM_EXIT_CLEAR_BNDCFGS; in nested_vmx_entry_exit_ctls_update()
11269 vmx->nested.msrs.entry_ctls_high &= ~VM_ENTRY_LOAD_BNDCFGS; in nested_vmx_entry_exit_ctls_update()
11270 vmx->nested.msrs.exit_ctls_high &= ~VM_EXIT_CLEAR_BNDCFGS; in nested_vmx_entry_exit_ctls_update()
11299 if (func == 1 && nested) in vmx_set_supported_cpuid()
11311 if (vmx->nested.pml_full) { in nested_ept_inject_page_fault()
11313 vmx->nested.pml_full = false; in nested_ept_inject_page_fault()
11344 to_vmx(vcpu)->nested.msrs.ept_caps & in nested_ept_init_mmu_context()
11381 !to_vmx(vcpu)->nested.nested_run_pending) { in vmx_inject_page_fault_nested()
11409 if (vmx->nested.apic_access_page) { /* shouldn't happen */ in nested_get_vmcs12_pages()
11410 kvm_release_page_dirty(vmx->nested.apic_access_page); in nested_get_vmcs12_pages()
11411 vmx->nested.apic_access_page = NULL; in nested_get_vmcs12_pages()
11421 vmx->nested.apic_access_page = page; in nested_get_vmcs12_pages()
11422 hpa = page_to_phys(vmx->nested.apic_access_page); in nested_get_vmcs12_pages()
11431 if (vmx->nested.virtual_apic_page) { /* shouldn't happen */ in nested_get_vmcs12_pages()
11432 kvm_release_page_dirty(vmx->nested.virtual_apic_page); in nested_get_vmcs12_pages()
11433 vmx->nested.virtual_apic_page = NULL; in nested_get_vmcs12_pages()
11451 vmx->nested.virtual_apic_page = page; in nested_get_vmcs12_pages()
11452 hpa = page_to_phys(vmx->nested.virtual_apic_page); in nested_get_vmcs12_pages()
11458 if (vmx->nested.pi_desc_page) { /* shouldn't happen */ in nested_get_vmcs12_pages()
11459 kunmap(vmx->nested.pi_desc_page); in nested_get_vmcs12_pages()
11460 kvm_release_page_dirty(vmx->nested.pi_desc_page); in nested_get_vmcs12_pages()
11461 vmx->nested.pi_desc_page = NULL; in nested_get_vmcs12_pages()
11466 vmx->nested.pi_desc_page = page; in nested_get_vmcs12_pages()
11467 vmx->nested.pi_desc = kmap(vmx->nested.pi_desc_page); in nested_get_vmcs12_pages()
11468 vmx->nested.pi_desc = in nested_get_vmcs12_pages()
11469 (struct pi_desc *)((void *)vmx->nested.pi_desc + in nested_get_vmcs12_pages()
11473 page_to_phys(vmx->nested.pi_desc_page) + in nested_get_vmcs12_pages()
11495 vmx_preemption_timer_fn(&vmx->nested.preemption_timer); in vmx_start_preemption_timer()
11505 hrtimer_start(&vmx->nested.preemption_timer, in vmx_start_preemption_timer()
11556 unsigned long *msr_bitmap_l0 = to_vmx(vcpu)->nested.vmcs02.msr_bitmap; in nested_vmx_prepare_msr_bitmap()
12063 if (vmx->nested.nested_run_pending && in prepare_vmcs02_full()
12067 vmcs_write64(GUEST_BNDCFGS, vmx->nested.vmcs01_guest_bndcfgs); in prepare_vmcs02_full()
12071 if (nested_cpu_has_vpid(vmcs12) && vmx->nested.vpid02) in prepare_vmcs02_full()
12072 vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->nested.vpid02); in prepare_vmcs02_full()
12088 vmcs_write64(MSR_BITMAP, __pa(vmx->nested.vmcs02.msr_bitmap)); in prepare_vmcs02_full()
12108 if (vmx->nested.dirty_vmcs12) { in prepare_vmcs02()
12110 vmx->nested.dirty_vmcs12 = false; in prepare_vmcs02()
12124 if (vmx->nested.nested_run_pending && in prepare_vmcs02()
12130 vmcs_write64(GUEST_IA32_DEBUGCTL, vmx->nested.vmcs01_debugctl); in prepare_vmcs02()
12132 if (vmx->nested.nested_run_pending) { in prepare_vmcs02()
12157 vmx->nested.posted_intr_nv = vmcs12->posted_intr_nv; in prepare_vmcs02()
12158 vmx->nested.pi_pending = false; in prepare_vmcs02()
12165 vmx->nested.preemption_timer_expired = false; in prepare_vmcs02()
12269 if (vmx->nested.nested_run_pending && in prepare_vmcs02()
12291 if (nested_cpu_has_vpid(vmcs12) && vmx->nested.vpid02) { in prepare_vmcs02()
12292 if (vmcs12->virtual_processor_id != vmx->nested.last_vpid) { in prepare_vmcs02()
12293 vmx->nested.last_vpid = vmcs12->virtual_processor_id; in prepare_vmcs02()
12294 __vmx_flush_tlb(vcpu, vmx->nested.vpid02, true); in prepare_vmcs02()
12337 if (vmx->nested.nested_run_pending && in prepare_vmcs02()
12419 vmx->nested.msrs.procbased_ctls_low, in check_vmentry_prereqs()
12420 vmx->nested.msrs.procbased_ctls_high) || in check_vmentry_prereqs()
12423 vmx->nested.msrs.secondary_ctls_low, in check_vmentry_prereqs()
12424 vmx->nested.msrs.secondary_ctls_high)) || in check_vmentry_prereqs()
12426 vmx->nested.msrs.pinbased_ctls_low, in check_vmentry_prereqs()
12427 vmx->nested.msrs.pinbased_ctls_high) || in check_vmentry_prereqs()
12429 vmx->nested.msrs.exit_ctls_low, in check_vmentry_prereqs()
12430 vmx->nested.msrs.exit_ctls_high) || in check_vmentry_prereqs()
12432 vmx->nested.msrs.entry_ctls_low, in check_vmentry_prereqs()
12433 vmx->nested.msrs.entry_ctls_high)) in check_vmentry_prereqs()
12441 ~vmx->nested.msrs.vmfunc_controls) in check_vmentry_prereqs()
12570 if (to_vmx(vcpu)->nested.nested_run_pending && in check_vmentry_postreqs()
12624 vmx->nested.vmcs01_debugctl = vmcs_read64(GUEST_IA32_DEBUGCTL); in enter_vmx_non_root_mode()
12627 vmx->nested.vmcs01_guest_bndcfgs = vmcs_read64(GUEST_BNDCFGS); in enter_vmx_non_root_mode()
12629 vmx_switch_vmcs(vcpu, &vmx->nested.vmcs02); in enter_vmx_non_root_mode()
12776 vmx->nested.nested_run_pending = 1; in nested_vmx_run()
12780 vmx->nested.nested_run_pending = 0; in nested_vmx_run()
12805 vmx->nested.nested_run_pending = 0; in nested_vmx_run()
12898 vmx->nested.nested_run_pending || kvm_event_needs_reinjection(vcpu); in vmx_check_nested_events()
12909 vmx->nested.preemption_timer_expired) { in vmx_check_nested_events()
12951 hrtimer_get_remaining(&to_vmx(vcpu)->nested.preemption_timer); in vmx_get_preemption_timer_value()
13028 hrtimer_cancel(&to_vmx(vcpu)->nested.preemption_timer); in sync_vmcs12()
13197 !(nested_cpu_has_vpid(vmcs12) && to_vmx(vcpu)->nested.vpid02)) { in load_vmcs12_host_state()
13291 WARN_ON_ONCE(vmx->nested.nested_run_pending); in nested_vmx_vmexit()
13342 if (vmx->nested.change_vmcs01_virtual_apic_mode) { in nested_vmx_vmexit()
13343 vmx->nested.change_vmcs01_virtual_apic_mode = false; in nested_vmx_vmexit()
13355 if (vmx->nested.apic_access_page) { in nested_vmx_vmexit()
13356 kvm_release_page_dirty(vmx->nested.apic_access_page); in nested_vmx_vmexit()
13357 vmx->nested.apic_access_page = NULL; in nested_vmx_vmexit()
13359 if (vmx->nested.virtual_apic_page) { in nested_vmx_vmexit()
13360 kvm_release_page_dirty(vmx->nested.virtual_apic_page); in nested_vmx_vmexit()
13361 vmx->nested.virtual_apic_page = NULL; in nested_vmx_vmexit()
13363 if (vmx->nested.pi_desc_page) { in nested_vmx_vmexit()
13364 kunmap(vmx->nested.pi_desc_page); in nested_vmx_vmexit()
13365 kvm_release_page_dirty(vmx->nested.pi_desc_page); in nested_vmx_vmexit()
13366 vmx->nested.pi_desc_page = NULL; in nested_vmx_vmexit()
13367 vmx->nested.pi_desc = NULL; in nested_vmx_vmexit()
13377 vmx->nested.sync_shadow_vmcs = true; in nested_vmx_vmexit()
13439 to_vmx(vcpu)->nested.nested_run_pending = 0; in vmx_leave_nested()
13461 to_vmx(vcpu)->nested.sync_shadow_vmcs = true; in nested_vmx_entry_failure()
13584 WARN_ON_ONCE(vmx->nested.pml_full); in vmx_write_pml_buffer()
13596 vmx->nested.pml_full = true; in vmx_write_pml_buffer()
13856 if (to_vmx(vcpu)->nested.nested_run_pending) in vmx_smi_allowed()
13865 vmx->nested.smm.guest_mode = is_guest_mode(vcpu); in vmx_pre_enter_smm()
13866 if (vmx->nested.smm.guest_mode) in vmx_pre_enter_smm()
13869 vmx->nested.smm.vmxon = vmx->nested.vmxon; in vmx_pre_enter_smm()
13870 vmx->nested.vmxon = false; in vmx_pre_enter_smm()
13880 if (vmx->nested.smm.vmxon) { in vmx_pre_leave_smm()
13881 vmx->nested.vmxon = true; in vmx_pre_leave_smm()
13882 vmx->nested.smm.vmxon = false; in vmx_pre_leave_smm()
13885 if (vmx->nested.smm.guest_mode) { in vmx_pre_leave_smm()
13892 vmx->nested.smm.guest_mode = false; in vmx_pre_leave_smm()
13922 (vmx->nested.vmxon || vmx->nested.smm.vmxon)) { in vmx_get_nested_state()
13923 kvm_state.vmx.vmxon_pa = vmx->nested.vmxon_ptr; in vmx_get_nested_state()
13924 kvm_state.vmx.vmcs_pa = vmx->nested.current_vmptr; in vmx_get_nested_state()
13926 if (vmx->nested.current_vmptr != -1ull) { in vmx_get_nested_state()
13935 if (vmx->nested.smm.vmxon) in vmx_get_nested_state()
13938 if (vmx->nested.smm.guest_mode) in vmx_get_nested_state()
13944 if (vmx->nested.nested_run_pending) in vmx_get_nested_state()
13955 if (vmx->nested.current_vmptr == -1ull) in vmx_get_nested_state()
13967 else if (enable_shadow_vmcs && !vmx->nested.sync_shadow_vmcs) in vmx_get_nested_state()
14044 vmx->nested.vmxon_ptr = kvm_state->vmx.vmxon_pa; in vmx_set_nested_state()
14052 vmx->nested.smm.vmxon = true; in vmx_set_nested_state()
14053 vmx->nested.vmxon = false; in vmx_set_nested_state()
14056 vmx->nested.smm.guest_mode = true; in vmx_set_nested_state()
14069 vmx->nested.nested_run_pending = in vmx_set_nested_state()
14092 vmx->nested.dirty_vmcs12 = true; in vmx_set_nested_state()