public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC patch] use thread.on_ustack to determine if on user stack
@ 2007-09-29  7:53 Luming Yu
  2007-10-12 22:15 ` Fenghua Yu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Luming Yu @ 2007-09-29  7:53 UTC (permalink / raw)
  To: linux-ia64

[-- 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);			\

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-10-16  1:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-29  7:53 [RFC patch] use thread.on_ustack to determine if on user stack Luming Yu
2007-10-12 22:15 ` Fenghua Yu
2007-10-15  4:28 ` Luming Yu
2007-10-15 23:26 ` Fenghua Yu
2007-10-16  1:14 ` Luming Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox