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=-0.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=unavailable 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 9BFF5C04AAB for ; Wed, 8 May 2019 16:06:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E6C0216C4 for ; Wed, 8 May 2019 16:06:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727356AbfEHQGT (ORCPT ); Wed, 8 May 2019 12:06:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:40110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725889AbfEHQGT (ORCPT ); Wed, 8 May 2019 12:06:19 -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 E8BF720989; Wed, 8 May 2019 16:06:15 +0000 (UTC) Date: Wed, 8 May 2019 12:06:14 -0400 From: Steven Rostedt To: Masami Hiramatsu Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Peter Zijlstra , Andy Lutomirski , 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: [PATCH 0/3] x86_64/ftrace: Emulate calls from int3 when patching functions Message-ID: <20190508120614.037779be@gandalf.local.home> In-Reply-To: <20190508133022.78cd9c9b8fcb7838fc0280d0@kernel.org> References: <20190508015559.767152678@goodmis.org> <20190508133022.78cd9c9b8fcb7838fc0280d0@kernel.org> 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 Wed, 8 May 2019 13:30:22 +0900 Masami Hiramatsu wrote: > > To solve this, an int3_emulate_call() is created for x86_64 to allow > > ftrace on x86_64 to emulate the call to ftrace_regs_caller() which will > > make sure all the registered handlers to that function are still called. > > And this keeps live kernel patching happy! > > Out of curiosity, would you have any idea to re-use these function for > other use-case? Maybe kprobes can reuse it, but very limited use-case. Yes, but only for x86_64. > > > To mimimize the changes, and to avoid controversial patches, this > > only changes x86_64. Due to the way x86_32 implements the regs->sp > > the complexity of emulating calls on that platform is too much for > > stable patches, and live kernel patching does not support x86_32 anyway. > > This series looks good to me. > > Reviewed-by: Masami Hiramatsu Thanks Masami! -- Steve