Lines Matching refs:vmcb

37 	if (svm->vmcb->control.exit_code != SVM_EXIT_NPF) {  in nested_svm_inject_npf_exit()
42 svm->vmcb->control.exit_code = SVM_EXIT_NPF; in nested_svm_inject_npf_exit()
43 svm->vmcb->control.exit_code_hi = 0; in nested_svm_inject_npf_exit()
44 svm->vmcb->control.exit_info_1 = (1ULL << 32); in nested_svm_inject_npf_exit()
45 svm->vmcb->control.exit_info_2 = fault->address; in nested_svm_inject_npf_exit()
48 svm->vmcb->control.exit_info_1 &= ~0xffffffffULL; in nested_svm_inject_npf_exit()
49 svm->vmcb->control.exit_info_1 |= fault->error_code; in nested_svm_inject_npf_exit()
78 struct vmcb *hsave = svm->nested.hsave; in nested_svm_init_mmu_context()
103 vmcb_mark_dirty(svm->vmcb, VMCB_INTERCEPTS); in recalc_intercepts()
108 c = &svm->vmcb->control; in recalc_intercepts()
194 svm->vmcb->control.msrpm_base_pa = __sme_set(__pa(svm->nested.msrpm)); in nested_svm_vmrun_msrpm()
228 static bool nested_vmcb_checks(struct vcpu_svm *svm, struct vmcb *vmcb12) in nested_vmcb_checks()
281 svm->nested.ctl.event_inj = svm->vmcb->control.event_inj; in sync_nested_vmcb_control()
282 svm->nested.ctl.event_inj_err = svm->vmcb->control.event_inj_err; in sync_nested_vmcb_control()
299 svm->nested.ctl.int_ctl |= svm->vmcb->control.int_ctl & mask; in sync_nested_vmcb_control()
307 struct vmcb *vmcb12) in nested_vmcb_save_pending_event()
375 static void nested_prepare_vmcb_save(struct vcpu_svm *svm, struct vmcb *vmcb12) in nested_prepare_vmcb_save()
378 svm->vmcb->save.es = vmcb12->save.es; in nested_prepare_vmcb_save()
379 svm->vmcb->save.cs = vmcb12->save.cs; in nested_prepare_vmcb_save()
380 svm->vmcb->save.ss = vmcb12->save.ss; in nested_prepare_vmcb_save()
381 svm->vmcb->save.ds = vmcb12->save.ds; in nested_prepare_vmcb_save()
382 svm->vmcb->save.gdtr = vmcb12->save.gdtr; in nested_prepare_vmcb_save()
383 svm->vmcb->save.idtr = vmcb12->save.idtr; in nested_prepare_vmcb_save()
388 svm->vmcb->save.cr2 = svm->vcpu.arch.cr2 = vmcb12->save.cr2; in nested_prepare_vmcb_save()
394 svm->vmcb->save.rax = vmcb12->save.rax; in nested_prepare_vmcb_save()
395 svm->vmcb->save.rsp = vmcb12->save.rsp; in nested_prepare_vmcb_save()
396 svm->vmcb->save.rip = vmcb12->save.rip; in nested_prepare_vmcb_save()
397 svm->vmcb->save.dr7 = vmcb12->save.dr7; in nested_prepare_vmcb_save()
399 svm->vmcb->save.cpl = vmcb12->save.cpl; in nested_prepare_vmcb_save()
409 svm->vmcb->control.tsc_offset = svm->vcpu.arch.tsc_offset = in nested_prepare_vmcb_control()
412 svm->vmcb->control.int_ctl = in nested_prepare_vmcb_control()
416 svm->vmcb->control.virt_ext = svm->nested.ctl.virt_ext; in nested_prepare_vmcb_control()
417 svm->vmcb->control.int_vector = svm->nested.ctl.int_vector; in nested_prepare_vmcb_control()
418 svm->vmcb->control.int_state = svm->nested.ctl.int_state; in nested_prepare_vmcb_control()
419 svm->vmcb->control.event_inj = svm->nested.ctl.event_inj; in nested_prepare_vmcb_control()
420 svm->vmcb->control.event_inj_err = svm->nested.ctl.event_inj_err; in nested_prepare_vmcb_control()
422 svm->vmcb->control.pause_filter_count = svm->nested.ctl.pause_filter_count; in nested_prepare_vmcb_control()
423 svm->vmcb->control.pause_filter_thresh = svm->nested.ctl.pause_filter_thresh; in nested_prepare_vmcb_control()
434 vmcb_mark_all_dirty(svm->vmcb); in nested_prepare_vmcb_control()
438 struct vmcb *vmcb12) in enter_svm_guest_mode()
460 struct vmcb *vmcb12; in nested_svm_vmrun()
461 struct vmcb *hsave = svm->nested.hsave; in nested_svm_vmrun()
462 struct vmcb *vmcb = svm->vmcb; in nested_svm_vmrun() local
471 vmcb12_gpa = svm->vmcb->save.rax; in nested_svm_vmrun()
495 trace_kvm_nested_vmrun(svm->vmcb->save.rip, vmcb12_gpa, in nested_svm_vmrun()
516 hsave->save.es = vmcb->save.es; in nested_svm_vmrun()
517 hsave->save.cs = vmcb->save.cs; in nested_svm_vmrun()
518 hsave->save.ss = vmcb->save.ss; in nested_svm_vmrun()
519 hsave->save.ds = vmcb->save.ds; in nested_svm_vmrun()
520 hsave->save.gdtr = vmcb->save.gdtr; in nested_svm_vmrun()
521 hsave->save.idtr = vmcb->save.idtr; in nested_svm_vmrun()
527 hsave->save.rsp = vmcb->save.rsp; in nested_svm_vmrun()
528 hsave->save.rax = vmcb->save.rax; in nested_svm_vmrun()
530 hsave->save.cr3 = vmcb->save.cr3; in nested_svm_vmrun()
534 copy_vmcb_control_area(&hsave->control, &vmcb->control); in nested_svm_vmrun()
547 svm->vmcb->control.exit_code = SVM_EXIT_ERR; in nested_svm_vmrun()
548 svm->vmcb->control.exit_code_hi = 0; in nested_svm_vmrun()
549 svm->vmcb->control.exit_info_1 = 0; in nested_svm_vmrun()
550 svm->vmcb->control.exit_info_2 = 0; in nested_svm_vmrun()
560 void nested_svm_vmloadsave(struct vmcb *from_vmcb, struct vmcb *to_vmcb) in nested_svm_vmloadsave()
579 struct vmcb *vmcb12; in nested_svm_vmexit()
580 struct vmcb *hsave = svm->nested.hsave; in nested_svm_vmexit()
581 struct vmcb *vmcb = svm->vmcb; in nested_svm_vmexit() local
603 vmcb12->save.es = vmcb->save.es; in nested_svm_vmexit()
604 vmcb12->save.cs = vmcb->save.cs; in nested_svm_vmexit()
605 vmcb12->save.ss = vmcb->save.ss; in nested_svm_vmexit()
606 vmcb12->save.ds = vmcb->save.ds; in nested_svm_vmexit()
607 vmcb12->save.gdtr = vmcb->save.gdtr; in nested_svm_vmexit()
608 vmcb12->save.idtr = vmcb->save.idtr; in nested_svm_vmexit()
612 vmcb12->save.cr2 = vmcb->save.cr2; in nested_svm_vmexit()
618 vmcb12->save.dr7 = vmcb->save.dr7; in nested_svm_vmexit()
620 vmcb12->save.cpl = vmcb->save.cpl; in nested_svm_vmexit()
622 vmcb12->control.int_state = vmcb->control.int_state; in nested_svm_vmexit()
623 vmcb12->control.exit_code = vmcb->control.exit_code; in nested_svm_vmexit()
624 vmcb12->control.exit_code_hi = vmcb->control.exit_code_hi; in nested_svm_vmexit()
625 vmcb12->control.exit_info_1 = vmcb->control.exit_info_1; in nested_svm_vmexit()
626 vmcb12->control.exit_info_2 = vmcb->control.exit_info_2; in nested_svm_vmexit()
632 vmcb12->control.next_rip = vmcb->control.next_rip; in nested_svm_vmexit()
640 svm->vmcb->control.pause_filter_count; in nested_svm_vmexit()
642 svm->vmcb->control.pause_filter_thresh; in nested_svm_vmexit()
645 copy_vmcb_control_area(&vmcb->control, &hsave->control); in nested_svm_vmexit()
650 svm->vmcb->control.tsc_offset = svm->vcpu.arch.tsc_offset = in nested_svm_vmexit()
656 svm->vmcb->save.es = hsave->save.es; in nested_svm_vmexit()
657 svm->vmcb->save.cs = hsave->save.cs; in nested_svm_vmexit()
658 svm->vmcb->save.ss = hsave->save.ss; in nested_svm_vmexit()
659 svm->vmcb->save.ds = hsave->save.ds; in nested_svm_vmexit()
660 svm->vmcb->save.gdtr = hsave->save.gdtr; in nested_svm_vmexit()
661 svm->vmcb->save.idtr = hsave->save.idtr; in nested_svm_vmexit()
669 svm->vmcb->save.dr7 = 0; in nested_svm_vmexit()
670 svm->vmcb->save.cpl = 0; in nested_svm_vmexit()
671 svm->vmcb->control.exit_int_info = 0; in nested_svm_vmexit()
673 vmcb_mark_all_dirty(svm->vmcb); in nested_svm_vmexit()
691 svm->vmcb->save.cr3 = hsave->save.cr3; in nested_svm_vmexit()
749 struct vmcb *hsave = svm->nested.hsave; in svm_leave_nested()
750 struct vmcb *vmcb = svm->vmcb; in svm_leave_nested() local
754 copy_vmcb_control_area(&vmcb->control, &hsave->control); in svm_leave_nested()
771 write = svm->vmcb->control.exit_info_1 & 1; in nested_svm_exit_handled_msr()
796 port = svm->vmcb->control.exit_info_1 >> 16; in nested_svm_intercept_ioio()
797 size = (svm->vmcb->control.exit_info_1 & SVM_IOIO_SIZE_MASK) >> in nested_svm_intercept_ioio()
813 u32 exit_code = svm->vmcb->control.exit_code; in nested_svm_intercept()
875 if (svm->vmcb->save.cpl) { in nested_svm_check_permissions()
894 svm->vmcb->control.exit_code = SVM_EXIT_EXCP_BASE + nr; in nested_svm_inject_exception_vmexit()
895 svm->vmcb->control.exit_code_hi = 0; in nested_svm_inject_exception_vmexit()
898 svm->vmcb->control.exit_info_1 = svm->vcpu.arch.exception.error_code; in nested_svm_inject_exception_vmexit()
906 svm->vmcb->control.exit_info_2 = svm->vcpu.arch.apf.nested_apf_token; in nested_svm_inject_exception_vmexit()
908 svm->vmcb->control.exit_info_2 = svm->vcpu.arch.exception.payload; in nested_svm_inject_exception_vmexit()
910 svm->vmcb->control.exit_info_2 = svm->vcpu.arch.cr2; in nested_svm_inject_exception_vmexit()
926 svm->vmcb->control.exit_code = SVM_EXIT_SMI; in nested_svm_smi()
927 svm->vmcb->control.exit_info_1 = 0; in nested_svm_smi()
928 svm->vmcb->control.exit_info_2 = 0; in nested_svm_smi()
935 svm->vmcb->control.exit_code = SVM_EXIT_NMI; in nested_svm_nmi()
936 svm->vmcb->control.exit_info_1 = 0; in nested_svm_nmi()
937 svm->vmcb->control.exit_info_2 = 0; in nested_svm_nmi()
944 trace_kvm_nested_intr_vmexit(svm->vmcb->save.rip); in nested_svm_intr()
946 svm->vmcb->control.exit_code = SVM_EXIT_INTR; in nested_svm_intr()
947 svm->vmcb->control.exit_info_1 = 0; in nested_svm_intr()
948 svm->vmcb->control.exit_info_2 = 0; in nested_svm_intr()
960 svm->vmcb->control.exit_code = SVM_EXIT_INIT; in nested_svm_init()
961 svm->vmcb->control.exit_info_1 = 0; in nested_svm_init()
962 svm->vmcb->control.exit_info_2 = 0; in nested_svm_init()
1026 u32 exit_code = svm->vmcb->control.exit_code; in nested_svm_exit_special()
1062 struct vmcb __user *user_vmcb = (struct vmcb __user *) in svm_get_nested_state()
1114 struct vmcb *hsave = svm->nested.hsave; in svm_set_nested_state()
1115 struct vmcb __user *user_vmcb = (struct vmcb __user *) in svm_set_nested_state()
1196 copy_vmcb_control_area(&hsave->control, &svm->vmcb->control); in svm_set_nested_state()