Lines Matching refs:vmcb
81 struct vmcb *hsave;
84 u64 vmcb; member
119 struct vmcb *vmcb; member
213 static inline void mark_all_dirty(struct vmcb *vmcb) in mark_all_dirty() argument
215 vmcb->control.clean = 0; in mark_all_dirty()
218 static inline void mark_all_clean(struct vmcb *vmcb) in mark_all_clean() argument
220 vmcb->control.clean = ((1 << VMCB_DIRTY_MAX) - 1) in mark_all_clean()
224 static inline void mark_dirty(struct vmcb *vmcb, int bit) in mark_dirty() argument
226 vmcb->control.clean &= ~(1 << bit); in mark_dirty()
239 mark_dirty(svm->vmcb, VMCB_INTERCEPTS); in recalc_intercepts()
244 c = &svm->vmcb->control; in recalc_intercepts()
254 static inline struct vmcb *get_host_vmcb(struct vcpu_svm *svm) in get_host_vmcb()
259 return svm->vmcb; in get_host_vmcb()
264 struct vmcb *vmcb = get_host_vmcb(svm); in set_cr_intercept() local
266 vmcb->control.intercept_cr |= (1U << bit); in set_cr_intercept()
273 struct vmcb *vmcb = get_host_vmcb(svm); in clr_cr_intercept() local
275 vmcb->control.intercept_cr &= ~(1U << bit); in clr_cr_intercept()
282 struct vmcb *vmcb = get_host_vmcb(svm); in is_cr_intercept() local
284 return vmcb->control.intercept_cr & (1U << bit); in is_cr_intercept()
289 struct vmcb *vmcb = get_host_vmcb(svm); in set_dr_intercept() local
291 vmcb->control.intercept_dr |= (1U << bit); in set_dr_intercept()
298 struct vmcb *vmcb = get_host_vmcb(svm); in clr_dr_intercept() local
300 vmcb->control.intercept_dr &= ~(1U << bit); in clr_dr_intercept()
307 struct vmcb *vmcb = get_host_vmcb(svm); in set_exception_intercept() local
309 vmcb->control.intercept_exceptions |= (1U << bit); in set_exception_intercept()
316 struct vmcb *vmcb = get_host_vmcb(svm); in clr_exception_intercept() local
318 vmcb->control.intercept_exceptions &= ~(1U << bit); in clr_exception_intercept()
325 struct vmcb *vmcb = get_host_vmcb(svm); in set_intercept() local
327 vmcb->control.intercept |= (1ULL << bit); in set_intercept()
334 struct vmcb *vmcb = get_host_vmcb(svm); in clr_intercept() local
336 vmcb->control.intercept &= ~(1ULL << bit); in clr_intercept()
445 to_svm(vcpu)->vmcb->save.efer = efer | EFER_SVME; in svm_set_efer()
446 mark_dirty(to_svm(vcpu)->vmcb, VMCB_CR); in svm_set_efer()
460 if (svm->vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) in svm_get_interrupt_shadow()
470 svm->vmcb->control.int_state &= ~SVM_INTERRUPT_SHADOW_MASK; in svm_set_interrupt_shadow()
472 svm->vmcb->control.int_state |= SVM_INTERRUPT_SHADOW_MASK; in svm_set_interrupt_shadow()
480 if (svm->vmcb->control.next_rip != 0) in skip_emulated_instruction()
481 svm->next_rip = svm->vmcb->control.next_rip; in skip_emulated_instruction()
523 svm->int3_rip = rip + svm->vmcb->save.cs.base; in svm_queue_exception()
527 svm->vmcb->control.event_inj = nr in svm_queue_exception()
531 svm->vmcb->control.event_inj_err = error_code; in svm_queue_exception()
752 svm->vmcb->control.lbr_ctl = 1; in svm_enable_lbrv()
763 svm->vmcb->control.lbr_ctl = 0; in svm_disable_lbrv()
863 g_tsc_offset = svm->vmcb->control.tsc_offset - in svm_write_tsc_offset()
868 svm->vmcb->control.tsc_offset = offset + g_tsc_offset; in svm_write_tsc_offset()
870 mark_dirty(svm->vmcb, VMCB_INTERCEPTS); in svm_write_tsc_offset()
877 svm->vmcb->control.tsc_offset += adjustment; in svm_adjust_tsc_offset()
880 mark_dirty(svm->vmcb, VMCB_INTERCEPTS); in svm_adjust_tsc_offset()
885 struct vmcb_control_area *control = &svm->vmcb->control; in init_vmcb()
886 struct vmcb_save_area *save = &svm->vmcb->save; in init_vmcb()
1006 svm->nested.vmcb = 0; in init_vmcb()
1014 mark_all_dirty(svm->vmcb); in init_vmcb()
1027 svm->vmcb->save.cs.base = svm->vcpu.arch.sipi_vector << 12; in svm_vcpu_reset()
1028 svm->vmcb->save.cs.selector = svm->vcpu.arch.sipi_vector << 8; in svm_vcpu_reset()
1080 svm->vmcb = page_address(page); in svm_create_vcpu()
1081 clear_page(svm->vmcb); in svm_create_vcpu()
1132 mark_all_dirty(svm->vmcb); in svm_vcpu_load()
1168 return to_svm(vcpu)->vmcb->save.rflags; in svm_get_rflags()
1173 to_svm(vcpu)->vmcb->save.rflags = rflags; in svm_set_rflags()
1200 struct vmcb_save_area *save = &to_svm(vcpu)->vmcb->save; in svm_seg()
1291 struct vmcb_save_area *save = &to_svm(vcpu)->vmcb->save; in svm_get_cpl()
1300 dt->size = svm->vmcb->save.idtr.limit; in svm_get_idt()
1301 dt->address = svm->vmcb->save.idtr.base; in svm_get_idt()
1308 svm->vmcb->save.idtr.limit = dt->size; in svm_set_idt()
1309 svm->vmcb->save.idtr.base = dt->address ; in svm_set_idt()
1310 mark_dirty(svm->vmcb, VMCB_DT); in svm_set_idt()
1317 dt->size = svm->vmcb->save.gdtr.limit; in svm_get_gdt()
1318 dt->address = svm->vmcb->save.gdtr.base; in svm_get_gdt()
1325 svm->vmcb->save.gdtr.limit = dt->size; in svm_set_gdt()
1326 svm->vmcb->save.gdtr.base = dt->address ; in svm_set_gdt()
1327 mark_dirty(svm->vmcb, VMCB_DT); in svm_set_gdt()
1345 u64 *hcr0 = &svm->vmcb->save.cr0; in update_cr0_intercept()
1353 mark_dirty(svm->vmcb, VMCB_CR); in update_cr0_intercept()
1383 svm->vmcb->control.exit_code = SVM_EXIT_CR0_SEL_WRITE; in svm_set_cr0()
1397 svm->vmcb->save.efer |= EFER_LMA | EFER_LME; in svm_set_cr0()
1402 svm->vmcb->save.efer &= ~(EFER_LMA | EFER_LME); in svm_set_cr0()
1419 svm->vmcb->save.cr0 = cr0; in svm_set_cr0()
1420 mark_dirty(svm->vmcb, VMCB_CR); in svm_set_cr0()
1427 unsigned long old_cr4 = to_svm(vcpu)->vmcb->save.cr4; in svm_set_cr4()
1436 to_svm(vcpu)->vmcb->save.cr4 = cr4; in svm_set_cr4()
1437 mark_dirty(to_svm(vcpu)->vmcb, VMCB_CR); in svm_set_cr4()
1462 svm->vmcb->save.cpl in svm_set_segment()
1463 = (svm->vmcb->save.cs.attrib in svm_set_segment()
1466 mark_dirty(svm->vmcb, VMCB_SEG); in svm_set_segment()
1494 svm->vmcb->save.dr7 = dbg->arch.debugreg[7]; in svm_guest_debug()
1496 svm->vmcb->save.dr7 = vcpu->arch.dr7; in svm_guest_debug()
1498 mark_dirty(svm->vmcb, VMCB_DR); in svm_guest_debug()
1508 svm->vmcb->control.tlb_ctl = TLB_CONTROL_FLUSH_ALL_ASID; in new_asid()
1512 svm->vmcb->control.asid = sd->next_asid++; in new_asid()
1514 mark_dirty(svm->vmcb, VMCB_ASID); in new_asid()
1521 svm->vmcb->save.dr7 = value; in svm_set_dr7()
1522 mark_dirty(svm->vmcb, VMCB_DR); in svm_set_dr7()
1527 u64 fault_address = svm->vmcb->control.exit_info_2; in pf_interception()
1533 error_code = svm->vmcb->control.exit_info_1; in pf_interception()
1539 svm->vmcb->control.insn_bytes, in pf_interception()
1540 svm->vmcb->control.insn_len); in pf_interception()
1572 svm->vmcb->save.rflags &= in db_interception()
1581 svm->vmcb->save.cs.base + svm->vmcb->save.rip; in db_interception()
1594 kvm_run->debug.arch.pc = svm->vmcb->save.cs.base + svm->vmcb->save.rip; in bp_interception()
1702 clear_page(svm->vmcb); in shutdown_interception()
1712 u32 io_info = svm->vmcb->control.exit_info_1; /* address size bug? */ in io_interception()
1724 svm->next_rip = svm->vmcb->control.exit_info_2; in io_interception()
1773 svm->vmcb->control.nested_cr3 = root; in nested_svm_set_tdp_cr3()
1774 mark_dirty(svm->vmcb, VMCB_NPT); in nested_svm_set_tdp_cr3()
1783 svm->vmcb->control.exit_code = SVM_EXIT_NPF; in nested_svm_inject_npf_exit()
1784 svm->vmcb->control.exit_code_hi = 0; in nested_svm_inject_npf_exit()
1785 svm->vmcb->control.exit_info_1 = fault->error_code; in nested_svm_inject_npf_exit()
1786 svm->vmcb->control.exit_info_2 = fault->address; in nested_svm_inject_npf_exit()
1819 if (svm->vmcb->save.cpl) { in nested_svm_check_permissions()
1835 svm->vmcb->control.exit_code = SVM_EXIT_EXCP_BASE + nr; in nested_svm_check_exception()
1836 svm->vmcb->control.exit_code_hi = 0; in nested_svm_check_exception()
1837 svm->vmcb->control.exit_info_1 = error_code; in nested_svm_check_exception()
1838 svm->vmcb->control.exit_info_2 = svm->vcpu.arch.cr2; in nested_svm_check_exception()
1867 svm->vmcb->control.exit_code = SVM_EXIT_INTR; in nested_svm_intr()
1868 svm->vmcb->control.exit_info_1 = 0; in nested_svm_intr()
1869 svm->vmcb->control.exit_info_2 = 0; in nested_svm_intr()
1879 trace_kvm_nested_intr_vmexit(svm->vmcb->save.rip); in nested_svm_intr()
1895 svm->vmcb->control.exit_code = SVM_EXIT_NMI; in nested_svm_nmi()
1937 port = svm->vmcb->control.exit_info_1 >> 16; in nested_svm_intercept_ioio()
1958 write = svm->vmcb->control.exit_info_1 & 1; in nested_svm_exit_handled_msr()
1975 u32 exit_code = svm->vmcb->control.exit_code; in nested_svm_exit_special()
2007 u32 exit_code = svm->vmcb->control.exit_code; in nested_svm_intercept()
2065 static inline void copy_vmcb_control_area(struct vmcb *dst_vmcb, struct vmcb *from_vmcb) in copy_vmcb_control_area()
2097 struct vmcb *nested_vmcb; in nested_svm_vmexit()
2098 struct vmcb *hsave = svm->nested.hsave; in nested_svm_vmexit()
2099 struct vmcb *vmcb = svm->vmcb; in nested_svm_vmexit() local
2102 trace_kvm_nested_vmexit_inject(vmcb->control.exit_code, in nested_svm_vmexit()
2103 vmcb->control.exit_info_1, in nested_svm_vmexit()
2104 vmcb->control.exit_info_2, in nested_svm_vmexit()
2105 vmcb->control.exit_int_info, in nested_svm_vmexit()
2106 vmcb->control.exit_int_info_err); in nested_svm_vmexit()
2108 nested_vmcb = nested_svm_map(svm, svm->nested.vmcb, &page); in nested_svm_vmexit()
2114 svm->nested.vmcb = 0; in nested_svm_vmexit()
2119 nested_vmcb->save.es = vmcb->save.es; in nested_svm_vmexit()
2120 nested_vmcb->save.cs = vmcb->save.cs; in nested_svm_vmexit()
2121 nested_vmcb->save.ss = vmcb->save.ss; in nested_svm_vmexit()
2122 nested_vmcb->save.ds = vmcb->save.ds; in nested_svm_vmexit()
2123 nested_vmcb->save.gdtr = vmcb->save.gdtr; in nested_svm_vmexit()
2124 nested_vmcb->save.idtr = vmcb->save.idtr; in nested_svm_vmexit()
2128 nested_vmcb->save.cr2 = vmcb->save.cr2; in nested_svm_vmexit()
2130 nested_vmcb->save.rflags = vmcb->save.rflags; in nested_svm_vmexit()
2131 nested_vmcb->save.rip = vmcb->save.rip; in nested_svm_vmexit()
2132 nested_vmcb->save.rsp = vmcb->save.rsp; in nested_svm_vmexit()
2133 nested_vmcb->save.rax = vmcb->save.rax; in nested_svm_vmexit()
2134 nested_vmcb->save.dr7 = vmcb->save.dr7; in nested_svm_vmexit()
2135 nested_vmcb->save.dr6 = vmcb->save.dr6; in nested_svm_vmexit()
2136 nested_vmcb->save.cpl = vmcb->save.cpl; in nested_svm_vmexit()
2138 nested_vmcb->control.int_ctl = vmcb->control.int_ctl; in nested_svm_vmexit()
2139 nested_vmcb->control.int_vector = vmcb->control.int_vector; in nested_svm_vmexit()
2140 nested_vmcb->control.int_state = vmcb->control.int_state; in nested_svm_vmexit()
2141 nested_vmcb->control.exit_code = vmcb->control.exit_code; in nested_svm_vmexit()
2142 nested_vmcb->control.exit_code_hi = vmcb->control.exit_code_hi; in nested_svm_vmexit()
2143 nested_vmcb->control.exit_info_1 = vmcb->control.exit_info_1; in nested_svm_vmexit()
2144 nested_vmcb->control.exit_info_2 = vmcb->control.exit_info_2; in nested_svm_vmexit()
2145 nested_vmcb->control.exit_int_info = vmcb->control.exit_int_info; in nested_svm_vmexit()
2146 nested_vmcb->control.exit_int_info_err = vmcb->control.exit_int_info_err; in nested_svm_vmexit()
2147 nested_vmcb->control.next_rip = vmcb->control.next_rip; in nested_svm_vmexit()
2157 if (vmcb->control.event_inj & SVM_EVTINJ_VALID) { in nested_svm_vmexit()
2160 nc->exit_int_info = vmcb->control.event_inj; in nested_svm_vmexit()
2161 nc->exit_int_info_err = vmcb->control.event_inj_err; in nested_svm_vmexit()
2173 copy_vmcb_control_area(vmcb, hsave); in nested_svm_vmexit()
2181 svm->vmcb->save.es = hsave->save.es; in nested_svm_vmexit()
2182 svm->vmcb->save.cs = hsave->save.cs; in nested_svm_vmexit()
2183 svm->vmcb->save.ss = hsave->save.ss; in nested_svm_vmexit()
2184 svm->vmcb->save.ds = hsave->save.ds; in nested_svm_vmexit()
2185 svm->vmcb->save.gdtr = hsave->save.gdtr; in nested_svm_vmexit()
2186 svm->vmcb->save.idtr = hsave->save.idtr; in nested_svm_vmexit()
2187 svm->vmcb->save.rflags = hsave->save.rflags; in nested_svm_vmexit()
2192 svm->vmcb->save.cr3 = hsave->save.cr3; in nested_svm_vmexit()
2200 svm->vmcb->save.dr7 = 0; in nested_svm_vmexit()
2201 svm->vmcb->save.cpl = 0; in nested_svm_vmexit()
2202 svm->vmcb->control.exit_int_info = 0; in nested_svm_vmexit()
2204 mark_all_dirty(svm->vmcb); in nested_svm_vmexit()
2243 svm->vmcb->control.msrpm_base_pa = __pa(svm->nested.msrpm); in nested_svm_vmrun_msrpm()
2248 static bool nested_vmcb_checks(struct vmcb *vmcb) in nested_vmcb_checks() argument
2250 if ((vmcb->control.intercept & (1ULL << INTERCEPT_VMRUN)) == 0) in nested_vmcb_checks()
2253 if (vmcb->control.asid == 0) in nested_vmcb_checks()
2256 if (vmcb->control.nested_ctl && !npt_enabled) in nested_vmcb_checks()
2264 struct vmcb *nested_vmcb; in nested_svm_vmrun()
2265 struct vmcb *hsave = svm->nested.hsave; in nested_svm_vmrun()
2266 struct vmcb *vmcb = svm->vmcb; in nested_svm_vmrun() local
2270 vmcb_gpa = svm->vmcb->save.rax; in nested_svm_vmrun()
2272 nested_vmcb = nested_svm_map(svm, svm->vmcb->save.rax, &page); in nested_svm_vmrun()
2287 trace_kvm_nested_vmrun(svm->vmcb->save.rip, vmcb_gpa, in nested_svm_vmrun()
2306 hsave->save.es = vmcb->save.es; in nested_svm_vmrun()
2307 hsave->save.cs = vmcb->save.cs; in nested_svm_vmrun()
2308 hsave->save.ss = vmcb->save.ss; in nested_svm_vmrun()
2309 hsave->save.ds = vmcb->save.ds; in nested_svm_vmrun()
2310 hsave->save.gdtr = vmcb->save.gdtr; in nested_svm_vmrun()
2311 hsave->save.idtr = vmcb->save.idtr; in nested_svm_vmrun()
2315 hsave->save.rflags = vmcb->save.rflags; in nested_svm_vmrun()
2317 hsave->save.rsp = vmcb->save.rsp; in nested_svm_vmrun()
2318 hsave->save.rax = vmcb->save.rax; in nested_svm_vmrun()
2320 hsave->save.cr3 = vmcb->save.cr3; in nested_svm_vmrun()
2324 copy_vmcb_control_area(hsave, vmcb); in nested_svm_vmrun()
2326 if (svm->vmcb->save.rflags & X86_EFLAGS_IF) in nested_svm_vmrun()
2338 svm->vmcb->save.es = nested_vmcb->save.es; in nested_svm_vmrun()
2339 svm->vmcb->save.cs = nested_vmcb->save.cs; in nested_svm_vmrun()
2340 svm->vmcb->save.ss = nested_vmcb->save.ss; in nested_svm_vmrun()
2341 svm->vmcb->save.ds = nested_vmcb->save.ds; in nested_svm_vmrun()
2342 svm->vmcb->save.gdtr = nested_vmcb->save.gdtr; in nested_svm_vmrun()
2343 svm->vmcb->save.idtr = nested_vmcb->save.idtr; in nested_svm_vmrun()
2344 svm->vmcb->save.rflags = nested_vmcb->save.rflags; in nested_svm_vmrun()
2349 svm->vmcb->save.cr3 = nested_vmcb->save.cr3; in nested_svm_vmrun()
2357 svm->vmcb->save.cr2 = svm->vcpu.arch.cr2 = nested_vmcb->save.cr2; in nested_svm_vmrun()
2363 svm->vmcb->save.rax = nested_vmcb->save.rax; in nested_svm_vmrun()
2364 svm->vmcb->save.rsp = nested_vmcb->save.rsp; in nested_svm_vmrun()
2365 svm->vmcb->save.rip = nested_vmcb->save.rip; in nested_svm_vmrun()
2366 svm->vmcb->save.dr7 = nested_vmcb->save.dr7; in nested_svm_vmrun()
2367 svm->vmcb->save.dr6 = nested_vmcb->save.dr6; in nested_svm_vmrun()
2368 svm->vmcb->save.cpl = nested_vmcb->save.cpl; in nested_svm_vmrun()
2380 svm->vmcb->control.int_ctl = nested_vmcb->control.int_ctl | V_INTR_MASKING_MASK; in nested_svm_vmrun()
2395 svm->vmcb->control.lbr_ctl = nested_vmcb->control.lbr_ctl; in nested_svm_vmrun()
2396 svm->vmcb->control.int_vector = nested_vmcb->control.int_vector; in nested_svm_vmrun()
2397 svm->vmcb->control.int_state = nested_vmcb->control.int_state; in nested_svm_vmrun()
2398 svm->vmcb->control.tsc_offset += nested_vmcb->control.tsc_offset; in nested_svm_vmrun()
2399 svm->vmcb->control.event_inj = nested_vmcb->control.event_inj; in nested_svm_vmrun()
2400 svm->vmcb->control.event_inj_err = nested_vmcb->control.event_inj_err; in nested_svm_vmrun()
2413 svm->nested.vmcb = vmcb_gpa; in nested_svm_vmrun()
2417 mark_all_dirty(svm->vmcb); in nested_svm_vmrun()
2422 static void nested_svm_vmloadsave(struct vmcb *from_vmcb, struct vmcb *to_vmcb) in nested_svm_vmloadsave()
2440 struct vmcb *nested_vmcb; in vmload_interception()
2449 nested_vmcb = nested_svm_map(svm, svm->vmcb->save.rax, &page); in vmload_interception()
2453 nested_svm_vmloadsave(nested_vmcb, svm->vmcb); in vmload_interception()
2461 struct vmcb *nested_vmcb; in vmsave_interception()
2470 nested_vmcb = nested_svm_map(svm, svm->vmcb->save.rax, &page); in vmsave_interception()
2474 nested_svm_vmloadsave(svm->vmcb, nested_vmcb); in vmsave_interception()
2498 svm->vmcb->control.exit_code = SVM_EXIT_ERR; in vmrun_interception()
2499 svm->vmcb->control.exit_code_hi = 0; in vmrun_interception()
2500 svm->vmcb->control.exit_info_1 = 0; in vmrun_interception()
2501 svm->vmcb->control.exit_info_2 = 0; in vmrun_interception()
2534 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; in clgi_interception()
2536 mark_dirty(svm->vmcb, VMCB_INTR); in clgi_interception()
2545 trace_kvm_invlpga(svm->vmcb->save.rip, vcpu->arch.regs[VCPU_REGS_RCX], in invlpga_interception()
2558 trace_kvm_skinit(svm->vmcb->save.rip, svm->vcpu.arch.regs[VCPU_REGS_RAX]); in skinit_interception()
2587 int int_type = svm->vmcb->control.exit_int_info & in task_switch_interception()
2589 int int_vec = svm->vmcb->control.exit_int_info & SVM_EVTINJ_VEC_MASK; in task_switch_interception()
2591 svm->vmcb->control.exit_int_info & SVM_EXITINTINFO_TYPE_MASK; in task_switch_interception()
2593 svm->vmcb->control.exit_int_info & SVM_EXITINTINFO_VALID; in task_switch_interception()
2597 tss_selector = (u16)svm->vmcb->control.exit_info_1; in task_switch_interception()
2599 if (svm->vmcb->control.exit_info_2 & in task_switch_interception()
2602 else if (svm->vmcb->control.exit_info_2 & in task_switch_interception()
2616 if (svm->vmcb->control.exit_info_2 & in task_switch_interception()
2620 (u32)svm->vmcb->control.exit_info_2; in task_switch_interception()
2669 kvm_mmu_invlpg(&svm->vcpu, svm->vmcb->control.exit_info_1); in invlpg_interception()
2690 if (unlikely((svm->vmcb->control.exit_info_1 & CR_VALID) == 0)) in cr_interception()
2693 reg = svm->vmcb->control.exit_info_1 & SVM_EXITINFO_REG_MASK; in cr_interception()
2694 cr = svm->vmcb->control.exit_code - SVM_EXIT_READ_CR0; in cr_interception()
2773 reg = svm->vmcb->control.exit_info_1 & SVM_EXITINFO_REG_MASK; in dr_interception()
2774 dr = svm->vmcb->control.exit_code - SVM_EXIT_READ_DR0; in dr_interception()
2814 struct vmcb *vmcb = get_host_vmcb(svm); in svm_get_msr() local
2816 *data = vmcb->control.tsc_offset + native_read_tsc(); in svm_get_msr()
2820 *data = svm->vmcb->save.star; in svm_get_msr()
2824 *data = svm->vmcb->save.lstar; in svm_get_msr()
2827 *data = svm->vmcb->save.cstar; in svm_get_msr()
2830 *data = svm->vmcb->save.kernel_gs_base; in svm_get_msr()
2833 *data = svm->vmcb->save.sfmask; in svm_get_msr()
2837 *data = svm->vmcb->save.sysenter_cs; in svm_get_msr()
2851 *data = svm->vmcb->save.dbgctl; in svm_get_msr()
2854 *data = svm->vmcb->save.br_from; in svm_get_msr()
2857 *data = svm->vmcb->save.br_to; in svm_get_msr()
2860 *data = svm->vmcb->save.last_excp_from; in svm_get_msr()
2863 *data = svm->vmcb->save.last_excp_to; in svm_get_msr()
2933 svm->vmcb->save.star = data; in svm_set_msr()
2937 svm->vmcb->save.lstar = data; in svm_set_msr()
2940 svm->vmcb->save.cstar = data; in svm_set_msr()
2943 svm->vmcb->save.kernel_gs_base = data; in svm_set_msr()
2946 svm->vmcb->save.sfmask = data; in svm_set_msr()
2950 svm->vmcb->save.sysenter_cs = data; in svm_set_msr()
2954 svm->vmcb->save.sysenter_eip = data; in svm_set_msr()
2958 svm->vmcb->save.sysenter_esp = data; in svm_set_msr()
2969 svm->vmcb->save.dbgctl = data; in svm_set_msr()
2970 mark_dirty(svm->vmcb, VMCB_LBR); in svm_set_msr()
3010 if (svm->vmcb->control.exit_info_1) in msr_interception()
3022 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; in interrupt_window_interception()
3023 mark_dirty(svm->vmcb, VMCB_INTR); in interrupt_window_interception()
3110 struct vmcb_control_area *control = &svm->vmcb->control; in dump_vmcb()
3111 struct vmcb_save_area *save = &svm->vmcb->save; in dump_vmcb()
3202 struct vmcb_control_area *control = &to_svm(vcpu)->vmcb->control; in svm_get_exit_info()
3212 u32 exit_code = svm->vmcb->control.exit_code; in handle_exit()
3217 vcpu->arch.cr0 = svm->vmcb->save.cr0; in handle_exit()
3219 vcpu->arch.cr3 = svm->vmcb->save.cr3; in handle_exit()
3231 trace_kvm_nested_vmexit(svm->vmcb->save.rip, exit_code, in handle_exit()
3232 svm->vmcb->control.exit_info_1, in handle_exit()
3233 svm->vmcb->control.exit_info_2, in handle_exit()
3234 svm->vmcb->control.exit_int_info, in handle_exit()
3235 svm->vmcb->control.exit_int_info_err); in handle_exit()
3248 if (svm->vmcb->control.exit_code == SVM_EXIT_ERR) { in handle_exit()
3251 = svm->vmcb->control.exit_code; in handle_exit()
3257 if (is_external_interrupt(svm->vmcb->control.exit_int_info) && in handle_exit()
3263 __func__, svm->vmcb->control.exit_int_info, in handle_exit()
3300 svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_NMI; in svm_inject_nmi()
3310 control = &svm->vmcb->control; in svm_inject_irq()
3315 mark_dirty(svm->vmcb, VMCB_INTR); in svm_inject_irq()
3327 svm->vmcb->control.event_inj = vcpu->arch.interrupt.nr | in svm_set_irq()
3348 struct vmcb *vmcb = svm->vmcb; in svm_nmi_allowed() local
3350 ret = !(vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) && in svm_nmi_allowed()
3380 struct vmcb *vmcb = svm->vmcb; in svm_interrupt_allowed() local
3384 (vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK)) in svm_interrupt_allowed()
3387 ret = !!(vmcb->save.rflags & X86_EFLAGS_IF); in svm_interrupt_allowed()
3424 svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF); in enable_nmi_window()
3438 svm->vmcb->control.tlb_ctl = TLB_CONTROL_FLUSH_ASID; in svm_flush_tlb()
3455 int cr8 = svm->vmcb->control.int_ctl & V_TPR_MASK; in sync_cr8_to_lapic()
3469 svm->vmcb->control.int_ctl &= ~V_TPR_MASK; in sync_lapic_to_cr8()
3470 svm->vmcb->control.int_ctl |= cr8 & V_TPR_MASK; in sync_lapic_to_cr8()
3477 u32 exitintinfo = svm->vmcb->control.exit_int_info; in svm_complete_interrupts()
3523 u32 err = svm->vmcb->control.exit_int_info_err; in svm_complete_interrupts()
3540 struct vmcb_control_area *control = &svm->vmcb->control; in svm_cancel_injection()
3558 svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX]; in svm_vcpu_run()
3559 svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP]; in svm_vcpu_run()
3560 svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP]; in svm_vcpu_run()
3573 svm->vmcb->save.cr2 = vcpu->arch.cr2; in svm_vcpu_run()
3626 [vmcb]"i"(offsetof(struct vcpu_svm, vmcb_pa)), in svm_vcpu_run()
3663 vcpu->arch.cr2 = svm->vmcb->save.cr2; in svm_vcpu_run()
3664 vcpu->arch.regs[VCPU_REGS_RAX] = svm->vmcb->save.rax; in svm_vcpu_run()
3665 vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp; in svm_vcpu_run()
3666 vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; in svm_vcpu_run()
3668 if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI)) in svm_vcpu_run()
3675 if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI)) in svm_vcpu_run()
3682 svm->vmcb->control.tlb_ctl = TLB_CONTROL_DO_NOTHING; in svm_vcpu_run()
3685 if (svm->vmcb->control.exit_code == SVM_EXIT_EXCP_BASE + PF_VECTOR) in svm_vcpu_run()
3697 if (unlikely(svm->vmcb->control.exit_code == in svm_vcpu_run()
3701 mark_all_clean(svm->vmcb); in svm_vcpu_run()
3710 svm->vmcb->save.cr3 = root;
3711 mark_dirty(svm->vmcb, VMCB_CR);
3719 svm->vmcb->control.nested_cr3 = root;
3720 mark_dirty(svm->vmcb, VMCB_NPT);
3723 svm->vmcb->save.cr3 = kvm_read_cr3(vcpu);
3724 mark_dirty(svm->vmcb, VMCB_CR);