@@ -583,7 +583,13 @@ static bool fiq_debugger_fiq_exec(struct fiq_debugger_state *state,
583
583
void * svc_sp )
584
584
{
585
585
bool signal_helper = false;
586
+ unsigned long va_start ;
586
587
588
+ #ifdef CONFIG_ARM64
589
+ va_start = VA_START ;
590
+ #else
591
+ va_start = PAGE_OFFSET ;
592
+ #endif
587
593
if (!strcmp (cmd , "help" ) || !strcmp (cmd , "?" )) {
588
594
fiq_debugger_help (state );
589
595
} else if (!strcmp (cmd , "pc" )) {
@@ -593,11 +599,14 @@ static bool fiq_debugger_fiq_exec(struct fiq_debugger_state *state,
593
599
} else if (!strcmp (cmd , "allregs" )) {
594
600
fiq_debugger_dump_allregs (& state -> output , regs );
595
601
} else if (!strcmp (cmd , "bt" )) {
596
- if (!user_mode ((struct pt_regs * )regs ))
602
+ if (user_mode ((struct pt_regs * )regs ) ||
603
+ ((unsigned long )svc_sp < va_start ) ||
604
+ ((unsigned long )svc_sp > -256UL ))
605
+ fiq_debugger_printf (& state -> output , "User mode\n" );
606
+ else
597
607
fiq_debugger_dump_stacktrace (& state -> output , regs ,
598
608
100 , svc_sp );
599
- else
600
- fiq_debugger_printf (& state -> output , "User mode\n" );
609
+
601
610
} else if (!strncmp (cmd , "reset" , 5 )) {
602
611
cmd += 5 ;
603
612
while (* cmd == ' ' )
@@ -1022,13 +1031,8 @@ void fiq_debugger_fiq(void *regs, u32 cpu)
1022
1031
if (!state )
1023
1032
return ;
1024
1033
1025
- if (!user_mode ((struct pt_regs * )regs ))
1026
- need_irq = fiq_debugger_handle_uart_interrupt (state ,
1027
- smp_processor_id (),
1028
- regs , current_thread_info ());
1029
- else
1030
- need_irq = fiq_debugger_handle_uart_interrupt (state , cpu ,
1031
- regs , current_thread_info ());
1034
+ need_irq = fiq_debugger_handle_uart_interrupt (state , cpu , regs ,
1035
+ current_thread_info ());
1032
1036
if (need_irq )
1033
1037
fiq_debugger_force_irq (state );
1034
1038
}
0 commit comments