From: Ingo Molnar <mingo@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Ard Biesheuvel <ardb+git@google.com>,
linux-kernel@vger.kernel.org, x86@kernel.org,
Tom Lendacky <thomas.lendacky@amd.com>,
Nathan Chancellor <nathan@kernel.org>
Subject: Re: [RFC PATCH 1/2] x86/relocs: Improve diagnostic for rejected absolute references
Date: Sat, 22 Feb 2025 13:01:15 +0100 [thread overview]
Message-ID: <Z7m8i8YC7Mltqcpz@gmail.com> (raw)
In-Reply-To: <CAMj1kXHi63vHS7EuZE-frb-nf8P9RV=dPyFR+UU9=NaCHvP=MA@mail.gmail.com>
* Ard Biesheuvel <ardb@kernel.org> wrote:
> On Mon, 3 Feb 2025 at 10:40, Ingo Molnar <mingo@kernel.org> wrote:
> >
> >
> > * Ard Biesheuvel <ardb@kernel.org> wrote:
> >
> > > On Mon, 27 Jan 2025 at 17:57, Linus Torvalds
> > > <torvalds@linux-foundation.org> wrote:
> > > >
> > > > On Mon, 27 Jan 2025 at 03:43, Ard Biesheuvel <ardb+git@google.com> wrote:
> > > > >
> > > > > Absolute reference to symbol '.rodata+0x180' detected in .head.text (0xffffffff820cb4ba).
> > > >
> > > > Do we have any symbol name lookup logic anywhere?
> > > >
> > >
> > > I can look into that. In this particular case, though, there is no
> > > symbol to look up as it is a anonymous jump table generated by the
> > > compiler. And the function name would be inaccurate too, as
> > > snp_cpuid_postprocess() got inlined into its caller. But I guess with
> > > the right DWARF data, at least the call site could be narrowed down a
> > > bit better.
> >
> > So patch #2 is now upstream, but should I apply this diagnostic patch
> > as-is, or will there be a -v2?
> >
>
> I'm looking into this. But give the points above, I'm reaching the
> conclusion that producing a better diagnostic based solely on vmlinux
> (which may be built without debug info) is intractable, and not even
> the DWARF metadata will describe a compiler generated jump table using
> a named ELF symbol.
>
> So I am also looking into isolating the startup code like I did for
> arm64 (and which has been adopted by RISC-V as well), but this is
> rather hairy on x86 so it will take some time. But once that lands,
> this diagnostic can be removed.
>
> So I will leave it up to you to decide whether to merge this
> improvement for now, or revert the diagnostic as you suggested before.
> This code has already identified some issues that were subsequently
> fixed, so it has already served its purpose.
So after another 2 weeks there's been no new upstream regressions I'm
aware of, so - knock on wood - it seems we can leave the die() in
place?
But could we perhaps make it more debuggable, should it trigger - such
as not removing the relevant object file and improving the message?
I.e. make the build failure experience Linus had somewhat more
palatable...
Thanks,
Ingo
next prev parent reply other threads:[~2025-02-22 12:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-27 11:43 [RFC PATCH 0/2] Fix more head.text bugs and improve diagnostic Ard Biesheuvel
2025-01-27 11:43 ` [RFC PATCH 1/2] x86/relocs: Improve diagnostic for rejected absolute references Ard Biesheuvel
2025-01-27 16:57 ` Linus Torvalds
2025-01-27 22:01 ` Ard Biesheuvel
2025-02-03 9:40 ` Ingo Molnar
2025-02-03 10:00 ` Ard Biesheuvel
2025-02-22 12:01 ` Ingo Molnar [this message]
2025-02-22 12:03 ` Ingo Molnar
2025-02-22 13:47 ` Ard Biesheuvel
2025-02-22 13:49 ` Ingo Molnar
2025-01-27 11:43 ` [RFC PATCH 2/2] x86/sev: Disable jump tables in SEV startup code Ard Biesheuvel
2025-01-27 17:09 ` Linus Torvalds
2025-01-27 22:15 ` Ard Biesheuvel
2025-01-27 22:28 ` Ard Biesheuvel
2025-01-28 22:22 ` [tip: x86/urgent] " tip-bot2 for Ard Biesheuvel
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=Z7m8i8YC7Mltqcpz@gmail.com \
--to=mingo@kernel.org \
--cc=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=thomas.lendacky@amd.com \
--cc=torvalds@linux-foundation.org \
--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