linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sedat Dilek <sedat.dilek@gmail.com>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Sami Tolvanen <samitolvanen@google.com>,
	Kees Cook <keescook@chromium.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Clang-Built-Linux ML <clang-built-linux@googlegroups.com>,
	Miroslav Benes <mbenes@suse.cz>
Subject: Re: [PATCH 00/21] objtool: vmlinux.o and CLANG LTO support
Date: Fri, 15 Jan 2021 16:30:05 +0100	[thread overview]
Message-ID: <CA+icZUVc0M3Ydf=SKSV2MhDmdb49nGSrN-9TjYvjL25vmDHaeQ@mail.gmail.com> (raw)
In-Reply-To: <CA+icZUV1a-DEf-dTm8MyyBbp_VYmW5WwJPF9DQb=yJHPykJASQ@mail.gmail.com>

On Fri, Jan 15, 2021 at 5:51 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> On Thu, Jan 14, 2021 at 8:40 PM Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >
> > Add support for proper vmlinux.o validation, which will be needed for
> > Sami's upcoming x86 LTO set.  (And vmlinux validation is the future for
> > objtool anyway, for other reasons.)
> >
> > This isn't 100% done -- most notably, crypto still needs to be supported
> > -- but I think this gets us most of the way there.
> >
> > This can also be found at
> >
> >   git://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git objtool-vmlinux
> >
> > And for more testing it can be combined with Sami's x86 LTO patches:
> >
> >   https://github.com/samitolvanen/linux clang-lto
> >
> >
> >
> > Josh Poimboeuf (21):
> >   objtool: Fix seg fault in BT_FUNC() with fake jump
> >   objtool: Fix error handling for STD/CLD warnings
> >   objtool: Fix retpoline detection in asm code
> >   objtool: Fix ".cold" section suffix check for newer versions of GCC
> >   objtool: Support retpoline jump detection for vmlinux.o
> >   x86/ftrace: Add UNWIND_HINT_FUNC annotation for ftrace_stub
> >   objtool: Assume only ELF functions do sibling calls
> >   objtool: Add asm version of STACK_FRAME_NON_STANDARD
> >   objtool: Combine UNWIND_HINT_RET_OFFSET and UNWIND_HINT_FUNC
> >   objtool: Add xen_start_kernel() to noreturn list
> >   objtool: Move unsuffixed symbol conversion to a helper function
> >   objtool: Add CONFIG_CFI_CLANG support
> >   x86/xen: Support objtool validation in xen-asm.S
> >   x86/xen: Support objtool vmlinux.o validation in xen-head.S
> >   x86/xen/pvh: Convert indirect jump to retpoline
> >   x86/ftrace: Support objtool vmlinux.o validation in ftrace_64.S
> >   x86/acpi: Convert indirect jump to retpoline
> >   x86/acpi: Support objtool validation in wakeup_64.S
> >   x86/power: Convert indirect jumps to retpolines
> >   x86/power: Move restore_registers() to top of the file
> >   x86/power: Support objtool validation in hibernate_asm_64.S
> >
> >  arch/x86/include/asm/unwind_hints.h |  13 +---
> >  arch/x86/kernel/acpi/Makefile       |   1 -
> >  arch/x86/kernel/acpi/wakeup_64.S    |   5 +-
> >  arch/x86/kernel/ftrace_64.S         |   8 +--
> >  arch/x86/lib/retpoline.S            |   2 +-
> >  arch/x86/platform/pvh/head.S        |   3 +-
> >  arch/x86/power/Makefile             |   1 -
> >  arch/x86/power/hibernate_asm_64.S   | 105 ++++++++++++++--------------
> >  arch/x86/xen/Makefile               |   1 -
> >  arch/x86/xen/xen-asm.S              |  29 +++++---
> >  arch/x86/xen/xen-head.S             |   5 +-
> >  include/linux/objtool.h             |  13 +++-
> >  tools/include/linux/objtool.h       |  13 +++-
> >  tools/objtool/arch/x86/decode.c     |   4 +-
> >  tools/objtool/arch/x86/special.c    |   2 +-
> >  tools/objtool/check.c               |  91 +++++++++++++-----------
> >  tools/objtool/check.h               |  12 +++-
> >  tools/objtool/elf.c                 |  87 +++++++++++++++++------
> >  tools/objtool/elf.h                 |   2 +-
> >  19 files changed, 241 insertions(+), 156 deletions(-)
> >
> > --
> > 2.29.2
> >
>
> I tried this series on top of clang-cfi and it segfaults here.
>
> + info OBJTOOL vmlinux.o
> + [  != silent_ ]
> + printf   %-7s %s\n OBJTOOL vmlinux.o
>  OBJTOOL vmlinux.o
> + tools/objtool/objtool orc generate --duplicate --mcount --vmlinux
> --no-fp --no-unreachable --retpoline --uaccess vmlinux.o
> Segmentation fault
> + on_exit
> + [ 139 -ne 0 ]
> + cleanup
> + rm -f .btf.*
> + rm -f .tmp_System.map
> + rm -f .tmp_initcalls.lds
> + rm -f .tmp_symversions.lds
> + rm -f .tmp_vmlinux*
> + rm -f System.map
> + rm -f vmlinux
> + rm -f vmlinux.o
> make[3]: *** [Makefile:1213: vmlinux] Error 139
>

I re-tried with the latest clang-lto Git and switched to Debian's LLVM-11.0.1.
This build was successful.
No objtool-vmlinux warnings observed.

In the next step I try with my selfmade LLVM-11.1.0-rc1 (to see if it's broken).

- Sedat

  parent reply	other threads:[~2021-01-15 15:31 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14 19:39 [PATCH 00/21] objtool: vmlinux.o and CLANG LTO support Josh Poimboeuf
2021-01-14 19:39 ` [PATCH 01/21] objtool: Fix seg fault in BT_FUNC() with fake jump Josh Poimboeuf
2021-01-14 20:04   ` Josh Poimboeuf
2021-01-14 19:39 ` [PATCH 02/21] objtool: Fix error handling for STD/CLD warnings Josh Poimboeuf
2021-01-14 19:39 ` [PATCH 03/21] objtool: Fix retpoline detection in asm code Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 04/21] objtool: Fix ".cold" section suffix check for newer versions of GCC Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 05/21] objtool: Support retpoline jump detection for vmlinux.o Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 06/21] x86/ftrace: Add UNWIND_HINT_FUNC annotation for ftrace_stub Josh Poimboeuf
2021-01-14 20:42   ` Steven Rostedt
2021-01-14 19:40 ` [PATCH 07/21] objtool: Assume only ELF functions do sibling calls Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 08/21] objtool: Add asm version of STACK_FRAME_NON_STANDARD Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 09/21] objtool: Combine UNWIND_HINT_RET_OFFSET and UNWIND_HINT_FUNC Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 10/21] objtool: Add xen_start_kernel() to noreturn list Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 11/21] objtool: Move unsuffixed symbol conversion to a helper function Josh Poimboeuf
2021-01-14 20:55   ` [PATCH v1.1 " Josh Poimboeuf
2021-01-14 21:30     ` Sedat Dilek
2021-01-14 19:40 ` [PATCH 12/21] objtool: Add CONFIG_CFI_CLANG support Josh Poimboeuf
2021-01-14 20:49   ` Sami Tolvanen
2021-01-14 20:52     ` Josh Poimboeuf
2021-01-14 20:56   ` [PATCH v1.1 " Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 13/21] x86/xen: Support objtool validation in xen-asm.S Josh Poimboeuf
2021-01-15  0:31   ` boris.ostrovsky
2021-01-14 19:40 ` [PATCH 14/21] x86/xen: Support objtool vmlinux.o validation in xen-head.S Josh Poimboeuf
2021-01-15  0:32   ` boris.ostrovsky
2021-01-15  5:17   ` Jürgen Groß
2021-01-15 19:46     ` Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 15/21] x86/xen/pvh: Convert indirect jump to retpoline Josh Poimboeuf
2021-01-15  0:33   ` boris.ostrovsky
2021-01-15  5:24   ` Jürgen Groß
2021-01-15 15:08     ` Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 16/21] x86/ftrace: Support objtool vmlinux.o validation in ftrace_64.S Josh Poimboeuf
2021-01-14 20:42   ` Steven Rostedt
2021-01-14 19:40 ` [PATCH 17/21] x86/acpi: Convert indirect jump to retpoline Josh Poimboeuf
2021-01-14 22:59   ` Andrew Cooper
2021-01-14 23:47     ` Josh Poimboeuf
2021-01-15  0:54       ` Andrew Cooper
2021-01-14 19:40 ` [PATCH 18/21] x86/acpi: Support objtool validation in wakeup_64.S Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 19/21] x86/power: Convert indirect jumps to retpolines Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 20/21] x86/power: Move restore_registers() to top of the file Josh Poimboeuf
2021-01-14 19:40 ` [PATCH 21/21] x86/power: Support objtool validation in hibernate_asm_64.S Josh Poimboeuf
2021-01-15  0:41 ` [PATCH 00/21] objtool: vmlinux.o and CLANG LTO support Sami Tolvanen
2021-01-15  0:49   ` Nick Desaulniers
2021-01-15 19:52   ` Josh Poimboeuf
2021-01-15 20:19     ` Sedat Dilek
2021-01-15 20:59       ` Josh Poimboeuf
2021-01-15 21:01         ` Sedat Dilek
2021-01-18 17:22   ` Josh Poimboeuf
2021-01-19 21:29     ` Nick Desaulniers
2021-01-20 15:37       ` Josh Poimboeuf
2021-01-15  4:51 ` Sedat Dilek
2021-01-15  5:18   ` Sedat Dilek
2021-01-15 15:30   ` Sedat Dilek [this message]
2021-01-15 18:54     ` Sedat Dilek
2021-01-15 19:28       ` Josh Poimboeuf

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='CA+icZUVc0M3Ydf=SKSV2MhDmdb49nGSrN-9TjYvjL25vmDHaeQ@mail.gmail.com' \
    --to=sedat.dilek@gmail.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=jpoimboe@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=samitolvanen@google.com \
    --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;
as well as URLs for NNTP newsgroup(s).