From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F902C43219 for ; Thu, 2 May 2019 23:31:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45A472085A for ; Thu, 2 May 2019 23:31:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726438AbfEBXbe (ORCPT ); Thu, 2 May 2019 19:31:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:33954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbfEBXbe (ORCPT ); Thu, 2 May 2019 19:31:34 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 41B9A206DF; Thu, 2 May 2019 23:31:31 +0000 (UTC) Date: Thu, 2 May 2019 19:31:29 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Linus Torvalds , Linux List Kernel Mailing , Ingo Molnar , Andrew Morton , Andy Lutomirski , Nicolai Stange , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , the arch/x86 maintainers , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Shuah Khan , Konrad Rzeszutek Wilk , Tim Chen , Sebastian Andrzej Siewior , Mimi Zohar , Juergen Gross , Nick Desaulniers , Nayna Jain , Masahiro Yamada , Joerg Roedel , "open list:KERNEL SELFTEST FRAMEWORK" , stable Subject: Re: [RFC][PATCH 1/2] x86: Allow breakpoints to emulate call functions Message-ID: <20190502193129.664c5b2e@gandalf.local.home> In-Reply-To: <20190502185225.0cdfc8bc@gandalf.local.home> References: <20190501202830.347656894@goodmis.org> <20190501203152.397154664@goodmis.org> <20190501232412.1196ef18@oasis.local.home> <20190502162133.GX2623@hirez.programming.kicks-ass.net> <20190502181811.GY2623@hirez.programming.kicks-ass.net> <20190502202146.GZ2623@hirez.programming.kicks-ass.net> <20190502185225.0cdfc8bc@gandalf.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2 May 2019 18:52:25 -0400 Steven Rostedt wrote: > On Thu, 2 May 2019 22:21:46 +0200 > Peter Zijlstra wrote: > > > On Thu, May 02, 2019 at 11:43:37AM -0700, Linus Torvalds wrote: > > > What would it look like with the "int3-from-kernel is special" modification? > > > > Something like so; it boots; but I could've made some horrible mistake > > (again). > > > > --- > > diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S > > index 7b23431be5cb..4de51cff5b8a 100644 > > --- a/arch/x86/entry/entry_32.S > > +++ b/arch/x86/entry/entry_32.S > > Oh, and so close! > > I was running this on my i386 tests and for test 8 of 9 (passed 1-7) I > hit this: Digging a little further, I pinpointed it out to being kretprobes. The problem I believe is the use of kernel_stack_pointer() which does some magic on x86_32. kretprobes uses this to hijack the return address of the function (much like the function graph tracer does). I do have code that would allow kretprobes to use the function graph tracer instead, but that's still in progress (almost done!). But still, we should not have this break the use of kernel_stack_pointer() either. Adding some printks in that code, it looks to be returning "®s->sp" which I think we changed. -- Steve