linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: "Ingo Molnar" <mingo@kernel.org>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
	"Ingo Molnar" <mingo@elte.hu>, "Brian Gerst" <brgerst@gmail.com>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Denys Vlasenko" <dvlasenk@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Frank Ch. Eigler" <fche@redhat.com>
Subject: Re: [PATCH] x86/debug: Remove perpetually broken, unmaintainable dwarf annotations
Date: Tue, 2 Jun 2015 10:00:24 -0700	[thread overview]
Message-ID: <CALCETrUG5Hq0ErsVDHozWLftBU2X2YfQLkq41oRhBDkmrovVsw@mail.gmail.com> (raw)
In-Reply-To: <20150602144618.GA24773@treble.redhat.com>

On Tue, Jun 2, 2015 at 7:46 AM, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> On Tue, Jun 02, 2015 at 07:57:06AM +0200, Ingo Molnar wrote:
>> * Andy Lutomirski <luto@amacapital.net> wrote:
>> > On Mon, Jun 1, 2015 at 12:45 PM, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
>> > > On Fri, May 29, 2015 at 10:47:31AM -0700, Andy Lutomirski wrote:
>> > >> FWIW, musl is considering some kind of automatic annotation scheme:
>> > >>
>> > >> http://www.openwall.com/lists/musl/2015/05/13/5
>> > >
>> > > Thanks for the link!  I found a newer version of it here:
>> > >
>> > >   http://www.openwall.com/lists/musl/2015/05/31/5
>> > >
>> > > Overall I think that script is a really good solution.
>> > >
>> > > From what I can tell, it tracks the CFA (stack pointer) perfectly.
>> > > (Which is actually pretty straightfoward if you just hook into function
>> > > entry/exit, push/pop, and add/sub to rsp).
>> > >
>> > > It also does a nice job at making a best effort at tracking the caller's
>> > > register values (which are less important than CFA but still nice to
>> > > have).
>> >
>> > It might be nice to be able to reliably unwind out from an exception / interrupt
>> > / syscall frame into userspace or into the kernel code that trapped, complete
>> > with registers.
>> >
>> > In any event, we'll almost certainly have to manually annotate these weird types
>> > of entries.  I wonder if we could manage to annotate just the entry parts and
>> > let a magic script do the rest.
>>
>> Even the entry parts we could help without uglifying the code:
>>
>>  - either by adding a 'RET' instruction after IRET/SYSRET/SYSEXIT/etc. that the
>>    tooling can recognize as 'return from function'. That's much nicer than ugly
>>    annotations.
>>
>>  - enhancing the tooling script to also recognize these instructions as function
>>    returns - because they _are_ function returns.
>
> I think the problem with the entry code (and other non-function asm
> code) is that it's quite spaghetti-esque, with lots of jumps, returns,
> calls, etc to random places.  There aren't enough constraints which
> would help the tooling make sense of where execution begins and ends,
> when registers are saved or trashed, etc.
>
> Maybe over time we can figure out what constraints (and/or annotations)
> are needed there.
>

We can also try to reduce the spaghetti, which I'm working on.  (It's
even harder than I expected, and I doubt that any of my code will be
ready for 4.2.)

--Andy

  reply	other threads:[~2015-06-02 17:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28  8:20 [PATCH] x86-64: fix unwind info for incomplete frames Jan Beulich
2015-05-28  9:01 ` Ingo Molnar
2015-05-28  9:45   ` Jan Beulich
2015-05-28 11:20     ` [PATCH] x86/debug: Remove perpetually broken, unmaintainable dwarf annotations Ingo Molnar
2015-05-28 11:39       ` [PATCH v2] " Ingo Molnar
2015-05-28 11:51       ` [PATCH] " Jan Beulich
2015-05-28 13:17         ` Ingo Molnar
2015-05-29 17:47           ` Andy Lutomirski
2015-05-29 20:27             ` Josh Poimboeuf
2015-05-29 21:39               ` Frank Ch. Eigler
2015-06-01 19:45             ` Josh Poimboeuf
2015-06-01 19:53               ` Andy Lutomirski
2015-06-01 20:19                 ` Josh Poimboeuf
2015-06-02  5:57                 ` Ingo Molnar
2015-06-02 14:46                   ` Josh Poimboeuf
2015-06-02 17:00                     ` Andy Lutomirski [this message]
2015-06-05 17:11             ` Andi Kleen

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=CALCETrUG5Hq0ErsVDHozWLftBU2X2YfQLkq41oRhBDkmrovVsw@mail.gmail.com \
    --to=luto@amacapital.net \
    --cc=JBeulich@suse.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=fche@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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).