]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.20/mips-remove-function-size-check-in-get_frame_info.patch
Linux 4.14.106
[thirdparty/kernel/stable-queue.git] / queue-4.20 / mips-remove-function-size-check-in-get_frame_info.patch
1 From 890edad3fec5ecb478f7fe3e8ad735a798ec4f4e Mon Sep 17 00:00:00 2001
2 From: Jun-Ru Chang <jrjang@realtek.com>
3 Date: Tue, 29 Jan 2019 11:56:07 +0800
4 Subject: MIPS: Remove function size check in get_frame_info()
5
6 [ Upstream commit 2b424cfc69728224fcb5fad138ea7260728e0901 ]
7
8 Patch (b6c7a324df37b "MIPS: Fix get_frame_info() handling of
9 microMIPS function size.") introduces additional function size
10 check for microMIPS by only checking insn between ip and ip + func_size.
11 However, func_size in get_frame_info() is always 0 if KALLSYMS is not
12 enabled. This causes get_frame_info() to return immediately without
13 calculating correct frame_size, which in turn causes "Can't analyze
14 schedule() prologue" warning messages at boot time.
15
16 This patch removes func_size check, and let the frame_size check run
17 up to 128 insns for both MIPS and microMIPS.
18
19 Signed-off-by: Jun-Ru Chang <jrjang@realtek.com>
20 Signed-off-by: Tony Wu <tonywu@realtek.com>
21 Signed-off-by: Paul Burton <paul.burton@mips.com>
22 Fixes: b6c7a324df37b ("MIPS: Fix get_frame_info() handling of microMIPS function size.")
23 Cc: <ralf@linux-mips.org>
24 Cc: <jhogan@kernel.org>
25 Cc: <macro@mips.com>
26 Cc: <yamada.masahiro@socionext.com>
27 Cc: <peterz@infradead.org>
28 Cc: <mingo@kernel.org>
29 Cc: <linux-mips@vger.kernel.org>
30 Cc: <linux-kernel@vger.kernel.org>
31 Signed-off-by: Sasha Levin <sashal@kernel.org>
32 ---
33 arch/mips/kernel/process.c | 7 +++----
34 1 file changed, 3 insertions(+), 4 deletions(-)
35
36 diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
37 index d4f7fd4550e1..85522c137f19 100644
38 --- a/arch/mips/kernel/process.c
39 +++ b/arch/mips/kernel/process.c
40 @@ -371,7 +371,7 @@ static inline int is_sp_move_ins(union mips_instruction *ip, int *frame_size)
41 static int get_frame_info(struct mips_frame_info *info)
42 {
43 bool is_mmips = IS_ENABLED(CONFIG_CPU_MICROMIPS);
44 - union mips_instruction insn, *ip, *ip_end;
45 + union mips_instruction insn, *ip;
46 const unsigned int max_insns = 128;
47 unsigned int last_insn_size = 0;
48 unsigned int i;
49 @@ -384,10 +384,9 @@ static int get_frame_info(struct mips_frame_info *info)
50 if (!ip)
51 goto err;
52
53 - ip_end = (void *)ip + info->func_size;
54 -
55 - for (i = 0; i < max_insns && ip < ip_end; i++) {
56 + for (i = 0; i < max_insns; i++) {
57 ip = (void *)ip + last_insn_size;
58 +
59 if (is_mmips && mm_insn_16bit(ip->halfword[0])) {
60 insn.word = ip->halfword[0] << 16;
61 last_insn_size = 2;
62 --
63 2.19.1
64