* [PATCH v2] MIPS: jump_label: Fix compat branch range check
@ 2022-11-03 15:10 Jiaxun Yang
2022-11-09 11:07 ` Jiaxun Yang
2022-11-11 15:04 ` Thomas Bogendoerfer
0 siblings, 2 replies; 3+ messages in thread
From: Jiaxun Yang @ 2022-11-03 15:10 UTC (permalink / raw)
To: linux-mips
Cc: linux-kernel, tsbogend, ardb, rostedt, Jiaxun Yang, stable,
Philippe Mathieu-Daudé
Cast upper bound of branch range to long to do signed compare,
avoid negative offset trigger this warning.
Fixes: 9b6584e35f40 ("MIPS: jump_label: Use compact branches for >= r6")
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: stable@vger.kernel.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
v2: Fix typo, collect review tags.
---
arch/mips/kernel/jump_label.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/kernel/jump_label.c b/arch/mips/kernel/jump_label.c
index 71a882c8c6eb..f7978d50a2ba 100644
--- a/arch/mips/kernel/jump_label.c
+++ b/arch/mips/kernel/jump_label.c
@@ -56,7 +56,7 @@ void arch_jump_label_transform(struct jump_entry *e,
* The branch offset must fit in the instruction's 26
* bit field.
*/
- WARN_ON((offset >= BIT(25)) ||
+ WARN_ON((offset >= (long)BIT(25)) ||
(offset < -(long)BIT(25)));
insn.j_format.opcode = bc6_op;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] MIPS: jump_label: Fix compat branch range check
2022-11-03 15:10 [PATCH v2] MIPS: jump_label: Fix compat branch range check Jiaxun Yang
@ 2022-11-09 11:07 ` Jiaxun Yang
2022-11-11 15:04 ` Thomas Bogendoerfer
1 sibling, 0 replies; 3+ messages in thread
From: Jiaxun Yang @ 2022-11-09 11:07 UTC (permalink / raw)
To: tsbogend
Cc: linux-mips, linux-kernel, ardb, rostedt, stable,
Philippe Mathieu-Daudé
在 2022/11/3 15:10, Jiaxun Yang 写道:
> Cast upper bound of branch range to long to do signed compare,
> avoid negative offset trigger this warning.
>
> Fixes: 9b6584e35f40 ("MIPS: jump_label: Use compact branches for >= r6")
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Cc: stable@vger.kernel.org
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Ping :-)
Thanks
- Jiaxun
> ---
> v2: Fix typo, collect review tags.
> ---
> arch/mips/kernel/jump_label.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/kernel/jump_label.c b/arch/mips/kernel/jump_label.c
> index 71a882c8c6eb..f7978d50a2ba 100644
> --- a/arch/mips/kernel/jump_label.c
> +++ b/arch/mips/kernel/jump_label.c
> @@ -56,7 +56,7 @@ void arch_jump_label_transform(struct jump_entry *e,
> * The branch offset must fit in the instruction's 26
> * bit field.
> */
> - WARN_ON((offset >= BIT(25)) ||
> + WARN_ON((offset >= (long)BIT(25)) ||
> (offset < -(long)BIT(25)));
>
> insn.j_format.opcode = bc6_op;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] MIPS: jump_label: Fix compat branch range check
2022-11-03 15:10 [PATCH v2] MIPS: jump_label: Fix compat branch range check Jiaxun Yang
2022-11-09 11:07 ` Jiaxun Yang
@ 2022-11-11 15:04 ` Thomas Bogendoerfer
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2022-11-11 15:04 UTC (permalink / raw)
To: Jiaxun Yang
Cc: linux-mips, linux-kernel, ardb, rostedt, stable,
Philippe Mathieu-Daudé
On Thu, Nov 03, 2022 at 03:10:53PM +0000, Jiaxun Yang wrote:
> Cast upper bound of branch range to long to do signed compare,
> avoid negative offset trigger this warning.
>
> Fixes: 9b6584e35f40 ("MIPS: jump_label: Use compact branches for >= r6")
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Cc: stable@vger.kernel.org
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> v2: Fix typo, collect review tags.
> ---
> arch/mips/kernel/jump_label.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/kernel/jump_label.c b/arch/mips/kernel/jump_label.c
> index 71a882c8c6eb..f7978d50a2ba 100644
> --- a/arch/mips/kernel/jump_label.c
> +++ b/arch/mips/kernel/jump_label.c
> @@ -56,7 +56,7 @@ void arch_jump_label_transform(struct jump_entry *e,
> * The branch offset must fit in the instruction's 26
> * bit field.
> */
> - WARN_ON((offset >= BIT(25)) ||
> + WARN_ON((offset >= (long)BIT(25)) ||
> (offset < -(long)BIT(25)));
>
> insn.j_format.opcode = bc6_op;
> --
> 2.34.1
applied to mips-fixes.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-11 15:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-03 15:10 [PATCH v2] MIPS: jump_label: Fix compat branch range check Jiaxun Yang
2022-11-09 11:07 ` Jiaxun Yang
2022-11-11 15:04 ` Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).