From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756035AbdEGWAb convert rfc822-to-8bit (ORCPT ); Sun, 7 May 2017 18:00:31 -0400 Received: from terminus.zytor.com ([65.50.211.136]:58001 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752838AbdEGWA3 (ORCPT ); Sun, 7 May 2017 18:00:29 -0400 Date: Sun, 07 May 2017 11:08:19 -0700 User-Agent: K-9 Mail for Android In-Reply-To: <20170507175915.ggwfusgvbwfqsvtz@gmail.com> References: <20170505122200.31436-1-jslaby@suse.cz> <20170505122200.31436-7-jslaby@suse.cz> <20170507165524.cdxfuwbd5alr7v6k@treble> <20170507175915.ggwfusgvbwfqsvtz@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [PATCH 7/7] DWARF: add the config option To: Ingo Molnar , Josh Poimboeuf CC: Linus Torvalds , Jiri Slaby , Andrew Morton , live-patching@vger.kernel.org, Linux Kernel Mailing List , Thomas Gleixner , Ingo Molnar , the arch/x86 maintainers , Andy Lutomirski , Jiri Kosina From: hpa@zytor.com Message-ID: <3980F538-919F-4A51-B7FE-4EC6E86AA259@zytor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On May 7, 2017 10:59:16 AM PDT, Ingo Molnar wrote: > >* Josh Poimboeuf wrote: > >> One instance of the structure would exist for each time the stack >> pointer changes, e.g. for every function entry, push/pop, and rsp >> add/subtract. The data could be assembled and sorted offline, >possibly >> derived from DWARF, or more likely, generated by objtool. After >doing >> some rough calculations, I think the section size would be comparable >to >> the sizes of the DWARF .eh_frame sections it would replace. > >That's something I've been thinking about as well: if objtool generates >the >unwinder data structures then the kernel is not directly exposed to >tooling bugs >anymore. > >A fair chunk of the fragility of DWARF comes from the fact that it's >generated by >a tool chain that we cannot fix as part of the kernel project. If GCC >generates >crap debuginfo, and GDB happens to work with it but the kernel not, >we'll have to >work it around in the kernel. If GCC starts bloating debuginfo in the >future we >are screwed as well, etc. > >If objtool generates debuginfo then it's _our_ responsibility to have >sane >unwinder info and we obviously manage its structure and size as well. >Win-win. > >The unwinder itself should still do sanity checks, etc. (like all good >debugging >infrastructure code) - but the nature of the kernel's exposure to tool >chain >details changes in a very fundamental way. > >So yes, I think this is a very good idea, assuming it works in >practice! ;-) > >Thanks, > > Ingo Can objtool verify the unwinder at each address in the kernel, or is that an AI-complete problem? -- Sent from my Android device with K-9 Mail. Please excuse my brevity.