From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28798 invoked by alias); 9 May 2009 01:16:24 -0000 Received: (qmail 28689 invoked by uid 22791); 9 May 2009 01:16:23 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 09 May 2009 01:16:18 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n490jtfh007101 for ; Fri, 8 May 2009 20:45:55 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n490jtlk013580 for ; Fri, 8 May 2009 20:45:55 -0400 Received: from localhost.localdomain (dhcp-100-3-156.bos.redhat.com [10.16.3.156]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n490jsv1024497; Fri, 8 May 2009 20:45:54 -0400 From: Masami Hiramatsu Subject: [PATCH -tip v5 5/7] x86: fix kernel_trap_sp() To: Ingo Molnar, Steven Rostedt , lkml Cc: systemtap, kvm, Masami Hiramatsu , Harvey Harrison , Ingo Molnar , Thomas Gleixner , Jan Blunck Date: Sat, 09 May 2009 01:16:00 -0000 Message-ID: <20090509004904.5505.59034.stgit@localhost.localdomain> In-Reply-To: <20090509004829.5505.38720.stgit@localhost.localdomain> References: <20090509004829.5505.38720.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00524.txt.bz2 Use ®s->sp instead of regs for getting the top of stack in kernel mode. (on x86-64, regs->sp always points the top of stack) [ impact: Oprofile decodes only stack for backtracing on i386 ] Signed-off-by: Masami Hiramatsu Cc: Harvey Harrison Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Jan Blunck --- arch/x86/include/asm/ptrace.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h index 5cdd19f..90b76b3 100644 --- a/arch/x86/include/asm/ptrace.h +++ b/arch/x86/include/asm/ptrace.h @@ -187,14 +187,14 @@ static inline int v8086_mode(struct pt_regs *regs) /* * X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode - * when it traps. So regs will be the current sp. + * when it traps. So ®s->sp will be the current sp. * * This is valid only for kernel mode traps. */ static inline unsigned long kernel_trap_sp(struct pt_regs *regs) { #ifdef CONFIG_X86_32 - return (unsigned long)regs; + return (unsigned long)®s->sp; #else return regs->sp; #endif -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America) Inc. Software Solutions Division e-mail: mhiramat@redhat.com