From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964809AbdEVWLX (ORCPT ); Mon, 22 May 2017 18:11:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55580 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751846AbdEVWLS (ORCPT ); Mon, 22 May 2017 18:11:18 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4640780C0B Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jpoimboe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4640780C0B Date: Mon, 22 May 2017 17:11:16 -0500 From: Josh Poimboeuf To: "H. Peter Anvin" Cc: "H.J. Lu" , Andy Lutomirski , "linux-kernel@vger.kernel.org" , Jiri Slaby , Andrew Morton , live-patching@vger.kernel.org, Thomas Gleixner , Ingo Molnar , the arch/x86 maintainers , Jiri Kosina , Linus Torvalds Subject: Re: [PATCH 7/7] DWARF: add the config option Message-ID: <20170522221116.onntuq7rinnqudcw@treble> References: <20170507165524.cdxfuwbd5alr7v6k@treble> <20170519205354.caeyqri2k6gvso3w@treble> <8dbbb971-fc41-fba2-f356-931a7eabe6ef@zytor.com> <20170519212913.otir6mlujoxoy3ha@treble> <20170519213556.pv5kxocfprfkloay@treble> <20170520162034.fcciinh3nw5mvad5@treble> <863bff71-0574-5093-ff45-2d68aedba906@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <863bff71-0574-5093-ff45-2d68aedba906@zytor.com> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 22 May 2017 22:11:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 22, 2017 at 02:37:50PM -0700, H. Peter Anvin wrote: > On 05/22/17 14:07, H. Peter Anvin wrote: > > On 05/20/17 13:01, H.J. Lu wrote: > >> On Sat, May 20, 2017 at 9:20 AM, Josh Poimboeuf wrote: > >> > >>>> > >>>> (H.J., could we get a binutils feature that allows is to do: > >>>> > >>>> pushq %whatever > >>>> .cfi_adjust_sp -8 > >>>> ... > >>>> popq %whatever > >>>> .cfi_adjust_sp 8 > >>>> > >> > >> Np. Compiler needs to generate this. > >> > > > > For actual assembly we have such a feature, it is called macros. > > > > push/pop is the easy stuff; macros take care of that, but the real pain > > is dealing with the flow of control. > > > > My biggest beef with the CFI directives that gas uses is that there is > that .cfi_remember_state/.cfi_restore_state doesn't have a way to > specify more than one state. That makes it really hard to get sanity > around control flow changes, especially with code that is intentionally > out of line. > > That, and some of the CFI directives seem to be a bit ill-defined in > their definition (are they even applicable to anything other than > DWARF?) They almost seem to be referencing some external specification, > but the only thing I'm finding is the DWARF documentation which is > written in very different terms. > > The best description of what a personality routine is I found in an > article by Ian Lance Taylor. It doesn't seem to be applicable to C as > far as I can tell. So my understanding is that there's stock DWARF (.debug_frame) and then there's souped-up DWARF (.eh_frame), which is basically DWARF with a few extensions. The remember/restore state thing is stock DWARF (DW_CFA_remember_state and DW_CFA_restore_state). The personality routine thing is in the .eh_frame extension which is documented here: http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html -- Josh