MIPS: Add is_jr_ra_ins() to end the loop early
authorJinyang He <hejinyang@loongson.cn>
Thu, 21 Jan 2021 05:31:38 +0000 (13:31 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Mon, 25 Jan 2021 11:21:23 +0000 (12:21 +0100)
commit50886234e846bbf2cbf14a86c727e5fc309fdf25
tree5301ada42dc0d4e3e629819a177bb205632bfb82
parent2d62f64bcc72ba45f73e58199f8e1b8cc5b67489
MIPS: Add is_jr_ra_ins() to end the loop early

For those leaf functions, they are likely to have no stack operations.
Add is_jr_ra_ins() to determine whether jr ra has been touched before
the frame_size is found. Without this patch, the get frame_size operation
may be out of range and get the frame_size from the next nested function.

There is no POOL32A format in uapi/asm/inst.h, so some bits here use the
format of r_format instead.
e.g.
---------------------------------------------------------------------
|    format      |  31:26  | 25:21 | 20:16 |    15:6    |    5:0    |
-----------------+---------+-------+-------+------------+------------
| pool32a_format | pool32a |  rt   |  rs   |   jalrc    | pool32axf |
-----------------+---------+-------+-------+------------+------------
|    r_format    |  opcode |  rs   |  rt   | rd:5, re:5 |    func   |
---------------------------------------------------------------------

Signed-off-by: Jinyang He <hejinyang@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/kernel/process.c