Lines Matching refs:vmcb
320 svm->vmcb->save.efer = efer | EFER_SVME; in svm_set_efer()
321 vmcb_mark_dirty(svm->vmcb, VMCB_CR); in svm_set_efer()
336 if (svm->vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) in svm_get_interrupt_shadow()
346 svm->vmcb->control.int_state &= ~SVM_INTERRUPT_SHADOW_MASK; in svm_set_interrupt_shadow()
348 svm->vmcb->control.int_state |= SVM_INTERRUPT_SHADOW_MASK; in svm_set_interrupt_shadow()
363 if (nrips && svm->vmcb->control.next_rip != 0) { in skip_emulated_instruction()
365 svm->next_rip = svm->vmcb->control.next_rip; in skip_emulated_instruction()
402 svm->int3_rip = rip + svm->vmcb->save.cs.base; in svm_queue_exception()
406 svm->vmcb->control.event_inj = nr in svm_queue_exception()
410 svm->vmcb->control.event_inj_err = error_code; in svm_queue_exception()
807 svm->vmcb->control.virt_ext |= LBR_CTL_ENABLE_MASK; in svm_enable_lbrv()
818 svm->vmcb->control.virt_ext &= ~LBR_CTL_ENABLE_MASK; in svm_disable_lbrv()
832 svm->vmcb->save.rflags &= ~X86_EFLAGS_TF; in disable_nmi_singlestep()
834 svm->vmcb->save.rflags &= ~X86_EFLAGS_RF; in disable_nmi_singlestep()
841 struct vmcb_control_area *control = &svm->vmcb->control; in grow_ple_window()
850 vmcb_mark_dirty(svm->vmcb, VMCB_INTERCEPTS); in grow_ple_window()
859 struct vmcb_control_area *control = &svm->vmcb->control; in shrink_ple_window()
868 vmcb_mark_dirty(svm->vmcb, VMCB_INTERCEPTS); in shrink_ple_window()
1150 svm->vmcb->control.tsc_offset = offset; in svm_write_tsc_offset()
1151 vmcb_mark_dirty(svm->vmcb, VMCB_INTERCEPTS); in svm_write_tsc_offset()
1195 svm->vmcb->control.virt_ext &= ~VIRTUAL_VMLOAD_VMSAVE_ENABLE_MASK; in init_vmcb_after_set_cpuid()
1207 svm->vmcb->control.virt_ext |= VIRTUAL_VMLOAD_VMSAVE_ENABLE_MASK; in init_vmcb_after_set_cpuid()
1218 struct vmcb_control_area *control = &svm->vmcb->control; in init_vmcb()
1219 struct vmcb_save_area *save = &svm->vmcb->save; in init_vmcb()
1347 svm->vmcb->control.int_ctl |= V_GIF_ENABLE_MASK; in init_vmcb()
1351 svm->vmcb->control.nested_ctl |= SVM_NESTED_CTL_SEV_ENABLE; in init_vmcb()
1360 svm_hv_init_vmcb(svm->vmcb); in init_vmcb()
1363 vmcb_mark_all_dirty(svm->vmcb); in init_vmcb()
1398 svm->vmcb = target_vmcb->ptr; in svm_switch_vmcb()
1470 static void svm_clear_current_vmcb(struct vmcb *vmcb) in svm_clear_current_vmcb() argument
1475 cmpxchg(&per_cpu(svm_data, i)->current_vmcb, vmcb, NULL); in svm_clear_current_vmcb()
1487 svm_clear_current_vmcb(svm->vmcb); in svm_free_vcpu()
1542 if (sd->current_vmcb != svm->vmcb) { in svm_vcpu_load()
1543 sd->current_vmcb = svm->vmcb; in svm_vcpu_load()
1563 unsigned long rflags = svm->vmcb->save.rflags; in svm_get_rflags()
1585 to_svm(vcpu)->vmcb->save.rflags = rflags; in svm_set_rflags()
1590 struct vmcb *vmcb = to_svm(vcpu)->vmcb; in svm_get_if_flag() local
1593 ? vmcb->control.int_state & SVM_GUEST_INTERRUPT_MASK in svm_get_if_flag()
1624 control = &svm->vmcb->control; in svm_set_vintr()
1629 vmcb_mark_dirty(svm->vmcb, VMCB_INTR); in svm_set_vintr()
1637 svm->vmcb->control.int_ctl &= ~V_IRQ_INJECTION_BITS_MASK; in svm_clear_vintr()
1641 WARN_ON((svm->vmcb->control.int_ctl & V_TPR_MASK) != in svm_clear_vintr()
1644 svm->vmcb->control.int_ctl |= svm->nested.ctl.int_ctl & in svm_clear_vintr()
1647 svm->vmcb->control.int_vector = svm->nested.ctl.int_vector; in svm_clear_vintr()
1650 vmcb_mark_dirty(svm->vmcb, VMCB_INTR); in svm_clear_vintr()
1655 struct vmcb_save_area *save = &to_svm(vcpu)->vmcb->save; in svm_seg()
1743 var->dpl = to_svm(vcpu)->vmcb->save.cpl; in svm_get_segment()
1750 struct vmcb_save_area *save = &to_svm(vcpu)->vmcb->save; in svm_get_cpl()
1759 dt->size = svm->vmcb->save.idtr.limit; in svm_get_idt()
1760 dt->address = svm->vmcb->save.idtr.base; in svm_get_idt()
1767 svm->vmcb->save.idtr.limit = dt->size; in svm_set_idt()
1768 svm->vmcb->save.idtr.base = dt->address ; in svm_set_idt()
1769 vmcb_mark_dirty(svm->vmcb, VMCB_DT); in svm_set_idt()
1776 dt->size = svm->vmcb->save.gdtr.limit; in svm_get_gdt()
1777 dt->address = svm->vmcb->save.gdtr.base; in svm_get_gdt()
1784 svm->vmcb->save.gdtr.limit = dt->size; in svm_set_gdt()
1785 svm->vmcb->save.gdtr.base = dt->address ; in svm_set_gdt()
1786 vmcb_mark_dirty(svm->vmcb, VMCB_DT); in svm_set_gdt()
1798 svm->vmcb->save.efer |= EFER_LMA | EFER_LME; in svm_set_cr0()
1803 svm->vmcb->save.efer &= ~(EFER_LMA | EFER_LME); in svm_set_cr0()
1820 svm->vmcb->save.cr0 = hcr0; in svm_set_cr0()
1821 vmcb_mark_dirty(svm->vmcb, VMCB_CR); in svm_set_cr0()
1857 to_svm(vcpu)->vmcb->save.cr4 = cr4; in svm_set_cr4()
1858 vmcb_mark_dirty(to_svm(vcpu)->vmcb, VMCB_CR); in svm_set_cr4()
1890 svm->vmcb->save.cpl = (var->dpl & 3); in svm_set_segment()
1892 vmcb_mark_dirty(svm->vmcb, VMCB_SEG); in svm_set_segment()
1912 svm->vmcb->control.tlb_ctl = TLB_CONTROL_FLUSH_ALL_ASID; in new_asid()
1913 vmcb_mark_dirty(svm->vmcb, VMCB_ASID); in new_asid()
1922 struct vmcb *vmcb = svm->vmcb; in svm_set_dr6() local
1927 if (unlikely(value != vmcb->save.dr6)) { in svm_set_dr6()
1928 vmcb->save.dr6 = value; in svm_set_dr6()
1929 vmcb_mark_dirty(vmcb, VMCB_DR); in svm_set_dr6()
1948 vcpu->arch.dr6 = svm->vmcb->save.dr6; in svm_sync_dirty_debug_regs()
1949 vcpu->arch.dr7 = svm->vmcb->save.dr7; in svm_sync_dirty_debug_regs()
1961 svm->vmcb->save.dr7 = value; in svm_set_dr7()
1962 vmcb_mark_dirty(svm->vmcb, VMCB_DR); in svm_set_dr7()
1969 u64 fault_address = svm->vmcb->control.exit_info_2; in pf_interception()
1970 u64 error_code = svm->vmcb->control.exit_info_1; in pf_interception()
1974 svm->vmcb->control.insn_bytes : NULL, in pf_interception()
1975 svm->vmcb->control.insn_len); in pf_interception()
1982 u64 fault_address = svm->vmcb->control.exit_info_2; in npf_interception()
1983 u64 error_code = svm->vmcb->control.exit_info_1; in npf_interception()
1988 svm->vmcb->control.insn_bytes : NULL, in npf_interception()
1989 svm->vmcb->control.insn_len); in npf_interception()
2000 u32 payload = svm->vmcb->save.dr6 ^ DR6_ACTIVE_LOW; in db_interception()
2014 kvm_run->debug.arch.dr6 = svm->vmcb->save.dr6; in db_interception()
2015 kvm_run->debug.arch.dr7 = svm->vmcb->save.dr7; in db_interception()
2017 svm->vmcb->save.cs.base + svm->vmcb->save.rip; in db_interception()
2031 kvm_run->debug.arch.pc = svm->vmcb->save.cs.base + svm->vmcb->save.rip; in bp_interception()
2132 clear_page(svm->vmcb); in shutdown_interception()
2142 u32 io_info = svm->vmcb->control.exit_info_1; /* address size bug? */ in io_interception()
2159 svm->next_rip = svm->vmcb->control.exit_info_2; in io_interception()
2183 struct vmcb *vmcb12; in vmload_vmsave_interception()
2190 ret = kvm_vcpu_map(vcpu, gpa_to_gfn(svm->vmcb->save.rax), &map); in vmload_vmsave_interception()
2202 svm_copy_vmloadsave_state(svm->vmcb, vmcb12); in vmload_vmsave_interception()
2206 svm_copy_vmloadsave_state(vmcb12, svm->vmcb); in vmload_vmsave_interception()
2297 u32 error_code = svm->vmcb->control.exit_info_1; in gp_interception()
2305 if (svm->vmcb->save.rax & ~PAGE_MASK) in gp_interception()
2398 trace_kvm_invlpga(to_svm(vcpu)->vmcb->save.rip, asid, gva); in invlpga_interception()
2408 trace_kvm_skinit(to_svm(vcpu)->vmcb->save.rip, kvm_rax_read(vcpu)); in skinit_interception()
2419 int int_type = svm->vmcb->control.exit_int_info & in task_switch_interception()
2421 int int_vec = svm->vmcb->control.exit_int_info & SVM_EVTINJ_VEC_MASK; in task_switch_interception()
2423 svm->vmcb->control.exit_int_info & SVM_EXITINTINFO_TYPE_MASK; in task_switch_interception()
2425 svm->vmcb->control.exit_int_info & SVM_EXITINTINFO_VALID; in task_switch_interception()
2429 tss_selector = (u16)svm->vmcb->control.exit_info_1; in task_switch_interception()
2431 if (svm->vmcb->control.exit_info_2 & in task_switch_interception()
2434 else if (svm->vmcb->control.exit_info_2 & in task_switch_interception()
2448 if (svm->vmcb->control.exit_info_2 & in task_switch_interception()
2452 (u32)svm->vmcb->control.exit_info_2; in task_switch_interception()
2498 kvm_mmu_invlpg(vcpu, to_svm(vcpu)->vmcb->control.exit_info_1); in invlpg_interception()
2527 svm->vmcb->control.exit_code = SVM_EXIT_CR0_SEL_WRITE; in check_selective_cr0_intercepted()
2546 if (unlikely((svm->vmcb->control.exit_info_1 & CR_VALID) == 0)) in cr_interception()
2549 reg = svm->vmcb->control.exit_info_1 & SVM_EXITINFO_REG_MASK; in cr_interception()
2550 if (svm->vmcb->control.exit_code == SVM_EXIT_CR0_SEL_WRITE) in cr_interception()
2553 cr = svm->vmcb->control.exit_code - SVM_EXIT_READ_CR0; in cr_interception()
2617 new_value = (unsigned long)svm->vmcb->control.exit_info_1; in cr_trap()
2619 cr = svm->vmcb->control.exit_code - SVM_EXIT_CR0_WRITE_TRAP; in cr_trap()
2666 reg = svm->vmcb->control.exit_info_1 & SVM_EXITINFO_REG_MASK; in dr_interception()
2667 dr = svm->vmcb->control.exit_code - SVM_EXIT_READ_DR0; in dr_interception()
2708 msr_info.data = to_svm(vcpu)->vmcb->control.exit_info_1 & ~EFER_SVME; in efer_trap()
2781 msr_info->data = svm->vmcb->save.dbgctl; in svm_get_msr()
2784 msr_info->data = svm->vmcb->save.br_from; in svm_get_msr()
2787 msr_info->data = svm->vmcb->save.br_to; in svm_get_msr()
2790 msr_info->data = svm->vmcb->save.last_excp_from; in svm_get_msr()
2793 msr_info->data = svm->vmcb->save.last_excp_to; in svm_get_msr()
2807 msr_info->data = svm->vmcb->save.spec_ctrl; in svm_get_msr()
2911 vmcb_mark_dirty(svm->vmcb, VMCB_NPT); in svm_set_msr()
2922 svm->vmcb->save.spec_ctrl = data; in svm_set_msr()
3024 svm->vmcb->save.dbgctl = data; in svm_set_msr()
3025 vmcb_mark_dirty(svm->vmcb, VMCB_LBR); in svm_set_msr()
3074 if (to_svm(vcpu)->vmcb->control.exit_info_1) in msr_interception()
3130 type = svm->vmcb->control.exit_info_2; in invpcid_interception()
3131 gva = svm->vmcb->control.exit_info_1; in invpcid_interception()
3213 struct vmcb_control_area *control = &svm->vmcb->control; in dump_vmcb()
3214 struct vmcb_save_area *save = &svm->vmcb->save; in dump_vmcb()
3375 struct vmcb_control_area *control = &to_svm(vcpu)->vmcb->control; in svm_get_exit_info()
3392 u32 exit_code = svm->vmcb->control.exit_code; in handle_exit()
3399 vcpu->arch.cr0 = svm->vmcb->save.cr0; in handle_exit()
3401 vcpu->arch.cr3 = svm->vmcb->save.cr3; in handle_exit()
3418 if (svm->vmcb->control.exit_code == SVM_EXIT_ERR) { in handle_exit()
3421 = svm->vmcb->control.exit_code; in handle_exit()
3427 if (is_external_interrupt(svm->vmcb->control.exit_int_info) && in handle_exit()
3433 __func__, svm->vmcb->control.exit_int_info, in handle_exit()
3462 vmcb_mark_all_dirty(svm->vmcb); in pre_svm_run()
3478 svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_NMI; in svm_inject_nmi()
3494 svm->vmcb->control.event_inj = vcpu->arch.interrupt.nr | in svm_set_irq()
3524 struct vmcb *vmcb = svm->vmcb; in svm_nmi_blocked() local
3533 ret = (vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) || in svm_nmi_blocked()
3575 struct vmcb *vmcb = svm->vmcb; in svm_interrupt_blocked() local
3595 return (vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK); in svm_interrupt_blocked()
3657 svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF); in svm_enable_nmi_window()
3682 svm->vmcb->control.tlb_ctl = TLB_CONTROL_FLUSH_ASID; in svm_flush_tlb()
3691 invlpga(gva, svm->vmcb->control.asid); in svm_flush_tlb_gva()
3702 int cr8 = svm->vmcb->control.int_ctl & V_TPR_MASK; in sync_cr8_to_lapic()
3717 svm->vmcb->control.int_ctl &= ~V_TPR_MASK; in sync_lapic_to_cr8()
3718 svm->vmcb->control.int_ctl |= cr8 & V_TPR_MASK; in sync_lapic_to_cr8()
3726 u32 exitintinfo = svm->vmcb->control.exit_int_info; in svm_complete_interrupts()
3778 u32 err = svm->vmcb->control.exit_int_info_err; in svm_complete_interrupts()
3795 struct vmcb_control_area *control = &svm->vmcb->control; in svm_cancel_injection()
3805 if (to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_MSR && in svm_exit_handlers_fastpath()
3806 to_svm(vcpu)->vmcb->control.exit_info_1) in svm_exit_handlers_fastpath()
3846 svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX]; in svm_vcpu_run()
3847 svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP]; in svm_vcpu_run()
3848 svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP]; in svm_vcpu_run()
3856 if (svm->nmi_singlestep && svm->vmcb->control.event_inj) { in svm_vcpu_run()
3870 if (unlikely(svm->asid != svm->vmcb->control.asid)) { in svm_vcpu_run()
3871 svm->vmcb->control.asid = svm->asid; in svm_vcpu_run()
3872 vmcb_mark_dirty(svm->vmcb, VMCB_ASID); in svm_vcpu_run()
3874 svm->vmcb->save.cr2 = vcpu->arch.cr2; in svm_vcpu_run()
3876 svm_hv_update_vp_id(svm->vmcb, vcpu); in svm_vcpu_run()
3929 vcpu->arch.cr2 = svm->vmcb->save.cr2; in svm_vcpu_run()
3930 vcpu->arch.regs[VCPU_REGS_RAX] = svm->vmcb->save.rax; in svm_vcpu_run()
3931 vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp; in svm_vcpu_run()
3932 vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; in svm_vcpu_run()
3935 if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI)) in svm_vcpu_run()
3943 if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI)) in svm_vcpu_run()
3954 svm->vmcb->control.exit_code != SVM_EXIT_ERR) in svm_vcpu_run()
3960 svm->vmcb->control.tlb_ctl = TLB_CONTROL_DO_NOTHING; in svm_vcpu_run()
3961 vmcb_mark_all_clean(svm->vmcb); in svm_vcpu_run()
3964 if (svm->vmcb->control.exit_code == SVM_EXIT_EXCP_BASE + PF_VECTOR) in svm_vcpu_run()
3975 if (unlikely(svm->vmcb->control.exit_code == in svm_vcpu_run()
3994 svm->vmcb->control.nested_cr3 = __sme_set(root_hpa); in svm_load_mmu_pgd()
3995 vmcb_mark_dirty(svm->vmcb, VMCB_NPT); in svm_load_mmu_pgd()
4011 svm->vmcb->save.cr3 = cr3; in svm_load_mmu_pgd()
4012 vmcb_mark_dirty(svm->vmcb, VMCB_CR); in svm_load_mmu_pgd()
4195 struct vmcb *vmcb = svm->vmcb; in svm_check_intercept() local
4246 vmcb->control.exit_info_1 = 1; in svm_check_intercept()
4248 vmcb->control.exit_info_1 = 0; in svm_check_intercept()
4285 vmcb->control.exit_info_1 = exit_info; in svm_check_intercept()
4286 vmcb->control.exit_info_2 = info->next_rip; in svm_check_intercept()
4296 vmcb->control.next_rip = info->next_rip; in svm_check_intercept()
4297 vmcb->control.exit_code = icpt_info.exit_code; in svm_check_intercept()
4361 svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX]; in svm_enter_smm()
4362 svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP]; in svm_enter_smm()
4363 svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP]; in svm_enter_smm()
4385 BUILD_BUG_ON(offsetof(struct vmcb, save) != 0x400); in svm_enter_smm()
4399 struct vmcb *vmcb12; in svm_leave_smm()
4550 (vmcb_is_intercept(&svm->vmcb->control, INTERCEPT_INIT)); in svm_apic_init_signal_blocked()