public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: "Luming Yu" <luming.yu@gmail.com>
To: linux-ia64@vger.kernel.org
Subject: [RFC patch] use thread.on_ustack to determine if on user stack
Date: Sat, 29 Sep 2007 07:53:43 +0000	[thread overview]
Message-ID: <3877989d0709290053s7b4e80b6t9e7127b9ccac522b@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

Hello list,

The PSR.lp bit of kernel thread kondemand sometimes would be set, then
causes set_pstate PAL call fails with invalid argument. I tracked down
to the place that the PSR.lp was set in do_notify_resume_user. I don't
understand why not use task->thread.on_ustack to
check if on user stack.in the first place. For optimization?

Signed-off-by: Yu Luming <luming.yu@intel.com>


  ptrace.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: user_stack.patch --]
[-- Type: text/x-patch; name="user_stack.patch", Size: 670 bytes --]

--- linux-2.6.18.ia64/include/asm-ia64/ptrace.h.0	2007-09-28 21:41:19.000000000 +0800
+++ linux-2.6.18.ia64/include/asm-ia64/ptrace.h	2007-09-28 21:41:40.000000000 +0800
@@ -257,7 +257,7 @@
 # define task_pt_regs(t)		(((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1)
 # define ia64_psr(regs)			((struct ia64_psr *) &(regs)->cr_ipsr)
 # define user_mode(regs)		(((struct ia64_psr *) &(regs)->cr_ipsr)->cpl != 0)
-# define user_stack(task,regs)	((long) regs - (long) task == IA64_STK_OFFSET - sizeof(*regs))
+# define user_stack(task,regs)  (task->thread.on_ustack)
 # define fsys_mode(task,regs)					\
   ({								\
 	  struct task_struct *_task = (task);			\

             reply	other threads:[~2007-09-29  7:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-29  7:53 Luming Yu [this message]
2007-10-12 22:15 ` [RFC patch] use thread.on_ustack to determine if on user stack Fenghua Yu
2007-10-15  4:28 ` Luming Yu
2007-10-15 23:26 ` Fenghua Yu
2007-10-16  1:14 ` Luming Yu

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=3877989d0709290053s7b4e80b6t9e7127b9ccac522b@mail.gmail.com \
    --to=luming.yu@gmail.com \
    --cc=linux-ia64@vger.kernel.org \
    /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