hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/arch/arm/kernel/unwind.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * arch/arm/kernel/unwind.c
34 *
45 * Copyright (C) 2008 ARM Limited
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
- *
196 *
207 * Stack unwinding support for ARM
218 *
....@@ -457,7 +444,7 @@
457444 ctrl.vrs[PC] = ctrl.vrs[LR];
458445
459446 /* check for infinite loop */
460
- if (frame->pc == ctrl.vrs[PC])
447
+ if (frame->pc == ctrl.vrs[PC] && frame->sp == ctrl.vrs[SP])
461448 return -URC_FAILURE;
462449
463450 frame->fp = ctrl.vrs[FP];
....@@ -468,7 +455,8 @@
468455 return URC_OK;
469456 }
470457
471
-void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk)
458
+void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk,
459
+ const char *loglvl)
472460 {
473461 struct stackframe frame;
474462
....@@ -506,7 +494,7 @@
506494 urc = unwind_frame(&frame);
507495 if (urc < 0)
508496 break;
509
- dump_backtrace_entry(where, frame.pc, frame.sp - 4);
497
+ dump_backtrace_entry(where, frame.pc, frame.sp - 4, loglvl);
510498 }
511499 }
512500