From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755527AbbFBF5T (ORCPT ); Tue, 2 Jun 2015 01:57:19 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:38577 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755392AbbFBF5L (ORCPT ); Tue, 2 Jun 2015 01:57:11 -0400 Date: Tue, 2 Jun 2015 07:57:06 +0200 From: Ingo Molnar To: Andy Lutomirski Cc: Josh Poimboeuf , Jan Beulich , Borislav Petkov , Peter Zijlstra , Ingo Molnar , Brian Gerst , =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , Thomas Gleixner , Linus Torvalds , Denys Vlasenko , "linux-kernel@vger.kernel.org" , "H. Peter Anvin" , "Frank Ch. Eigler" Subject: Re: [PATCH] x86/debug: Remove perpetually broken, unmaintainable dwarf annotations Message-ID: <20150602055706.GA27094@gmail.com> References: <5566EBE7020000780007E659@mail.emea.novell.com> <20150528090133.GA469@gmail.com> <5566FFDD020000780007E711@mail.emea.novell.com> <20150528112017.GA28196@gmail.com> <55671D63020000780007E885@mail.emea.novell.com> <20150528131743.GA9496@gmail.com> <20150601194516.GA6110@treble.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andy Lutomirski wrote: > On Mon, Jun 1, 2015 at 12:45 PM, Josh Poimboeuf wrote: > > On Fri, May 29, 2015 at 10:47:31AM -0700, Andy Lutomirski wrote: > >> On Thu, May 28, 2015 at 6:17 AM, Ingo Molnar wrote: > >> > > >> > * Jan Beulich wrote: > >> > > >> >> > and meanwhile you can keep a revert of this patch ported to SUSE kernels in > >> >> > whatever fashion you prefer. > >> >> > >> >> Funny suggestion - I don't think that's reasonable for us to do. Or if we were > >> >> to, we could as well invest in doing the re-work you're asking for; I don't > >> >> think anyone will have the time to do either. > >> > > >> > That's fair enough: if there's not enough resources to keep a feature maintainable > >> > upstream then it should not be upstream in that form. > >> > > >> > This isn't just some driver we can let bit-rot in peace until it finds a > >> > maintainer (or not), without affecting anyone but users of that driver. > >> > > >> > This is hundreds of usage sites of ugly code intermixed with critical pieces of > >> > assembly code that negatively affects the hackability of everything. > >> > > >> > Also, with the feature missing completely, maybe someone finds a method to > >> > introduce it in a maintainable fashion, while with the feature included upstream > >> > there's very little pressure to do that. As a bonus we'd also win a workable dwarf > >> > unwinder. > >> > >> Before doing something drastic like this, I think we should get Josh's > >> opinion, since I think he's working on a new (?) unwinder. > >> > >> 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. So I'll commit the removal patch - it's clear at this point that the old annotations won't be used and they are actively getting in the way of bug fixes and new work. This became glaringly obvious during and after the big asm code refresh we did in v4.1. If anyone needs debuginfo badly (who?) then they should help Josh get it all upstream again ASAP, it doesn't seem much is missing to get all that done in a much cleaner way. Thanks, Ingo