BPF List
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	bpf <bpf@vger.kernel.org>, Peter Zijlstra <peterz@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Nicolas Schier <nicolas@fjasle.eu>,
	Zheng Yejian <zhengyejian1@huawei.com>,
	Martin Kelly <martin.kelly@crowdstrike.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>
Subject: Re: [for-next][PATCH 4/6] scripts/sorttable: Zero out weak functions in mcount_loc table
Date: Mon, 24 Feb 2025 22:28:33 -0500	[thread overview]
Message-ID: <20250224222833.0a9f2f4c@batman.local.home> (raw)
In-Reply-To: <20250225025631.GA271248@ax162>

On Mon, 24 Feb 2025 18:56:31 -0800
Nathan Chancellor <nathan@kernel.org> wrote:

> I am also seeing a crash when booting arm64 with certain configurations
> that I don't see at the parent change.

Thanks, I also just bisected it down to this. But I didn't have early
printk on so I didn't see what was crashing. So this is helpful.

> 
>   $ printf 'CONFIG_%s=y\n' FTRACE FUNCTION_TRACER >kernel/configs/repro.config
> 
>   $ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux- mrproper virtconfig repro.config Image.gz
> 
>   $ qemu-system-aarch64 \
>       -display none \
>       -nodefaults \
>       -cpu max,pauth-impdef=true \
>       -machine virt,gic-version=max,virtualization=true \
>       -append 'console=ttyAMA0 earlycon' \
>       -kernel arch/arm64/boot/Image.gz \
>       -initrd rootfs.cpio \
>       -m 512m \
>       -serial mon:stdio
>   [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x000f0510]
>   [    0.000000] Linux version 6.14.0-rc4-next-20250224-dirty (nathan@ax162) (aarch64-linux-gcc (GCC) 14.2.0, GNU ld (GNU Binutils) 2.42) #1 SMP PREEMPT Mon Feb 24 18:47:59 PST 2025
>   ...
>   [    0.000000] ------------[ cut here ]------------
>   [    0.000000] kernel BUG at arch/arm64/kernel/patching.c:39!
>   [    0.000000] Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP
>   [    0.000000] Modules linked in:
>   [    0.000000] CPU: 0 UID: 0 PID: 0 Comm: swapper Not tainted 6.14.0-rc4-next-20250224-dirty #1
>   [    0.000000] Hardware name: linux,dummy-virt (DT)
>   [    0.000000] pstate: 000000c9 (nzcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
>   [    0.000000] pc : patch_map.constprop.0+0xfc/0x108
>   [    0.000000] lr : patch_map.constprop.0+0x3c/0x108
>   [    0.000000] sp : ffff96c0b6fa3ce0
>   [    0.000000] x29: ffff96c0b6fa3ce0 x28: ffff96c0b6faafd0 x27: 00000000000000ff
>   [    0.000000] x26: fff9f3a0c2408080 x25: 0000000000000001 x24: fff9f3a0c2408000
>   [    0.000000] x23: 0000000000000000 x22: ffff96c0b72391d8 x21: 00000000000000c0
>   [    0.000000] x20: 000016c035400000 x19: 000016c035400000 x18: 00000000f0000000
>   [    0.000000] x17: 0000000000000068 x16: 0000000000000100 x15: ffff96c0b6fa39c4
>   [    0.000000] x14: 0000000000000008 x13: 0000000000000000 x12: ffffe9ce43090280
>   [    0.000000] x11: fff9f3a0dfef80c8 x10: ffffe9ce43090288 x9 : 0000000000000000
>   [    0.000000] x8 : fff9f3a0dfef80b8 x7 : fffa5ce02929a000 x6 : ffff96c0b6fa39d0
>   [    0.000000] x5 : 0000000000000030 x4 : 0000000000000000 x3 : ffff96c0b69b4000
>   [    0.000000] x2 : ffff96c0b69b4000 x1 : 0000000000000000 x0 : 0000000000000000
>   [    0.000000] Call trace:
>   [    0.000000]  patch_map.constprop.0+0xfc/0x108 (P)
>   [    0.000000]  aarch64_insn_write_literal_u64+0x38/0x80
>   [    0.000000]  ftrace_init_nop+0x40/0xe0
>   [    0.000000]  ftrace_process_locs+0x2a8/0x530
>   [    0.000000]  ftrace_init+0x60/0x130
>   [    0.000000]  start_kernel+0x4ac/0x708
>   [    0.000000]  __primary_switched+0x88/0x98
>   [    0.000000] Code: d1681000 a8c27bfd d50323bf d65f03c0 (d4210000)
>   [    0.000000] ---[ end trace 0000000000000000 ]---
>   [    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
>   [    0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---
> 
> I see the same crash with clang (after applying your suggested fix for
> the issue that Arnd brought up).
> 
>   [    0.000000] Unable to handle kernel paging request at virtual address 00001cb7f7800008
>   [    0.000000] Mem abort info:
>   [    0.000000]   ESR = 0x000000009600002b
>   [    0.000000]   EC = 0x25: DABT (current EL), IL = 32 bits
>   [    0.000000]   SET = 0, FnV = 0
>   [    0.000000]   EA = 0, S1PTW = 0
>   [    0.000000]   FSC = 0x2b: level -1 translation fault
>   [    0.000000] Data abort info:
>   [    0.000000]   ISV = 0, ISS = 0x0000002b, ISS2 = 0x00000000
>   [    0.000000]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
>   [    0.000000]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
>   [    0.000000] [00001cb7f7800008] user address but active_mm is swapper
>   [    0.000000] Internal error: Oops: 000000009600002b [#1] PREEMPT SMP
>   [    0.000000] Modules linked in:
>   [    0.000000] CPU: 0 UID: 0 PID: 0 Comm: swapper Not tainted 6.14.0-rc4-next-20250224-dirty #1
>   [    0.000000] Hardware name: linux,dummy-virt (DT)
>   [    0.000000] pstate: 400000c9 (nZcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
>   [    0.000000] pc : ftrace_call_adjust+0x44/0xd0
>   [    0.000000] lr : ftrace_process_locs+0x1e0/0x560
>   [    0.000000] sp : ffff9cb878f93da0
>   [    0.000000] x29: ffff9cb878f93da0 x28: ffff9cb879234000 x27: ffff9cb879234000
>   [    0.000000] x26: 00001cb7f7800000 x25: ffff9cb878ed8578 x24: fffac24642008000
>   [    0.000000] x23: ffff9cb878f3cf90 x22: fffac24642008000 x21: 0000000000000000
>   [    0.000000] x20: 0000000000001000 x19: 00001cb7f7800000 x18: 0000000000000068
>   [    0.000000] x17: 0000000000000002 x16: 00000000fffffffe x15: ffff9cb878fa58c0
>   [    0.000000] x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000000
>   [    0.000000] x11: 0000000000000000 x10: 0000000000000000 x9 : 00007fff80000000
>   [    0.000000] x8 : 000000000000201f x7 : 0000000000000000 x6 : 6d6067666871ff73
>   [    0.000000] x5 : 0000000000000001 x4 : 0000000000000000 x3 : 0000000000000001
>   [    0.000000] x2 : 0000000000000004 x1 : 0000000000000040 x0 : 00001cb7f7800000
>   [    0.000000] Call trace:
>   [    0.000000]  ftrace_call_adjust+0x44/0xd0 (P)
>   [    0.000000]  ftrace_process_locs+0x1e0/0x560
>   [    0.000000]  ftrace_init+0x7c/0xc8
>   [    0.000000]  start_kernel+0x160/0x3b8
>   [    0.000000]  __primary_switched+0x88/0x98
>   [    0.000000] Code: aa1f03e0 14000014 aa0003f3 528403e8 (b8408e74)
> 
> If there is any other information I can provide or patches I can test, I
> am more than happy to do so.

Thanks, I'm about to go to bed soon and I'll take a look more into it tomorrow.

-- Steve

  reply	other threads:[~2025-02-25  3:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250219151815.734900568@goodmis.org>
2025-02-19 15:18 ` [for-next][PATCH 1/6] arm64: scripts/sorttable: Implement sorting mcount_loc at boot for arm64 Steven Rostedt
2025-02-19 15:18 ` [for-next][PATCH 2/6] scripts/sorttable: Have mcount rela sort use direct values Steven Rostedt
2025-02-19 15:18 ` [for-next][PATCH 3/6] scripts/sorttable: Always use an array for the mcount_loc sorting Steven Rostedt
2025-02-19 15:18 ` [for-next][PATCH 4/6] scripts/sorttable: Zero out weak functions in mcount_loc table Steven Rostedt
2025-02-24 18:08   ` Nathan Chancellor
2025-02-24 18:15     ` Steven Rostedt
2025-02-25  2:56   ` Nathan Chancellor
2025-02-25  3:28     ` Steven Rostedt [this message]
2025-02-25 15:47       ` Steven Rostedt
2025-02-25 18:00         ` Nathan Chancellor
2025-02-19 15:18 ` [for-next][PATCH 5/6] ftrace: Update the mcount_loc check of skipped entries Steven Rostedt
2025-02-19 15:18 ` [for-next][PATCH 6/6] ftrace: Have ftrace pages output reflect freed pages Steven Rostedt

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=20250224222833.0a9f2f4c@batman.local.home \
    --to=rostedt@goodmis.org \
    --cc=agordeev@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=bpf@vger.kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=martin.kelly@crowdstrike.com \
    --cc=masahiroy@kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=will@kernel.org \
    --cc=zhengyejian1@huawei.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