linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/4] syscalls: clean up stub naming convention
@ 2018-04-09 10:51 Dominik Brodowski
  2018-04-09 10:51 ` [PATCHv2 1/4] syscalls: clean up syscall " Dominik Brodowski
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Dominik Brodowski @ 2018-04-09 10:51 UTC (permalink / raw)
  To: linux-kernel, mingo
  Cc: Dominik Brodowski, Al Viro, Andi Kleen, Andrew Morton,
	Andy Lutomirski, Brian Gerst, Denys Vlasenko, H. Peter Anvin,
	Ingo Molnar, Linus Torvalds, Peter Zijlstra, Thomas Gleixner,
	x86, Maninder Singh, Arnd Bergmann, linux-arch

As per the discussion with Ingo, here is an updated patchset on top of tip/asm
to clean up the syscall stub naming convention. Changes to v1 include renames
(__do_ becomes __se_ for sign-extending, __in_ becomes __do_) and more
comments.

For the generic case, we now will have:

t	        kernel_waitid	# common C function (see kernel/exit.c)

i	      __do_sys_waitid	# inlined helper doing the actual work
				# (takes original parameters as declared)

T	      __se_sys_waitid	# sign-extending C function calling inlined
				# helper (takes parameters of type long; casts
				# them to the declared type)

i	__do_compat_sys_waitid	# inlined helper doing the actual work
				# (takes parameters as declared)

T	__se_compat_sys_waitid	# sign-extending C function calling inlined
				# helper (takes parameters of type long, casts
				# them to unsigned long and then to the
				# declared type)

T	            sys_waitid	# alias to __se_sys_waitid() (taking
				# parameters as declared), to be included
				# in syscall table

T	     compat_sys_waitid	# alias to __se_compat_sys_waitid()
				# (taking parameters as declared), to
				# be included in syscall table


For 64-bit x86, kernel_waitid, __do_sys_waitid and __se_sys_waitid are the
same. But instead of sys_waitid and compat_sys_waitid, there are:

T	      __x64_sys_waitid	# x86 64-bit-ptregs -> C stub, calls
				# __se_sys_waitid(); to be included in
				# syscall table

T	     __ia32_sys_waitid	# IA32_EMULATION 32-bit-ptregs -> C stub,
				# calls __se_sys_waitid(); to be included
				# in syscall table unless there is a
				# compat syscall stub [in that case, it is
				# unused]

T     __ia32_compat_sys_waitid	# IA32_EMULATION 32-bit-ptregs -> C stub,
				# calls __se_compat_sys_waitid(); to be
				# included in syscall table

T      __x32_compat_sys_waitid	# x32 64-bit-ptregs -> C stub, calls
				# __se_compat_sys_waitid(); to be included
				# in syscall table

In short (0xffffffff prefix removed, re-ordered):

810f0af0 t            kernel_waitid	# common (32/64) kernel helper

<inline>            __do_sys_waitid	# inlined helper doing actual work
810f0be0 t          __se_sys_waitid	# C func calling inlined helper

<inline>     __do_compat_sys_waitid	# inlined helper doing actual work
810f0d80 t   __se_compat_sys_waitid	# compat C func calling inlined helper

810f2080 T         __x64_sys_waitid	# x64 64-bit-ptregs -> C stub
810f20b0 T        __ia32_sys_waitid	# ia32 32-bit-ptregs -> C stub [unused]
810f2470 T __ia32_compat_sys_waitid	# ia32 32-bit-ptregs -> compat C stub
810f2490 T  __x32_compat_sys_waitid	# x32 64-bit-ptregs -> compat C stub

The kbuild test robot barked at an alleged +20038 bytes kernel size regression
for i386-tinyconfig due to the first patch of this series. That seems to be a
false positive, as it likely doesn't take into account the change to
scripts/bloat-o-meter. Moreover, I could not reproduce such a size regression
on local i386 builds.

Thanks,
	Dominik


Dominik Brodowski (4):
  syscalls: clean up syscall stub naming convention
  syscalls: clean up compat syscall stub naming convention
  syscalls: rename struct pt_regs-based sys_*() to __x64_sys_*()
  syscalls/x86: adapt syscall_wrapper.h to the new syscall stub naming
    convention

 Documentation/process/adding-syscalls.rst |   4 +-
 arch/x86/entry/syscalls/syscall_32.tbl    | 720 +++++++++++-----------
 arch/x86/entry/syscalls/syscall_64.tbl    | 710 ++++++++++-----------
 arch/x86/entry/syscalls/syscalltbl.sh     |  14 +-
 arch/x86/entry/vsyscall/vsyscall_64.c     |   6 +-
 arch/x86/include/asm/syscall_wrapper.h    | 156 +++--
 arch/x86/include/asm/syscalls.h           |   2 +-
 include/linux/compat.h                    |  29 +-
 include/linux/syscalls.h                  |  17 +-
 scripts/bloat-o-meter                     |   4 +-
 10 files changed, 858 insertions(+), 804 deletions(-)

-- 
2.17.0

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

end of thread, other threads:[~2018-04-09 16:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-09 10:51 [PATCHv2 0/4] syscalls: clean up stub naming convention Dominik Brodowski
2018-04-09 10:51 ` [PATCHv2 1/4] syscalls: clean up syscall " Dominik Brodowski
2018-04-09 16:16   ` [tip:x86/asm] syscalls/core, syscalls/x86: Clean " tip-bot for Dominik Brodowski
2018-04-09 10:51 ` [PATCHv2 2/4] syscalls: clean up compat " Dominik Brodowski
2018-04-09 16:17   ` [tip:x86/asm] syscalls/core, syscalls/x86: Clean " tip-bot for Dominik Brodowski
2018-04-09 10:51 ` [PATCHv2 3/4] syscalls: rename struct pt_regs-based sys_*() to __x64_sys_*() Dominik Brodowski
2018-04-09 16:17   ` [tip:x86/asm] syscalls/core, syscalls/x86: Rename " tip-bot for Dominik Brodowski
2018-04-09 10:51 ` [PATCHv2 4/4] syscalls/x86: adapt syscall_wrapper.h to the new syscall stub naming convention Dominik Brodowski
2018-04-09 16:18   ` [tip:x86/asm] syscalls/x86: Adapt " tip-bot for Dominik Brodowski

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).