From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934976AbdEVOkB (ORCPT ); Mon, 22 May 2017 10:40:01 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:33937 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934046AbdEVOj6 (ORCPT ); Mon, 22 May 2017 10:39:58 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170505122200.31436-1-jslaby@suse.cz> <20170505122200.31436-7-jslaby@suse.cz> <20170507165524.cdxfuwbd5alr7v6k@treble> <20170519205354.caeyqri2k6gvso3w@treble> <8dbbb971-fc41-fba2-f356-931a7eabe6ef@zytor.com> <20170519212913.otir6mlujoxoy3ha@treble> <20170519213556.pv5kxocfprfkloay@treble> <20170520162034.fcciinh3nw5mvad5@treble> From: "H.J. Lu" Date: Mon, 22 May 2017 07:39:57 -0700 Message-ID: Subject: Re: [PATCH 7/7] DWARF: add the config option To: Jiri Kosina Cc: Andy Lutomirski , Josh Poimboeuf , "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , Jiri Slaby , Andrew Morton , live-patching@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "the arch/x86 maintainers" , Linus Torvalds Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 22, 2017 at 4:34 AM, Jiri Kosina wrote: > On Sat, 20 May 2017, H.J. Lu wrote: > >> >>>> pushq %whatever >> >>>> .cfi_adjust_sp -8 >> >>>> ... >> >>>> popq %whatever >> >>>> .cfi_adjust_sp 8 >> >>>> >> >> >> >> Np. Compiler needs to generate this. >> >> >> > >> > How would the compiler generate this when inline asm is involved? For >> > the kernel, objtool could get around the need to have these >> > annotations, but not so much for user code? Is the compiler supposed >> > to parse the inline asm? Would the compiler provide some magic % code >> > to represent the current CFA base register? >> >> Here is one example of inline asm with call frame info: >> >> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/x86_64/sigaction.c;h=be058bac436d1cc9794b2b03107676ed99f6b872;hb=HEAD > > That brings us basically pretty close to square one though; having to > maintain "manual" anotations. Something we're pretty much trying to avoid > through this excercise. Assembler only encodes instructions. You need to a different tool to figure out what an instruction does. -- H.J.