Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Paul Burton <paul.burton@imgtec.com>
To: <linux-mips@linux-mips.org>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Paul Burton <paul.burton@imgtec.com>,
	Tony Wu <tung7970@gmail.com>,
	"# v3 . 10+" <stable@vger.kernel.org>
Subject: [PATCH 6/6] MIPS: Handle microMIPS jumps in the same way as MIPS32/MIPS64 jumps
Date: Mon, 7 Nov 2016 15:07:07 +0000	[thread overview]
Message-ID: <20161107150707.5079-7-paul.burton@imgtec.com> (raw)
In-Reply-To: <20161107150707.5079-1-paul.burton@imgtec.com>

is_jump_ins() checks for plain jump ("j") instructions since commit
e7438c4b893e ("MIPS: Fix sibling call handling in get_frame_info") but
that commit didn't make the same change to the microMIPS code, leaving
it inconsistent with the MIPS32/MIPS64 code. Handle the microMIPS
encoding of the jump instruction too such that it behaves consistently.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Fixes: e7438c4b893e ("MIPS: Fix sibling call handling in get_frame_info")
Cc: linux-mips@linux-mips.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Tony Wu <tung7970@gmail.com>
Cc: <stable@vger.kernel.org> # v3.10+

---

 arch/mips/kernel/process.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 39c946f..1652f36 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -293,6 +293,8 @@ static inline int is_jump_ins(union mips_instruction *ip)
 		return 0;
 	}
 
+	if (ip->j_format.opcode == mm_j32_op)
+		return 1;
 	if (ip->j_format.opcode == mm_jal32_op)
 		return 1;
 	if (ip->r_format.opcode != mm_pool32a_op ||
-- 
2.10.2

WARNING: multiple messages have this Message-ID (diff)
From: Paul Burton <paul.burton@imgtec.com>
To: linux-mips@linux-mips.org
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Paul Burton <paul.burton@imgtec.com>,
	Tony Wu <tung7970@gmail.com>,
	"# v3 . 10+" <stable@vger.kernel.org>
Subject: [PATCH 6/6] MIPS: Handle microMIPS jumps in the same way as MIPS32/MIPS64 jumps
Date: Mon, 7 Nov 2016 15:07:07 +0000	[thread overview]
Message-ID: <20161107150707.5079-7-paul.burton@imgtec.com> (raw)
Message-ID: <20161107150707.TDZ5eE3Ep3WWdo3MtZBaHXjYmzN-Vsw8KagFkr48_NE@z> (raw)
In-Reply-To: <20161107150707.5079-1-paul.burton@imgtec.com>

is_jump_ins() checks for plain jump ("j") instructions since commit
e7438c4b893e ("MIPS: Fix sibling call handling in get_frame_info") but
that commit didn't make the same change to the microMIPS code, leaving
it inconsistent with the MIPS32/MIPS64 code. Handle the microMIPS
encoding of the jump instruction too such that it behaves consistently.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Fixes: e7438c4b893e ("MIPS: Fix sibling call handling in get_frame_info")
Cc: linux-mips@linux-mips.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Tony Wu <tung7970@gmail.com>
Cc: <stable@vger.kernel.org> # v3.10+

---

 arch/mips/kernel/process.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 39c946f..1652f36 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -293,6 +293,8 @@ static inline int is_jump_ins(union mips_instruction *ip)
 		return 0;
 	}
 
+	if (ip->j_format.opcode == mm_j32_op)
+		return 1;
 	if (ip->j_format.opcode == mm_jal32_op)
 		return 1;
 	if (ip->r_format.opcode != mm_pool32a_op ||
-- 
2.10.2

  parent reply	other threads:[~2016-11-07 15:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07 15:07 [PATCH 0/6] MIPS: microMIPS stack unwinding fixes Paul Burton
2016-11-07 15:07 ` Paul Burton
2016-11-07 15:07 ` [PATCH 1/6] MIPS: Clear ISA bit correctly in get_frame_info() Paul Burton
2016-11-07 15:07   ` Paul Burton
2016-11-07 15:07 ` [PATCH 2/6] MIPS: Prevent unaligned accesses during stack unwinding Paul Burton
2016-11-07 15:07   ` Paul Burton
2016-11-07 15:07 ` [PATCH 3/6] MIPS: Fix get_frame_info() handling of microMIPS function size Paul Burton
2016-11-07 15:07   ` Paul Burton
2016-11-07 15:07 ` [PATCH 4/6] MIPS: Fix is_jump_ins() handling of 16b microMIPS instructions Paul Burton
2016-11-07 15:07   ` Paul Burton
2016-11-07 15:07 ` [PATCH 5/6] MIPS: Calculate microMIPS ra properly when unwinding the stack Paul Burton
2016-11-07 15:07   ` Paul Burton
2016-11-07 15:07 ` Paul Burton [this message]
2016-11-07 15:07   ` [PATCH 6/6] MIPS: Handle microMIPS jumps in the same way as MIPS32/MIPS64 jumps Paul Burton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161107150707.5079-7-paul.burton@imgtec.com \
    --to=paul.burton@imgtec.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=stable@vger.kernel.org \
    --cc=tung7970@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox