public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] arm64: Disable branch profiling for all arm64 code
@ 2026-01-06 10:16 Breno Leitao
  2026-01-06 12:21 ` Mark Rutland
  2026-01-08 22:29 ` Will Deacon
  0 siblings, 2 replies; 10+ messages in thread
From: Breno Leitao @ 2026-01-06 10:16 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Mark Rutland, Laura Abbott
  Cc: linux-arm-kernel, linux-kernel, linux-trace-kernel,
	Steven Rostedt, Masami Hiramatsu, kernel-team, puranjay, stable,
	Breno Leitao

The arm64 kernel doesn't boot with annotated branches
(PROFILE_ANNOTATED_BRANCHES) enabled and CONFIG_DEBUG_VIRTUAL together.

Bisecting it, I found that disabling branch profiling in arch/arm64/mm
solved the problem. Narrowing down a bit further, I found that
physaddr.c is the file that needs to have branch profiling disabled to
get the machine to boot.

I suspect that it might invoke some ftrace helper very early in the boot
process and ftrace is still not enabled(!?).

Rather than playing whack-a-mole with individual files, disable branch
profiling for the entire arch/arm64 tree, similar to what x86 already
does in arch/x86/Kbuild.

Cc: stable@vger.kernel.org
Fixes: ec6d06efb0bac ("arm64: Add support for CONFIG_DEBUG_VIRTUAL")
Signed-off-by: Breno Leitao <leitao@debian.org>
---
Changes in v2:
- Expand the scope to arch/arm64 instead of just physaddr.c
- Link to v1: https://lore.kernel.org/all/20251231-annotated-v1-1-9db1c0d03062@debian.org/
---
 arch/arm64/Kbuild | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/Kbuild b/arch/arm64/Kbuild
index 5bfbf7d79c99..d876bc0e5421 100644
--- a/arch/arm64/Kbuild
+++ b/arch/arm64/Kbuild
@@ -1,4 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0-only
+
+# Branch profiling isn't noinstr-safe
+subdir-ccflags-$(CONFIG_TRACE_BRANCH_PROFILING) += -DDISABLE_BRANCH_PROFILING
+
 obj-y			+= kernel/ mm/ net/
 obj-$(CONFIG_KVM)	+= kvm/
 obj-$(CONFIG_XEN)	+= xen/

---
base-commit: c8ebd433459bcbf068682b09544e830acd7ed222
change-id: 20251231-annotated-75de3f33cd7b

Best regards,
--  
Breno Leitao <leitao@debian.org>


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-01-08 22:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-06 10:16 [PATCH v2] arm64: Disable branch profiling for all arm64 code Breno Leitao
2026-01-06 12:21 ` Mark Rutland
2026-01-06 12:24   ` Mark Rutland
2026-01-06 16:11     ` Steven Rostedt
2026-01-07  9:37       ` Breno Leitao
2026-01-07 16:10         ` Steven Rostedt
2026-01-06 14:05   ` Breno Leitao
2026-01-06 15:31     ` Mark Rutland
2026-01-06 15:46       ` Breno Leitao
2026-01-08 22:29 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox