• Josh Poimboeuf's avatar
    objtool: Allow alternatives to be ignored · 258c7605
    Josh Poimboeuf authored
    Getting objtool to understand retpolines is going to be a bit of a
    challenge.  For now, take advantage of the fact that retpolines are
    patched in with alternatives.  Just read the original (sane)
    non-alternative instruction, and ignore the patched-in retpoline.
    
    This allows objtool to understand the control flow *around* the
    retpoline, even if it can't yet follow what's inside.  This means the
    ORC unwinder will fail to unwind from inside a retpoline, but will work
    fine otherwise.
    Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
    Signed-off-by: default avatarDavid Woodhouse <dwmw@amazon.co.uk>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Cc: gnomes@lxorguk.ukuu.org.uk
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: thomas.lendacky@amd.com
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Jiri Kosina <jikos@kernel.org>
    Cc: Andy Lutomirski <luto@amacapital.net>
    Cc: Dave Hansen <dave.hansen@intel.com>
    Cc: Kees Cook <keescook@google.com>
    Cc: Tim Chen <tim.c.chen@linux.intel.com>
    Cc: Greg Kroah-Hartman <gregkh@linux-foundation.org>
    Cc: Paul Turner <pjt@google.com>
    Link: https://lkml.kernel.org/r/1515707194-20531-3-git-send-email-dwmw@amazon.co.uk
    258c7605
check.h 2.18 KB