From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "tiejun.chen" <tiejun.chen@windriver.com>
Cc: Scott Wood <scottwood@freescale.com>,
"linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: Re: [v3 PATCH 1/1] booke/kprobe: make program exception to use one dedicated exception stack
Date: Tue, 30 Aug 2011 15:44:24 +1000 [thread overview]
Message-ID: <1314683064.2488.76.camel@pasglop> (raw)
In-Reply-To: <4E2561F0.5040701@windriver.com>
> > As I understand it, the problem comes from the fact that stwu combines the
> > creation of a stack frame with storing into that stack frame. If they were
>
> Yes.
>
> > separate instructions you'd have a new exception frame at a lower address
> > by the time you actually store to the non-exception frame.
>
> So when kprobe we should use a unique stack frame to skip that stack frame the
> kprobed stwu want to create.
I still don't like that patch. Potentially the problem exist for all
variants of powerpc, not just booke, and I'm not sure I like adding yet
another exception stack.
Another (non-great) approach would be to special case stwu to the stack,
and instead of doing the store while emulating the instruction, keep the
store address around and do it later, after the stack has been unwound,
in the exit path (a TIF flag to hit the slow path and then do it in the
slow path).
It sounds hackish but it makes it easier to fix everybody at once, there
are "issues" with changing stacks especially on ppc64 and it would
definitely be affected as well if the stack frame created is larger than
our gap.
Cheers,
Ben.
next prev parent reply other threads:[~2011-08-30 5:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-11 11:31 [v3 PATCH 1/1] booke/kprobe: make program exception to use one dedicated exception stack Tiejun Chen
2011-07-11 11:31 ` [v3] booke/kprobe: Fix stack corrupt issue when kprobe 'stwu' Tiejun Chen
2011-07-14 11:56 ` tiejun.chen
2011-07-12 2:35 ` [v3 PATCH 1/1] booke/kprobe: make program exception to use one dedicated exception stack tiejun.chen
2011-07-14 13:27 ` Kumar Gala
2011-07-14 15:53 ` Scott Wood
2011-07-15 5:28 ` tiejun.chen
2011-07-15 18:42 ` Scott Wood
2011-07-16 3:25 ` Chen, Tiejun
2011-07-18 15:56 ` Scott Wood
2011-07-19 10:52 ` tiejun.chen
2011-08-30 5:44 ` Benjamin Herrenschmidt [this message]
2011-08-31 9:17 ` tiejun.chen
2011-08-31 21:32 ` Benjamin Herrenschmidt
2011-07-21 9:32 ` tiejun.chen
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=1314683064.2488.76.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=scottwood@freescale.com \
--cc=tiejun.chen@windriver.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).