Lines Matching refs:arch
115 return !!(vcpu->arch.pending_exceptions); in kvm_arch_vcpu_runnable()
153 kvm->arch.gpa_mm.pgd = kvm_pgd_alloc(); in kvm_arch_init_vm()
154 if (!kvm->arch.gpa_mm.pgd) in kvm_arch_init_vm()
168 pgd_free(NULL, kvm->arch.gpa_mm.pgd); in kvm_mips_free_gpa_pt()
265 vcpu = container_of(timer, struct kvm_vcpu, arch.comparecount_timer); in kvm_mips_comparecount_wakeup()
269 vcpu->arch.wait = 0; in kvm_mips_comparecount_wakeup()
293 hrtimer_init(&vcpu->arch.comparecount_timer, CLOCK_MONOTONIC, in kvm_arch_vcpu_create()
295 vcpu->arch.comparecount_timer.function = kvm_mips_comparecount_wakeup; in kvm_arch_vcpu_create()
328 vcpu->arch.guest_ebase = gebase; in kvm_arch_vcpu_create()
355 vcpu->arch.vcpu_run = p; in kvm_arch_vcpu_create()
362 dump_handler("kvm_vcpu_run", vcpu->arch.vcpu_run, p); in kvm_arch_vcpu_create()
365 dump_handler("kvm_exit", gebase + 0x2000, vcpu->arch.vcpu_run); in kvm_arch_vcpu_create()
372 vcpu->arch.last_sched_cpu = -1; in kvm_arch_vcpu_create()
373 vcpu->arch.last_exec_cpu = -1; in kvm_arch_vcpu_create()
391 hrtimer_cancel(&vcpu->arch.comparecount_timer); in kvm_arch_vcpu_destroy()
396 kfree(vcpu->arch.guest_ebase); in kvm_arch_vcpu_destroy()
511 dvcpu->arch.wait = 0; in kvm_vcpu_ioctl_interrupt()
586 if (kvm_mips_guest_can_have_fpu(&vcpu->arch)) { in kvm_mips_num_regs()
592 if (kvm_mips_guest_can_have_msa(&vcpu->arch)) in kvm_mips_num_regs()
609 if (kvm_mips_guest_can_have_fpu(&vcpu->arch)) { in kvm_mips_copy_reg_indices()
632 if (kvm_mips_guest_can_have_msa(&vcpu->arch)) { in kvm_mips_copy_reg_indices()
652 struct mips_coproc *cop0 = &vcpu->arch.cop0; in kvm_mips_get_reg()
653 struct mips_fpu_struct *fpu = &vcpu->arch.fpu; in kvm_mips_get_reg()
662 v = (long)vcpu->arch.gprs[reg->id - KVM_REG_MIPS_R0]; in kvm_mips_get_reg()
666 v = (long)vcpu->arch.hi; in kvm_mips_get_reg()
669 v = (long)vcpu->arch.lo; in kvm_mips_get_reg()
673 v = (long)vcpu->arch.pc; in kvm_mips_get_reg()
678 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_get_reg()
688 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_get_reg()
697 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_get_reg()
702 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_get_reg()
709 if (!kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_get_reg()
726 if (!kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_get_reg()
731 if (!kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_get_reg()
764 struct mips_coproc *cop0 = &vcpu->arch.cop0; in kvm_mips_set_reg()
765 struct mips_fpu_struct *fpu = &vcpu->arch.fpu; in kvm_mips_set_reg()
796 vcpu->arch.gprs[reg->id - KVM_REG_MIPS_R0] = v; in kvm_mips_set_reg()
800 vcpu->arch.hi = v; in kvm_mips_set_reg()
803 vcpu->arch.lo = v; in kvm_mips_set_reg()
807 vcpu->arch.pc = v; in kvm_mips_set_reg()
812 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_set_reg()
822 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_set_reg()
831 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_set_reg()
836 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_set_reg()
843 if (!kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_set_reg()
857 if (!kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_set_reg()
862 if (!kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_set_reg()
888 vcpu->arch.fpu_enabled = true; in kvm_vcpu_ioctl_enable_cap()
891 vcpu->arch.msa_enabled = true; in kvm_vcpu_ioctl_enable_cap()
1083 kvm_read_c0_guest_cause(&vcpu->arch.cop0) & C_TI; in kvm_cpu_has_pending_timer()
1095 kvm_debug("\tpc = 0x%08lx\n", vcpu->arch.pc); in kvm_arch_vcpu_dump_regs()
1096 kvm_debug("\texceptions: %08lx\n", vcpu->arch.pending_exceptions); in kvm_arch_vcpu_dump_regs()
1100 vcpu->arch.gprs[i], in kvm_arch_vcpu_dump_regs()
1101 vcpu->arch.gprs[i + 1], in kvm_arch_vcpu_dump_regs()
1102 vcpu->arch.gprs[i + 2], vcpu->arch.gprs[i + 3]); in kvm_arch_vcpu_dump_regs()
1104 kvm_debug("\thi: 0x%08lx\n", vcpu->arch.hi); in kvm_arch_vcpu_dump_regs()
1105 kvm_debug("\tlo: 0x%08lx\n", vcpu->arch.lo); in kvm_arch_vcpu_dump_regs()
1107 cop0 = &vcpu->arch.cop0; in kvm_arch_vcpu_dump_regs()
1123 for (i = 1; i < ARRAY_SIZE(vcpu->arch.gprs); i++) in kvm_arch_vcpu_ioctl_set_regs()
1124 vcpu->arch.gprs[i] = regs->gpr[i]; in kvm_arch_vcpu_ioctl_set_regs()
1125 vcpu->arch.gprs[0] = 0; /* zero is special, and cannot be set. */ in kvm_arch_vcpu_ioctl_set_regs()
1126 vcpu->arch.hi = regs->hi; in kvm_arch_vcpu_ioctl_set_regs()
1127 vcpu->arch.lo = regs->lo; in kvm_arch_vcpu_ioctl_set_regs()
1128 vcpu->arch.pc = regs->pc; in kvm_arch_vcpu_ioctl_set_regs()
1140 for (i = 0; i < ARRAY_SIZE(vcpu->arch.gprs); i++) in kvm_arch_vcpu_ioctl_get_regs()
1141 regs->gpr[i] = vcpu->arch.gprs[i]; in kvm_arch_vcpu_ioctl_get_regs()
1143 regs->hi = vcpu->arch.hi; in kvm_arch_vcpu_ioctl_get_regs()
1144 regs->lo = vcpu->arch.lo; in kvm_arch_vcpu_ioctl_get_regs()
1145 regs->pc = vcpu->arch.pc; in kvm_arch_vcpu_ioctl_get_regs()
1174 u32 cause = vcpu->arch.host_cp0_cause; in __kvm_mips_handle_exit()
1176 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in __kvm_mips_handle_exit()
1177 unsigned long badvaddr = vcpu->arch.host_cp0_badvaddr; in __kvm_mips_handle_exit()
1229 cause, kvm_read_c0_guest_status(&vcpu->arch.cop0), opc, in __kvm_mips_handle_exit()
1301 kvm_read_c0_guest_status(&vcpu->arch.cop0)); in __kvm_mips_handle_exit()
1349 if (kvm_mips_guest_has_fpu(&vcpu->arch) && in __kvm_mips_handle_exit()
1351 __kvm_restore_fcsr(&vcpu->arch); in __kvm_mips_handle_exit()
1353 if (kvm_mips_guest_has_msa(&vcpu->arch) && in __kvm_mips_handle_exit()
1355 __kvm_restore_msacsr(&vcpu->arch); in __kvm_mips_handle_exit()
1374 struct mips_coproc *cop0 = &vcpu->arch.cop0; in kvm_own_fpu()
1388 vcpu->arch.aux_inuse & KVM_MIPS_AUX_MSA) in kvm_own_fpu()
1403 if (!(vcpu->arch.aux_inuse & KVM_MIPS_AUX_FPU)) { in kvm_own_fpu()
1404 __kvm_restore_fpu(&vcpu->arch); in kvm_own_fpu()
1405 vcpu->arch.aux_inuse |= KVM_MIPS_AUX_FPU; in kvm_own_fpu()
1418 struct mips_coproc *cop0 = &vcpu->arch.cop0; in kvm_own_msa()
1427 if (kvm_mips_guest_has_fpu(&vcpu->arch)) { in kvm_own_msa()
1435 (vcpu->arch.aux_inuse & (KVM_MIPS_AUX_FPU | in kvm_own_msa()
1450 switch (vcpu->arch.aux_inuse & (KVM_MIPS_AUX_FPU | KVM_MIPS_AUX_MSA)) { in kvm_own_msa()
1455 __kvm_restore_msa_upper(&vcpu->arch); in kvm_own_msa()
1456 vcpu->arch.aux_inuse |= KVM_MIPS_AUX_MSA; in kvm_own_msa()
1461 __kvm_restore_msa(&vcpu->arch); in kvm_own_msa()
1462 vcpu->arch.aux_inuse |= KVM_MIPS_AUX_MSA; in kvm_own_msa()
1463 if (kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_own_msa()
1464 vcpu->arch.aux_inuse |= KVM_MIPS_AUX_FPU; in kvm_own_msa()
1481 if (cpu_has_msa && vcpu->arch.aux_inuse & KVM_MIPS_AUX_MSA) { in kvm_drop_fpu()
1484 vcpu->arch.aux_inuse &= ~KVM_MIPS_AUX_MSA; in kvm_drop_fpu()
1486 if (vcpu->arch.aux_inuse & KVM_MIPS_AUX_FPU) { in kvm_drop_fpu()
1489 vcpu->arch.aux_inuse &= ~KVM_MIPS_AUX_FPU; in kvm_drop_fpu()
1505 if (cpu_has_msa && vcpu->arch.aux_inuse & KVM_MIPS_AUX_MSA) { in kvm_lose_fpu()
1506 __kvm_save_msa(&vcpu->arch); in kvm_lose_fpu()
1511 if (vcpu->arch.aux_inuse & KVM_MIPS_AUX_FPU) { in kvm_lose_fpu()
1515 vcpu->arch.aux_inuse &= ~(KVM_MIPS_AUX_FPU | KVM_MIPS_AUX_MSA); in kvm_lose_fpu()
1516 } else if (vcpu->arch.aux_inuse & KVM_MIPS_AUX_FPU) { in kvm_lose_fpu()
1517 __kvm_save_fpu(&vcpu->arch); in kvm_lose_fpu()
1518 vcpu->arch.aux_inuse &= ~KVM_MIPS_AUX_FPU; in kvm_lose_fpu()