From mboxrd@z Thu Jan 1 00:00:00 1970 From: peterz at infradead.org (Peter Zijlstra) Date: Wed, 1 May 2019 20:57:26 +0200 Subject: [RFC][PATCH v3] ftrace/x86_64: Emulate call function while updating in breakpoint handler In-Reply-To: References: <20190501113238.0ab3f9dd@gandalf.local.home> Message-ID: <20190501185726.GR7905@worktop.programming.kicks-ass.net> On Wed, May 01, 2019 at 11:01:07AM -0700, Linus Torvalds wrote: > This looks sane to me, although I'm surprised that we didn't already > have an annotation for the nonstandard stack frame for asm files. That > probably would be cleaner in a separate commit, but I guess it doesn't > matter. > > Anyway, I'm willing to consider the entry code version if it looks a > _lot_ simpler than this (so I'd like to see them side-by-side), but > it's not like this looks all that complicated to me either. So I posted one earlier today: https://lkml.kernel.org/r/20190501131117.GW2623 at hirez.programming.kicks-ass.net it's about a 1/3rd the number of lines and has 32bit support. It also provides all the bits required to implement static_call(). That is; I think I'm firmly in favour of the entry variant -- provided it actually works of course. From mboxrd@z Thu Jan 1 00:00:00 1970 From: peterz@infradead.org (Peter Zijlstra) Date: Wed, 1 May 2019 20:57:26 +0200 Subject: [RFC][PATCH v3] ftrace/x86_64: Emulate call function while updating in breakpoint handler In-Reply-To: References: <20190501113238.0ab3f9dd@gandalf.local.home> Message-ID: <20190501185726.GR7905@worktop.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" Message-ID: <20190501185726.VCRmZ7evLLjbPL_XVQfQOm6xxtETizz5kl7aMDrAh_I@z> On Wed, May 01, 2019@11:01:07AM -0700, Linus Torvalds wrote: > This looks sane to me, although I'm surprised that we didn't already > have an annotation for the nonstandard stack frame for asm files. That > probably would be cleaner in a separate commit, but I guess it doesn't > matter. > > Anyway, I'm willing to consider the entry code version if it looks a > _lot_ simpler than this (so I'd like to see them side-by-side), but > it's not like this looks all that complicated to me either. So I posted one earlier today: https://lkml.kernel.org/r/20190501131117.GW2623 at hirez.programming.kicks-ass.net it's about a 1/3rd the number of lines and has 32bit support. It also provides all the bits required to implement static_call(). That is; I think I'm firmly in favour of the entry variant -- provided it actually works of course. 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=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT 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 77B7BC43219 for ; Wed, 1 May 2019 18:58:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B13420675 for ; Wed, 1 May 2019 18:58:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="fm9qS77V" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726150AbfEAS6D (ORCPT ); Wed, 1 May 2019 14:58:03 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:60976 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726019AbfEAS6C (ORCPT ); Wed, 1 May 2019 14:58:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3CoCMxRNI5B81hO4bBNVrThAA9Fq27JtsrjXALFMYvM=; b=fm9qS77Vw7+9yE2lMBrpxLtZj oEyoU6pcvTlYigA8B7sutWVGYJzn0tgwf8z0dXBIxzgiXLy/voa4x7O0lTiK0X6XJFbhSLcE+2t0D h+MELCRu7dNUdXyKI0+zXNcV2FYVRW5O3qBsZOk+fuuCnFO+ayo9NB2QwATFkn9bzoEgzHrzhmOIX /4dWzIkIdBFz5R/3/HGFzb24EOnhAmtUOUqfUff8ugc6lCuM5UZQTPztHV5w0aegeWLSBY5iYrzZU v3kdgMt5rme6EAHc1qA6v0Cd233xRrBjV5jhbrS16kNy3pyrVYylNabEjFF0a+YsW3enmcTuULWOI Gs9fHE7rQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLuQ6-0007pZ-C0; Wed, 01 May 2019 18:57:30 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id DC946984EB4; Wed, 1 May 2019 20:57:26 +0200 (CEST) Date: Wed, 1 May 2019 20:57:26 +0200 From: Peter Zijlstra To: Linus Torvalds Cc: Steven Rostedt , 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 , Linux List Kernel Mailing , live-patching@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" Subject: Re: [RFC][PATCH v3] ftrace/x86_64: Emulate call function while updating in breakpoint handler Message-ID: <20190501185726.GR7905@worktop.programming.kicks-ass.net> References: <20190501113238.0ab3f9dd@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 01, 2019 at 11:01:07AM -0700, Linus Torvalds wrote: > This looks sane to me, although I'm surprised that we didn't already > have an annotation for the nonstandard stack frame for asm files. That > probably would be cleaner in a separate commit, but I guess it doesn't > matter. > > Anyway, I'm willing to consider the entry code version if it looks a > _lot_ simpler than this (so I'd like to see them side-by-side), but > it's not like this looks all that complicated to me either. So I posted one earlier today: https://lkml.kernel.org/r/20190501131117.GW2623@hirez.programming.kicks-ass.net it's about a 1/3rd the number of lines and has 32bit support. It also provides all the bits required to implement static_call(). That is; I think I'm firmly in favour of the entry variant -- provided it actually works of course.