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 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_cop_unusable()
71 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_cop_unusable()
77 if (!kvm_mips_guest_has_fpu(&vcpu->arch) || in kvm_trap_emul_handle_cop_unusable()
80 * Unusable/no FPU in guest: in kvm_trap_emul_handle_cop_unusable()
99 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_cop_unusable()
104 vcpu->run->exit_reason = KVM_EXIT_INTR; in kvm_trap_emul_handle_cop_unusable()
125 if (kvm_is_ifetch_fault(&vcpu->arch)) { in kvm_mips_bad_load()
126 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_mips_bad_load()
135 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_mips_bad_load()
143 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_mips_bad_load()
145 vcpu->run->exit_reason = KVM_EXIT_MMIO; in kvm_mips_bad_load()
161 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_mips_bad_store()
169 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_mips_bad_store()
171 vcpu->run->exit_reason = KVM_EXIT_MMIO; in kvm_mips_bad_store()
187 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_handle_tlb_mod()
188 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_tlb_mod()
189 unsigned long badvaddr = vcpu->arch.host_cp0_badvaddr; in kvm_trap_emul_handle_tlb_mod()
190 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_tlb_mod()
199 * write was due to the guest TLB, it should be up to the guest in kvm_trap_emul_handle_tlb_mod()
211 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_tlb_mod()
214 tlb = vcpu->arch.guest_tlb + index; in kvm_trap_emul_handle_tlb_mod()
216 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_tlb_mod()
247 struct kvm_run *run = vcpu->run; in kvm_trap_emul_handle_tlb_miss()
248 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_tlb_miss()
249 unsigned long badvaddr = vcpu->arch.host_cp0_badvaddr; in kvm_trap_emul_handle_tlb_miss()
250 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_tlb_miss()
257 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_tlb_miss()
262 kvm_debug("USER ADDR TLB %s fault: cause %#x, PC: %p, BadVaddr: %#lx\n", in kvm_trap_emul_handle_tlb_miss()
279 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_tlb_miss()
297 kvm_err("Illegal TLB %s fault address , cause %#x, PC: %p, BadVaddr: %#lx\n", in kvm_trap_emul_handle_tlb_miss()
301 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_tlb_miss()
319 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_addr_err_st()
320 unsigned long badvaddr = vcpu->arch.host_cp0_badvaddr; in kvm_trap_emul_handle_addr_err_st()
321 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_addr_err_st()
328 kvm_err("Address Error (STORE): cause %#x, PC: %p, BadVaddr: %#lx\n", in kvm_trap_emul_handle_addr_err_st()
330 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_addr_err_st()
338 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_addr_err_ld()
339 unsigned long badvaddr = vcpu->arch.host_cp0_badvaddr; in kvm_trap_emul_handle_addr_err_ld()
340 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_addr_err_ld()
346 kvm_err("Address Error (LOAD): cause %#x, PC: %p, BadVaddr: %#lx\n", in kvm_trap_emul_handle_addr_err_ld()
348 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_addr_err_ld()
356 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_syscall()
357 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_syscall()
365 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_syscall()
373 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_res_inst()
374 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_res_inst()
382 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_res_inst()
390 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_break()
391 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_break()
399 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_break()
407 u32 __user *opc = (u32 __user *)vcpu->arch.pc; in kvm_trap_emul_handle_trap()
408 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_trap()
416 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_trap()
424 u32 __user *opc = (u32 __user *)vcpu->arch.pc; in kvm_trap_emul_handle_msa_fpe()
425 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_msa_fpe()
433 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_msa_fpe()
441 u32 __user *opc = (u32 __user *)vcpu->arch.pc; in kvm_trap_emul_handle_fpe()
442 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_fpe()
450 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_fpe()
457 * kvm_trap_emul_handle_msa_disabled() - Guest used MSA while disabled in root.
464 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_handle_msa_disabled()
465 u32 __user *opc = (u32 __user *) vcpu->arch.pc; in kvm_trap_emul_handle_msa_disabled()
466 u32 cause = vcpu->arch.host_cp0_cause; in kvm_trap_emul_handle_msa_disabled()
470 if (!kvm_mips_guest_has_msa(&vcpu->arch) || in kvm_trap_emul_handle_msa_disabled()
473 * No MSA in guest, or FPU enabled and not in FR=1 mode, in kvm_trap_emul_handle_msa_disabled()
492 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_trap_emul_handle_msa_disabled()
532 struct mm_struct *kern_mm = &vcpu->arch.guest_kernel_mm; in kvm_trap_emul_vcpu_init()
533 struct mm_struct *user_mm = &vcpu->arch.guest_user_mm; in kvm_trap_emul_vcpu_init()
536 * Allocate GVA -> HPA page tables. in kvm_trap_emul_vcpu_init()
539 kern_mm->pgd = pgd_alloc(kern_mm); in kvm_trap_emul_vcpu_init()
540 if (!kern_mm->pgd) in kvm_trap_emul_vcpu_init()
541 return -ENOMEM; in kvm_trap_emul_vcpu_init()
543 user_mm->pgd = pgd_alloc(user_mm); in kvm_trap_emul_vcpu_init()
544 if (!user_mm->pgd) { in kvm_trap_emul_vcpu_init()
545 pgd_free(kern_mm, kern_mm->pgd); in kvm_trap_emul_vcpu_init()
546 return -ENOMEM; in kvm_trap_emul_vcpu_init()
599 kvm_mips_emul_free_gva_pt(vcpu->arch.guest_kernel_mm.pgd); in kvm_trap_emul_vcpu_uninit()
600 kvm_mips_emul_free_gva_pt(vcpu->arch.guest_user_mm.pgd); in kvm_trap_emul_vcpu_uninit()
605 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_vcpu_setup()
607 int vcpu_id = vcpu->vcpu_id; in kvm_trap_emul_vcpu_setup()
617 /* r2-r5, simulate a MIPS 24kc */ in kvm_trap_emul_vcpu_setup()
624 * Have config1, Cacheable, noncoherent, write-back, write allocate. in kvm_trap_emul_vcpu_setup()
643 config1 |= ((ilog2(cpu_dcache_line_size()) - 1) << in kvm_trap_emul_vcpu_setup()
649 config1 |= ((KVM_MIPS_GUEST_TLB_SIZE - 1) << 25); in kvm_trap_emul_vcpu_setup()
656 /* Have config3, no tertiary/secondary caches implemented */ in kvm_trap_emul_vcpu_setup()
666 /* No config6 */ in kvm_trap_emul_vcpu_setup()
684 /* Put PC at guest reset vector */ in kvm_trap_emul_vcpu_setup()
685 vcpu->arch.pc = KVM_GUEST_CKSEG1ADDR(0x1fc00000); in kvm_trap_emul_vcpu_setup()
751 return -EFAULT; in kvm_trap_emul_copy_reg_indices()
761 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_get_one_reg()
763 switch (reg->id) { in kvm_trap_emul_get_one_reg()
840 *v = vcpu->arch.count_ctl; in kvm_trap_emul_get_one_reg()
843 *v = ktime_to_ns(vcpu->arch.count_resume); in kvm_trap_emul_get_one_reg()
846 *v = vcpu->arch.count_hz; in kvm_trap_emul_get_one_reg()
870 return -EINVAL; in kvm_trap_emul_get_one_reg()
879 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_set_one_reg()
883 switch (reg->id) { in kvm_trap_emul_set_one_reg()
918 /* No VInt, so no VS, read-only for now */ in kvm_trap_emul_set_one_reg()
963 /* read-only for now */ in kvm_trap_emul_set_one_reg()
974 /* read-only for now */ in kvm_trap_emul_set_one_reg()
1034 return -EINVAL; in kvm_trap_emul_set_one_reg()
1041 struct mm_struct *kern_mm = &vcpu->arch.guest_kernel_mm; in kvm_trap_emul_vcpu_load()
1042 struct mm_struct *user_mm = &vcpu->arch.guest_user_mm; in kvm_trap_emul_vcpu_load()
1049 if (current->flags & PF_VCPU) { in kvm_trap_emul_vcpu_load()
1063 if (current->flags & PF_VCPU) { in kvm_trap_emul_vcpu_put()
1065 check_switch_mmu_context(current->mm); in kvm_trap_emul_vcpu_put()
1076 struct mm_struct *kern_mm = &vcpu->arch.guest_kernel_mm; in kvm_trap_emul_check_requests()
1077 struct mm_struct *user_mm = &vcpu->arch.guest_user_mm; in kvm_trap_emul_check_requests()
1088 * anyway so no need to reload it here. in kvm_trap_emul_check_requests()
1090 kvm_mips_flush_gva_pt(kern_mm->pgd, KMF_GPA | KMF_KERN); in kvm_trap_emul_check_requests()
1091 kvm_mips_flush_gva_pt(user_mm->pgd, KMF_GPA | KMF_USER); in kvm_trap_emul_check_requests()
1103 TLBMISS_HANDLER_SETUP_PGD(mm->pgd); in kvm_trap_emul_check_requests()
1110 * kvm_trap_emul_gva_lockless_begin() - Begin lockless access to GVA space.
1121 /* We re-enable IRQs in kvm_trap_emul_gva_lockless_end() */ in kvm_trap_emul_gva_lockless_begin()
1133 * write to vcpu->mode, or we could miss a TLB flush request while in kvm_trap_emul_gva_lockless_begin()
1137 smp_store_mb(vcpu->mode, READING_SHADOW_PAGE_TABLES); in kvm_trap_emul_gva_lockless_begin()
1152 * kvm_trap_emul_gva_lockless_end() - End lockless access to GVA space.
1161 * Make sure the write to vcpu->mode is not reordered in front of GVA in kvm_trap_emul_gva_lockless_end()
1165 smp_store_release(&vcpu->mode, OUTSIDE_GUEST_MODE); in kvm_trap_emul_gva_lockless_end()
1176 struct mm_struct *kern_mm = &vcpu->arch.guest_kernel_mm; in kvm_trap_emul_vcpu_reenter()
1177 struct mm_struct *user_mm = &vcpu->arch.guest_user_mm; in kvm_trap_emul_vcpu_reenter()
1179 struct mips_coproc *cop0 = vcpu->arch.cop0; in kvm_trap_emul_vcpu_reenter()
1184 * No need to reload ASID, IRQs are disabled already so there's no rush, in kvm_trap_emul_vcpu_reenter()
1186 * re-entering the guest. in kvm_trap_emul_vcpu_reenter()
1202 if (gasid != vcpu->arch.last_user_gasid) { in kvm_trap_emul_vcpu_reenter()
1203 kvm_mips_flush_gva_pt(user_mm->pgd, KMF_USER); in kvm_trap_emul_vcpu_reenter()
1206 vcpu->arch.last_user_gasid = gasid; in kvm_trap_emul_vcpu_reenter()
1224 kvm_read_c0_guest_cause(vcpu->arch.cop0)); in kvm_trap_emul_vcpu_run()
1244 r = vcpu->arch.vcpu_run(vcpu); in kvm_trap_emul_vcpu_run()
1250 check_switch_mmu_context(current->mm); in kvm_trap_emul_vcpu_run()