Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1638175

Re: [PATCH 7/7] DWARF: add the config option

From Josh Poimboeuf <jpoimboe@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 7/7] DWARF: add the config option
Date 2017-05-09 17:00 +0200
Message-ID <tFeMi-37Z-5@gated-at.bofh.it> (permalink)
References (4 earlier) <tF1cl-2Da-5@gated-at.bofh.it> <tF2i5-3ix-7@gated-at.bofh.it> <tF3e9-3Xg-1@gated-at.bofh.it> <tF4ad-4v9-3@gated-at.bofh.it> <tFafD-hL-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 09, 2017 at 03:00:45AM -0700, hpa@zytor.com wrote:
> I'm, ahem, highly skeptical to creating our own unwinding data format
> unless there is *documented, supported, and tested* way to force the
> compiler to *automatically* fall back to frame pointers any time there
> may be complexity involved, which at a very minimum includes any kind
> of data-dependent manipulation of the stack pointer.

That would be nice.  But isn't falling back to a frame pointer (or
another callee-saved reg or a stack location) already needed in such
cases?  Otherwise how could DWARF unwinding work?

> Otherwise you will have to fail the kernel build when your static tool
> runs into instruction sequences it can't deal with, but the compiler
> may generate them - boom.

Failing the build is harsh, we could just warn about it and skip the
data for the affected function(s).

BTW, there is another option.  Instead of generating the data from
scratch, we could just convert gcc's DWARF CFI to the format we need.

However that wouldn't solve the problems we have with the holes and
inaccuracies in DWARF from our hand-annotated asm, inline asm, and
special sections (extable, alternatives, etc).  We'd still have to rely
on objtool for that, so we'd still be in the same boat of needing
objtool to be able to follow gcc code paths.

So yes, it sucks that objtool needs to work for unwinding to work.  But
if we want decent DWARF-esque unwinding, I don't see any way around
that due to the low-level nature of the kernel.

> Worse, your tool will not even recognize the problem and you're in a
> worse place than when you started.

We could have a runtime NMI-based stack checker which ensures it can
always unwind to the bottom of the stack.  Over time this would
hopefully provide full validation of the unwinder data and
functionality.

-- 
Josh

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 7/7] DWARF: add the config option Jiri Slaby <jslaby@suse.cz> - 2017-05-05 14:30 +0200
  Re: [PATCH 7/7] DWARF: add the config option Linus Torvalds <torvalds@linux-foundation.org> - 2017-05-05 22:00 +0200
    Re: [PATCH 7/7] DWARF: add the config option Ingo Molnar <mingo@kernel.org> - 2017-05-06 09:30 +0200
      Re: [PATCH 7/7] DWARF: add the config option Jiri Slaby <jslaby@suse.cz> - 2017-05-10 09:50 +0200
    Re: [PATCH 7/7] DWARF: add the config option Jiri Kosina <jikos@kernel.org> - 2017-05-06 16:30 +0200
    Re: [PATCH 7/7] DWARF: add the config option Ingo Molnar <mingo@kernel.org> - 2017-05-07 23:50 +0200
      Re: [PATCH 7/7] DWARF: add the config option Josh Poimboeuf <jpoimboe@redhat.com> - 2017-05-07 23:50 +0200
        Re: [PATCH 7/7] DWARF: add the config option Vojtech Pavlik <vojtech@suse.com> - 2017-05-08 10:20 +0200
          Re: [PATCH 7/7] DWARF: add the config option Josh Poimboeuf <jpoimboe@redhat.com> - 2017-05-08 15:20 +0200
      Re: [PATCH 7/7] DWARF: add the config option hpa@zytor.com - 2017-05-08 00:10 +0200
    Re: [PATCH 7/7] DWARF: add the config option Josh Poimboeuf <jpoimboe@redhat.com> - 2017-05-07 23:50 +0200
      Re: [PATCH 7/7] DWARF: add the config option Andy Lutomirski <luto@amacapital.net> - 2017-05-08 07:40 +0200
        Re: [PATCH 7/7] DWARF: add the config option Ingo Molnar <mingo@kernel.org> - 2017-05-08 08:20 +0200
        Re: [PATCH 7/7] DWARF: add the config option Josh Poimboeuf <jpoimboe@redhat.com> - 2017-05-08 16:50 +0200
          Re: [PATCH 7/7] DWARF: add the config option hpa@zytor.com - 2017-05-08 21:10 +0200
      Re: [PATCH 7/7] DWARF: add the config option Andy Lutomirski <luto@kernel.org> - 2017-05-09 02:30 +0200
        Re: [PATCH 7/7] DWARF: add the config option Josh Poimboeuf <jpoimboe@redhat.com> - 2017-05-09 03:40 +0200
          Re: [PATCH 7/7] DWARF: add the config option Andy Lutomirski <luto@kernel.org> - 2017-05-09 04:40 +0200
            Re: [PATCH 7/7] DWARF: add the config option Josh Poimboeuf <jpoimboe@redhat.com> - 2017-05-09 05:40 +0200
              Re: [PATCH 7/7] DWARF: add the config option hpa@zytor.com - 2017-05-09 12:10 +0200
                Re: [PATCH 7/7] DWARF: add the config option Josh Poimboeuf <jpoimboe@redhat.com> - 2017-05-09 17:00 +0200
                Re: [PATCH 7/7] DWARF: add the config option "H.J. Lu" <hjl.tools@gmail.com> - 2017-05-09 18:50 +0200
                Re: [PATCH 7/7] DWARF: add the config option Jiri Slaby <jslaby@suse.cz> - 2017-05-10 10:20 +0200
                Re: [PATCH 7/7] DWARF: add the config option Josh Poimboeuf <jpoimboe@redhat.com> - 2017-05-10 15:10 +0200
                Re: [PATCH 7/7] DWARF: add the config option "H.J. Lu" <hjl.tools@gmail.com> - 2017-05-10 18:30 +0200
      Re: [PATCH 7/7] DWARF: add the config option Jiri Kosina <jikos@kernel.org> - 2017-05-09 20:50 +0200
        Re: [PATCH 7/7] DWARF: add the config option Josh Poimboeuf <jpoimboe@redhat.com> - 2017-05-09 21:30 +0200
          Re: [PATCH 7/7] DWARF: add the config option Jiri Slaby <jslaby@suse.cz> - 2017-05-10 10:40 +0200
            Re: [PATCH 7/7] DWARF: add the config option Josh Poimboeuf <jpoimboe@redhat.com> - 2017-05-10 15:20 +0200
    Re: [PATCH 7/7] DWARF: add the config option Jiri Slaby <jslaby@suse.cz> - 2017-05-10 09:50 +0200
      Re: [PATCH 7/7] DWARF: add the config option Josh Poimboeuf <jpoimboe@redhat.com> - 2017-05-10 14:50 +0200
        Re: [PATCH 7/7] DWARF: add the config option Jiri Slaby <jslaby@suse.cz> - 2017-05-10 14:50 +0200
      Re: [PATCH 7/7] DWARF: add the config option Linus Torvalds <torvalds@linux-foundation.org> - 2017-05-10 20:20 +0200

csiph-web