@@ -399,7 +399,7 @@ int __MIPS16e_compute_return_epc(struct pt_regs *regs)
399399 *
400400 * @regs: Pointer to pt_regs
401401 * @insn: branch instruction to decode
402- * @returns: -EFAULT on error and forces SIGBUS , and on success
402+ * @returns: -EFAULT on error and forces SIGILL , and on success
403403 * returns 0 or BRANCH_LIKELY_TAKEN as appropriate after
404404 * evaluating the branch.
405405 *
@@ -431,7 +431,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
431431 /* Fall through */
432432 case jr_op :
433433 if (NO_R6EMU && insn .r_format .func == jr_op )
434- goto sigill_r6 ;
434+ goto sigill_r2r6 ;
435435 regs -> cp0_epc = regs -> regs [insn .r_format .rs ];
436436 break ;
437437 }
@@ -446,7 +446,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
446446 switch (insn .i_format .rt ) {
447447 case bltzl_op :
448448 if (NO_R6EMU )
449- goto sigill_r6 ;
449+ goto sigill_r2r6 ;
450450 case bltz_op :
451451 if ((long )regs -> regs [insn .i_format .rs ] < 0 ) {
452452 epc = epc + 4 + (insn .i_format .simmediate << 2 );
@@ -459,7 +459,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
459459
460460 case bgezl_op :
461461 if (NO_R6EMU )
462- goto sigill_r6 ;
462+ goto sigill_r2r6 ;
463463 case bgez_op :
464464 if ((long )regs -> regs [insn .i_format .rs ] >= 0 ) {
465465 epc = epc + 4 + (insn .i_format .simmediate << 2 );
@@ -473,10 +473,8 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
473473 case bltzal_op :
474474 case bltzall_op :
475475 if (NO_R6EMU && (insn .i_format .rs ||
476- insn .i_format .rt == bltzall_op )) {
477- ret = - SIGILL ;
478- break ;
479- }
476+ insn .i_format .rt == bltzall_op ))
477+ goto sigill_r2r6 ;
480478 regs -> regs [31 ] = epc + 8 ;
481479 /*
482480 * OK we are here either because we hit a NAL
@@ -507,10 +505,8 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
507505 case bgezal_op :
508506 case bgezall_op :
509507 if (NO_R6EMU && (insn .i_format .rs ||
510- insn .i_format .rt == bgezall_op )) {
511- ret = - SIGILL ;
512- break ;
513- }
508+ insn .i_format .rt == bgezall_op ))
509+ goto sigill_r2r6 ;
514510 regs -> regs [31 ] = epc + 8 ;
515511 /*
516512 * OK we are here either because we hit a BAL
@@ -556,6 +552,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
556552 /*
557553 * These are unconditional and in j_format.
558554 */
555+ case jalx_op :
559556 case jal_op :
560557 regs -> regs [31 ] = regs -> cp0_epc + 8 ;
561558 case j_op :
@@ -573,7 +570,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
573570 */
574571 case beql_op :
575572 if (NO_R6EMU )
576- goto sigill_r6 ;
573+ goto sigill_r2r6 ;
577574 case beq_op :
578575 if (regs -> regs [insn .i_format .rs ] ==
579576 regs -> regs [insn .i_format .rt ]) {
@@ -587,7 +584,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
587584
588585 case bnel_op :
589586 if (NO_R6EMU )
590- goto sigill_r6 ;
587+ goto sigill_r2r6 ;
591588 case bne_op :
592589 if (regs -> regs [insn .i_format .rs ] !=
593590 regs -> regs [insn .i_format .rt ]) {
@@ -601,7 +598,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
601598
602599 case blezl_op : /* not really i_format */
603600 if (!insn .i_format .rt && NO_R6EMU )
604- goto sigill_r6 ;
601+ goto sigill_r2r6 ;
605602 case blez_op :
606603 /*
607604 * Compact branches for R6 for the
@@ -636,7 +633,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
636633
637634 case bgtzl_op :
638635 if (!insn .i_format .rt && NO_R6EMU )
639- goto sigill_r6 ;
636+ goto sigill_r2r6 ;
640637 case bgtz_op :
641638 /*
642639 * Compact branches for R6 for the
@@ -843,11 +840,12 @@ int __compute_return_epc_for_insn(struct pt_regs *regs,
843840 return ret ;
844841
845842sigill_dsp :
846- printk ("%s: DSP branch but not DSP ASE - sending SIGBUS.\n" , current -> comm );
847- force_sig (SIGBUS , current );
843+ pr_info ("%s: DSP branch but not DSP ASE - sending SIGILL.\n" ,
844+ current -> comm );
845+ force_sig (SIGILL , current );
848846 return - EFAULT ;
849- sigill_r6 :
850- pr_info ("%s: R2 branch but r2-to-r6 emulator is not preset - sending SIGILL.\n" ,
847+ sigill_r2r6 :
848+ pr_info ("%s: R2 branch but r2-to-r6 emulator is not present - sending SIGILL.\n" ,
851849 current -> comm );
852850 force_sig (SIGILL , current );
853851 return - EFAULT ;
0 commit comments