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


Groups > linux.kernel > #1706832

Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder
Date 2017-08-08 21:10 +0200
Message-ID <uci38-4cO-15@gated-at.bofh.it> (permalink)
References (4 earlier) <u8il4-7oj-29@gated-at.bofh.it> <u8iEq-7vB-23@gated-at.bofh.it> <u8jKc-8pF-35@gated-at.bofh.it> <u8r50-4Yt-7@gated-at.bofh.it> <uchTt-3SV-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Aug 8, 2017 at 11:58 AM, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
>
> Take for example the lock_is_held_type() function.  In vmlinux, it has
> the following instruction:
>
>   callq *0xffffffff85a94880 (pv_irq_ops.save_fl)
>
> At runtime, that instruction is patched and replaced with a fast inline
> version of arch_local_save_flags() which eliminates the call:
>
>   pushfq
>   pop %rax
>
> The problem is when an interrupt hits after the push:
>
>   pushfq
>   --- irq ---
>   pop %rax

That should actually be something easily fixable, for an odd reason:
the instruction boundaries are different.

> I'm not sure what the solution should be.  It will probably need to be
> one of the following:
>
>   a) either don't allow runtime "alternative" patches to mess with the
>      stack pointer (objtool could enforce this); or
>
>   b) come up with some way to register such patches with the ORC
>      unwinder at runtime.

c) just add ORC data for the alternative statically and _unconditionally_.

No runtime registration. Just an unconditional entry for the
particular IP that comes after the "pushfq". It cannot match the
"callq" instruction, since it would be in the middle of that
instruction.

Basically, just do a "union" of the ORC data for all the alternatives.

Now, objtool should still verify that the instruction pointers for
alternatives are unique - or that they share the same ORC unwinder
information if they are not.

But in cases like this, when the instruction boundaires are different,
things should "just work", with no need for any special cases.

Hmm?

                    Linus

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


Thread

Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-08 21:00 +0200
  Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Linus Torvalds <torvalds@linux-foundation.org> - 2017-08-08 21:10 +0200
    Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-08 21:20 +0200
      Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Andy Lutomirski <luto@kernel.org> - 2017-08-08 22:10 +0200
        Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-09 00:10 +0200
        Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Juergen Gross <jgross@suse.com> - 2017-08-09 10:50 +0200
          Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Peter Zijlstra <peterz@infradead.org> - 2017-08-09 11:20 +0200
            Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Juergen Gross <jgross@suse.com> - 2017-08-09 11:30 +0200
              Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Peter Zijlstra <peterz@infradead.org> - 2017-08-09 11:40 +0200
                Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Juergen Gross <jgross@suse.com> - 2017-08-09 12:00 +0200
                Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-09 22:20 +0200
                Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Juergen Gross <jgross@suse.com> - 2017-08-10 09:10 +0200
                Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-10 16:10 +0200
                Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Juergen Gross <jgross@suse.com> - 2017-08-10 16:30 +0200
                Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-10 16:40 +0200
                Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Juergen Gross <jgross@suse.com> - 2017-08-10 17:10 +0200
                Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-10 17:50 +0200
                Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-10 16:50 +0200
          Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Andy Lutomirski <luto@kernel.org> - 2017-08-09 18:20 +0200
            Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder Juergen Gross <jgross@suse.com> - 2017-08-09 20:00 +0200

csiph-web