Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754607AbdGNRRu (ORCPT ); Fri, 14 Jul 2017 13:17:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39348 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753486AbdGNRRs (ORCPT ); Fri, 14 Jul 2017 13:17:48 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B852BC0502B9 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jpoimboe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B852BC0502B9 Date: Fri, 14 Jul 2017 12:17:45 -0500 From: Josh Poimboeuf To: Ingo Molnar Cc: x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Linus Torvalds , Andy Lutomirski , Jiri Slaby , "H. Peter Anvin" , Peter Zijlstra , Mike Galbraith Subject: Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Message-ID: <20170714171745.xq257arzxnypq4mt@treble> References: <20170712082710.g2syanmhtwqeus4o@gmail.com> <20170712144254.tihj43mvdj2so74d@treble> <20170712192750.p4wwz6ptjrub7bav@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170712192750.p4wwz6ptjrub7bav@gmail.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.31]); Fri, 14 Jul 2017 17:17:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2310 Lines: 60 On Wed, Jul 12, 2017 at 09:27:50PM +0200, Ingo Molnar wrote: > Maybe we could offer a menu of unwinders - i.e. make the whole Kconfig interface a > bit nicer: > > CONFIG_UNWINDER_FRAME_POINTER > CONFIG_UNWINDER_ORC > CONFIG_UNWINDER_GUESS > > ... or so? So far I haven't been able to figure out how to make the above three options into a multiple choice selection, such that allnoconfig selects CONFIG_UNWINDER_GUESS and alldefconfig selects CONFIG_UNWINDER_FRAME_POINTER. I *think* I should be able to do it by setting the choice default to FRAME_POINTER, and setting the 'allnoconfig_y' option for UNWINDER_GUESS. But kconfig apparently doesn't support 'allnoconfig_y' for choice selections yet. I may need to modify kconfig for that. But IMO, this change can come later, and the current patches should be fine to merge as-is. And it might make sense to delay such a patch anyway, see below. > Default would be the historic FRAME_POINTER, at least initially, I think. > > I wouldn't mind making CONFIG_UNWINDER_ORC the new default either, due to the > non-trivial speedup it offers - but maybe folks would object? Personally I wouldn't have an objection to making ORC the default, though we should probably wait to give it some burn-in time first. If we *do* decide to eventually make it the default, we could flip the switch at the same time we introduced the multiple-choice config and rename above. That way, users of "make oldconfig" would see the change and would be encouraged to switch ORC. > > > CONFIG_FRAME_POINTERS et al would be left for architectures where it has a meaning > > > beyond backtrace generation. (Not sure whether there's any such architectures.) > > > > Well, on x86, hardened usercopy relies on frame pointers, but not the > > unwinder. It does the frame pointer walk manually to avoid the full > > unwinder overhead. See arch_within_stack_frames(). > > Oh well... > > > Ok, how about: > > > > "Orc unwind tables take up ~50% more RAM (+1.3MB on an x86 defconfig > > kernel) than DWARF eh_frame tables." > > > > (My previous 1MB number was from my distro-based config, and it also > > forgot to take into account the fast lookup table (".orc_lookup")). > > Sounds good to me! Ok, I'll post a v3.1 of patch 9 with the changed wording. -- Josh