From: Yonghong Song <yonghong.song@linux.dev>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>, Song Liu <song@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Kernel Team <kernel-team@fb.com>
Subject: Re: objtool failure caused some kernel functionality not working
Date: Thu, 30 Jan 2025 08:30:52 -0800 [thread overview]
Message-ID: <14c56104-074e-4449-abd6-1290ec506390@linux.dev> (raw)
In-Reply-To: <20250130082532.mvfz5v2ikqixtesc@jpoimboe>
On 1/30/25 12:25 AM, Josh Poimboeuf wrote:
> On Wed, Jan 29, 2025 at 11:10:14PM -0800, Yonghong Song wrote:
>> The llvm18 does not have issues. I tried to bisect what changed in llvm19 and
>> found the following llvm patch is responsible:
>>
>> https://github.com/llvm/llvm-project/pull/96089
>>
>> Basically, the compiler might be able to create a jump target which actually
>> not possible at runtime. For example, in one of examples in the above llvm patch, something
>> like
>> if i >= 3 goto out; /* i unsigned */
>> switch i, label default_unreachable:
>> case 0: goto label1;
>> case 1: goto label2;
>> case 2: goto label3;
>> label1: ...; return;
>> label2: ...; return;
>> label3: ...; return;
>> default_unreachable:
>>
>> I think that this should be a valid code from compiler perspective.
>>
>> Can we fix objtool to handle jump target which is immediately after the func body?Thanks, Yonghong
> I actually have a fix for that, can you try this?
>
> https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git/commit/?h=objtool/core&id=fbb454b7bb39955c324693e73a5cf7e448632553
I applied the above fix and now the kernel works fine and /sys/kernel/debug/tracing/available_filter_functions
can display tracable functions properly.
The fix is in your personal branch. Any plan to send it to upstream repo?
The fix also makes sense to me. So
Tested-by: Yonghong Song <yonghong.song@linux.dev>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
next prev parent reply other threads:[~2025-01-30 16:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-30 7:10 objtool failure caused some kernel functionality not working Yonghong Song
2025-01-30 7:21 ` Yonghong Song
2025-01-30 8:25 ` Josh Poimboeuf
2025-01-30 16:30 ` Yonghong Song [this message]
2025-02-08 2:16 ` 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=14c56104-074e-4449-abd6-1290ec506390@linux.dev \
--to=yonghong.song@linux.dev \
--cc=jpoimboe@kernel.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=song@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.