All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86-64: remove unnecessary ptregs call stubs
@ 2008-06-18 11:42 Jan Beulich
  2008-06-19 12:25 ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2008-06-18 11:42 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: Andi Kleen, linux-kernel

A few of the ptregs call stubs are superfluous these days - the called
functions don't have a trailing 'struct pt_regs *' parameter anymore.

Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Jan Beulich <jbeulich@novell.com>

---
 arch/x86/ia32/ia32entry.S   |    6 ++----
 arch/x86/kernel/entry_64.S  |    1 -
 include/asm-x86/unistd_64.h |    2 +-
 3 files changed, 3 insertions(+), 6 deletions(-)

--- linux-2.6.26-rc6/arch/x86/ia32/ia32entry.S	2008-06-18 12:49:29.000000000 +0200
+++ 2.6.26-rc6-x86_64-remove-ptregs-stubs/arch/x86/ia32/ia32entry.S	2008-06-11 12:26:13.000000000 +0200
@@ -370,13 +370,11 @@ quiet_ni_syscall:
 	PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi
 	PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi
 	PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx
-	PTREGSCALL stub32_sigsuspend, sys32_sigsuspend, %rcx
 	PTREGSCALL stub32_execve, sys32_execve, %rcx
 	PTREGSCALL stub32_fork, sys_fork, %rdi
 	PTREGSCALL stub32_clone, sys32_clone, %rdx
 	PTREGSCALL stub32_vfork, sys_vfork, %rdi
 	PTREGSCALL stub32_iopl, sys_iopl, %rsi
-	PTREGSCALL stub32_rt_sigsuspend, sys_rt_sigsuspend, %rdx
 
 ENTRY(ia32_ptregs_common)
 	popq %r11
@@ -476,7 +474,7 @@ ia32_sys_call_table:
 	.quad sys_ssetmask
 	.quad sys_setreuid16	/* 70 */
 	.quad sys_setregid16
-	.quad stub32_sigsuspend
+	.quad sys32_sigsuspend
 	.quad compat_sys_sigpending
 	.quad sys_sethostname
 	.quad compat_sys_setrlimit	/* 75 */
@@ -583,7 +581,7 @@ ia32_sys_call_table:
 	.quad sys32_rt_sigpending
 	.quad compat_sys_rt_sigtimedwait
 	.quad sys32_rt_sigqueueinfo
-	.quad stub32_rt_sigsuspend
+	.quad sys_rt_sigsuspend
 	.quad sys32_pread		/* 180 */
 	.quad sys32_pwrite
 	.quad sys_chown16
--- linux-2.6.26-rc6/arch/x86/kernel/entry_64.S	2008-06-18 12:49:29.000000000 +0200
+++ 2.6.26-rc6-x86_64-remove-ptregs-stubs/arch/x86/kernel/entry_64.S	2008-06-11 12:24:52.000000000 +0200
@@ -420,7 +420,6 @@ END(\label)
 	PTREGSCALL stub_clone, sys_clone, %r8
 	PTREGSCALL stub_fork, sys_fork, %rdi
 	PTREGSCALL stub_vfork, sys_vfork, %rdi
-	PTREGSCALL stub_rt_sigsuspend, sys_rt_sigsuspend, %rdx
 	PTREGSCALL stub_sigaltstack, sys_sigaltstack, %rdx
 	PTREGSCALL stub_iopl, sys_iopl, %rsi
 
--- linux-2.6.26-rc6/include/asm-x86/unistd_64.h	2008-06-18 12:49:47.000000000 +0200
+++ 2.6.26-rc6-x86_64-remove-ptregs-stubs/include/asm-x86/unistd_64.h	2008-06-11 12:29:56.000000000 +0200
@@ -290,7 +290,7 @@ __SYSCALL(__NR_rt_sigtimedwait, sys_rt_s
 #define __NR_rt_sigqueueinfo			129
 __SYSCALL(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo)
 #define __NR_rt_sigsuspend			130
-__SYSCALL(__NR_rt_sigsuspend, stub_rt_sigsuspend)
+__SYSCALL(__NR_rt_sigsuspend, sys_rt_sigsuspend)
 #define __NR_sigaltstack			131
 __SYSCALL(__NR_sigaltstack, stub_sigaltstack)
 #define __NR_utime				132




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

* Re: [PATCH] x86-64: remove unnecessary ptregs call stubs
  2008-06-18 11:42 [PATCH] x86-64: remove unnecessary ptregs call stubs Jan Beulich
@ 2008-06-19 12:25 ` Ingo Molnar
  2008-06-19 12:50   ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2008-06-19 12:25 UTC (permalink / raw)
  To: Jan Beulich; +Cc: tglx, hpa, Andi Kleen, linux-kernel, the arch/x86 maintainers


* Jan Beulich <jbeulich@novell.com> wrote:

> A few of the ptregs call stubs are superfluous these days - the called 
> functions don't have a trailing 'struct pt_regs *' parameter anymore.

applied to tip/x86/cleanups - thanks Jan.

	Ingo

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

* Re: [PATCH] x86-64: remove unnecessary ptregs call stubs
  2008-06-19 12:25 ` Ingo Molnar
@ 2008-06-19 12:50   ` Andi Kleen
  2008-06-19 14:32     ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2008-06-19 12:50 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Jan Beulich, tglx, hpa, linux-kernel, the arch/x86 maintainers

Ingo Molnar wrote:
> * Jan Beulich <jbeulich@novell.com> wrote:
> 
>> A few of the ptregs call stubs are superfluous these days - the called 
>> functions don't have a trailing 'struct pt_regs *' parameter anymore.
> 
> applied to tip/x86/cleanups - thanks Jan.

Just want to point out that not having a pt_regs * argument is not necessarily
sufficient for not needing a ptregs stub. Some code also accesses ptregs directly
through the stack top from get_thread_info() and might assume a full one. That said I *think*
it's ok for sigsuspend et.al. as in Jan's patch, but I haven't audited the complete code paths
in question that they never do that.

Would be good to clarify that in the commit log.

-Andi

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

* Re: [PATCH] x86-64: remove unnecessary ptregs call stubs
  2008-06-19 12:50   ` Andi Kleen
@ 2008-06-19 14:32     ` Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2008-06-19 14:32 UTC (permalink / raw)
  To: Ingo Molnar, Andi Kleen; +Cc: the arch/x86 maintainers, tglx, linux-kernel, hpa

>>> Andi Kleen <andi@firstfloor.org> 19.06.08 14:50 >>>
>Ingo Molnar wrote:
>> * Jan Beulich <jbeulich@novell.com> wrote:
>> 
>>> A few of the ptregs call stubs are superfluous these days - the called 
>>> functions don't have a trailing 'struct pt_regs *' parameter anymore.
>> 
>> applied to tip/x86/cleanups - thanks Jan.
>
>Just want to point out that not having a pt_regs * argument is not necessarily
>sufficient for not needing a ptregs stub. Some code also accesses ptregs directly
>through the stack top from get_thread_info() and might assume a full one. That said I *think*
>it's ok for sigsuspend et.al. as in Jan's patch, but I haven't audited the complete code paths
>in question that they never do that.
>
>Would be good to clarify that in the commit log.

Looking at both the source and disassembly of sys_rt_sigsuspend() and
sys32_sigsuspend(), I cannot see anything pt_regs related. All these
functions call are copy_from_user(), spin_lock_irq(), recalc_sigpending(),
and schedule(), and besides that they just update some global and task
state.

Jan


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

end of thread, other threads:[~2008-06-19 14:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-18 11:42 [PATCH] x86-64: remove unnecessary ptregs call stubs Jan Beulich
2008-06-19 12:25 ` Ingo Molnar
2008-06-19 12:50   ` Andi Kleen
2008-06-19 14:32     ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.