Lines Matching refs:arch

46 	struct kvm_vcpu_arch *arch = &vcpu->arch;  in kvm_compute_return_epc()  local
66 arch->gprs[insn.r_format.rd] = epc + 8; in kvm_compute_return_epc()
69 nextpc = arch->gprs[insn.r_format.rs]; in kvm_compute_return_epc()
85 if ((long)arch->gprs[insn.i_format.rs] < 0) in kvm_compute_return_epc()
94 if ((long)arch->gprs[insn.i_format.rs] >= 0) in kvm_compute_return_epc()
103 arch->gprs[31] = epc + 8; in kvm_compute_return_epc()
104 if ((long)arch->gprs[insn.i_format.rs] < 0) in kvm_compute_return_epc()
113 arch->gprs[31] = epc + 8; in kvm_compute_return_epc()
114 if ((long)arch->gprs[insn.i_format.rs] >= 0) in kvm_compute_return_epc()
142 arch->gprs[31] = instpc + 8; in kvm_compute_return_epc()
154 if (arch->gprs[insn.i_format.rs] == in kvm_compute_return_epc()
155 arch->gprs[insn.i_format.rt]) in kvm_compute_return_epc()
164 if (arch->gprs[insn.i_format.rs] != in kvm_compute_return_epc()
165 arch->gprs[insn.i_format.rt]) in kvm_compute_return_epc()
178 if ((long)arch->gprs[insn.i_format.rs] <= 0) in kvm_compute_return_epc()
191 if ((long)arch->gprs[insn.i_format.rs] > 0) in kvm_compute_return_epc()
248 err = kvm_compute_return_epc(vcpu, vcpu->arch.pc, in update_pc()
249 &vcpu->arch.pc); in update_pc()
253 vcpu->arch.pc += 4; in update_pc()
256 kvm_debug("update_pc(): New PC: %#lx\n", vcpu->arch.pc); in update_pc()
275 *out = vcpu->arch.host_cp0_badinstr; in kvm_get_badinstr()
296 *out = vcpu->arch.host_cp0_badinstrp; in kvm_get_badinstrp()
313 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_count_disabled()
315 return (vcpu->arch.count_ctl & KVM_REG_MIPS_COUNT_CTL_DC) || in kvm_mips_count_disabled()
332 delta = now_ns + vcpu->arch.count_dyn_bias; in kvm_mips_ktime_to_count()
334 if (delta >= vcpu->arch.count_period) { in kvm_mips_ktime_to_count()
336 periods = div64_s64(now_ns, vcpu->arch.count_period); in kvm_mips_ktime_to_count()
337 vcpu->arch.count_dyn_bias = -periods * vcpu->arch.count_period; in kvm_mips_ktime_to_count()
339 delta = now_ns + vcpu->arch.count_dyn_bias; in kvm_mips_ktime_to_count()
352 return div_u64(delta * vcpu->arch.count_hz, NSEC_PER_SEC); in kvm_mips_ktime_to_count()
367 if (unlikely(vcpu->arch.count_ctl & KVM_REG_MIPS_COUNT_CTL_DC)) in kvm_mips_count_time()
368 return vcpu->arch.count_resume; in kvm_mips_count_time()
385 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_read_count_running()
391 count = vcpu->arch.count_bias + kvm_mips_ktime_to_count(vcpu, now); in kvm_mips_read_count_running()
407 expires = hrtimer_get_expires(&vcpu->arch.comparecount_timer); in kvm_mips_read_count_running()
408 threshold = ktime_add_ns(now, vcpu->arch.count_period / 4); in kvm_mips_read_count_running()
414 running = hrtimer_cancel(&vcpu->arch.comparecount_timer); in kvm_mips_read_count_running()
425 vcpu->arch.count_period); in kvm_mips_read_count_running()
426 hrtimer_start(&vcpu->arch.comparecount_timer, expires, in kvm_mips_read_count_running()
445 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_read_count()
475 hrtimer_cancel(&vcpu->arch.comparecount_timer); in kvm_mips_freeze_hrtimer()
503 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_resume_hrtimer()
511 delta = div_u64(delta * NSEC_PER_SEC, vcpu->arch.count_hz); in kvm_mips_resume_hrtimer()
515 hrtimer_cancel(&vcpu->arch.comparecount_timer); in kvm_mips_resume_hrtimer()
516 hrtimer_start(&vcpu->arch.comparecount_timer, expire, HRTIMER_MODE_ABS); in kvm_mips_resume_hrtimer()
550 before_count = vcpu->arch.count_bias + in kvm_mips_restore_hrtimer()
563 vcpu->arch.count_bias += drift; in kvm_mips_restore_hrtimer()
570 now_count = vcpu->arch.count_bias + kvm_mips_ktime_to_count(vcpu, now); in kvm_mips_restore_hrtimer()
579 vcpu->arch.count_bias += drift; in kvm_mips_restore_hrtimer()
586 delta = div_u64(delta * NSEC_PER_SEC, vcpu->arch.count_hz); in kvm_mips_restore_hrtimer()
604 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_write_count()
609 vcpu->arch.count_bias = count - kvm_mips_ktime_to_count(vcpu, now); in kvm_mips_write_count()
629 vcpu->arch.count_hz = count_hz; in kvm_mips_init_count()
630 vcpu->arch.count_period = div_u64((u64)NSEC_PER_SEC << 32, count_hz); in kvm_mips_init_count()
631 vcpu->arch.count_dyn_bias = 0; in kvm_mips_init_count()
650 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_set_count_hz()
659 if (vcpu->arch.count_hz == count_hz) in kvm_mips_set_count_hz()
672 vcpu->arch.count_hz = count_hz; in kvm_mips_set_count_hz()
673 vcpu->arch.count_period = div_u64((u64)NSEC_PER_SEC << 32, count_hz); in kvm_mips_set_count_hz()
674 vcpu->arch.count_dyn_bias = 0; in kvm_mips_set_count_hz()
677 vcpu->arch.count_bias = count - kvm_mips_ktime_to_count(vcpu, now); in kvm_mips_set_count_hz()
697 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_write_compare()
782 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_count_disable()
787 hrtimer_cancel(&vcpu->arch.comparecount_timer); in kvm_mips_count_disable()
809 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_count_disable_cause()
812 if (!(vcpu->arch.count_ctl & KVM_REG_MIPS_COUNT_CTL_DC)) in kvm_mips_count_disable_cause()
829 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_count_enable_cause()
855 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_set_count_ctl()
856 s64 changed = count_ctl ^ vcpu->arch.count_ctl; in kvm_mips_set_count_ctl()
866 vcpu->arch.count_ctl = count_ctl; in kvm_mips_set_count_ctl()
874 vcpu->arch.count_resume = ktime_get(); in kvm_mips_set_count_ctl()
877 vcpu->arch.count_resume = kvm_mips_count_disable(vcpu); in kvm_mips_set_count_ctl()
887 vcpu->arch.count_hz); in kvm_mips_set_count_ctl()
888 expire = ktime_add_ns(vcpu->arch.count_resume, delta); in kvm_mips_set_count_ctl()
925 vcpu->arch.count_resume = ns_to_ktime(count_resume); in kvm_mips_set_count_resume()
940 hrtimer_add_expires_ns(&vcpu->arch.comparecount_timer, in kvm_mips_count_timeout()
941 vcpu->arch.count_period); in kvm_mips_count_timeout()
947 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emul_eret()
952 vcpu->arch.pc = kvm_read_c0_guest_errorepc(cop0); in kvm_mips_emul_eret()
954 kvm_debug("[%#lx] ERET to %#lx\n", vcpu->arch.pc, in kvm_mips_emul_eret()
957 vcpu->arch.pc = kvm_read_c0_guest_epc(cop0); in kvm_mips_emul_eret()
961 vcpu->arch.pc); in kvm_mips_emul_eret()
970 kvm_debug("[%#lx] !!!WAIT!!! (%#lx)\n", vcpu->arch.pc, in kvm_mips_emul_wait()
971 vcpu->arch.pending_exceptions); in kvm_mips_emul_wait()
975 if (!vcpu->arch.pending_exceptions) { in kvm_mips_emul_wait()
977 vcpu->arch.wait = 1; in kvm_mips_emul_wait()
996 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_change_entryhi()
997 struct mm_struct *kern_mm = &vcpu->arch.guest_kernel_mm; in kvm_mips_change_entryhi()
1030 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emul_tlbr()
1032 unsigned long pc = vcpu->arch.pc; in kvm_mips_emul_tlbr()
1042 tlb = &vcpu->arch.guest_tlb[index]; in kvm_mips_emul_tlbr()
1062 struct mm_struct *kern_mm = &vcpu->arch.guest_kernel_mm; in kvm_mips_invalidate_guest_tlb()
1063 struct mm_struct *user_mm = &vcpu->arch.guest_user_mm; in kvm_mips_invalidate_guest_tlb()
1103 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emul_tlbwi()
1106 unsigned long pc = vcpu->arch.pc; in kvm_mips_emul_tlbwi()
1118 tlb = &vcpu->arch.guest_tlb[index]; in kvm_mips_emul_tlbwi()
1139 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emul_tlbwr()
1141 unsigned long pc = vcpu->arch.pc; in kvm_mips_emul_tlbwr()
1147 tlb = &vcpu->arch.guest_tlb[index]; in kvm_mips_emul_tlbwr()
1166 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emul_tlbp()
1168 unsigned long pc = vcpu->arch.pc; in kvm_mips_emul_tlbp()
1193 if (kvm_mips_guest_can_have_fpu(&vcpu->arch)) in kvm_mips_config1_wrmask()
1212 if (kvm_mips_guest_can_have_msa(&vcpu->arch)) in kvm_mips_config3_wrmask()
1248 if (kvm_mips_guest_has_msa(&vcpu->arch)) in kvm_mips_config5_wrmask()
1255 if (kvm_mips_guest_has_fpu(&vcpu->arch)) { in kvm_mips_config5_wrmask()
1269 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_CP0()
1278 curr_pc = vcpu->arch.pc; in kvm_mips_emulate_CP0()
1322 vcpu->arch.gprs[rt] = in kvm_mips_emulate_CP0()
1325 vcpu->arch.gprs[rt] = 0x0; in kvm_mips_emulate_CP0()
1330 vcpu->arch.gprs[rt] = (s32)cop0->reg[rd][sel]; in kvm_mips_emulate_CP0()
1339 vcpu->arch.gprs[rt]); in kvm_mips_emulate_CP0()
1343 vcpu->arch.gprs[rt] = cop0->reg[rd][sel]; in kvm_mips_emulate_CP0()
1347 vcpu->arch.gprs[rt]); in kvm_mips_emulate_CP0()
1356 vcpu->arch.gprs[rt]); in kvm_mips_emulate_CP0()
1359 && (vcpu->arch.gprs[rt] >= in kvm_mips_emulate_CP0()
1362 vcpu->arch.gprs[rt]); in kvm_mips_emulate_CP0()
1372 vcpu->arch.gprs[rt]); in kvm_mips_emulate_CP0()
1375 vcpu->arch.gprs[rt]); in kvm_mips_emulate_CP0()
1379 kvm_mips_write_count(vcpu, vcpu->arch.gprs[rt]); in kvm_mips_emulate_CP0()
1385 vcpu->arch.gprs[rt], in kvm_mips_emulate_CP0()
1391 val = vcpu->arch.gprs[rt]; in kvm_mips_emulate_CP0()
1402 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_emulate_CP0()
1433 vcpu->arch.aux_inuse & KVM_MIPS_AUX_MSA) in kvm_mips_emulate_CP0()
1444 vcpu->arch.aux_inuse & KVM_MIPS_AUX_FPU) in kvm_mips_emulate_CP0()
1456 if (!kvm_mips_guest_has_fpu(&vcpu->arch)) in kvm_mips_emulate_CP0()
1463 val = vcpu->arch.gprs[rt]; in kvm_mips_emulate_CP0()
1479 vcpu->arch.aux_inuse & KVM_MIPS_AUX_FPU) in kvm_mips_emulate_CP0()
1489 vcpu->arch.aux_inuse & KVM_MIPS_AUX_MSA) in kvm_mips_emulate_CP0()
1500 new_cause = vcpu->arch.gprs[rt]; in kvm_mips_emulate_CP0()
1520 cop0->reg[rd][sel] = vcpu->arch.gprs[rt] & mask; in kvm_mips_emulate_CP0()
1522 cop0->reg[rd][sel] = vcpu->arch.gprs[rt]; in kvm_mips_emulate_CP0()
1531 vcpu->arch.pc, rt, rd, sel); in kvm_mips_emulate_CP0()
1534 vcpu->arch.gprs[rt]); in kvm_mips_emulate_CP0()
1543 vcpu->arch.gprs[rt] = in kvm_mips_emulate_CP0()
1548 vcpu->arch.pc); in kvm_mips_emulate_CP0()
1552 vcpu->arch.pc); in kvm_mips_emulate_CP0()
1572 vcpu->arch.gprs[rt]); in kvm_mips_emulate_CP0()
1573 vcpu->arch.gprs[rd] = vcpu->arch.gprs[rt]; in kvm_mips_emulate_CP0()
1578 vcpu->arch.pc, inst.c0r_format.rs); in kvm_mips_emulate_CP0()
1587 vcpu->arch.pc = curr_pc; in kvm_mips_emulate_CP0()
1613 curr_pc = vcpu->arch.pc; in kvm_mips_emulate_store()
1621 vcpu->arch.host_cp0_badvaddr); in kvm_mips_emulate_store()
1629 *(u64 *)data = vcpu->arch.gprs[rt]; in kvm_mips_emulate_store()
1632 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr, in kvm_mips_emulate_store()
1633 vcpu->arch.gprs[rt], *(u64 *)data); in kvm_mips_emulate_store()
1639 *(u32 *)data = vcpu->arch.gprs[rt]; in kvm_mips_emulate_store()
1642 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr, in kvm_mips_emulate_store()
1643 vcpu->arch.gprs[rt], *(u32 *)data); in kvm_mips_emulate_store()
1648 *(u16 *)data = vcpu->arch.gprs[rt]; in kvm_mips_emulate_store()
1651 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr, in kvm_mips_emulate_store()
1652 vcpu->arch.gprs[rt], *(u16 *)data); in kvm_mips_emulate_store()
1657 *(u8 *)data = vcpu->arch.gprs[rt]; in kvm_mips_emulate_store()
1660 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr, in kvm_mips_emulate_store()
1661 vcpu->arch.gprs[rt], *(u8 *)data); in kvm_mips_emulate_store()
1677 vcpu->arch.pc = curr_pc; in kvm_mips_emulate_store()
1697 curr_pc = vcpu->arch.pc; in kvm_mips_emulate_load()
1701 vcpu->arch.io_pc = vcpu->arch.pc; in kvm_mips_emulate_load()
1702 vcpu->arch.pc = curr_pc; in kvm_mips_emulate_load()
1704 vcpu->arch.io_gpr = rt; in kvm_mips_emulate_load()
1707 vcpu->arch.host_cp0_badvaddr); in kvm_mips_emulate_load()
1782 vcpu->arch.host_cp0_badvaddr = addr; in kvm_mips_guest_cache_op()
1783 vcpu->arch.pc = curr_pc; in kvm_mips_guest_cache_op()
1788 vcpu->arch.host_cp0_badvaddr = addr; in kvm_mips_guest_cache_op()
1789 vcpu->arch.pc = curr_pc; in kvm_mips_guest_cache_op()
1806 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_cache() local
1814 curr_pc = vcpu->arch.pc; in kvm_mips_emulate_cache()
1828 va = arch->gprs[base] + offset; in kvm_mips_emulate_cache()
1831 cache, op, base, arch->gprs[base], offset); in kvm_mips_emulate_cache()
1840 vcpu->arch.pc, vcpu->arch.gprs[31], cache, op, base, in kvm_mips_emulate_cache()
1841 arch->gprs[base], offset); in kvm_mips_emulate_cache()
1917 cache, op, base, arch->gprs[base], offset); in kvm_mips_emulate_cache()
1924 vcpu->arch.pc = curr_pc; in kvm_mips_emulate_cache()
1994 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_guest_exception_base()
2007 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_syscall()
2008 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_syscall() local
2013 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_syscall()
2021 kvm_debug("Delivering SYSCALL @ pc %#lx\n", arch->pc); in kvm_mips_emulate_syscall()
2027 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_syscall()
2042 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_tlbmiss_ld()
2043 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_tlbmiss_ld() local
2044 unsigned long entryhi = (vcpu->arch. host_cp0_badvaddr & VPN2_MASK) | in kvm_mips_emulate_tlbmiss_ld()
2049 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_tlbmiss_ld()
2058 arch->pc); in kvm_mips_emulate_tlbmiss_ld()
2061 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x0; in kvm_mips_emulate_tlbmiss_ld()
2065 arch->pc); in kvm_mips_emulate_tlbmiss_ld()
2067 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_tlbmiss_ld()
2074 kvm_write_c0_guest_badvaddr(cop0, vcpu->arch.host_cp0_badvaddr); in kvm_mips_emulate_tlbmiss_ld()
2086 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_tlbinv_ld()
2087 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_tlbinv_ld() local
2089 (vcpu->arch.host_cp0_badvaddr & VPN2_MASK) | in kvm_mips_emulate_tlbinv_ld()
2094 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_tlbinv_ld()
2103 arch->pc); in kvm_mips_emulate_tlbinv_ld()
2106 arch->pc); in kvm_mips_emulate_tlbinv_ld()
2110 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_tlbinv_ld()
2116 kvm_write_c0_guest_badvaddr(cop0, vcpu->arch.host_cp0_badvaddr); in kvm_mips_emulate_tlbinv_ld()
2128 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_tlbmiss_st()
2129 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_tlbmiss_st() local
2130 unsigned long entryhi = (vcpu->arch.host_cp0_badvaddr & VPN2_MASK) | in kvm_mips_emulate_tlbmiss_st()
2135 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_tlbmiss_st()
2144 arch->pc); in kvm_mips_emulate_tlbmiss_st()
2147 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x0; in kvm_mips_emulate_tlbmiss_st()
2150 arch->pc); in kvm_mips_emulate_tlbmiss_st()
2151 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_tlbmiss_st()
2158 kvm_write_c0_guest_badvaddr(cop0, vcpu->arch.host_cp0_badvaddr); in kvm_mips_emulate_tlbmiss_st()
2170 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_tlbinv_st()
2171 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_tlbinv_st() local
2172 unsigned long entryhi = (vcpu->arch.host_cp0_badvaddr & VPN2_MASK) | in kvm_mips_emulate_tlbinv_st()
2177 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_tlbinv_st()
2186 arch->pc); in kvm_mips_emulate_tlbinv_st()
2189 arch->pc); in kvm_mips_emulate_tlbinv_st()
2193 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_tlbinv_st()
2199 kvm_write_c0_guest_badvaddr(cop0, vcpu->arch.host_cp0_badvaddr); in kvm_mips_emulate_tlbinv_st()
2211 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_tlbmod()
2212 unsigned long entryhi = (vcpu->arch.host_cp0_badvaddr & VPN2_MASK) | in kvm_mips_emulate_tlbmod()
2214 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_tlbmod() local
2218 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_tlbmod()
2227 arch->pc); in kvm_mips_emulate_tlbmod()
2230 arch->pc); in kvm_mips_emulate_tlbmod()
2233 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_tlbmod()
2239 kvm_write_c0_guest_badvaddr(cop0, vcpu->arch.host_cp0_badvaddr); in kvm_mips_emulate_tlbmod()
2251 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_fpu_exc()
2252 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_fpu_exc() local
2256 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_fpu_exc()
2266 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_fpu_exc()
2280 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_ri_exc()
2281 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_ri_exc() local
2286 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_ri_exc()
2294 kvm_debug("Delivering RI @ pc %#lx\n", arch->pc); in kvm_mips_emulate_ri_exc()
2300 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_ri_exc()
2315 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_bp_exc()
2316 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_bp_exc() local
2321 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_bp_exc()
2329 kvm_debug("Delivering BP @ pc %#lx\n", arch->pc); in kvm_mips_emulate_bp_exc()
2335 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_bp_exc()
2350 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_trap_exc()
2351 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_trap_exc() local
2356 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_trap_exc()
2364 kvm_debug("Delivering TRAP @ pc %#lx\n", arch->pc); in kvm_mips_emulate_trap_exc()
2370 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_trap_exc()
2385 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_msafpe_exc()
2386 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_msafpe_exc() local
2391 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_msafpe_exc()
2399 kvm_debug("Delivering MSAFPE @ pc %#lx\n", arch->pc); in kvm_mips_emulate_msafpe_exc()
2405 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_msafpe_exc()
2420 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_fpe_exc()
2421 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_fpe_exc() local
2426 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_fpe_exc()
2434 kvm_debug("Delivering FPE @ pc %#lx\n", arch->pc); in kvm_mips_emulate_fpe_exc()
2440 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_fpe_exc()
2455 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_msadis_exc()
2456 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_msadis_exc() local
2461 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_msadis_exc()
2469 kvm_debug("Delivering MSADIS @ pc %#lx\n", arch->pc); in kvm_mips_emulate_msadis_exc()
2475 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_msadis_exc()
2489 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_handle_ri()
2490 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_handle_ri() local
2500 curr_pc = vcpu->arch.pc; in kvm_mips_handle_ri()
2531 arch->gprs[rt] = vcpu->vcpu_id; in kvm_mips_handle_ri()
2534 arch->gprs[rt] = min(current_cpu_data.dcache.linesz, in kvm_mips_handle_ri()
2538 arch->gprs[rt] = (s32)kvm_mips_read_count(vcpu); in kvm_mips_handle_ri()
2544 arch->gprs[rt] = 1; in kvm_mips_handle_ri()
2547 arch->gprs[rt] = 2; in kvm_mips_handle_ri()
2551 arch->gprs[rt] = kvm_read_c0_guest_userlocal(cop0); in kvm_mips_handle_ri()
2560 vcpu->arch.gprs[rt]); in kvm_mips_handle_ri()
2574 vcpu->arch.pc = curr_pc; in kvm_mips_handle_ri()
2581 unsigned long *gpr = &vcpu->arch.gprs[vcpu->arch.io_gpr]; in kvm_mips_complete_mmio_load()
2591 vcpu->arch.pc = vcpu->arch.io_pc; in kvm_mips_complete_mmio_load()
2630 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_mips_emulate_exc()
2631 struct kvm_vcpu_arch *arch = &vcpu->arch; in kvm_mips_emulate_exc() local
2636 kvm_write_c0_guest_epc(cop0, arch->pc); in kvm_mips_emulate_exc()
2648 arch->pc = kvm_mips_guest_exception_base(vcpu) + 0x180; in kvm_mips_emulate_exc()
2649 kvm_write_c0_guest_badvaddr(cop0, vcpu->arch.host_cp0_badvaddr); in kvm_mips_emulate_exc()
2669 unsigned long badvaddr = vcpu->arch.host_cp0_badvaddr; in kvm_mips_check_privilege()
2766 unsigned long va = vcpu->arch.host_cp0_badvaddr; in kvm_mips_handle_tlbmiss()
2770 vcpu->arch.host_cp0_badvaddr); in kvm_mips_handle_tlbmiss()
2780 (kvm_read_c0_guest_entryhi(vcpu->arch.cop0) & in kvm_mips_handle_tlbmiss()
2793 struct kvm_mips_tlb *tlb = &vcpu->arch.guest_tlb[index]; in kvm_mips_handle_tlbmiss()