Lines Matching +full:no +full:- +full:pc +full:- +full:write

46 	u32 __user *opc = (u32 __user *) vcpu->arch.pc;  in kvm_trap_emul_no_handler()
47 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_no_handler()
49 unsigned long badvaddr = vcpu->arch.host_cp0_badvaddr; in kvm_trap_emul_no_handler()
59 kvm_err("Exception Code: %d not handled @ PC: %p, inst: 0x%08x BadVaddr: %#lx Status: %#x\n", in kvm_trap_emul_no_handler()
61 kvm_read_c0_guest_status(vcpu->arch.cop0)); in kvm_trap_emul_no_handler()
63 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_no_handler()
69 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_handle_cop_unusable()
70 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_cop_unusable()
71 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_cop_unusable()
72 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_cop_unusable()
78 if (!kvm_mips_guest_has_fpu(&vcpu->arch) || in kvm_trap_emul_handle_cop_unusable()
81 * Unusable/no FPU in guest: in kvm_trap_emul_handle_cop_unusable()
100 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_cop_unusable()
105 run->exit_reason = KVM_EXIT_INTR; in kvm_trap_emul_handle_cop_unusable()
127 if (kvm_is_ifetch_fault(&vcpu->arch)) { in kvm_mips_bad_load()
128 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_mips_bad_load()
137 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_mips_bad_load()
145 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_mips_bad_load()
147 run->exit_reason = KVM_EXIT_MMIO; in kvm_mips_bad_load()
164 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_mips_bad_store()
172 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_mips_bad_store()
174 run->exit_reason = KVM_EXIT_MMIO; in kvm_mips_bad_store()
190 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_handle_tlb_mod()
191 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_tlb_mod()
192 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_tlb_mod()
193 unsigned long badvaddr = vcpu->arch.host_cp0_badvaddr; in kvm_trap_emul_handle_tlb_mod()
194 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_tlb_mod()
203 * write was due to the guest TLB, it should be up to the guest in kvm_trap_emul_handle_tlb_mod()
215 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_tlb_mod()
218 tlb = vcpu->arch.guest_tlb + index; in kvm_trap_emul_handle_tlb_mod()
220 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_tlb_mod()
251 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_tlb_miss()
252 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_tlb_miss()
253 unsigned long badvaddr = vcpu->arch.host_cp0_badvaddr; in kvm_trap_emul_handle_tlb_miss()
254 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_tlb_miss()
261 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_tlb_miss()
266 kvm_debug("USER ADDR TLB %s fault: cause %#x, PC: %p, BadVaddr: %#lx\n", in kvm_trap_emul_handle_tlb_miss()
283 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_tlb_miss()
301 kvm_err("Illegal TLB %s fault address , cause %#x, PC: %p, BadVaddr: %#lx\n", in kvm_trap_emul_handle_tlb_miss()
305 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_tlb_miss()
323 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_addr_err_st()
324 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_addr_err_st()
325 unsigned long badvaddr = vcpu->arch.host_cp0_badvaddr; in kvm_trap_emul_handle_addr_err_st()
326 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_addr_err_st()
333 kvm_err("Address Error (STORE): cause %#x, PC: %p, BadVaddr: %#lx\n", in kvm_trap_emul_handle_addr_err_st()
335 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_addr_err_st()
343 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_addr_err_ld()
344 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_addr_err_ld()
345 unsigned long badvaddr = vcpu->arch.host_cp0_badvaddr; in kvm_trap_emul_handle_addr_err_ld()
346 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_addr_err_ld()
352 kvm_err("Address Error (LOAD): cause %#x, PC: %p, BadVaddr: %#lx\n", in kvm_trap_emul_handle_addr_err_ld()
354 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_addr_err_ld()
362 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_syscall()
363 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_syscall()
364 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_syscall()
372 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_syscall()
380 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_res_inst()
381 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_res_inst()
382 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_res_inst()
390 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_res_inst()
398 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_break()
399 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_break()
400 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_break()
408 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_break()
416 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_trap()
417 u32 __user *opc = (u32 __user *)vcpu->arch.pc; in kvm_trap_emul_handle_trap()
418 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_trap()
426 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_trap()
434 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_msa_fpe()
435 u32 __user *opc = (u32 __user *)vcpu->arch.pc; in kvm_trap_emul_handle_msa_fpe()
436 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_msa_fpe()
444 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_msa_fpe()
452 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_fpe()
453 u32 __user *opc = (u32 __user *)vcpu->arch.pc; in kvm_trap_emul_handle_fpe()
454 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_fpe()
462 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_fpe()
469 * kvm_trap_emul_handle_msa_disabled() - Guest used MSA while disabled in root.
476 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_handle_msa_disabled()
477 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_msa_disabled()
478 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_msa_disabled()
479 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_msa_disabled()
483 if (!kvm_mips_guest_has_msa(&vcpu->arch) || in kvm_trap_emul_handle_msa_disabled()
486 * No MSA in guest, or FPU enabled and not in FR=1 mode, in kvm_trap_emul_handle_msa_disabled()
505 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_msa_disabled()
542 struct mm_struct *kern_mm = &vcpu->arch.guest_kernel_mm; in kvm_trap_emul_vcpu_init()
543 struct mm_struct *user_mm = &vcpu->arch.guest_user_mm; in kvm_trap_emul_vcpu_init()
546 * Allocate GVA -> HPA page tables. in kvm_trap_emul_vcpu_init()
549 kern_mm->pgd = pgd_alloc(kern_mm); in kvm_trap_emul_vcpu_init()
550 if (!kern_mm->pgd) in kvm_trap_emul_vcpu_init()
551 return -ENOMEM; in kvm_trap_emul_vcpu_init()
553 user_mm->pgd = pgd_alloc(user_mm); in kvm_trap_emul_vcpu_init()
554 if (!user_mm->pgd) { in kvm_trap_emul_vcpu_init()
555 pgd_free(kern_mm, kern_mm->pgd); in kvm_trap_emul_vcpu_init()
556 return -ENOMEM; in kvm_trap_emul_vcpu_init()
607 kvm_mips_emul_free_gva_pt(vcpu->arch.guest_kernel_mm.pgd); in kvm_trap_emul_vcpu_uninit()
608 kvm_mips_emul_free_gva_pt(vcpu->arch.guest_user_mm.pgd); in kvm_trap_emul_vcpu_uninit()
613 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_vcpu_setup()
615 int vcpu_id = vcpu->vcpu_id; in kvm_trap_emul_vcpu_setup()
625 /* r2-r5, simulate a MIPS 24kc */ in kvm_trap_emul_vcpu_setup()
632 * Have config1, Cacheable, noncoherent, write-back, write allocate. in kvm_trap_emul_vcpu_setup()
651 config1 |= ((ilog2(cpu_dcache_line_size()) - 1) << in kvm_trap_emul_vcpu_setup()
657 config1 |= ((KVM_MIPS_GUEST_TLB_SIZE - 1) << 25); in kvm_trap_emul_vcpu_setup()
664 /* Have config3, no tertiary/secondary caches implemented */ in kvm_trap_emul_vcpu_setup()
674 /* No config6 */ in kvm_trap_emul_vcpu_setup()
692 /* Put PC at guest reset vector */ in kvm_trap_emul_vcpu_setup()
693 vcpu->arch.pc = KVM_GUEST_CKSEG1ADDR(0x1fc00000); in kvm_trap_emul_vcpu_setup()
759 return -EFAULT; in kvm_trap_emul_copy_reg_indices()
769 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_get_one_reg()
771 switch (reg->id) { in kvm_trap_emul_get_one_reg()
848 *v = vcpu->arch.count_ctl; in kvm_trap_emul_get_one_reg()
851 *v = ktime_to_ns(vcpu->arch.count_resume); in kvm_trap_emul_get_one_reg()
854 *v = vcpu->arch.count_hz; in kvm_trap_emul_get_one_reg()
878 return -EINVAL; in kvm_trap_emul_get_one_reg()
887 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_set_one_reg()
891 switch (reg->id) { in kvm_trap_emul_set_one_reg()
926 /* No VInt, so no VS, read-only for now */ in kvm_trap_emul_set_one_reg()
971 /* read-only for now */ in kvm_trap_emul_set_one_reg()
982 /* read-only for now */ in kvm_trap_emul_set_one_reg()
1042 return -EINVAL; in kvm_trap_emul_set_one_reg()
1049 struct mm_struct *kern_mm = &vcpu->arch.guest_kernel_mm; in kvm_trap_emul_vcpu_load()
1050 struct mm_struct *user_mm = &vcpu->arch.guest_user_mm; in kvm_trap_emul_vcpu_load()
1057 if (current->flags & PF_VCPU) { in kvm_trap_emul_vcpu_load()
1071 if (current->flags & PF_VCPU) { in kvm_trap_emul_vcpu_put()
1073 check_switch_mmu_context(current->mm); in kvm_trap_emul_vcpu_put()
1084 struct mm_struct *kern_mm = &vcpu->arch.guest_kernel_mm; in kvm_trap_emul_check_requests()
1085 struct mm_struct *user_mm = &vcpu->arch.guest_user_mm; in kvm_trap_emul_check_requests()
1096 * anyway so no need to reload it here. in kvm_trap_emul_check_requests()
1098 kvm_mips_flush_gva_pt(kern_mm->pgd, KMF_GPA | KMF_KERN); in kvm_trap_emul_check_requests()
1099 kvm_mips_flush_gva_pt(user_mm->pgd, KMF_GPA | KMF_USER); in kvm_trap_emul_check_requests()
1111 TLBMISS_HANDLER_SETUP_PGD(mm->pgd); in kvm_trap_emul_check_requests()
1118 * kvm_trap_emul_gva_lockless_begin() - Begin lockless access to GVA space.
1129 /* We re-enable IRQs in kvm_trap_emul_gva_lockless_end() */ in kvm_trap_emul_gva_lockless_begin()
1141 * write to vcpu->mode, or we could miss a TLB flush request while in kvm_trap_emul_gva_lockless_begin()
1145 smp_store_mb(vcpu->mode, READING_SHADOW_PAGE_TABLES); in kvm_trap_emul_gva_lockless_begin()
1160 * kvm_trap_emul_gva_lockless_end() - End lockless access to GVA space.
1169 * Make sure the write to vcpu->mode is not reordered in front of GVA in kvm_trap_emul_gva_lockless_end()
1173 smp_store_release(&vcpu->mode, OUTSIDE_GUEST_MODE); in kvm_trap_emul_gva_lockless_end()
1185 struct mm_struct *kern_mm = &vcpu->arch.guest_kernel_mm; in kvm_trap_emul_vcpu_reenter()
1186 struct mm_struct *user_mm = &vcpu->arch.guest_user_mm; in kvm_trap_emul_vcpu_reenter()
1188 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_vcpu_reenter()
1193 * No need to reload ASID, IRQs are disabled already so there's no rush, in kvm_trap_emul_vcpu_reenter()
1195 * re-entering the guest. in kvm_trap_emul_vcpu_reenter()
1211 if (gasid != vcpu->arch.last_user_gasid) { in kvm_trap_emul_vcpu_reenter()
1212 kvm_mips_flush_gva_pt(user_mm->pgd, KMF_USER); in kvm_trap_emul_vcpu_reenter()
1215 vcpu->arch.last_user_gasid = gasid; in kvm_trap_emul_vcpu_reenter()
1233 kvm_read_c0_guest_cause(vcpu->arch.cop0)); in kvm_trap_emul_vcpu_run()
1253 r = vcpu->arch.vcpu_run(run, vcpu); in kvm_trap_emul_vcpu_run()
1259 check_switch_mmu_context(current->mm); in kvm_trap_emul_vcpu_run()