@@ -1462,9 +1462,8 @@ static int emulate_math(struct pt_regs *regs)
1462
1462
static inline int emulate_math (struct pt_regs * regs ) { return -1 ; }
1463
1463
#endif
1464
1464
1465
- void program_check_exception (struct pt_regs * regs )
1465
+ static void do_program_check (struct pt_regs * regs )
1466
1466
{
1467
- enum ctx_state prev_state = exception_enter ();
1468
1467
unsigned int reason = get_reason (regs );
1469
1468
1470
1469
/* We can now get here via a FP Unavailable exception if the core
@@ -1473,22 +1472,22 @@ void program_check_exception(struct pt_regs *regs)
1473
1472
if (reason & REASON_FP ) {
1474
1473
/* IEEE FP exception */
1475
1474
parse_fpe (regs );
1476
- goto bail ;
1475
+ return ;
1477
1476
}
1478
1477
if (reason & REASON_TRAP ) {
1479
1478
unsigned long bugaddr ;
1480
1479
/* Debugger is first in line to stop recursive faults in
1481
1480
* rcu_lock, notify_die, or atomic_notifier_call_chain */
1482
1481
if (debugger_bpt (regs ))
1483
- goto bail ;
1482
+ return ;
1484
1483
1485
1484
if (kprobe_handler (regs ))
1486
- goto bail ;
1485
+ return ;
1487
1486
1488
1487
/* trap exception */
1489
1488
if (notify_die (DIE_BPT , "breakpoint" , regs , 5 , 5 , SIGTRAP )
1490
1489
== NOTIFY_STOP )
1491
- goto bail ;
1490
+ return ;
1492
1491
1493
1492
bugaddr = regs -> nip ;
1494
1493
/*
@@ -1500,10 +1499,10 @@ void program_check_exception(struct pt_regs *regs)
1500
1499
if (!(regs -> msr & MSR_PR ) && /* not user-mode */
1501
1500
report_bug (bugaddr , regs ) == BUG_TRAP_TYPE_WARN ) {
1502
1501
regs -> nip += 4 ;
1503
- goto bail ;
1502
+ return ;
1504
1503
}
1505
1504
_exception (SIGTRAP , regs , TRAP_BRKPT , regs -> nip );
1506
- goto bail ;
1505
+ return ;
1507
1506
}
1508
1507
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
1509
1508
if (reason & REASON_TM ) {
@@ -1524,7 +1523,7 @@ void program_check_exception(struct pt_regs *regs)
1524
1523
*/
1525
1524
if (user_mode (regs )) {
1526
1525
_exception (SIGILL , regs , ILL_ILLOPN , regs -> nip );
1527
- goto bail ;
1526
+ return ;
1528
1527
} else {
1529
1528
printk (KERN_EMERG "Unexpected TM Bad Thing exception "
1530
1529
"at %lx (msr 0x%lx) tm_scratch=%llx\n" ,
@@ -1557,18 +1556,18 @@ void program_check_exception(struct pt_regs *regs)
1557
1556
* pattern to occurrences etc. -dgibson 31/Mar/2003
1558
1557
*/
1559
1558
if (!emulate_math (regs ))
1560
- goto bail ;
1559
+ return ;
1561
1560
1562
1561
/* Try to emulate it if we should. */
1563
1562
if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED )) {
1564
1563
switch (emulate_instruction (regs )) {
1565
1564
case 0 :
1566
1565
regs -> nip += 4 ;
1567
1566
emulate_single_step (regs );
1568
- goto bail ;
1567
+ return ;
1569
1568
case - EFAULT :
1570
1569
_exception (SIGSEGV , regs , SEGV_MAPERR , regs -> nip );
1571
- goto bail ;
1570
+ return ;
1572
1571
}
1573
1572
}
1574
1573
@@ -1578,7 +1577,14 @@ void program_check_exception(struct pt_regs *regs)
1578
1577
else
1579
1578
_exception (SIGILL , regs , ILL_ILLOPC , regs -> nip );
1580
1579
1581
- bail :
1580
+ }
1581
+
1582
+ void program_check_exception (struct pt_regs * regs )
1583
+ {
1584
+ enum ctx_state prev_state = exception_enter ();
1585
+
1586
+ do_program_check (regs );
1587
+
1582
1588
exception_exit (prev_state );
1583
1589
}
1584
1590
NOKPROBE_SYMBOL (program_check_exception );
@@ -1589,8 +1595,12 @@ NOKPROBE_SYMBOL(program_check_exception);
1589
1595
*/
1590
1596
void emulation_assist_interrupt (struct pt_regs * regs )
1591
1597
{
1598
+ enum ctx_state prev_state = exception_enter ();
1599
+
1592
1600
regs -> msr |= REASON_ILLEGAL ;
1593
- program_check_exception (regs );
1601
+ do_program_check (regs );
1602
+
1603
+ exception_exit (prev_state );
1594
1604
}
1595
1605
NOKPROBE_SYMBOL (emulation_assist_interrupt );
1596
1606
0 commit comments