Skip to content

Commit 2b424cf

Browse files
jrjangpaulburton
authored andcommitted
MIPS: Remove function size check in get_frame_info()
Patch (b6c7a32 "MIPS: Fix get_frame_info() handling of microMIPS function size.") introduces additional function size check for microMIPS by only checking insn between ip and ip + func_size. However, func_size in get_frame_info() is always 0 if KALLSYMS is not enabled. This causes get_frame_info() to return immediately without calculating correct frame_size, which in turn causes "Can't analyze schedule() prologue" warning messages at boot time. This patch removes func_size check, and let the frame_size check run up to 128 insns for both MIPS and microMIPS. Signed-off-by: Jun-Ru Chang <jrjang@realtek.com> Signed-off-by: Tony Wu <tonywu@realtek.com> Signed-off-by: Paul Burton <paul.burton@mips.com> Fixes: b6c7a32 ("MIPS: Fix get_frame_info() handling of microMIPS function size.") Cc: <ralf@linux-mips.org> Cc: <jhogan@kernel.org> Cc: <macro@mips.com> Cc: <yamada.masahiro@socionext.com> Cc: <peterz@infradead.org> Cc: <mingo@kernel.org> Cc: <linux-mips@vger.kernel.org> Cc: <linux-kernel@vger.kernel.org>
1 parent 047f2d9 commit 2b424cf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

arch/mips/kernel/process.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ static inline int is_sp_move_ins(union mips_instruction *ip, int *frame_size)
371371
static int get_frame_info(struct mips_frame_info *info)
372372
{
373373
bool is_mmips = IS_ENABLED(CONFIG_CPU_MICROMIPS);
374-
union mips_instruction insn, *ip, *ip_end;
374+
union mips_instruction insn, *ip;
375375
const unsigned int max_insns = 128;
376376
unsigned int last_insn_size = 0;
377377
unsigned int i;
@@ -384,10 +384,9 @@ static int get_frame_info(struct mips_frame_info *info)
384384
if (!ip)
385385
goto err;
386386

387-
ip_end = (void *)ip + info->func_size;
388-
389-
for (i = 0; i < max_insns && ip < ip_end; i++) {
387+
for (i = 0; i < max_insns; i++) {
390388
ip = (void *)ip + last_insn_size;
389+
391390
if (is_mmips && mm_insn_16bit(ip->halfword[0])) {
392391
insn.word = ip->halfword[0] << 16;
393392
last_insn_size = 2;

0 commit comments

Comments
 (0)