* [PATCH 6.12/6.13] loongarch: Use ASM_REACHABLE
@ 2025-03-08 5:37 Huacai Chen
2025-03-09 19:56 ` Miguel Ojeda
2025-03-10 2:14 ` Sasha Levin
0 siblings, 2 replies; 3+ messages in thread
From: Huacai Chen @ 2025-03-08 5:37 UTC (permalink / raw)
To: Greg Kroah-Hartman, Sasha Levin, Huacai Chen
Cc: Xuerui Wang, Peter Zijlstra, Josh Poimboeuf, stable, linux-kernel,
loongarch, Huacai Chen
From: Peter Zijlstra <peterz@infradead.org>
commit 624bde3465f660e54a7cd4c1efc3e536349fead5 upstream.
annotate_reachable() is unreliable since the compiler is free to place
random code inbetween two consecutive asm() statements.
This removes the last and only annotate_reachable() user.
Backport to solve a build error since relevant commits have already been
backported.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20241128094312.133437051@infradead.org
Closes: https://lore.kernel.org/loongarch/20250307214943.372210-1-ojeda@kernel.org/
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
arch/loongarch/include/asm/bug.h | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/arch/loongarch/include/asm/bug.h b/arch/loongarch/include/asm/bug.h
index 08388876ade4..561ac1bf79e2 100644
--- a/arch/loongarch/include/asm/bug.h
+++ b/arch/loongarch/include/asm/bug.h
@@ -4,6 +4,7 @@
#include <asm/break.h>
#include <linux/stringify.h>
+#include <linux/objtool.h>
#ifndef CONFIG_DEBUG_BUGVERBOSE
#define _BUGVERBOSE_LOCATION(file, line)
@@ -33,25 +34,25 @@
#define ASM_BUG_FLAGS(flags) \
__BUG_ENTRY(flags) \
- break BRK_BUG
+ break BRK_BUG;
#define ASM_BUG() ASM_BUG_FLAGS(0)
-#define __BUG_FLAGS(flags) \
- asm_inline volatile (__stringify(ASM_BUG_FLAGS(flags)));
+#define __BUG_FLAGS(flags, extra) \
+ asm_inline volatile (__stringify(ASM_BUG_FLAGS(flags)) \
+ extra);
#define __WARN_FLAGS(flags) \
do { \
instrumentation_begin(); \
- __BUG_FLAGS(BUGFLAG_WARNING|(flags)); \
- annotate_reachable(); \
+ __BUG_FLAGS(BUGFLAG_WARNING|(flags), ASM_REACHABLE); \
instrumentation_end(); \
} while (0)
#define BUG() \
do { \
instrumentation_begin(); \
- __BUG_FLAGS(0); \
+ __BUG_FLAGS(0, ""); \
unreachable(); \
} while (0)
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 6.12/6.13] loongarch: Use ASM_REACHABLE
2025-03-08 5:37 [PATCH 6.12/6.13] loongarch: Use ASM_REACHABLE Huacai Chen
@ 2025-03-09 19:56 ` Miguel Ojeda
2025-03-10 2:14 ` Sasha Levin
1 sibling, 0 replies; 3+ messages in thread
From: Miguel Ojeda @ 2025-03-09 19:56 UTC (permalink / raw)
To: chenhuacai
Cc: chenhuacai, gregkh, jpoimboe, kernel, linux-kernel, loongarch,
peterz, sashal, stable, Miguel Ojeda
On Sat, 08 Mar 2025 13:37:53 +0800 Huacai Chen <chenhuacai@loongson.cn> wrote:
>
> From: Peter Zijlstra <peterz@infradead.org>
>
> commit 624bde3465f660e54a7cd4c1efc3e536349fead5 upstream.
>
> annotate_reachable() is unreliable since the compiler is free to place
> random code inbetween two consecutive asm() statements.
>
> This removes the last and only annotate_reachable() user.
>
> Backport to solve a build error since relevant commits have already been
> backported.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
> Link: https://lore.kernel.org/r/20241128094312.133437051@infradead.org
> Closes: https://lore.kernel.org/loongarch/20250307214943.372210-1-ojeda@kernel.org/
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This indeed removes the build failure for me -- built-tested for loongarch64
(together with the rest of the Rust long backport series):
Tested-by: Miguel Ojeda <ojeda@kernel.org>
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 6.12/6.13] loongarch: Use ASM_REACHABLE
2025-03-08 5:37 [PATCH 6.12/6.13] loongarch: Use ASM_REACHABLE Huacai Chen
2025-03-09 19:56 ` Miguel Ojeda
@ 2025-03-10 2:14 ` Sasha Levin
1 sibling, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2025-03-10 2:14 UTC (permalink / raw)
To: stable; +Cc: Huacai Chen, Sasha Levin
[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected.
No action required from the submitter.
The upstream commit SHA1 provided is correct: 624bde3465f660e54a7cd4c1efc3e536349fead5
WARNING: Author mismatch between patch and upstream commit:
Backport author: Huacai Chen<chenhuacai@loongson.cn>
Commit author: Peter Zijlstra<peterz@infradead.org>
Status in newer kernel trees:
6.13.y | Present (different SHA1: 92a3a4ad5be7)
6.6.y | Not found
Note: The patch differs from the upstream commit:
---
1: 624bde3465f66 ! 1: 0911995aac2a8 loongarch: Use ASM_REACHABLE
@@ Metadata
## Commit message ##
loongarch: Use ASM_REACHABLE
+ commit 624bde3465f660e54a7cd4c1efc3e536349fead5 upstream.
+
annotate_reachable() is unreliable since the compiler is free to place
random code inbetween two consecutive asm() statements.
This removes the last and only annotate_reachable() user.
+ Backport to solve a build error since relevant commits have already been
+ backported.
+
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20241128094312.133437051@infradead.org
+ Closes: https://lore.kernel.org/loongarch/20250307214943.372210-1-ojeda@kernel.org/
+ Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
## arch/loongarch/include/asm/bug.h ##
@@
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.12.y | Success | Success |
| stable/linux-6.13.y | Success | Success |
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-10 2:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-08 5:37 [PATCH 6.12/6.13] loongarch: Use ASM_REACHABLE Huacai Chen
2025-03-09 19:56 ` Miguel Ojeda
2025-03-10 2:14 ` Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox