All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Segher Boessenkool <segher@kernel.crashing.org>,
	Borislav Petkov <bp@alien8.de>, X86 ML <x86@kernel.org>,
	linux-toolchains@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: [PATCH] x86/sev: Mark snp_abort() noreturn
Date: Thu, 25 Aug 2022 12:29:38 +0000 (UTC)	[thread overview]
Message-ID: <alpine.LSU.2.20.2208251219590.24312@wotan.suse.de> (raw)
In-Reply-To: <YwcZjxVkO/lspvmv@worktop.programming.kicks-ass.net>

Hello,

On Thu, 25 Aug 2022, Peter Zijlstra wrote:

> > > STT_FUNC_NORETURN would do I suppose, except then all
> > > the tools will need to be taught how to deal with that, which is also
> > > very painful.
> > 
> > What is that?  Even Google has no idea.  Hrm.
> 
> Something I just made up :-) A new symbol type for noreturn functions
> would be very useful.

But very, very, very painful for everyone else :-)  And: there are only 15 
symbol types, and in the OS-specific range only two are left (GNU_IFUNC is 
the taken one in that range).  That's too few to waste it on this very 
specific purpose.  A second symtab-like structure might work out, but 
then, what about attribute(frobnicate)?  Or one of the other actually 
existing ones that influence codegen?  Extending debuginfo might be an 
idea, but will bloat it even more.  Tears everywhere.

Just stay with probalistic hacking?  :-)  (And see below)

> Now, as mentioned we have heuristics that try and detect if a function
> is noreturn or not; but all those fail horribly if the function is in
> another translation unit for example.

You could add another mode of operation in objtool that merely scans all 
disassembled function bodies and emits a new list of candidate noreturn 
functions.  You run it from time to time to see if the hard-coded list is 
still sensible.


Ciao,
Michael.

  reply	other threads:[~2022-08-25 12:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 15:24 [PATCH] x86/sev: Mark snp_abort() noreturn Borislav Petkov
2022-08-24 15:38 ` Peter Zijlstra
2022-08-24 15:48   ` Borislav Petkov
2022-08-24 16:16     ` Peter Zijlstra
2022-08-24 16:43       ` [PATCH v2] " Borislav Petkov
2022-08-24 17:29 ` [PATCH] " Segher Boessenkool
2022-08-24 18:23   ` Borislav Petkov
2022-08-24 18:44   ` Nick Desaulniers
2022-08-24 19:43     ` Segher Boessenkool
2022-08-24 20:45   ` Peter Zijlstra
2022-08-24 22:41     ` Segher Boessenkool
2022-08-25  6:41       ` Peter Zijlstra
2022-08-25 12:29         ` Michael Matz [this message]
2022-08-25 12:58         ` Segher Boessenkool
2022-08-25 13:12         ` David Laight
2022-08-30  4:48           ` Josh Poimboeuf
2022-08-30  4:46     ` Josh Poimboeuf
2022-08-25 14:01 ` [tip: x86/urgent] " tip-bot2 for Borislav Petkov

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=alpine.LSU.2.20.2208251219590.24312@wotan.suse.de \
    --to=matz@suse.de \
    --cc=bp@alien8.de \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-toolchains@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=segher@kernel.crashing.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 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.