From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751104AbdLAHfy (ORCPT ); Fri, 1 Dec 2017 02:35:54 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:34568 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbdLAHef (ORCPT ); Fri, 1 Dec 2017 02:34:35 -0500 X-Google-Smtp-Source: AGs4zMYBCzzKJdpi7sicPxFGz865WFlAO0paSLuqaGwPhLb1aUxzI/ayLlah5iAAtnbFOqTy4FrsIw== Subject: Re: [PATCH 1/2] x86/stacktrace: do not fail when regs on stack for ORC To: Josh Poimboeuf Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, Thomas Gleixner , "H. Peter Anvin" , x86@kernel.org, live-patching@vger.kernel.org References: <20171130080325.24785-1-jslaby@suse.cz> <20171130195710.cu2lsa47kwnow2hi@treble> <20171130195939.gx2qlewwjprfql42@treble> From: Jiri Slaby Message-ID: <3024aa33-2ff8-1e43-6c33-0aa781202eba@suse.cz> Date: Fri, 1 Dec 2017 08:34:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171130195939.gx2qlewwjprfql42@treble> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/30/2017, 08:59 PM, Josh Poimboeuf wrote: > On Thu, Nov 30, 2017 at 01:57:10PM -0600, Josh Poimboeuf wrote: >> On Thu, Nov 30, 2017 at 09:03:24AM +0100, Jiri Slaby wrote: >>> save_stack_trace_reliable now returns "non reliable" when there are >>> kernel pt_regs on stack. This means an interrupt or exception happened. >>> Somewhere down the route. It is a problem for frame pointer unwinder, >>> because the frame might now have been set up yet when the irq happened, >>> so it might fail to unwind from the interrupted function. >>> >>> With ORC, this is not a problem, as ORC has out-of-band data. We can >>> find ORC data even for the IP in interrupted function and always unwind >>> one level up. >>> >>> So introduce `unwind_regs_reliable' which decides if this is an issue >>> for the currently selected unwinder at all and change the code >>> accordingly. >> >> Thanks. I'm thinking there a few ways we can simplify things. (Most of >> these are actually issues with the existing code.) >> >> - Currently we check to make sure that there's no frame *after* the user >> space regs. I think there's no way that could ever happen and the >> check is overkill. >> >> - We should probably remove the STACKTRACE_DUMP_ONCE() warnings. There >> are some known places where a stack trace will fail, particularly with >> generated code. I wish we had a DEBUG_WARN_ON() macro which used >> pr_debug(), but oh well. At least the livepatch code has some helpful >> pr_warn()s, those are probably good enough. > ^^^^^^^ > meant to say pr_debug()s. > > Also adding the live patching mailing list as an FYI. The changes are now in: https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git/log/?h=devel Letting 01 bot to run through them, then I will send a v2. thanks, -- js suse labs