linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: ananth@in.ibm.com
Cc: LKML <linux-kernel@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	linuxppc-dev@ozlabs.org,
	systemtap-ml <systemtap@sources.redhat.com>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [RFC][PATCH -tip 4/9] power: add kernel_trap_sp()
Date: Fri, 20 Mar 2009 06:53:43 -0400	[thread overview]
Message-ID: <49C375B7.5090806@redhat.com> (raw)
In-Reply-To: <20090320073334.GA10519@in.ibm.com>

Ananth N Mavinakayanahalli wrote:
> On Fri, Mar 20, 2009 at 04:42:40PM +1100, Benjamin Herrenschmidt wrote:
>> On Thu, 2009-03-19 at 17:10 -0400, Masami Hiramatsu wrote:
>>> Add kernel_trap_sp() on powerpc, based on systemtap's runtime/regs.h.
>>>
>>> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
>> I haven't looked at the usage of it, but it's weird to have something
>> call "kernel_trap_sp" that returns the -user- stack pointer... is
>> this really what's expected here ?
> 
> In the current usage scenario, this gets called only with a pt_regs
> snapshot from in kernel. user_stack_pointer() is a misnomer though;
> all this macro needs is to return the stack pointer from the given
> pt_regs.

Indeed,
I expect kernel_trap_sp() returns the top of stack from pt_regs in the kernel.
Why I'm using user_stack_pointer() for kernel_trap_sp() is just that the
definitions of both are same...

Perhaps, should I define as below, even it is same as user_stack_pointer()?
#define kernel_trap_sp(regs) ((regs)->gpr[1])

Thank you,

> 
> Ananth
> --
> 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/

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

      reply	other threads:[~2009-03-20 10:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19 21:10 [RFC][PATCH -tip 4/9] power: add kernel_trap_sp() Masami Hiramatsu
2009-03-20  5:42 ` Benjamin Herrenschmidt
2009-03-20  7:33   ` Ananth N Mavinakayanahalli
2009-03-20 10:53     ` Masami Hiramatsu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49C375B7.5090806@redhat.com \
    --to=mhiramat@redhat.com \
    --cc=ananth@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).