From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Chen Zhongjin <chenzhongjin@huawei.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
linux-arch@vger.kernel.org, peterz@infradead.org,
tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, hpa@zytor.com, mbenes@suse.cz
Subject: Re: [PATCH] Revert "x86/unwind/orc: Don't skip the first frame for inactive tasks"
Date: Wed, 3 Aug 2022 21:55:18 -0700 [thread overview]
Message-ID: <20220804045518.bfhe3rxhpkxzn4hk@treble> (raw)
In-Reply-To: <20220727031506.59322-1-chenzhongjin@huawei.com>
On Wed, Jul 27, 2022 at 11:15:06AM +0800, Chen Zhongjin wrote:
> This reverts commit f1d9a2abff66aa8156fbc1493abed468db63ea48.
>
> When CONFIG_GCOV_PROFILE_ALL is enabled, show_stack() and related
> functions (e.g. dump_stack) will break for x86 ORC unwinder.
>
> Call Trace:
> <TASK>
> ? dump_stack_lvl+0x83/0xb7
> ? schedule+0x1/0x190
> ? dump_stack+0x13/0x1f
> ? handler_pre0+0x3f/0x53 [kp_unwind]
> ...
>
> show_trace_log_lvl() searches text address on stack to validate
> whether unwind results are reliable. The code:
Hi,
Thanks for the patch. The change itself makes sense, though I'm having
trouble recreating the bug described in the patch description.
I enabled CONFIG_GCOV_PROFILE_ALL and did 'echo l >
/proc/sysrq-trigger', but I got a valid stack trace:
# echo l > /proc/sysrq-trigger
[ 343.916728] sysrq: Show backtrace of all active CPUs
[ 343.917459] NMI backtrace for cpu 2
[ 343.917884] CPU: 2 PID: 1007 Comm: bash Not tainted 5.19.0-rc8+ #68
[ 343.918562] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.0-1.fc36 04/01/2014
[ 343.919534] Call Trace:
[ 343.919904] <TASK>
[ 343.920226] dump_stack_lvl+0xcc/0x11b
[ 343.920742] dump_stack+0x17/0x24
[ 343.921199] nmi_cpu_backtrace.cold+0xb5/0x10d
[ 343.921795] ? lapic_can_unplug_cpu+0xa0/0xa0
[ 343.922375] nmi_trigger_cpumask_backtrace+0x171/0x200
[ 343.923053] arch_trigger_cpumask_backtrace+0x21/0x30
[ 343.923599] sysrq_handle_showallcpus+0x1f/0x30
[ 343.924104] __handle_sysrq.cold+0x81/0x234
[ 343.924576] write_sysrq_trigger+0x6a/0x90
[ 343.925098] proc_reg_write+0x99/0x120
[ 343.925587] vfs_write+0x16c/0x350
[ 343.926093] ksys_write+0x8c/0x180
[ 343.926597] __x64_sys_write+0x21/0x30
[ 343.927144] do_syscall_64+0x76/0x100
[ 343.927676] entry_SYSCALL_64_after_hwframe+0x63/0xcd
[ 343.928343] RIP: 0033:0x7f555e8f7b50
[ 343.928822] Code: 73 01 c3 48 8b 0d 38 83 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 79 db 2c 00 00 75 10 b8 01 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 1e e3 01 00 48 89 04 24
[ 343.930801] RSP: 002b:00007ffdd20d0978 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[ 343.931761] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f555e8f7b50
[ 343.932551] RDX: 0000000000000002 RSI: 000055ff471bfe20 RDI: 0000000000000001
[ 343.933347] RBP: 000055ff471bfe20 R08: 00007f555ebc2740 R09: 00007f555f80f700
[ 343.934155] R10: 0000000000000073 R11: 0000000000000246 R12: 0000000000000002
[ 343.934962] R13: 0000000000000001 R14: 00007f555ebc15e0 R15: 00007f555ebbd3c0
[ 343.935798] </TASK>
[ 343.936341] Sending NMI from CPU 2 to CPUs 0-1,3:
[ 343.937163] NMI backtrace for cpu 3
[ 343.937167] CPU: 3 PID: 600 Comm: systemd-journal Not tainted 5.19.0-rc8+ #68
Was this with an upstream kernel? Can you share the config and
toolchain versions?
--
Josh
next prev parent reply other threads:[~2022-08-04 4:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 3:15 [PATCH] Revert "x86/unwind/orc: Don't skip the first frame for inactive tasks" Chen Zhongjin
2022-08-04 4:55 ` Josh Poimboeuf [this message]
2022-08-04 7:27 ` Chen Zhongjin
2022-08-04 22:06 ` Josh Poimboeuf
2022-10-09 3:14 ` Chen Zhongjin
2022-10-14 22:44 ` Josh Poimboeuf
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=20220804045518.bfhe3rxhpkxzn4hk@treble \
--to=jpoimboe@kernel.org \
--cc=bp@alien8.de \
--cc=chenzhongjin@huawei.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).