Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7821766yba; Thu, 2 May 2019 17:24:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLWnkk0+ES/YgCj6iDJFnPga87cLxUAplZoZdrG2FxwMsmgHQmIVZsGn7ckiM+B9mUn1iE X-Received: by 2002:a63:ed10:: with SMTP id d16mr6813110pgi.75.1556843076219; Thu, 02 May 2019 17:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556843076; cv=none; d=google.com; s=arc-20160816; b=wDaoV0VZNZA6y6LdXWDwMj8TVCOFGwUDCrRKaOxCgkMtL9yKF03bmPAUh9VD1PlUZD 7aEx+OCJB1NhSaXQbOxdzQyNAgRRZ1NUEwdTSdEAo8D8KWz4LaGqNaX5x9iWp1ACvDpG FwkdGHZeSSGsHxAjc+xKRy5vHwfQoBF8jotJ97nepXhb2FiTRftmTt5dVBGcsyYpbJDL ZDUN8s8Fj41M00G70gLkawVA6ebKZRZT/NEGsQo9WneHVjUo4fonGpfLQbEAoapYhDwn kodmOUPGt7ShnFMojEUwk9LgsbYGTJLX0Nl4qfZSA9VuQzyn1FaTCBhuFDiLAx6on8Gc gCYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=vS7VUbFDoiH0vXXzwnj9ZorupgB6veXIayW7EcKXWrE=; b=T7jYvndqygbujdLUocsbmrxFrz81fv9uU4kRl7Wp/YLvOiuL1AiV8agdj739qM5OPg TTjEdwvLwj//Vpvcp7nH4cMF/XriyOwiPyVlyl/crZ438sZlL/sQiQKNeMrCn3BuriXk 0pugjscsBZaqti0E91ZqDL4zs4dlPgfEFLQ3ODA/u0ZJG6wz67cTDkWCnxTIXglsBa/A 14l6PAWgcdBQpVa2cT9Kxk6WluS8Dxdrbn5/9b3vhWzSKiJxsG0RYa3ysB7dbXgy7jeg 6RuJDj30ag6G1EV4hYX+LuKbXMRGE/E0XZubrDREou58XRvg0/RfRihB0uZq4rSV3qfs cMYg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si513826pgr.167.2019.05.02.17.24.08; Thu, 02 May 2019 17:24:36 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726425AbfEBXbe (ORCPT + 99 others); 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