public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Christopher Friesen" <cfriesen@nortel.com>
To: "linux-os (Dick Johnson)" <linux-os@analogic.com>
Cc: Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: CONFIG_FRAME_POINTER and module vermagic
Date: Tue, 04 Apr 2006 15:58:32 -0600	[thread overview]
Message-ID: <4432EC08.4010104@nortel.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0603291308240.28274@chaos.analogic.com>


A while back there was a post that CONFIG_FRAME_POINTER doesn't affect 
calling conventions and doesn't need to be in vermagic.

One of my coworkers seems to think otherwise, and I don't know enough 
about the issue to know for sure.  Could someone with i386 knowledge 
comment on his thoughts?

Here's what he's currently thinking:

1) regs->ebp hold a copy of the stack frame pointer. It's value is 
conserved through any function that are compiled with FRAME_POINTER on.

2) (unsigned long *)(regs->ebp + 4) is the "pc" of the caller (like the 
link register on PPC which is relative to "fp")

3) The profile_pc function usually look directly at "pc" to do it's 
profiling magic but sometimes (when the current "pc" is inside a 
lock_function, we're SMP, and CONFIG_FRAME_POINTER is enabled) it uses 
"regs->ebp+4" to be more accurate on the profiling. In other word 
profile_pc doesn't want to create a profiling entry that would show 
redundant information about being stuck into a spin_lock...

So, if the kernel was built with SMP and FRAME_POINTER, a module wasn't, 
the module used ebp as a general register, then blocked in a spinlock 
when profile_pc started...then a regs->ebp value of something 
interesting (like "0", for instance) could cause interesting behaviour.

Seems reasonable to me, but like I said, I'm not an expert on i386.

Chris

  parent reply	other threads:[~2006-04-04 21:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-29 17:58 CONFIG_FRAME_POINTER and module vermagic Christopher Friesen
2006-03-29 18:15 ` linux-os (Dick Johnson)
2006-03-29 19:44   ` Christopher Friesen
2006-04-04 21:58   ` Christopher Friesen [this message]
2006-04-04 22:48     ` Joshua Hudson
2006-04-05 12:01     ` linux-os (Dick Johnson)
2006-04-05 17:00       ` Joshua Hudson

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=4432EC08.4010104@nortel.com \
    --to=cfriesen@nortel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-os@analogic.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