From: Sandipan Das <sandipan.das@amd.com>
To: "Erhard F." <erhard_f@mailbox.org>,
Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org
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 11:20:53 +0530 [thread overview]
Message-ID: <178000f1-1464-03cb-2335-a01b77e70692@amd.com> (raw)
In-Reply-To: <Y8lfStnaUFNRxgYu@hirez.programming.kicks-ass.net>
On 1/19/2023 8:48 PM, Peter Zijlstra wrote:
> On Thu, Jan 19, 2023 at 02:56:08PM +0100, Peter Zijlstra wrote:
>> On Thu, Jan 19, 2023 at 02:23:03AM +0100, Erhard F. wrote:
>>> Hi!
>>>
>>> I did a kernel bisect for an issue I originally posted on https://github.com/ClangBuiltLinux/linux/issues/1774
>>>
>>> It is about kernel 6.1.x not booting on my machines when built with clang. A gcc built kernel with the same config just works fine. Turns out kernel v6.2-rc4 and earlier v6.2-rc are still affected.
>>>
>>> I did a kernel bisect which revealed this commit:
>>>
>>> # git bisect bad
>>> 706460a96fc654e80b6bed1f562b00d2ce9f2f4d is the first bad commit
>>> commit 706460a96fc654e80b6bed1f562b00d2ce9f2f4d
>>> Author: Sandipan Das <sandipan.das@amd.com>
>>> Date: Thu Aug 11 17:59:51 2022 +0530
>>>
>>> perf/x86/amd/core: Add generic branch record interfaces
>>>
>>> AMD processors that are capable of recording branches support either Branch
>>> Sampling (BRS) or Last Branch Record (LBR). In preparation for adding Last
>>> Branch Record Extension Version 2 (LbrExtV2) support, introduce new static
>>> calls which act as gateways to call into the feature-dependent functions
>>> based on what is available on the processor.
>>>
>>> Signed-off-by: Sandipan Das <sandipan.das@amd.com>
>>> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>>> Link: https://lore.kernel.org/r/b75dbc32663cb395f0d701167e952c6a6b0445a3.1660211399.git.sandipan.das@amd.com
>>>
>>> arch/x86/events/amd/core.c | 34 ++++++++++++++++++++++------------
>>> 1 file changed, 22 insertions(+), 12 deletions(-)
>>
>> Using: v6.2-rc4-67-g7287904c8771
>>
>> I have an AMD Interlagos and after bringing it back to live/up-to-date I
>> can't seem to even boot your .config in qemu/kvm irrespective of
>> GCC/Clang.
>>
I had a similar experience on a system with an AMD EPYC 7713. Both guest
and bare-metal boot failed.
>> When I build defconfig+kvm_guest.config both GCC-12 and clang-15 boot
>> just fine in qemu/kvm.
>
> Furthermore, testing localyesconfig based off Debian's
> config-6.1.0-1-amd64 boots fine using both GCC-12 and clang-15 as host
> kernels on that machine.
>
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.
- Sandipan
next prev parent reply other threads:[~2023-01-20 5:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-19 1:23 Erhard F.
2023-01-19 13:56 ` Peter Zijlstra
2023-01-19 15:18 ` Peter Zijlstra
2023-01-20 5:50 ` Sandipan Das [this message]
2023-01-20 10:27 ` Peter Zijlstra
2023-01-20 11:16 ` Peter Zijlstra
2023-01-20 11:49 ` Erhard F.
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=178000f1-1464-03cb-2335-a01b77e70692@amd.com \
--to=sandipan.das@amd.com \
--cc=erhard_f@mailbox.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.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
all inboxes | Powered by JetHome®