aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kvm/trap_emul.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kvm/trap_emul.c')
-rw-r--r--arch/mips/kvm/trap_emul.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/mips/kvm/trap_emul.c b/arch/mips/kvm/trap_emul.c
index 4372cc86650c..dc019950e243 100644
--- a/arch/mips/kvm/trap_emul.c
+++ b/arch/mips/kvm/trap_emul.c
@@ -330,6 +330,24 @@ static int kvm_trap_emul_handle_break(struct kvm_vcpu *vcpu)
330 return ret; 330 return ret;
331} 331}
332 332
333static int kvm_trap_emul_handle_trap(struct kvm_vcpu *vcpu)
334{
335 struct kvm_run *run = vcpu->run;
336 uint32_t __user *opc = (uint32_t __user *)vcpu->arch.pc;
337 unsigned long cause = vcpu->arch.host_cp0_cause;
338 enum emulation_result er = EMULATE_DONE;
339 int ret = RESUME_GUEST;
340
341 er = kvm_mips_emulate_trap_exc(cause, opc, run, vcpu);
342 if (er == EMULATE_DONE) {
343 ret = RESUME_GUEST;
344 } else {
345 run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
346 ret = RESUME_HOST;
347 }
348 return ret;
349}
350
333static int kvm_trap_emul_handle_msa_disabled(struct kvm_vcpu *vcpu) 351static int kvm_trap_emul_handle_msa_disabled(struct kvm_vcpu *vcpu)
334{ 352{
335 struct kvm_run *run = vcpu->run; 353 struct kvm_run *run = vcpu->run;
@@ -497,6 +515,7 @@ static struct kvm_mips_callbacks kvm_trap_emul_callbacks = {
497 .handle_syscall = kvm_trap_emul_handle_syscall, 515 .handle_syscall = kvm_trap_emul_handle_syscall,
498 .handle_res_inst = kvm_trap_emul_handle_res_inst, 516 .handle_res_inst = kvm_trap_emul_handle_res_inst,
499 .handle_break = kvm_trap_emul_handle_break, 517 .handle_break = kvm_trap_emul_handle_break,
518 .handle_trap = kvm_trap_emul_handle_trap,
500 .handle_msa_disabled = kvm_trap_emul_handle_msa_disabled, 519 .handle_msa_disabled = kvm_trap_emul_handle_msa_disabled,
501 520
502 .vm_init = kvm_trap_emul_vm_init, 521 .vm_init = kvm_trap_emul_vm_init,