H A D | svm.c | 96 struct vmcb *hsave; 99 u64 vmcb; member in struct:nested_state 132 struct vmcb *vmcb; member in struct:vcpu_svm 235 static inline void mark_all_dirty(struct vmcb *vmcb) mark_all_dirty() argument 237 vmcb->control.clean = 0; mark_all_dirty() 240 static inline void mark_all_clean(struct vmcb *vmcb) mark_all_clean() argument 242 vmcb->control.clean = ((1 << VMCB_DIRTY_MAX) - 1) mark_all_clean() 246 static inline void mark_dirty(struct vmcb *vmcb, int bit) mark_dirty() argument 248 vmcb->control.clean &= ~(1 << bit); mark_dirty() 261 mark_dirty(svm->vmcb, VMCB_INTERCEPTS); recalc_intercepts() 266 c = &svm->vmcb->control; recalc_intercepts() 276 static inline struct vmcb *get_host_vmcb(struct vcpu_svm *svm) get_host_vmcb() 281 return svm->vmcb; get_host_vmcb() 286 struct vmcb *vmcb = get_host_vmcb(svm); set_cr_intercept() local 288 vmcb->control.intercept_cr |= (1U << bit); set_cr_intercept() 295 struct vmcb *vmcb = get_host_vmcb(svm); clr_cr_intercept() local 297 vmcb->control.intercept_cr &= ~(1U << bit); clr_cr_intercept() 304 struct vmcb *vmcb = get_host_vmcb(svm); is_cr_intercept() local 306 return vmcb->control.intercept_cr & (1U << bit); is_cr_intercept() 311 struct vmcb *vmcb = get_host_vmcb(svm); set_dr_intercepts() local 313 vmcb->control.intercept_dr = (1 << INTERCEPT_DR0_READ) set_dr_intercepts() 335 struct vmcb *vmcb = get_host_vmcb(svm); clr_dr_intercepts() local 337 vmcb->control.intercept_dr = 0; clr_dr_intercepts() 344 struct vmcb *vmcb = get_host_vmcb(svm); set_exception_intercept() local 346 vmcb->control.intercept_exceptions |= (1U << bit); set_exception_intercept() 353 struct vmcb *vmcb = get_host_vmcb(svm); clr_exception_intercept() local 355 vmcb->control.intercept_exceptions &= ~(1U << bit); clr_exception_intercept() 362 struct vmcb *vmcb = get_host_vmcb(svm); set_intercept() local 364 vmcb->control.intercept |= (1ULL << bit); set_intercept() 371 struct vmcb *vmcb = get_host_vmcb(svm); clr_intercept() local 373 vmcb->control.intercept &= ~(1ULL << bit); clr_intercept() 481 to_svm(vcpu)->vmcb->save.efer = efer | EFER_SVME; svm_set_efer() 482 mark_dirty(to_svm(vcpu)->vmcb, VMCB_CR); svm_set_efer() 496 if (svm->vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) svm_get_interrupt_shadow() 506 svm->vmcb->control.int_state &= ~SVM_INTERRUPT_SHADOW_MASK; svm_set_interrupt_shadow() 508 svm->vmcb->control.int_state |= SVM_INTERRUPT_SHADOW_MASK; svm_set_interrupt_shadow() 516 if (svm->vmcb->control.next_rip != 0) { skip_emulated_instruction() 518 svm->next_rip = svm->vmcb->control.next_rip; skip_emulated_instruction() 561 svm->int3_rip = rip + svm->vmcb->save.cs.base; svm_queue_exception() 565 svm->vmcb->control.event_inj = nr svm_queue_exception() 569 svm->vmcb->control.event_inj_err = error_code; svm_queue_exception() 851 svm->vmcb->control.lbr_ctl = 1; svm_enable_lbrv() 862 svm->vmcb->control.lbr_ctl = 0; svm_disable_lbrv() 964 return svm->vmcb->control.tsc_offset; svm_read_tsc_offset() 973 g_tsc_offset = svm->vmcb->control.tsc_offset - svm_write_tsc_offset() 978 svm->vmcb->control.tsc_offset, svm_write_tsc_offset() 981 svm->vmcb->control.tsc_offset = offset + g_tsc_offset; svm_write_tsc_offset() 983 mark_dirty(svm->vmcb, VMCB_INTERCEPTS); svm_write_tsc_offset() 990 svm->vmcb->control.tsc_offset += adjustment; svm_adjust_tsc_offset_guest() 995 svm->vmcb->control.tsc_offset - adjustment, svm_adjust_tsc_offset_guest() 996 svm->vmcb->control.tsc_offset); svm_adjust_tsc_offset_guest() 998 mark_dirty(svm->vmcb, VMCB_INTERCEPTS); svm_adjust_tsc_offset_guest() 1003 struct vmcb_control_area *control = &svm->vmcb->control; init_vmcb() 1004 struct vmcb_save_area *save = &svm->vmcb->save; init_vmcb() 1103 svm->nested.vmcb = 0; init_vmcb() 1111 mark_all_dirty(svm->vmcb); init_vmcb() 1178 svm->vmcb = page_address(page); svm_create_vcpu() 1179 clear_page(svm->vmcb); svm_create_vcpu() 1221 mark_all_dirty(svm->vmcb); svm_vcpu_load() 1265 return to_svm(vcpu)->vmcb->save.rflags; svm_get_rflags() 1275 to_svm(vcpu)->vmcb->save.rflags = rflags; svm_set_rflags() 1302 struct vmcb_save_area *save = &to_svm(vcpu)->vmcb->save; svm_seg() 1388 var->dpl = to_svm(vcpu)->vmcb->save.cpl; svm_get_segment() 1395 struct vmcb_save_area *save = &to_svm(vcpu)->vmcb->save; svm_get_cpl() 1404 dt->size = svm->vmcb->save.idtr.limit; svm_get_idt() 1405 dt->address = svm->vmcb->save.idtr.base; svm_get_idt() 1412 svm->vmcb->save.idtr.limit = dt->size; svm_set_idt() 1413 svm->vmcb->save.idtr.base = dt->address ; svm_set_idt() 1414 mark_dirty(svm->vmcb, VMCB_DT); svm_set_idt() 1421 dt->size = svm->vmcb->save.gdtr.limit; svm_get_gdt() 1422 dt->address = svm->vmcb->save.gdtr.base; svm_get_gdt() 1429 svm->vmcb->save.gdtr.limit = dt->size; svm_set_gdt() 1430 svm->vmcb->save.gdtr.base = dt->address ; svm_set_gdt() 1431 mark_dirty(svm->vmcb, VMCB_DT); svm_set_gdt() 1449 u64 *hcr0 = &svm->vmcb->save.cr0; update_cr0_intercept() 1457 mark_dirty(svm->vmcb, VMCB_CR); update_cr0_intercept() 1476 svm->vmcb->save.efer |= EFER_LMA | EFER_LME; svm_set_cr0() 1481 svm->vmcb->save.efer &= ~(EFER_LMA | EFER_LME); svm_set_cr0() 1499 svm->vmcb->save.cr0 = cr0; svm_set_cr0() 1500 mark_dirty(svm->vmcb, VMCB_CR); svm_set_cr0() 1507 unsigned long old_cr4 = to_svm(vcpu)->vmcb->save.cr4; svm_set_cr4() 1519 to_svm(vcpu)->vmcb->save.cr4 = cr4; svm_set_cr4() 1520 mark_dirty(to_svm(vcpu)->vmcb, VMCB_CR); svm_set_cr4() 1553 svm->vmcb->save.cpl = (s->attrib >> SVM_SELECTOR_DPL_SHIFT) & 3; svm_set_segment() 1555 mark_dirty(svm->vmcb, VMCB_SEG); svm_set_segment() 1576 svm->vmcb->control.tlb_ctl = TLB_CONTROL_FLUSH_ALL_ASID; new_asid() 1580 svm->vmcb->control.asid = sd->next_asid++; new_asid() 1582 mark_dirty(svm->vmcb, VMCB_ASID); new_asid() 1587 return to_svm(vcpu)->vmcb->save.dr6; svm_get_dr6() 1594 svm->vmcb->save.dr6 = value; svm_set_dr6() 1595 mark_dirty(svm->vmcb, VMCB_DR); svm_set_dr6() 1607 vcpu->arch.dr7 = svm->vmcb->save.dr7; svm_sync_dirty_debug_regs() 1617 svm->vmcb->save.dr7 = value; svm_set_dr7() 1618 mark_dirty(svm->vmcb, VMCB_DR); svm_set_dr7() 1623 u64 fault_address = svm->vmcb->control.exit_info_2; pf_interception() 1629 error_code = svm->vmcb->control.exit_info_1; pf_interception() 1635 svm->vmcb->control.insn_bytes, pf_interception() 1636 svm->vmcb->control.insn_len); pf_interception() 1668 svm->vmcb->save.rflags &= db_interception() 1676 svm->vmcb->save.cs.base + svm->vmcb->save.rip; db_interception() 1689 kvm_run->debug.arch.pc = svm->vmcb->save.cs.base + svm->vmcb->save.rip; bp_interception() 1803 clear_page(svm->vmcb); shutdown_interception() 1813 u32 io_info = svm->vmcb->control.exit_info_1; /* address size bug? */ io_interception() 1825 svm->next_rip = svm->vmcb->control.exit_info_2; io_interception() 1886 svm->vmcb->control.nested_cr3 = root; nested_svm_set_tdp_cr3() 1887 mark_dirty(svm->vmcb, VMCB_NPT); nested_svm_set_tdp_cr3() 1896 if (svm->vmcb->control.exit_code != SVM_EXIT_NPF) { nested_svm_inject_npf_exit() 1901 svm->vmcb->control.exit_code = SVM_EXIT_NPF; nested_svm_inject_npf_exit() 1902 svm->vmcb->control.exit_code_hi = 0; nested_svm_inject_npf_exit() 1903 svm->vmcb->control.exit_info_1 = (1ULL << 32); nested_svm_inject_npf_exit() 1904 svm->vmcb->control.exit_info_2 = fault->address; nested_svm_inject_npf_exit() 1907 svm->vmcb->control.exit_info_1 &= ~0xffffffffULL; nested_svm_inject_npf_exit() 1908 svm->vmcb->control.exit_info_1 |= fault->error_code; nested_svm_inject_npf_exit() 1914 if (svm->vmcb->control.exit_info_1 & (2ULL << 32)) nested_svm_inject_npf_exit() 1915 svm->vmcb->control.exit_info_1 &= ~1; nested_svm_inject_npf_exit() 1946 if (svm->vmcb->save.cpl) { nested_svm_check_permissions() 1962 svm->vmcb->control.exit_code = SVM_EXIT_EXCP_BASE + nr; nested_svm_check_exception() 1963 svm->vmcb->control.exit_code_hi = 0; nested_svm_check_exception() 1964 svm->vmcb->control.exit_info_1 = error_code; nested_svm_check_exception() 1965 svm->vmcb->control.exit_info_2 = svm->vcpu.arch.cr2; nested_svm_check_exception() 1994 svm->vmcb->control.exit_code = SVM_EXIT_INTR; nested_svm_intr() 1995 svm->vmcb->control.exit_info_1 = 0; nested_svm_intr() 1996 svm->vmcb->control.exit_info_2 = 0; nested_svm_intr() 2006 trace_kvm_nested_intr_vmexit(svm->vmcb->save.rip); nested_svm_intr() 2022 svm->vmcb->control.exit_code = SVM_EXIT_NMI; nested_svm_nmi() 2064 port = svm->vmcb->control.exit_info_1 >> 16; nested_svm_intercept_ioio() 2065 size = (svm->vmcb->control.exit_info_1 & SVM_IOIO_SIZE_MASK) >> nested_svm_intercept_ioio() 2089 write = svm->vmcb->control.exit_info_1 & 1; nested_svm_exit_handled_msr() 2106 u32 exit_code = svm->vmcb->control.exit_code; nested_svm_exit_special() 2138 u32 exit_code = svm->vmcb->control.exit_code; nested_svm_intercept() 2196 static inline void copy_vmcb_control_area(struct vmcb *dst_vmcb, struct vmcb *from_vmcb) copy_vmcb_control_area() 2228 struct vmcb *nested_vmcb; nested_svm_vmexit() 2229 struct vmcb *hsave = svm->nested.hsave; nested_svm_vmexit() 2230 struct vmcb *vmcb = svm->vmcb; nested_svm_vmexit() local 2233 trace_kvm_nested_vmexit_inject(vmcb->control.exit_code, nested_svm_vmexit() 2234 vmcb->control.exit_info_1, nested_svm_vmexit() 2235 vmcb->control.exit_info_2, nested_svm_vmexit() 2236 vmcb->control.exit_int_info, nested_svm_vmexit() 2237 vmcb->control.exit_int_info_err, nested_svm_vmexit() 2240 nested_vmcb = nested_svm_map(svm, svm->nested.vmcb, &page); nested_svm_vmexit() 2246 svm->nested.vmcb = 0; nested_svm_vmexit() 2248 /* Give the current vmcb to the guest */ nested_svm_vmexit() 2251 nested_vmcb->save.es = vmcb->save.es; nested_svm_vmexit() 2252 nested_vmcb->save.cs = vmcb->save.cs; nested_svm_vmexit() 2253 nested_vmcb->save.ss = vmcb->save.ss; nested_svm_vmexit() 2254 nested_vmcb->save.ds = vmcb->save.ds; nested_svm_vmexit() 2255 nested_vmcb->save.gdtr = vmcb->save.gdtr; nested_svm_vmexit() 2256 nested_vmcb->save.idtr = vmcb->save.idtr; nested_svm_vmexit() 2260 nested_vmcb->save.cr2 = vmcb->save.cr2; nested_svm_vmexit() 2263 nested_vmcb->save.rip = vmcb->save.rip; nested_svm_vmexit() 2264 nested_vmcb->save.rsp = vmcb->save.rsp; nested_svm_vmexit() 2265 nested_vmcb->save.rax = vmcb->save.rax; nested_svm_vmexit() 2266 nested_vmcb->save.dr7 = vmcb->save.dr7; nested_svm_vmexit() 2267 nested_vmcb->save.dr6 = vmcb->save.dr6; nested_svm_vmexit() 2268 nested_vmcb->save.cpl = vmcb->save.cpl; nested_svm_vmexit() 2270 nested_vmcb->control.int_ctl = vmcb->control.int_ctl; nested_svm_vmexit() 2271 nested_vmcb->control.int_vector = vmcb->control.int_vector; nested_svm_vmexit() 2272 nested_vmcb->control.int_state = vmcb->control.int_state; nested_svm_vmexit() 2273 nested_vmcb->control.exit_code = vmcb->control.exit_code; nested_svm_vmexit() 2274 nested_vmcb->control.exit_code_hi = vmcb->control.exit_code_hi; nested_svm_vmexit() 2275 nested_vmcb->control.exit_info_1 = vmcb->control.exit_info_1; nested_svm_vmexit() 2276 nested_vmcb->control.exit_info_2 = vmcb->control.exit_info_2; nested_svm_vmexit() 2277 nested_vmcb->control.exit_int_info = vmcb->control.exit_int_info; nested_svm_vmexit() 2278 nested_vmcb->control.exit_int_info_err = vmcb->control.exit_int_info_err; nested_svm_vmexit() 2281 nested_vmcb->control.next_rip = vmcb->control.next_rip; nested_svm_vmexit() 2291 if (vmcb->control.event_inj & SVM_EVTINJ_VALID) { nested_svm_vmexit() 2294 nc->exit_int_info = vmcb->control.event_inj; nested_svm_vmexit() 2295 nc->exit_int_info_err = vmcb->control.event_inj_err; nested_svm_vmexit() 2307 copy_vmcb_control_area(vmcb, hsave); nested_svm_vmexit() 2315 svm->vmcb->save.es = hsave->save.es; nested_svm_vmexit() 2316 svm->vmcb->save.cs = hsave->save.cs; nested_svm_vmexit() 2317 svm->vmcb->save.ss = hsave->save.ss; nested_svm_vmexit() 2318 svm->vmcb->save.ds = hsave->save.ds; nested_svm_vmexit() 2319 svm->vmcb->save.gdtr = hsave->save.gdtr; nested_svm_vmexit() 2320 svm->vmcb->save.idtr = hsave->save.idtr; nested_svm_vmexit() 2326 svm->vmcb->save.cr3 = hsave->save.cr3; nested_svm_vmexit() 2334 svm->vmcb->save.dr7 = 0; nested_svm_vmexit() 2335 svm->vmcb->save.cpl = 0; nested_svm_vmexit() 2336 svm->vmcb->control.exit_int_info = 0; nested_svm_vmexit() 2338 mark_all_dirty(svm->vmcb); nested_svm_vmexit() 2353 * nested vmcb. It is optimized in that it only merges the parts where nested_svm_vmrun_msrpm() 2377 svm->vmcb->control.msrpm_base_pa = __pa(svm->nested.msrpm); nested_svm_vmrun_msrpm() 2382 static bool nested_vmcb_checks(struct vmcb *vmcb) nested_vmcb_checks() argument 2384 if ((vmcb->control.intercept & (1ULL << INTERCEPT_VMRUN)) == 0) nested_vmcb_checks() 2387 if (vmcb->control.asid == 0) nested_vmcb_checks() 2390 if (vmcb->control.nested_ctl && !npt_enabled) nested_vmcb_checks() 2398 struct vmcb *nested_vmcb; nested_svm_vmrun() 2399 struct vmcb *hsave = svm->nested.hsave; nested_svm_vmrun() 2400 struct vmcb *vmcb = svm->vmcb; nested_svm_vmrun() local 2404 vmcb_gpa = svm->vmcb->save.rax; nested_svm_vmrun() 2406 nested_vmcb = nested_svm_map(svm, svm->vmcb->save.rax, &page); nested_svm_vmrun() 2421 trace_kvm_nested_vmrun(svm->vmcb->save.rip, vmcb_gpa, nested_svm_vmrun() 2437 * Save the old vmcb, so we don't need to pick what we save, but can nested_svm_vmrun() 2440 hsave->save.es = vmcb->save.es; nested_svm_vmrun() 2441 hsave->save.cs = vmcb->save.cs; nested_svm_vmrun() 2442 hsave->save.ss = vmcb->save.ss; nested_svm_vmrun() 2443 hsave->save.ds = vmcb->save.ds; nested_svm_vmrun() 2444 hsave->save.gdtr = vmcb->save.gdtr; nested_svm_vmrun() 2445 hsave->save.idtr = vmcb->save.idtr; nested_svm_vmrun() 2451 hsave->save.rsp = vmcb->save.rsp; nested_svm_vmrun() 2452 hsave->save.rax = vmcb->save.rax; nested_svm_vmrun() 2454 hsave->save.cr3 = vmcb->save.cr3; nested_svm_vmrun() 2458 copy_vmcb_control_area(hsave, vmcb); nested_svm_vmrun() 2472 svm->vmcb->save.es = nested_vmcb->save.es; nested_svm_vmrun() 2473 svm->vmcb->save.cs = nested_vmcb->save.cs; nested_svm_vmrun() 2474 svm->vmcb->save.ss = nested_vmcb->save.ss; nested_svm_vmrun() 2475 svm->vmcb->save.ds = nested_vmcb->save.ds; nested_svm_vmrun() 2476 svm->vmcb->save.gdtr = nested_vmcb->save.gdtr; nested_svm_vmrun() 2477 svm->vmcb->save.idtr = nested_vmcb->save.idtr; nested_svm_vmrun() 2483 svm->vmcb->save.cr3 = nested_vmcb->save.cr3; nested_svm_vmrun() 2491 svm->vmcb->save.cr2 = svm->vcpu.arch.cr2 = nested_vmcb->save.cr2; nested_svm_vmrun() 2497 svm->vmcb->save.rax = nested_vmcb->save.rax; nested_svm_vmrun() 2498 svm->vmcb->save.rsp = nested_vmcb->save.rsp; nested_svm_vmrun() 2499 svm->vmcb->save.rip = nested_vmcb->save.rip; nested_svm_vmrun() 2500 svm->vmcb->save.dr7 = nested_vmcb->save.dr7; nested_svm_vmrun() 2501 svm->vmcb->save.dr6 = nested_vmcb->save.dr6; nested_svm_vmrun() 2502 svm->vmcb->save.cpl = nested_vmcb->save.cpl; nested_svm_vmrun() 2514 svm->vmcb->control.int_ctl = nested_vmcb->control.int_ctl | V_INTR_MASKING_MASK; nested_svm_vmrun() 2529 svm->vmcb->control.lbr_ctl = nested_vmcb->control.lbr_ctl; nested_svm_vmrun() 2530 svm->vmcb->control.int_vector = nested_vmcb->control.int_vector; nested_svm_vmrun() 2531 svm->vmcb->control.int_state = nested_vmcb->control.int_state; nested_svm_vmrun() 2532 svm->vmcb->control.tsc_offset += nested_vmcb->control.tsc_offset; nested_svm_vmrun() 2533 svm->vmcb->control.event_inj = nested_vmcb->control.event_inj; nested_svm_vmrun() 2534 svm->vmcb->control.event_inj_err = nested_vmcb->control.event_inj_err; nested_svm_vmrun() 2547 svm->nested.vmcb = vmcb_gpa; nested_svm_vmrun() 2551 mark_all_dirty(svm->vmcb); nested_svm_vmrun() 2556 static void nested_svm_vmloadsave(struct vmcb *from_vmcb, struct vmcb *to_vmcb) nested_svm_vmloadsave() 2574 struct vmcb *nested_vmcb; vmload_interception() 2580 nested_vmcb = nested_svm_map(svm, svm->vmcb->save.rax, &page); vmload_interception() 2587 nested_svm_vmloadsave(nested_vmcb, svm->vmcb); vmload_interception() 2595 struct vmcb *nested_vmcb; vmsave_interception() 2601 nested_vmcb = nested_svm_map(svm, svm->vmcb->save.rax, &page); vmsave_interception() 2608 nested_svm_vmloadsave(svm->vmcb, nested_vmcb); vmsave_interception() 2632 svm->vmcb->control.exit_code = SVM_EXIT_ERR; vmrun_interception() 2633 svm->vmcb->control.exit_code_hi = 0; vmrun_interception() 2634 svm->vmcb->control.exit_info_1 = 0; vmrun_interception() 2635 svm->vmcb->control.exit_info_2 = 0; vmrun_interception() 2668 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; clgi_interception() 2670 mark_dirty(svm->vmcb, VMCB_INTR); clgi_interception() 2679 trace_kvm_invlpga(svm->vmcb->save.rip, kvm_register_read(&svm->vcpu, VCPU_REGS_RCX), invlpga_interception() 2692 trace_kvm_skinit(svm->vmcb->save.rip, kvm_register_read(&svm->vcpu, VCPU_REGS_RAX)); skinit_interception() 2721 int int_type = svm->vmcb->control.exit_int_info & task_switch_interception() 2723 int int_vec = svm->vmcb->control.exit_int_info & SVM_EVTINJ_VEC_MASK; task_switch_interception() 2725 svm->vmcb->control.exit_int_info & SVM_EXITINTINFO_TYPE_MASK; task_switch_interception() 2727 svm->vmcb->control.exit_int_info & SVM_EXITINTINFO_VALID; task_switch_interception() 2731 tss_selector = (u16)svm->vmcb->control.exit_info_1; task_switch_interception() 2733 if (svm->vmcb->control.exit_info_2 & task_switch_interception() 2736 else if (svm->vmcb->control.exit_info_2 & task_switch_interception() 2750 if (svm->vmcb->control.exit_info_2 & task_switch_interception() 2754 (u32)svm->vmcb->control.exit_info_2; task_switch_interception() 2807 kvm_mmu_invlpg(&svm->vcpu, svm->vmcb->control.exit_info_1); invlpg_interception() 2847 svm->vmcb->control.exit_code = SVM_EXIT_CR0_SEL_WRITE; check_selective_cr0_intercepted() 2865 if (unlikely((svm->vmcb->control.exit_info_1 & CR_VALID) == 0)) cr_interception() 2868 reg = svm->vmcb->control.exit_info_1 & SVM_EXITINFO_REG_MASK; cr_interception() 2869 if (svm->vmcb->control.exit_code == SVM_EXIT_CR0_SEL_WRITE) cr_interception() 2872 cr = svm->vmcb->control.exit_code - SVM_EXIT_READ_CR0; cr_interception() 2948 reg = svm->vmcb->control.exit_info_1 & SVM_EXITINFO_REG_MASK; dr_interception() 2949 dr = svm->vmcb->control.exit_code - SVM_EXIT_READ_DR0; dr_interception() 2986 struct vmcb *vmcb = get_host_vmcb(to_svm(vcpu)); svm_read_l1_tsc() local 2987 return vmcb->control.tsc_offset + host_tsc; svm_read_l1_tsc() 2996 msr_info->data = svm->vmcb->control.tsc_offset + svm_get_msr() 3002 msr_info->data = svm->vmcb->save.star; svm_get_msr() 3006 msr_info->data = svm->vmcb->save.lstar; svm_get_msr() 3009 msr_info->data = svm->vmcb->save.cstar; svm_get_msr() 3012 msr_info->data = svm->vmcb->save.kernel_gs_base; svm_get_msr() 3015 msr_info->data = svm->vmcb->save.sfmask; svm_get_msr() 3019 msr_info->data = svm->vmcb->save.sysenter_cs; svm_get_msr() 3033 msr_info->data = svm->vmcb->save.dbgctl; svm_get_msr() 3036 msr_info->data = svm->vmcb->save.br_from; svm_get_msr() 3039 msr_info->data = svm->vmcb->save.br_to; svm_get_msr() 3042 msr_info->data = svm->vmcb->save.last_excp_from; svm_get_msr() 3045 msr_info->data = svm->vmcb->save.last_excp_to; svm_get_msr() 3121 svm->vmcb->save.star = data; svm_set_msr() 3125 svm->vmcb->save.lstar = data; svm_set_msr() 3128 svm->vmcb->save.cstar = data; svm_set_msr() 3131 svm->vmcb->save.kernel_gs_base = data; svm_set_msr() 3134 svm->vmcb->save.sfmask = data; svm_set_msr() 3138 svm->vmcb->save.sysenter_cs = data; svm_set_msr() 3142 svm->vmcb->save.sysenter_eip = data; svm_set_msr() 3146 svm->vmcb->save.sysenter_esp = data; svm_set_msr() 3157 svm->vmcb->save.dbgctl = data; svm_set_msr() 3158 mark_dirty(svm->vmcb, VMCB_LBR); svm_set_msr() 3201 if (svm->vmcb->control.exit_info_1) msr_interception() 3211 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; interrupt_window_interception() 3212 mark_dirty(svm->vmcb, VMCB_INTR); interrupt_window_interception() 3309 struct vmcb_control_area *control = &svm->vmcb->control; dump_vmcb() 3310 struct vmcb_save_area *save = &svm->vmcb->save; dump_vmcb() 3413 struct vmcb_control_area *control = &to_svm(vcpu)->vmcb->control; svm_get_exit_info() 3423 u32 exit_code = svm->vmcb->control.exit_code; handle_exit() 3428 vcpu->arch.cr0 = svm->vmcb->save.cr0; handle_exit() 3430 vcpu->arch.cr3 = svm->vmcb->save.cr3; handle_exit() 3442 trace_kvm_nested_vmexit(svm->vmcb->save.rip, exit_code, handle_exit() 3443 svm->vmcb->control.exit_info_1, handle_exit() 3444 svm->vmcb->control.exit_info_2, handle_exit() 3445 svm->vmcb->control.exit_int_info, handle_exit() 3446 svm->vmcb->control.exit_int_info_err, handle_exit() 3460 if (svm->vmcb->control.exit_code == SVM_EXIT_ERR) { handle_exit() 3463 = svm->vmcb->control.exit_code; handle_exit() 3469 if (is_external_interrupt(svm->vmcb->control.exit_int_info) && handle_exit() 3475 __func__, svm->vmcb->control.exit_int_info, handle_exit() 3512 svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_NMI; svm_inject_nmi() 3522 control = &svm->vmcb->control; svm_inject_irq() 3527 mark_dirty(svm->vmcb, VMCB_INTR); svm_inject_irq() 3539 svm->vmcb->control.event_inj = vcpu->arch.interrupt.nr | svm_set_irq() 3582 struct vmcb *vmcb = svm->vmcb; svm_nmi_allowed() local 3584 ret = !(vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) && svm_nmi_allowed() 3614 struct vmcb *vmcb = svm->vmcb; svm_interrupt_allowed() local 3618 (vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK)) svm_interrupt_allowed() 3658 svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF); enable_nmi_window() 3671 svm->vmcb->control.tlb_ctl = TLB_CONTROL_FLUSH_ASID; svm_flush_tlb() 3688 int cr8 = svm->vmcb->control.int_ctl & V_TPR_MASK; sync_cr8_to_lapic() 3702 svm->vmcb->control.int_ctl &= ~V_TPR_MASK; sync_lapic_to_cr8() 3703 svm->vmcb->control.int_ctl |= cr8 & V_TPR_MASK; sync_lapic_to_cr8() 3710 u32 exitintinfo = svm->vmcb->control.exit_int_info; svm_complete_interrupts() 3756 u32 err = svm->vmcb->control.exit_int_info_err; svm_complete_interrupts() 3773 struct vmcb_control_area *control = &svm->vmcb->control; svm_cancel_injection() 3785 svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX]; svm_vcpu_run() 3786 svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP]; svm_vcpu_run() 3787 svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP]; svm_vcpu_run() 3800 svm->vmcb->save.cr2 = vcpu->arch.cr2; svm_vcpu_run() 3827 "mov %c[vmcb](%[svm]), %%" _ASM_AX " \n\t" svm_vcpu_run() 3853 [vmcb]"i"(offsetof(struct vcpu_svm, vmcb_pa)), svm_vcpu_run() 3892 vcpu->arch.cr2 = svm->vmcb->save.cr2; svm_vcpu_run() 3893 vcpu->arch.regs[VCPU_REGS_RAX] = svm->vmcb->save.rax; svm_vcpu_run() 3894 vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp; svm_vcpu_run() 3895 vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; svm_vcpu_run() 3897 if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI)) svm_vcpu_run() 3904 if (unlikely(svm->vmcb->control.exit_code == SVM_EXIT_NMI)) svm_vcpu_run() 3911 svm->vmcb->control.tlb_ctl = TLB_CONTROL_DO_NOTHING; svm_vcpu_run() 3914 if (svm->vmcb->control.exit_code == SVM_EXIT_EXCP_BASE + PF_VECTOR) svm_vcpu_run() 3926 if (unlikely(svm->vmcb->control.exit_code == svm_vcpu_run() 3930 mark_all_clean(svm->vmcb); svm_vcpu_run() 3937 svm->vmcb->save.cr3 = root; svm_set_cr3() 3938 mark_dirty(svm->vmcb, VMCB_CR); svm_set_cr3() 3946 svm->vmcb->control.nested_cr3 = root; set_tdp_cr3() 3947 mark_dirty(svm->vmcb, VMCB_NPT); set_tdp_cr3() 3950 svm->vmcb->save.cr3 = kvm_read_cr3(vcpu); set_tdp_cr3() 3951 mark_dirty(svm->vmcb, VMCB_CR); set_tdp_cr3() 4141 struct vmcb *vmcb = svm->vmcb; svm_check_intercept() local 4194 vmcb->control.exit_info_1 = 1; svm_check_intercept() 4196 vmcb->control.exit_info_1 = 0; svm_check_intercept() 4232 vmcb->control.exit_info_1 = exit_info; svm_check_intercept() 4233 vmcb->control.exit_info_2 = info->next_rip; svm_check_intercept() 4243 vmcb->control.next_rip = info->next_rip; svm_check_intercept() 4244 vmcb->control.exit_code = icpt_info.exit_code; svm_check_intercept()
|