Lines Matching refs:vcpu

62 static int kvm_mips_reset_vcpu(struct kvm_vcpu *vcpu)  in kvm_mips_reset_vcpu()  argument
67 vcpu->arch.guest_kernel_asid[i] = 0; in kvm_mips_reset_vcpu()
68 vcpu->arch.guest_user_asid[i] = 0; in kvm_mips_reset_vcpu()
78 int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) in kvm_arch_vcpu_runnable() argument
80 return !!(vcpu->arch.pending_exceptions); in kvm_arch_vcpu_runnable()
83 int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu) in kvm_arch_vcpu_should_kick() argument
143 struct kvm_vcpu *vcpu; in kvm_mips_free_vcpus() local
152 kvm_for_each_vcpu(i, vcpu, kvm) { in kvm_mips_free_vcpus()
153 kvm_arch_vcpu_free(vcpu); in kvm_mips_free_vcpus()
250 struct kvm_vcpu *vcpu = kzalloc(sizeof(struct kvm_vcpu), GFP_KERNEL); in kvm_arch_vcpu_create() local
252 if (!vcpu) { in kvm_arch_vcpu_create()
257 err = kvm_vcpu_init(vcpu, kvm, id); in kvm_arch_vcpu_create()
262 kvm_debug("kvm @ %p: create cpu %d at %p\n", kvm, id, vcpu); in kvm_arch_vcpu_create()
274 vcpu->arch.host_ebase = (void *)read_c0_ebase(); in kvm_arch_vcpu_create()
286 vcpu->arch.guest_ebase = gebase; in kvm_arch_vcpu_create()
323 vcpu->arch.kseg0_commpage = kzalloc(PAGE_SIZE << 1, GFP_KERNEL); in kvm_arch_vcpu_create()
325 if (!vcpu->arch.kseg0_commpage) { in kvm_arch_vcpu_create()
330 kvm_debug("Allocated COMM page @ %p\n", vcpu->arch.kseg0_commpage); in kvm_arch_vcpu_create()
331 kvm_mips_commpage_init(vcpu); in kvm_arch_vcpu_create()
334 vcpu->arch.last_sched_cpu = -1; in kvm_arch_vcpu_create()
337 kvm_mips_init_count(vcpu); in kvm_arch_vcpu_create()
339 return vcpu; in kvm_arch_vcpu_create()
345 kvm_vcpu_uninit(vcpu); in kvm_arch_vcpu_create()
348 kfree(vcpu); in kvm_arch_vcpu_create()
354 void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu) in kvm_arch_vcpu_free() argument
356 hrtimer_cancel(&vcpu->arch.comparecount_timer); in kvm_arch_vcpu_free()
358 kvm_vcpu_uninit(vcpu); in kvm_arch_vcpu_free()
360 kvm_mips_dump_stats(vcpu); in kvm_arch_vcpu_free()
362 kfree(vcpu->arch.guest_ebase); in kvm_arch_vcpu_free()
363 kfree(vcpu->arch.kseg0_commpage); in kvm_arch_vcpu_free()
364 kfree(vcpu); in kvm_arch_vcpu_free()
367 void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) in kvm_arch_vcpu_destroy() argument
369 kvm_arch_vcpu_free(vcpu); in kvm_arch_vcpu_destroy()
372 int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, in kvm_arch_vcpu_ioctl_set_guest_debug() argument
378 int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) in kvm_arch_vcpu_ioctl_run() argument
383 if (vcpu->sigset_active) in kvm_arch_vcpu_ioctl_run()
384 sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved); in kvm_arch_vcpu_ioctl_run()
386 if (vcpu->mmio_needed) { in kvm_arch_vcpu_ioctl_run()
387 if (!vcpu->mmio_is_write) in kvm_arch_vcpu_ioctl_run()
388 kvm_mips_complete_mmio_load(vcpu, run); in kvm_arch_vcpu_ioctl_run()
389 vcpu->mmio_needed = 0; in kvm_arch_vcpu_ioctl_run()
396 kvm_mips_deliver_interrupts(vcpu, in kvm_arch_vcpu_ioctl_run()
397 kvm_read_c0_guest_cause(vcpu->arch.cop0)); in kvm_arch_vcpu_ioctl_run()
404 r = __kvm_mips_vcpu_run(run, vcpu); in kvm_arch_vcpu_ioctl_run()
412 if (vcpu->sigset_active) in kvm_arch_vcpu_ioctl_run()
418 int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, in kvm_vcpu_ioctl_interrupt() argument
429 dvcpu = vcpu; in kvm_vcpu_ioctl_interrupt()
431 dvcpu = vcpu->kvm->vcpus[irq->cpu]; in kvm_vcpu_ioctl_interrupt()
452 int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu, in kvm_arch_vcpu_ioctl_get_mpstate() argument
458 int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, in kvm_arch_vcpu_ioctl_set_mpstate() argument
530 static int kvm_mips_get_reg(struct kvm_vcpu *vcpu, in kvm_mips_get_reg() argument
533 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_get_reg()
534 struct mips_fpu_struct *fpu = &vcpu->arch.fpu; in kvm_mips_get_reg()
543 v = (long)vcpu->arch.gprs[reg->id - KVM_REG_MIPS_R0]; in kvm_mips_get_reg()
546 v = (long)vcpu->arch.hi; in kvm_mips_get_reg()
549 v = (long)vcpu->arch.lo; in kvm_mips_get_reg()
552 v = (long)vcpu->arch.pc; in kvm_mips_get_reg()
557 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_get_reg()
567 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_get_reg()
576 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_get_reg()
581 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_get_reg()
588 if (!kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_get_reg()
605 if (!kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_get_reg()
610 if (!kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_get_reg()
684 ret = kvm_mips_callbacks->get_one_reg(vcpu, reg, &v); in kvm_mips_get_reg()
709 static int kvm_mips_set_reg(struct kvm_vcpu *vcpu, in kvm_mips_set_reg() argument
712 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_set_reg()
713 struct mips_fpu_struct *fpu = &vcpu->arch.fpu; in kvm_mips_set_reg()
744 vcpu->arch.gprs[reg->id - KVM_REG_MIPS_R0] = v; in kvm_mips_set_reg()
747 vcpu->arch.hi = v; in kvm_mips_set_reg()
750 vcpu->arch.lo = v; in kvm_mips_set_reg()
753 vcpu->arch.pc = v; in kvm_mips_set_reg()
758 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_set_reg()
768 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_set_reg()
777 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_set_reg()
782 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_set_reg()
789 if (!kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_set_reg()
803 if (!kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_set_reg()
808 if (!kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_set_reg()
863 return kvm_mips_callbacks->set_one_reg(vcpu, reg, v); in kvm_mips_set_reg()
870 static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu, in kvm_vcpu_ioctl_enable_cap() argument
875 if (!kvm_vm_ioctl_check_extension(vcpu->kvm, cap->cap)) in kvm_vcpu_ioctl_enable_cap()
884 vcpu->arch.fpu_enabled = true; in kvm_vcpu_ioctl_enable_cap()
887 vcpu->arch.msa_enabled = true; in kvm_vcpu_ioctl_enable_cap()
900 struct kvm_vcpu *vcpu = filp->private_data; in kvm_arch_vcpu_ioctl() local
912 return kvm_mips_set_reg(vcpu, &reg); in kvm_arch_vcpu_ioctl()
914 return kvm_mips_get_reg(vcpu, &reg); in kvm_arch_vcpu_ioctl()
938 r = kvm_mips_reset_vcpu(vcpu); in kvm_arch_vcpu_ioctl()
948 kvm_debug("[%d] %s: irq: %d\n", vcpu->vcpu_id, __func__, in kvm_arch_vcpu_ioctl()
951 r = kvm_vcpu_ioctl_interrupt(vcpu, &irq); in kvm_arch_vcpu_ioctl()
960 r = kvm_vcpu_ioctl_enable_cap(vcpu, &cap); in kvm_arch_vcpu_ioctl()
1034 int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu, in kvm_arch_vcpu_ioctl_get_sregs() argument
1040 int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, in kvm_arch_vcpu_ioctl_set_sregs() argument
1046 void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu) in kvm_arch_vcpu_postcreate() argument
1050 int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) in kvm_arch_vcpu_ioctl_get_fpu() argument
1055 int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) in kvm_arch_vcpu_ioctl_set_fpu() argument
1060 int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf) in kvm_arch_vcpu_fault() argument
1102 int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu) in kvm_cpu_has_pending_timer() argument
1104 return kvm_mips_pending_timer(vcpu); in kvm_cpu_has_pending_timer()
1107 int kvm_arch_vcpu_dump_regs(struct kvm_vcpu *vcpu) in kvm_arch_vcpu_dump_regs() argument
1112 if (!vcpu) in kvm_arch_vcpu_dump_regs()
1116 kvm_debug("\tpc = 0x%08lx\n", vcpu->arch.pc); in kvm_arch_vcpu_dump_regs()
1117 kvm_debug("\texceptions: %08lx\n", vcpu->arch.pending_exceptions); in kvm_arch_vcpu_dump_regs()
1121 vcpu->arch.gprs[i], in kvm_arch_vcpu_dump_regs()
1122 vcpu->arch.gprs[i + 1], in kvm_arch_vcpu_dump_regs()
1123 vcpu->arch.gprs[i + 2], vcpu->arch.gprs[i + 3]); in kvm_arch_vcpu_dump_regs()
1125 kvm_debug("\thi: 0x%08lx\n", vcpu->arch.hi); in kvm_arch_vcpu_dump_regs()
1126 kvm_debug("\tlo: 0x%08lx\n", vcpu->arch.lo); in kvm_arch_vcpu_dump_regs()
1128 cop0 = vcpu->arch.cop0; in kvm_arch_vcpu_dump_regs()
1138 int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) in kvm_arch_vcpu_ioctl_set_regs() argument
1142 for (i = 1; i < ARRAY_SIZE(vcpu->arch.gprs); i++) in kvm_arch_vcpu_ioctl_set_regs()
1143 vcpu->arch.gprs[i] = regs->gpr[i]; in kvm_arch_vcpu_ioctl_set_regs()
1144 vcpu->arch.gprs[0] = 0; /* zero is special, and cannot be set. */ in kvm_arch_vcpu_ioctl_set_regs()
1145 vcpu->arch.hi = regs->hi; in kvm_arch_vcpu_ioctl_set_regs()
1146 vcpu->arch.lo = regs->lo; in kvm_arch_vcpu_ioctl_set_regs()
1147 vcpu->arch.pc = regs->pc; in kvm_arch_vcpu_ioctl_set_regs()
1152 int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) in kvm_arch_vcpu_ioctl_get_regs() argument
1156 for (i = 0; i < ARRAY_SIZE(vcpu->arch.gprs); i++) in kvm_arch_vcpu_ioctl_get_regs()
1157 regs->gpr[i] = vcpu->arch.gprs[i]; in kvm_arch_vcpu_ioctl_get_regs()
1159 regs->hi = vcpu->arch.hi; in kvm_arch_vcpu_ioctl_get_regs()
1160 regs->lo = vcpu->arch.lo; in kvm_arch_vcpu_ioctl_get_regs()
1161 regs->pc = vcpu->arch.pc; in kvm_arch_vcpu_ioctl_get_regs()
1168 struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data; in kvm_mips_comparecount_func() local
1170 kvm_mips_callbacks->queue_timer_int(vcpu); in kvm_mips_comparecount_func()
1172 vcpu->arch.wait = 0; in kvm_mips_comparecount_func()
1173 if (waitqueue_active(&vcpu->wq)) in kvm_mips_comparecount_func()
1174 wake_up_interruptible(&vcpu->wq); in kvm_mips_comparecount_func()
1180 struct kvm_vcpu *vcpu; in kvm_mips_comparecount_wakeup() local
1182 vcpu = container_of(timer, struct kvm_vcpu, arch.comparecount_timer); in kvm_mips_comparecount_wakeup()
1183 kvm_mips_comparecount_func((unsigned long) vcpu); in kvm_mips_comparecount_wakeup()
1184 return kvm_mips_count_timeout(vcpu); in kvm_mips_comparecount_wakeup()
1187 int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) in kvm_arch_vcpu_init() argument
1189 kvm_mips_callbacks->vcpu_init(vcpu); in kvm_arch_vcpu_init()
1190 hrtimer_init(&vcpu->arch.comparecount_timer, CLOCK_MONOTONIC, in kvm_arch_vcpu_init()
1192 vcpu->arch.comparecount_timer.function = kvm_mips_comparecount_wakeup; in kvm_arch_vcpu_init()
1196 int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu, in kvm_arch_vcpu_ioctl_translate() argument
1203 int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) in kvm_arch_vcpu_setup() argument
1205 return kvm_mips_callbacks->vcpu_setup(vcpu); in kvm_arch_vcpu_setup()
1222 int kvm_mips_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu) in kvm_mips_handle_exit() argument
1224 uint32_t cause = vcpu->arch.host_cp0_cause; in kvm_mips_handle_exit()
1226 uint32_t __user *opc = (uint32_t __user *) vcpu->arch.pc; in kvm_mips_handle_exit()
1227 unsigned long badvaddr = vcpu->arch.host_cp0_badvaddr; in kvm_mips_handle_exit()
1247 cause, opc, run, vcpu); in kvm_mips_handle_exit()
1253 er = kvm_mips_check_privilege(cause, opc, run, vcpu); in kvm_mips_handle_exit()
1264 kvm_debug("[%d]T_INT @ %p\n", vcpu->vcpu_id, opc); in kvm_mips_handle_exit()
1266 ++vcpu->stat.int_exits; in kvm_mips_handle_exit()
1267 trace_kvm_exit(vcpu, INT_EXITS); in kvm_mips_handle_exit()
1278 ++vcpu->stat.cop_unusable_exits; in kvm_mips_handle_exit()
1279 trace_kvm_exit(vcpu, COP_UNUSABLE_EXITS); in kvm_mips_handle_exit()
1280 ret = kvm_mips_callbacks->handle_cop_unusable(vcpu); in kvm_mips_handle_exit()
1287 ++vcpu->stat.tlbmod_exits; in kvm_mips_handle_exit()
1288 trace_kvm_exit(vcpu, TLBMOD_EXITS); in kvm_mips_handle_exit()
1289 ret = kvm_mips_callbacks->handle_tlb_mod(vcpu); in kvm_mips_handle_exit()
1294 cause, kvm_read_c0_guest_status(vcpu->arch.cop0), opc, in kvm_mips_handle_exit()
1297 ++vcpu->stat.tlbmiss_st_exits; in kvm_mips_handle_exit()
1298 trace_kvm_exit(vcpu, TLBMISS_ST_EXITS); in kvm_mips_handle_exit()
1299 ret = kvm_mips_callbacks->handle_tlb_st_miss(vcpu); in kvm_mips_handle_exit()
1306 ++vcpu->stat.tlbmiss_ld_exits; in kvm_mips_handle_exit()
1307 trace_kvm_exit(vcpu, TLBMISS_LD_EXITS); in kvm_mips_handle_exit()
1308 ret = kvm_mips_callbacks->handle_tlb_ld_miss(vcpu); in kvm_mips_handle_exit()
1312 ++vcpu->stat.addrerr_st_exits; in kvm_mips_handle_exit()
1313 trace_kvm_exit(vcpu, ADDRERR_ST_EXITS); in kvm_mips_handle_exit()
1314 ret = kvm_mips_callbacks->handle_addr_err_st(vcpu); in kvm_mips_handle_exit()
1318 ++vcpu->stat.addrerr_ld_exits; in kvm_mips_handle_exit()
1319 trace_kvm_exit(vcpu, ADDRERR_LD_EXITS); in kvm_mips_handle_exit()
1320 ret = kvm_mips_callbacks->handle_addr_err_ld(vcpu); in kvm_mips_handle_exit()
1324 ++vcpu->stat.syscall_exits; in kvm_mips_handle_exit()
1325 trace_kvm_exit(vcpu, SYSCALL_EXITS); in kvm_mips_handle_exit()
1326 ret = kvm_mips_callbacks->handle_syscall(vcpu); in kvm_mips_handle_exit()
1330 ++vcpu->stat.resvd_inst_exits; in kvm_mips_handle_exit()
1331 trace_kvm_exit(vcpu, RESVD_INST_EXITS); in kvm_mips_handle_exit()
1332 ret = kvm_mips_callbacks->handle_res_inst(vcpu); in kvm_mips_handle_exit()
1336 ++vcpu->stat.break_inst_exits; in kvm_mips_handle_exit()
1337 trace_kvm_exit(vcpu, BREAK_INST_EXITS); in kvm_mips_handle_exit()
1338 ret = kvm_mips_callbacks->handle_break(vcpu); in kvm_mips_handle_exit()
1342 ++vcpu->stat.trap_inst_exits; in kvm_mips_handle_exit()
1343 trace_kvm_exit(vcpu, TRAP_INST_EXITS); in kvm_mips_handle_exit()
1344 ret = kvm_mips_callbacks->handle_trap(vcpu); in kvm_mips_handle_exit()
1348 ++vcpu->stat.msa_fpe_exits; in kvm_mips_handle_exit()
1349 trace_kvm_exit(vcpu, MSA_FPE_EXITS); in kvm_mips_handle_exit()
1350 ret = kvm_mips_callbacks->handle_msa_fpe(vcpu); in kvm_mips_handle_exit()
1354 ++vcpu->stat.fpe_exits; in kvm_mips_handle_exit()
1355 trace_kvm_exit(vcpu, FPE_EXITS); in kvm_mips_handle_exit()
1356 ret = kvm_mips_callbacks->handle_fpe(vcpu); in kvm_mips_handle_exit()
1360 ++vcpu->stat.msa_disabled_exits; in kvm_mips_handle_exit()
1361 trace_kvm_exit(vcpu, MSA_DISABLED_EXITS); in kvm_mips_handle_exit()
1362 ret = kvm_mips_callbacks->handle_msa_disabled(vcpu); in kvm_mips_handle_exit()
1367 exccode, opc, kvm_get_inst(opc, vcpu), badvaddr, in kvm_mips_handle_exit()
1368 kvm_read_c0_guest_status(vcpu->arch.cop0)); in kvm_mips_handle_exit()
1369 kvm_arch_vcpu_dump_regs(vcpu); in kvm_mips_handle_exit()
1380 kvm_mips_deliver_interrupts(vcpu, cause); in kvm_mips_handle_exit()
1387 ++vcpu->stat.signal_exits; in kvm_mips_handle_exit()
1388 trace_kvm_exit(vcpu, SIGNAL_EXITS); in kvm_mips_handle_exit()
1402 if (kvm_mips_guest_has_fpu(&vcpu->arch) && in kvm_mips_handle_exit()
1404 __kvm_restore_fcsr(&vcpu->arch); in kvm_mips_handle_exit()
1406 if (kvm_mips_guest_has_msa(&vcpu->arch) && in kvm_mips_handle_exit()
1408 __kvm_restore_msacsr(&vcpu->arch); in kvm_mips_handle_exit()
1418 void kvm_own_fpu(struct kvm_vcpu *vcpu) in kvm_own_fpu() argument
1420 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_own_fpu()
1438 vcpu->arch.fpu_inuse & KVM_MIPS_FPU_MSA) in kvm_own_fpu()
1439 kvm_lose_fpu(vcpu); in kvm_own_fpu()
1453 if (!(vcpu->arch.fpu_inuse & KVM_MIPS_FPU_FPU)) { in kvm_own_fpu()
1454 __kvm_restore_fpu(&vcpu->arch); in kvm_own_fpu()
1455 vcpu->arch.fpu_inuse |= KVM_MIPS_FPU_FPU; in kvm_own_fpu()
1463 void kvm_own_msa(struct kvm_vcpu *vcpu) in kvm_own_msa() argument
1465 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_own_msa()
1474 if (kvm_mips_guest_has_fpu(&vcpu->arch)) { in kvm_own_msa()
1482 (vcpu->arch.fpu_inuse & (KVM_MIPS_FPU_FPU | in kvm_own_msa()
1484 kvm_lose_fpu(vcpu); in kvm_own_msa()
1497 switch (vcpu->arch.fpu_inuse & (KVM_MIPS_FPU_FPU | KVM_MIPS_FPU_MSA)) { in kvm_own_msa()
1502 __kvm_restore_msa_upper(&vcpu->arch); in kvm_own_msa()
1503 vcpu->arch.fpu_inuse |= KVM_MIPS_FPU_MSA; in kvm_own_msa()
1507 __kvm_restore_msa(&vcpu->arch); in kvm_own_msa()
1508 vcpu->arch.fpu_inuse |= KVM_MIPS_FPU_MSA; in kvm_own_msa()
1509 if (kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_own_msa()
1510 vcpu->arch.fpu_inuse |= KVM_MIPS_FPU_FPU; in kvm_own_msa()
1521 void kvm_drop_fpu(struct kvm_vcpu *vcpu) in kvm_drop_fpu() argument
1524 if (cpu_has_msa && vcpu->arch.fpu_inuse & KVM_MIPS_FPU_MSA) { in kvm_drop_fpu()
1526 vcpu->arch.fpu_inuse &= ~KVM_MIPS_FPU_MSA; in kvm_drop_fpu()
1528 if (vcpu->arch.fpu_inuse & KVM_MIPS_FPU_FPU) { in kvm_drop_fpu()
1530 vcpu->arch.fpu_inuse &= ~KVM_MIPS_FPU_FPU; in kvm_drop_fpu()
1536 void kvm_lose_fpu(struct kvm_vcpu *vcpu) in kvm_lose_fpu() argument
1546 if (cpu_has_msa && vcpu->arch.fpu_inuse & KVM_MIPS_FPU_MSA) { in kvm_lose_fpu()
1550 __kvm_save_msa(&vcpu->arch); in kvm_lose_fpu()
1554 if (vcpu->arch.fpu_inuse & KVM_MIPS_FPU_FPU) in kvm_lose_fpu()
1556 vcpu->arch.fpu_inuse &= ~(KVM_MIPS_FPU_FPU | KVM_MIPS_FPU_MSA); in kvm_lose_fpu()
1557 } else if (vcpu->arch.fpu_inuse & KVM_MIPS_FPU_FPU) { in kvm_lose_fpu()
1561 __kvm_save_fpu(&vcpu->arch); in kvm_lose_fpu()
1562 vcpu->arch.fpu_inuse &= ~KVM_MIPS_FPU_FPU; in kvm_lose_fpu()