Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751489AbdGYJJu (ORCPT ); Tue, 25 Jul 2017 05:09:50 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37123 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751441AbdGYJJs (ORCPT ); Tue, 25 Jul 2017 05:09:48 -0400 Date: Tue, 25 Jul 2017 11:09:44 +0200 From: Ingo Molnar To: Josh Poimboeuf 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: <20170725090944.enku4cxxnrh5eszi@gmail.com> References: <20170712082710.g2syanmhtwqeus4o@gmail.com> <20170712144254.tihj43mvdj2so74d@treble> <20170712192750.p4wwz6ptjrub7bav@gmail.com> <20170714171745.xq257arzxnypq4mt@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170714171745.xq257arzxnypq4mt@treble> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2453 Lines: 59 * Josh Poimboeuf wrote: > 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 don't think that's a problem: the scheduler preemption model Kconfig setup has similar behavior - allyesconfig does not enable CONFIG_PREEMPT=y. The new x86 default will eventually be the Orc unwinder, but not initially. > > 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. Sure, that's what testing is for. > 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. I disagree, as the current Kconfig layout actively hinders the 'more testing' part: you can only enable Orc if you knew how to do it, and 99% of our testers won't bother. In practice that's a testing coverage that is close to not testing it at all ... > > > > 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(). BTW., I think this aspect of the hardened user-copy is crazy stuff - there can be many stack frames, and this adds a serious amount of overhead even with frame pointers... I think the current behavior is fine: if frame pointers are disabled then arch_within_stack_frames() returns NOT_STACK. Maybe it could do a few sanity checks: we do know the kernel stack range and we could check alignment as well. Thanks, Ingo