public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* V2 [PATCH 0/2] x32: Properly pass long to syscall [BZ #25810]
@ 2020-04-13 17:51 H.J. Lu
  2020-04-13 17:51 ` V2 [PATCH 1/2] Add SYSCALL_ULONG_ARG_[12] to " H.J. Lu
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: H.J. Lu @ 2020-04-13 17:51 UTC (permalink / raw)
  To: libc-alpha

X32 has 32-bit long and pointer with 64-bit off_t.  Since x32 psABI
requires that pointers passed in registers must be zero-extended to
64bit, x32 can share many syscall interfaces with LP64.  When a LP64
syscall with long and unsigned long arguments is used for x32, these
arguments must be properly extended to 64-bit.  Otherwise if the upper
32 bits of the register have undefined value, such a syscall will be
rejected by kernel.

For syscalls implemented in assembly codes, 'U' is added to syscall
signature key letters for unsigned long.  SYSCALL_ULONG_ARG_1 and
SYSCALL_ULONG_ARG_2 are passed to syscall-template.S for the first
and the second unsigned long arguments if PSEUDOS_HAVE_4_ARGS is
defined.  They are used by x32 to zero-extend 32-bit arguments to
64 bits.

Tested on i386, x86-64 and x32 as well as with build-many-glibcs.py.

OK for master branch?

H.J. Lu (2):
  Add SYSCALL_ULONG_ARG_[12] to pass long to syscall [BZ #25810]
  Add a syscall test for [BZ #25810]

 misc/Makefile                               |   2 +-
 misc/tst-syscalls.c                         | 146 ++++++++++++++++++++
 sysdeps/unix/make-syscalls.sh               |  88 ++++++++++++
 sysdeps/unix/syscall-template.S             |  43 +++++-
 sysdeps/unix/syscalls.list                  |   6 +-
 sysdeps/unix/sysv/linux/syscalls.list       |  14 +-
 sysdeps/unix/sysv/linux/x86_64/sysdep.h     |  70 ++++++++--
 sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h |  20 ++-
 8 files changed, 360 insertions(+), 29 deletions(-)
 create mode 100644 misc/tst-syscalls.c

-- 
2.25.2


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

end of thread, other threads:[~2020-04-29 13:30 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 17:51 V2 [PATCH 0/2] x32: Properly pass long to syscall [BZ #25810] H.J. Lu
2020-04-13 17:51 ` V2 [PATCH 1/2] Add SYSCALL_ULONG_ARG_[12] to " H.J. Lu
2020-04-22 10:42   ` Florian Weimer
2020-04-22 11:44     ` Adhemerval Zanella
2020-04-22 22:01       ` Joseph Myers
2020-04-23 21:34         ` Adhemerval Zanella
2020-04-22 16:09     ` V3 " H.J. Lu
2020-04-25 13:56       ` PING: " H.J. Lu
2020-04-28 13:27         ` PING^2: " H.J. Lu
2020-04-29 12:14       ` Florian Weimer
2020-04-29 12:43         ` H.J. Lu
2020-04-29 12:56           ` Florian Weimer
2020-04-29 12:57             ` H.J. Lu
2020-04-29 13:15         ` H.J. Lu
2020-04-29 13:30           ` Florian Weimer
2020-04-13 17:51 ` V2 [PATCH 2/2] Add a syscall test for " H.J. Lu
2020-04-22 12:25   ` Florian Weimer
2020-04-22 12:43     ` H.J. Lu
2020-04-22 12:47       ` Florian Weimer
2020-04-22 13:42         ` H.J. Lu
2020-04-22 13:46           ` Florian Weimer
2020-04-22 15:52             ` V3 " H.J. Lu
2020-04-22 15:55               ` Florian Weimer
2020-04-16 12:52 ` PING: V2 [PATCH 0/2] x32: Properly pass long to syscall " H.J. Lu
2020-04-20 14:15   ` PING^2: " H.J. Lu

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 read-only IMAP folder(s) and NNTP newsgroup(s).