Received: by 10.213.65.68 with SMTP id h4csp121883imn; Mon, 12 Mar 2018 08:37:11 -0700 (PDT) X-Google-Smtp-Source: AG47ELvVSnj8XVohp9Tij+I+NrhKbyrRaF4mP03C4ipsHvu/BazNrtio+j238WoMJSQ4KllDXSvZ X-Received: by 10.98.63.147 with SMTP id z19mr8305604pfj.221.1520869031512; Mon, 12 Mar 2018 08:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520869031; cv=none; d=google.com; s=arc-20160816; b=LqybEbngF5280iNum2SyfWBRTXyRlbR52weKG3FALlkV1wDcFTMmrN4GCqSsrVQln4 9Br844yO5HQO5vafNOzhg04T0eWPg1a+x3wJvKIodYA794Wd3N7vJeEtshiuobYpNbxZ eu50FyfVcRftbulJS6UhTAAIDO6Ntt32ac0m7g7AmSjPYm5kMDbtOwDeMJGlaKQdB9uV JUtyc5+Jct+9Thm0o3/SmSGv4uD11vLyqUWEFVtnVh4+jr3FxFqc/2WHbWu2J8EU7KQr KuakrRuFroTVW6BtdP86DzGmYomCzcnCsPslHqpWmgnR9Zt68cbUrWQFKg/7/S5Dtl/a GdXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=8m4vz+iw8e71lsy8/K37Q6PB3Xxb5mXD52ckX03LvBI=; b=vRwuD+lSi9cH1Mc42xT6v3MybA3sQCBiGhn5HjYHl/BUNMSL5BdQnRrGqdO4R0d32S XEYtly0M1MLUEoW8OeuebbEuuITDQGvNyJ3p8QSW4dLq7Wch33xY4gkKzG7VvXdpAteT ge25Y7xji7Ln9y5F02kqJYoOgvsToFOg8W9MrfPYdO4M/FyqX7GkKDrmRM8mL6pEFB/g YIjPjAgZ3Pa3hRTHD9BFmL3OGtS2xujhFFTi0msNic5dRdA0AV4Tu2XFtOpokCOEkMaT e0QtVA8tON4zdPYAUfkE0Mg8T3Wn/aBMPhNJ3kbvpU86pGpn/5+hMpRlgUCfQB0WW1+p 6jIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m68si2237534pfm.99.2018.03.12.08.36.56; Mon, 12 Mar 2018 08:37:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932485AbeCLPfk (ORCPT + 99 others); Mon, 12 Mar 2018 11:35:40 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45788 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932456AbeCLPfi (ORCPT ); Mon, 12 Mar 2018 11:35:38 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3E322D1432; Mon, 12 Mar 2018 15:35:38 +0000 (UTC) Received: from treble (ovpn-122-218.rdu2.redhat.com [10.10.122.218]) by smtp.corp.redhat.com (Postfix) with SMTP id 1483E10B0F41; Mon, 12 Mar 2018 15:35:37 +0000 (UTC) Date: Mon, 12 Mar 2018 10:35:36 -0500 From: Josh Poimboeuf To: Torsten Duwe Cc: Michael Ellerman , Jiri Kosina , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Nicholas Piggin , live-patching@vger.kernel.org Subject: Re: [PATCH v2] On ppc64le we HAVE_RELIABLE_STACKTRACE Message-ID: <20180312153536.7avozx64ku4lvd3e@treble> References: <20180305164928.GA17953@lst.de> <20180308162616.yhbymodggnfzpskx@treble> <20180309174718.2700b29e@blackhole.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180309174718.2700b29e@blackhole.lan> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 12 Mar 2018 15:35:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 12 Mar 2018 15:35:38 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jpoimboe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 09, 2018 at 05:47:18PM +0100, Torsten Duwe wrote: > On Thu, 8 Mar 2018 10:26:16 -0600 > Josh Poimboeuf wrote: > > > This doesn't seem to address some of my previous concerns: > > You're right. That discussion quickly headed towards objtool > and I forgot about this one paragraph with the remarks. > > > - Bailing on interrupt/exception frames > > That is a good question. My current code keeps unwinding as long > as the trace looks sane. If the exception frame has a valid code > pointer in the LR slot it will continue. Couldn't there be cases > where this is desirable? I thought we established in the previous discussion that this could cause some functions to get skipped in the stack trace: https://lkml.kernel.org/r/20171219214652.u7qeb7fxov62ttke@treble > Should this be configurable? Not that > I have an idea how this situation could occur for a thread > that is current or sleeping... Page faults and preemption. > Michael, Balbir: is that possible? Any Idea how to reliably detect > an exception frame? My approach would be to look at the next return > address and compare it to the usual suspects (i.e. collect all > "b ret" addresses in the EXCEPTION_COMMON macro, for BookS). It looks like show_stack() already knows how to do this: /* * See if this is an exception frame. * We look for the "regshere" marker in the current frame. */ if (validate_sp(sp, tsk, STACK_INT_FRAME_SIZE) && stack[STACK_FRAME_MARKER] == STACK_FRAME_REGS_MARKER) { So you could do something similar. > > - Function graph tracing return address conversion > > > > - kretprobes return address conversion > > You mean like in arch/x86/kernel/unwind_frame.c the call to > ftrace_graph_ret_addr ? > > Forgive me my directness but I don't see why these should be handled in > arch-dependent code, other than maybe a hook, if inevitable, that calls > back into the graph tracer / kretprobes in order to get the proper > address, I don't really follow, where exactly would you propose calling ftrace_graph_ret_addr() from? > or simply call the trace unreliable in case it finds such a > return address. If you're going to make livepatch incompatible with function graph tracing, there needs to be a good justification for it (and we'd need to make sure existing users are fine with it). -- Josh