linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Erhard F." <erhard_f@mailbox.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Sandipan Das <sandipan.das@amd.com>,
	linux-kernel@vger.kernel.org,
	Nick Desaulniers <ndesaulniers@google.com>,
	Joao Moreira <joao@overdrivepizza.com>
Subject: Re: [bisected] clang 15 built kernel fails to boot, stuck at "Loading Linux 6.1.1 ...", gcc 12 built kernel with same config boots fine
Date: Fri, 20 Jan 2023 12:49:33 +0100	[thread overview]
Message-ID: <20230120124933.69c3ae99@yea> (raw)
In-Reply-To: <Y8p4CnJU6T7+17Sw@hirez.programming.kicks-ass.net>

On Fri, 20 Jan 2023 12:16:26 +0100
Peter Zijlstra <peterz@infradead.org> wrote:

> On Fri, Jan 20, 2023 at 11:20:53AM +0530, Sandipan Das wrote:
> 
> > With the combination of defconfig+kvm_guest.config+localyesconfig, the only
> > thing that made a difference was the compiler optimization choice. The kernel
> > boots up with CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y but not with
> > CONFIG_CC_OPTIMIZE_FOR_SIZE=y. Both Clang 15 and 16 kernel builds are affected.  
> 
> *groan*..
> 
> 0000000000000350 <amd_pmu_add_event>:
> 350:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1) 351: R_X86_64_NONE      __fentry__-0x4
> 355:       48 83 bf 20 01 00 00 00         cmpq   $0x0,0x120(%rdi)
> 35d:       0f 85 00 00 00 00       jne    363 <amd_pmu_add_event+0x13>     35f: R_X86_64_PLT32     __SCT__amd_pmu_branch_add-0x4
> 363:       e9 00 00 00 00          jmp    368 <amd_pmu_add_event+0x18>     364: R_X86_64_PLT32     __x86_return_thunk-0x4
> 
> and static_call() can't deal with Jcc, I wonder why we've not seen that
> before -- this isn't totally idiotic code-gen and esp. clang is known to
> do this (see the retpoline thing).
> 
> Let me see if I can do something about that.

I can confirm that with -O2 I get a booting kernel with netconsole output using the .config I originally posted.

However the machine does not finish booting, even with -O2. In the netconsole dmesg I get to the point "Run /sbin/init as init process" but that's it, no on-screen ouput on the laptop itself... So there seem to be 2 issues.

And sorry for my custom .config! Forgot that it was tailored for my Lenovo Thinkpad A275. Next time I'll try to replicate my issues with a more generic config (hopefully) bootable on a VM.

Regards,
Erhard

  reply	other threads:[~2023-01-20 11:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19  1:23 [bisected] clang 15 built kernel fails to boot, stuck at "Loading Linux 6.1.1 ...", gcc 12 built kernel with same config boots fine Erhard F.
2023-01-19 13:56 ` Peter Zijlstra
2023-01-19 15:18   ` Peter Zijlstra
2023-01-20  5:50     ` Sandipan Das
2023-01-20 10:27       ` Peter Zijlstra
2023-01-20 11:16       ` Peter Zijlstra
2023-01-20 11:49         ` Erhard F. [this message]
2023-01-20 14:57         ` Peter Zijlstra
2023-01-20 15:20           ` Erhard F.
2023-01-20 16:13             ` Peter Zijlstra
2023-01-20 15:32           ` Peter Zijlstra
2023-01-22  8:46           ` Masami Hiramatsu
2023-01-19 14:44 ` Linux kernel regression tracking (#adding)
2023-01-26 11:47   ` Linux kernel regression tracking (#update)

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=20230120124933.69c3ae99@yea \
    --to=erhard_f@mailbox.org \
    --cc=joao@overdrivepizza.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=sandipan.das@amd.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;
as well as URLs for NNTP newsgroup(s).