Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751487AbdGMMfq (ORCPT ); Thu, 13 Jul 2017 08:35:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44576 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157AbdGMMfo (ORCPT ); Thu, 13 Jul 2017 08:35:44 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D5356652E Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jpoimboe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D5356652E Date: Thu, 13 Jul 2017 07:35:39 -0500 From: Josh Poimboeuf To: Ingo Molnar Cc: Peter Zijlstra , Andres Freund , x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Linus Torvalds , Andy Lutomirski , Jiri Slaby , "H. Peter Anvin" , Mike Galbraith , Jiri Olsa , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin Subject: Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Message-ID: <20170713123539.t6az4pnrdjewjvms@treble> References: <20170712214920.5droainfqjmq7sgu@alap3.anarazel.de> <20170712223225.zkq7tdb7pzgb3wy7@treble> <20170713071253.a3slz3j5tcgy3rkk@hirez.programming.kicks-ass.net> <20170713085015.yjjv5ig2znplx5jl@hirez.programming.kicks-ass.net> <20170713085114.h4vjgg7jjbl6dohb@hirez.programming.kicks-ass.net> <20170713091911.aj7e7dvrbqcyxh7l@gmail.com> <20170713121755.hsuvecrzvyxbdvvk@treble> <20170713122115.p62q7ua6gtuapfep@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170713122115.p62q7ua6gtuapfep@treble> 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.39]); Thu, 13 Jul 2017 12:35:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1155 Lines: 27 On Thu, Jul 13, 2017 at 07:21:15AM -0500, Josh Poimboeuf wrote: > On Thu, Jul 13, 2017 at 07:17:55AM -0500, Josh Poimboeuf wrote: > > BTW, while we're throwing out ideas for this, here's another idea, > > though it's almost certainly not a good one :-) > > > > For user space stack unwinding, the kernel could emulate what the kernel > > 'guess' unwinder does by scanning the user space stack and returning all > > the text addresses it finds. To clarify, text address would mean any address in a VMA with the executable bit set. > > The results wouldn't be 100% accurate, but they could end up being > > useful over time. > > And to expound further on the bad idea, maybe the "bad" addresses could > be filtered out somehow in post-processing (insert lots of hand waving). And some details on the post-processing: in most cases it should be possible to determine which of the found stack addresses are valid by looking at the call instructions immediately preceding the stack text addresses, and making sure the call target points to the same function as the previously found address. But of course that wouldn't work for indirect calls. -- Josh