All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	linux-efi@vger.kernel.org
Subject: Re: [PATCH] efi/x86-mixed: move unmitigated RET into .rodata
Date: Tue, 16 Aug 2022 12:17:29 +0200	[thread overview]
Message-ID: <Yvtuufkkzr3G6cIp@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <CAMj1kXHUyAZQqLbT8uqKJTb9QHq1A4ZUbVnx+J0yQfZihJGjbg@mail.gmail.com>

On Tue, Aug 16, 2022 at 09:04:56AM +0200, Ard Biesheuvel wrote:
> (cc Peter and Josh)
> 
> On Mon, 15 Aug 2022 at 22:18, Borislav Petkov <bp@alien8.de> wrote:
> >
> > On Mon, Aug 15, 2022 at 09:57:50PM +0200, Ard Biesheuvel wrote:
> > > I'm not seeing that warning. Any config in particular beyond
> > > x86_64_defconfig that you have enabled?
> >
> > It is my workstation's tailored config. Attached.
> >
> > > I'm using Debian GCC 12.1.0 btw
> >
> > gcc (Debian 11.2.0-19) 11.2.0
> >
> 
> Complete thread here:
> https://lore.kernel.org/all/20220815132028.732531-1-ardb@kernel.org/
> 
> On Mon, 15 Aug 2022 at 22:18, Borislav Petkov <bp@alien8.de> wrote:
> >
> > For some reason, objtool is not happy here:
> > vmlinux.o: warning: objtool: efi_thunk_query_variable_info_nonblocking+0x1ba: unreachable instruction
> 
> [which is the instruction right after the call to __efi_thunk64()]
> 
> However, with the same config but without the patch (i.e., v6.0-rc1
> with nothing on top), I see:
> 
> vmlinux.o: warning: objtool: sme_enable+0x71: unreachable instruction
> 
> It appears that objtool is making inferences about whether or not
> __efi_thunk64() returns, even though it is marked as
> STACK_FRAME_NON_STANDARD. And note that I am not seeing any of these
> with x86_64_defconfig, only with Boris's config (attached)

STACK_FRAME_NON_STANDARD has no bearing on a call to that symbol being
noreturn or not.

noreturn is a bit of a pain point in that the compiler leaves no clue
in the object file. Objtool has a bunch of heuristics to guess at
noreturn, but the only surefire way to make things consistent is to
annotate the function with __noreturn and add it to the
global_noreturns[] array in tools/objtool/check.c

Alternatively, if objtool guesses wrong, you can annotate the assembler
with 'REACHABLE'.

Josh; should we create a config file for objtool to contain many of this
stuff? Then again, parsing a config file over and over and over again
isn't going to make it faster :/

  parent reply	other threads:[~2022-08-16 10:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15 13:20 [PATCH] efi/x86-mixed: move unmitigated RET into .rodata Ard Biesheuvel
2022-08-15 19:46 ` Borislav Petkov
2022-08-15 19:57   ` Ard Biesheuvel
     [not found]     ` <YvqqGD0IrqutH20a@zn.tnic>
     [not found]       ` <CAMj1kXHUyAZQqLbT8uqKJTb9QHq1A4ZUbVnx+J0yQfZihJGjbg@mail.gmail.com>
2022-08-16 10:17         ` Peter Zijlstra [this message]
2022-08-16 10:28           ` 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=Yvtuufkkzr3G6cIp@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=jpoimboe@kernel.org \
    --cc=linux-efi@vger.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.