Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754707Ab2FFOZK (ORCPT ); Wed, 6 Jun 2012 10:25:10 -0400 Received: from mail7.hitachi.co.jp ([133.145.228.42]:43399 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752026Ab2FFOZJ (ORCPT ); Wed, 6 Jun 2012 10:25:09 -0400 X-AuditID: b753bd60-925c5ba000002ea5-1d-4fcf6842e9d0 X-AuditID: b753bd60-925c5ba000002ea5-1d-4fcf6842e9d0 Message-ID: <4FCF683A.90202@hitachi.com> Date: Wed, 06 Jun 2012 23:24:58 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Andi Kleen Cc: Steven Rostedt , linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Ananth N Mavinakayanahalli , "Frank Ch. Eigler" , Andrew Morton , Frederic Weisbecker , yrl.pp-manager.tt@hitachi.com Subject: Re: [PATCH -tip v2 3/9] ftrace/x86: Support SAVE_REGS feature on i386 References: <20120605102734.27845.43401.stgit@localhost.localdomain> <20120605102802.27845.49309.stgit@localhost.localdomain> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1210 Lines: 34 (2012/06/06 6:51), Andi Kleen wrote: > Masami Hiramatsu writes: >> >> + .macro FTRACE_SAVE_ALL >> + /* eflags is saved on cs */ >> + subl $8, %esp /* skip ip and orig_ax */ >> + pushl %gs >> + pushl %fs > > For pure in kernel use you don't need to save/restore fs/gs > This is only needed on kernel/user space boundaries. > > And for this usage probably also not flags I see, most of the case, user doesn't really need it. But in some case, it can be easily imagined that pt_regs is used for dumping all registers. Suppose that this ftrace-based kprobe optimization is done transparently, they may see that the results of dumping registers are different even if the probe moves just one instruction ahead. I'd like to avoid this kind of differences. Thank you, -- Masami HIRAMATSU Software Platform Research Dept. Linux Technology Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: masami.hiramatsu.pt@hitachi.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/