summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-02-20x32: Add struct ucontext_x32H. J. Lu
Add a definition for struct ucontext_x32; this is inherently a mix of the 32- and 64-bit versions. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20x32: Export setup/restore_sigcontext from signal.cH. Peter Anvin
Export setup_sigcontext() and restore_sigcontext() from signal.c, so we can use the 64-bit versions verbatim for x32. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20x86: Move some signal-handling definitions to a common headerH. Peter Anvin
There are some definitions which are duplicated between kernel/signal.c and ia32/ia32_signal.c; move them to a common header file. Rather than adding stuff to existing header files which contain data structures, create a new header file; hence the slightly odd name ("all the good ones were taken.") Note: nothing relied on signal_fault() being defined in <asm/ptrace.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20x32: Generate <asm/unistd_64_x32.h>H. Peter Anvin
Generate macros for the *kernel* code to use to refer to x32 system calls. These have an __NR_x32_ prefix and do not include __X32_SYSCALL_BIT. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20x32: Generate <asm/unistd_x32.h>H. Peter Anvin
Generate <asm/unistd_x32.h>; this exports x32 system call numbers to user space. [ v2: Enclose all arguments to syshdr in '' so empty arguments aren't dropped on the floor. ] Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20x32: Add x32 system calls to syscall/syscall_64.tblH. Peter Anvin
Split the 64-bit system calls into "64" (64-bit only) and "common" (64-bit or x32) and add the x32 system call numbers. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20x86-64, ia32: Drop sys32_rt_sigprocmaskH. Peter Anvin
On x86, the only difference between sys_rt_sigprocmask and sys32_rt_sigprocmask is the alignment of the data structures. However, x86 allows data accesses with arbitrary alignment, and therefore there is no reason for this code to be different. Reported-by: Gregory M. Lueck <gregory.m.lueck@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20x32: Add a thread flag for x32 processesH. Peter Anvin
An x32 process is *almost* the same thing as a 64-bit process with a 32-bit address limit, but there are a few minor differences -- in particular core dumps are 32 bits and signal handling is different. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20x86-64: Add prototype for old_rsp to a header fileH. J. Lu
So far this has only been used in process_64.c, but the x32 code will need it in additional code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20elf: Allow core dump-related fields to be overriddenH. J. Lu
Allow some core dump-related fields to be overridden. This allows core dumps to work correctly for x32. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Roland McGrath <roland@redhat.com> Cc: Oleg Nesterov <oleg@redhat.com>
2012-02-20compat: Create compat_sys_p{read,write}v64H. J. Lu
For 32-bit ABIs which have real 64-bit registers, we don't want to break the position argument into two. However, we still need compat support to deal with 32-bit pointers, so we can't just use sys_p{read,write} directly. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20aio: Use __kernel_ulong_t to define aio_context_tH. Peter Anvin
Rather than using "unsigned long" which is ABI-dependent, use __kernel_ulong_t to define the externally visible type aio_context_t. Note: the change in this form will cause unsigned long/unsigned int differences on existing ABIs. If that is unacceptable we may have to define a new type. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Benjamin LaHaise <bcrl@kvack.org>
2012-02-20compat: Handle COMPAT_USE_64BIT_TIME in net/socket.cH. Peter Anvin
Use helper functions aware of COMPAT_USE_64BIT_TIME to write struct timeval and struct timespec to userspace in net/socket.c. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20compat: Use COMPAT_USE_64BIT_TIME in net/compat.cH. J. Lu
Handle 64-bit time structures in the networking core compat code. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: David S. Miller <davem@davemloft.net>
2012-02-20compat: Use COMPAT_USE_64BIT_TIME in the Bluetooth subsystemH. J. Lu
Enable the Bluetooth subsystem to be used with a compat ABI with 64-bit time. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Marcel Holtmann <marcel@holtmann.org> Cc: Gustavo F. Padovan <padovan@profusion.mobi> Cc: David S. Miller <davem@davemloft.net>
2012-02-20compat: Use COMPAT_USE_64BIT_TIME in the input subsystemH. J. Lu
Enable the input system to be used with a compat ABI with 64-bit time. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-02-20compat: Handle COMPAT_USE_64BIT_TIME in the lp driverH. Peter Anvin
Enable the lp driver to be used with a compat ABI with 64-bit time. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Greg Kroah-Hartman <greg@kroah.com>
2012-02-20compat: Add helper functions to read/write struct timeval, timespecH. Peter Anvin
Add helper functions to read and write struct timeval and struct timespec from userspace. We already had helper functions for reading and writing struct compat_timespec; add a set of functions to do the same with struct timeval, and add a second suite of functions which can be sensitive to COMPAT_USE_64BIT_TIME and access either 32- or 64-bit time structures. This also exports these helper functions to modules. Rename the existing inlines for converting between struct compat_timeval and native struct timespec so we can have a saner naming convention for the exported functions. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20compat: Introduce COMPAT_USE_64BIT_TIMEH. J. Lu
Allow a compatibility ABI to use a 64-bit time_t and 64-bit members in struct timeval and struct timespec to avoid the Y2038 problem. This will be used for the x32 ABI. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20sysinfo: Use explicit types in <linux/sysinfo.h>H. Peter Anvin
Change <linux/sysinfo.h> to use explicitly sized types. Replace long/unsigned long with __kernel_[u]long_t so that a non-legacy 32-bit ABI running on a 64-bit kernel can export those as 64-bit types. Originally-by: H. J. Lu <hjl.tools@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20x32: Create posix_types_x32.hH. Peter Anvin
This is the same as the 64-bit posix_types.h, except that __kernel_[u]long_t is defined to be [unsigned] long long and therefore 64 bits. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20posix_types: Introduce __kernel_[u]long_tH. Peter Anvin
Introduce __kernel_[u]long_t, which allows an ABI to override all defaults of type [unsigned] long. This enables x32 and potentially other 32-bit userspace on 64-bit kernel ABIs. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-02-20sysinfo: Move struct sysinfo to a separate header fileH. Peter Anvin
struct sysinfo is just about the only thing exported to userspace from <linux/kernel.h>, so move it into a separate header file with a residual #include in <linux/kernel.h>. Originally-by: H. J. Lu <hjl.tools@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/n/tip-4pr1xnnksprt7t0h3w5fw4rv@git.kernel.org
2012-02-20x86-64: Use explicit sizes in sigcontext.h, prepare for x32H. Peter Anvin
Use explicit sizes (__u64) instead of implicit sizes (unsigned long) in the definition for sigcontext.h; this will allow this structure to be shared between the x86-64 native ABI and the x32 ABI. Originally-by: H. J. Lu <hjl.tools@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/n/tip-4pr1xnnksprt7t0h3w5fw4rv@git.kernel.org
2012-02-20x86: Factor out TIF_IA32 from 32-bit address spaceH. Peter Anvin
Factor out IA32 (compatibility instruction set) from 32-bit address space in the thread_info flags; this is a precondition patch for x32 support. Originally-by: H. J. Lu <hjl.tools@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/n/tip-4pr1xnnksprt7t0h3w5fw4rv@git.kernel.org
2012-02-19Delete the __FD_*() funcs for operating on fd_set from linux/time.hDavid Howells
Delete the __FD_*() functions for operating on fd_set structs from linux/time.h as they're no longer used within the kernel with the preceding patch and are not exported to userspace. Whilst linux/time.h *does* export the FD_*() equivalents as wrappers around __FD_*(), userspace provides its own definition of __FD_*(). Note that the definition of FD_ZERO() in linux/time.h may not be used with the fd_sets associated with struct fdtable as the fd_set may have been allocated in a truncated fashion. Signed-off-by: David Howells <dhowells@redhat.com> Link: http://lkml.kernel.org/r/20120216175006.23314.18984.stgit@warthog.procyon.org.uk Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Al Viro <viro@zeniv.linux.org.uk>
2012-02-19Replace the fd_sets in struct fdtable with an array of unsigned longsDavid Howells
Replace the fd_sets in struct fdtable with an array of unsigned longs and then use the standard non-atomic bit operations rather than the FD_* macros. This: (1) Removes the abuses of struct fd_set: (a) Since we don't want to allocate a full fd_set the vast majority of the time, we actually, in effect, just allocate a just-big-enough array of unsigned longs and cast it to an fd_set type - so why bother with the fd_set at all? (b) Some places outside of the core fdtable handling code (such as SELinux) want to look inside the array of unsigned longs hidden inside the fd_set struct for more efficient iteration over the entire set. (2) Eliminates the use of FD_*() macros in the kernel completely. (3) Permits the __FD_*() macros to be deleted entirely where not exposed to userspace. Signed-off-by: David Howells <dhowells@redhat.com> Link: http://lkml.kernel.org/r/20120216174954.23314.48147.stgit@warthog.procyon.org.uk Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Al Viro <viro@zeniv.linux.org.uk>
2012-02-19Wrap accesses to the fd_sets in struct fdtableDavid Howells
Wrap accesses to the fd_sets in struct fdtable (for recording open files and close-on-exec flags) so that we can move away from using fd_sets since we abuse the fd_set structs by not allocating the full-sized structure under normal circumstances and by non-core code looking at the internals of the fd_sets. The first abuse means that use of FD_ZERO() on these fd_sets is not permitted, since that cannot be told about their abnormal lengths. This introduces six wrapper functions for setting, clearing and testing close-on-exec flags and fd-is-open flags: void __set_close_on_exec(int fd, struct fdtable *fdt); void __clear_close_on_exec(int fd, struct fdtable *fdt); bool close_on_exec(int fd, const struct fdtable *fdt); void __set_open_fd(int fd, struct fdtable *fdt); void __clear_open_fd(int fd, struct fdtable *fdt); bool fd_is_open(int fd, const struct fdtable *fdt); Note that I've prepended '__' to the names of the set/clear functions because they require the caller to hold a lock to use them. Note also that I haven't added wrappers for looking behind the scenes at the the array. Possibly that should exist too. Signed-off-by: David Howells <dhowells@redhat.com> Link: http://lkml.kernel.org/r/20120216174942.23314.1364.stgit@warthog.procyon.org.uk Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Al Viro <viro@zeniv.linux.org.uk>
2012-02-14posix_types: Remove fd_set macrosH. Peter Anvin
<asm/posix_types.h> includes a set of macros that operate on file descriptors. Way long ago those were exported to user space, but nowadays they are #ifdef __KERNEL__. However, they are nothing but standard (nonatomic) bit operations, and we already have optimized versions of bit operations in the kernel. We can't include <linux/bitops.h> in <asm/posix_types.h> but we can move the definitions to <linux/time.h> and define them there in terms of standard kernel bitops. [ v2: folds the following fixes in: a) Stray space in __FD_SET(), reported by Andrew Morton b) #include <linux/string.h> needed for memset(), reported by Tony Luck ] Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-22-git-send-email-hpa@zytor.com Cc: Arnd Bergmann <arnd@arndb.de> Cc: Tony Luck <tony.luck@intel.com> Cc: Andrew Morton <akpm@linux-foundation.org>
2012-02-14xtensa: Use generic posix_types.hH. Peter Anvin
Change the xtensa architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-21-git-send-email-hpa@zytor.com Cc: Chris Zankel <chris@zankel.net>
2012-02-14x86: Use generic posix_types.hH. Peter Anvin
Change the x86 architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-20-git-send-email-hpa@zytor.com Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de>
2012-02-14sparc: Use generic posix_types.hH. Peter Anvin
Change the sparc architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Acked-by: "David S. Miller" <davem@davemloft.net> Link: http://lkml.kernel.org/r/1328677745-20121-19-git-send-email-hpa@zytor.com
2012-02-14sh: Remove unnecessary posix_types.h type overridesH. Peter Anvin
Remove type overrides in <asm/posix_types.h> for the sh architecture that are no longer necessary. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-18-git-send-email-hpa@zytor.com Cc: Paul Mundt <lethal@linux-sh.org>
2012-02-14s390: Use generic posix_types.hH. Peter Anvin
Change the s390 architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Link: http://lkml.kernel.org/r/1328677745-20121-17-git-send-email-hpa@zytor.com Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: <linux390@de.ibm.com>
2012-02-14powerpc: Use generic posix_types.hH. Peter Anvin
Change the powerpc architecture to use <asm-generic/posix_types.h>. [ v2: fix the definition for __kernel_ssize_t ] Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-16-git-send-email-hpa@zytor.com Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org>
2012-02-14parisc: Use generic posix_types.hH. Peter Anvin
Change the parisc architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-15-git-send-email-hpa@zytor.com Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Helge Deller <deller@gmx.de> Cc: James Bottomley <jejb@parisc-linux.org>
2012-02-14mn10300: Use generic posix_types.hH. Peter Anvin
Change the mn10300 architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-14-git-send-email-hpa@zytor.com Cc: David Howells <dhowells@redhat.com> Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
2012-02-14mips: Use generic posix_types.hH. Peter Anvin
Change the mips architecture to use <asm-generic/posix_types.h>. [ v2: remove redundant definition of __kernel_loff_t ] Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-13-git-send-email-hpa@zytor.com Cc: Ralf Baechle <ralf@linux-mips.org>
2012-02-14m68k: Use generic posix_types.hH. Peter Anvin
Change the m68k architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-12-git-send-email-hpa@zytor.com Cc: Geert Uytterhoeven <geert@linux-m68k.org>
2012-02-14m32r: Use generic posix_types.hH. Peter Anvin
Change the m32r architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-11-git-send-email-hpa@zytor.com Cc: Hirokazu Takata <takata@linux-m32r.org>
2012-02-14ia64: Use generic posix_types.hH. Peter Anvin
Change the ia64 architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-10-git-send-email-hpa@zytor.com Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com>
2012-02-14h8300: Use generic posix_types.hH. Peter Anvin
Change the h8300 architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-9-git-send-email-hpa@zytor.com Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
2012-02-14frv: Use generic posix_types.hH. Peter Anvin
Change the frv architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-8-git-send-email-hpa@zytor.com Cc: David Howells <dhowells@redhat.com>
2012-02-14cris: Use generic posix_types.hH. Peter Anvin
Change the cris architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Cc: Mikael Starvik <starvik@axis.com> Link: http://lkml.kernel.org/r/1328677745-20121-7-git-send-email-hpa@zytor.com
2012-02-14avr32: Use generic posix_types.hH. Peter Anvin
Change the avr32 architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-6-git-send-email-hpa@zytor.com Cc: Haavard Skinnemoen <hskinnemoen@gmail.com> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
2012-02-14arm: Use generic posix_types.hH. Peter Anvin
Change the arm architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Link: http://lkml.kernel.org/r/1328677745-20121-5-git-send-email-hpa@zytor.com
2012-02-14alpha: Use generic posix_types.hH. Peter Anvin
Change the alpha architecture to use <asm-generic/posix_types.h>. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-4-git-send-email-hpa@zytor.com Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com>
2012-02-14posix_types: Make it possible to override __kernel_fsid_tH. Peter Anvin
__kernel_fsid_t has members of type "long" on at least one architecture (MIPS32), so make it possible to override the definition. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-3-git-send-email-hpa@zytor.com Cc: Arnd Bergmann <arnd@arndb.de>
2012-02-14posix_types: Make __kernel_[ug]id32_t default to unsigned intH. Peter Anvin
All ports use unsigned int for __kernel_[ug]id32_t, but not all ports use unsigned int for __kernel_[ug]id_t. Thus, change the default for the "32" types so ports don't need to override them. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1328677745-20121-2-git-send-email-hpa@zytor.com Cc: Arnd Bergmann <arnd@arndb.de>
2012-02-09Linux 3.3-rc3Linus Torvalds