* [PATCH] fixing sendfile on 64bit architectures
@ 2004-05-19 9:49 Andi Kleen
2004-05-19 12:21 ` Arnd Bergmann
2004-05-19 18:17 ` David Mosberger
0 siblings, 2 replies; 9+ messages in thread
From: Andi Kleen @ 2004-05-19 9:49 UTC (permalink / raw)
To: linux-arch; +Cc: akpm
sys_sendfile has a hardcoded 2GB limit. 64bit architectures should probably
always use sys_sendfile64() in their native system tables, because
for them sizeof(off_t) == sizeof(loff_t). This patch does
this. It seemed easier to just change the 64bit entry tables instead of
fixing up all the emulation layers to do 2GB checks on their own.
I changed all 64bit architectures except for parisc64, which seemed to
already have a sendfile64.
-Andi
diff -u linux/include/asm-x86_64/unistd.h-o linux/include/asm-x86_64/unistd.h
--- linux/include/asm-x86_64/unistd.h-o 2004-05-19 11:42:07.000000000 +0200
+++ linux/include/asm-x86_64/unistd.h 2004-05-19 11:42:15.000000000 +0200
@@ -98,7 +98,7 @@
__SYSCALL(__NR_getpid, sys_getpid)
#define __NR_sendfile 40
-__SYSCALL(__NR_sendfile, sys_sendfile)
+__SYSCALL(__NR_sendfile, sys_sendfile64)
#define __NR_socket 41
__SYSCALL(__NR_socket, sys_socket)
#define __NR_connect 42
diff -u linux/arch/sparc64/kernel/systbls.S-o linux/arch/sparc64/kernel/systbls.S
--- linux/arch/sparc64/kernel/systbls.S-o 2004-04-06 13:12:04.000000000 +0200
+++ linux/arch/sparc64/kernel/systbls.S 2004-05-19 11:45:58.000000000 +0200
@@ -88,7 +88,7 @@
/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid
/*25*/ .word sys_nis_syscall, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall
/*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice
- .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile
+ .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64
/*40*/ .word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall
.word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid
/*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl
diff -u linux/arch/ia64/kernel/entry.S-o linux/arch/ia64/kernel/entry.S
--- linux/arch/ia64/kernel/entry.S-o 2004-05-19 11:33:01.000000000 +0200
+++ linux/arch/ia64/kernel/entry.S 2004-05-19 11:42:26.000000000 +0200
@@ -1437,7 +1437,7 @@
data8 sys_getcwd
data8 sys_capget // 1185
data8 sys_capset
- data8 sys_sendfile
+ data8 sys_sendfile64
data8 sys_ni_syscall // sys_getpmsg (STREAMS)
data8 sys_ni_syscall // sys_putpmsg (STREAMS)
data8 sys_socket // 1190
diff -u linux/arch/alpha/kernel/systbls.S-o linux/arch/alpha/kernel/systbls.S
--- linux/arch/alpha/kernel/systbls.S-o 1970-01-01 01:12:51.000000000 +0100
+++ linux/arch/alpha/kernel/systbls.S 2004-05-19 11:43:52.000000000 +0200
@@ -389,7 +389,7 @@
.quad sys_getcwd
.quad sys_capget
.quad sys_capset
- .quad sys_sendfile /* 370 */
+ .quad sys_sendfile64 /* 370 */
.quad sys_setresgid
.quad sys_getresgid
.quad sys_ni_syscall /* sys_dipc */
diff -u linux/arch/mips/kernel/scall64-64.S-o linux/arch/mips/kernel/scall64-64.S
--- linux/arch/mips/kernel/scall64-64.S-o 1970-01-01 01:12:51.000000000 +0100
+++ linux/arch/mips/kernel/scall64-64.S 2004-05-19 11:44:22.000000000 +0200
@@ -244,7 +244,7 @@
PTR sys_setitimer
PTR sys_alarm
PTR sys_getpid
- PTR sys_sendfile
+ PTR sys_sendfile64
PTR sys_socket /* 5040 */
PTR sys_connect
PTR sys_accept
diff -u linux/arch/ppc64/kernel/misc.S-o linux/arch/ppc64/kernel/misc.S
--- linux/arch/ppc64/kernel/misc.S-o 2004-05-19 11:32:12.000000000 +0200
+++ linux/arch/ppc64/kernel/misc.S 2004-05-19 11:43:33.000000000 +0200
@@ -1061,7 +1061,7 @@
.llong .sys_capget
.llong .sys_capset
.llong .sys_sigaltstack /* 185 */
- .llong .sys_sendfile
+ .llong .sys_sendfile64
.llong .sys_ni_syscall /* reserved for streams1 */
.llong .sys_ni_syscall /* reserved for streams2 */
.llong .sys_vfork
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fixing sendfile on 64bit architectures
2004-05-19 9:49 Andi Kleen
@ 2004-05-19 12:21 ` Arnd Bergmann
2004-05-19 18:17 ` David Mosberger
1 sibling, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2004-05-19 12:21 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-arch, akpm
[-- Attachment #1: Type: text/plain, Size: 855 bytes --]
On Wednesday 19 May 2004 11:49, Andi Kleen wrote:
> I changed all 64bit architectures except for parisc64, which seemed to
> already have a sendfile64.
And it looks like you missed s390.
===== arch/s390/kernel/syscalls.S 1.11 vs edited =====
--- 1.11/arch/s390/kernel/syscalls.S Thu Apr 29 11:41:09 2004
+++ edited/arch/s390/kernel/syscalls.S Wed May 19 14:15:36 2004
@@ -195,7 +195,7 @@
SYSCALL(sys_capget,sys_capget,sys32_capget_wrapper)
SYSCALL(sys_capset,sys_capset,sys32_capset_wrapper) /* 185 */
SYSCALL(sys_sigaltstack_glue,sys_sigaltstack_glue,sys32_sigaltstack_glue)
-SYSCALL(sys_sendfile,sys_sendfile,sys32_sendfile_wrapper)
+SYSCALL(sys_sendfile,sys_sendfile64,sys32_sendfile_wrapper)
NI_SYSCALL /* streams1 */
NI_SYSCALL /* streams2 */
SYSCALL(sys_vfork_glue,sys_vfork_glue,sys_vfork_glue) /* 190 */
[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fixing sendfile on 64bit architectures
2004-05-19 9:49 Andi Kleen
2004-05-19 12:21 ` Arnd Bergmann
@ 2004-05-19 18:17 ` David Mosberger
2004-05-19 19:01 ` Andi Kleen
1 sibling, 1 reply; 9+ messages in thread
From: David Mosberger @ 2004-05-19 18:17 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-arch, akpm
>>>>> On Wed, 19 May 2004 11:49:40 +0200, Andi Kleen <ak@suse.de> said:
Andi> sys_sendfile has a hardcoded 2GB limit. 64bit architectures
Andi> should probably always use sys_sendfile64() in their native
Andi> system tables, because for them sizeof(off_t) ==
Andi> sizeof(loff_t). This patch does this. It seemed easier to
Andi> just change the 64bit entry tables instead of fixing up all
Andi> the emulation layers to do 2GB checks on their own.
Argh, I had that fixed at one point (I think it was prior to
sys_sendfile64()) but it appears that got lost somewhere along the
line. Thanks for (re-)catching this.
Andi> I changed all 64bit architectures except for parisc64, which
Andi> seemed to already have a sendfile64.
The patch looks fine to me. My only minor quibble is that it would be
nice if sys_sendfile() wasn't defined at all when it isn't needed and,
in that case, do_sendfile() should be inlined (unit-at-a-time
compilation will take care of the inlining if sys_sendfile() isn't
defined when not needed, so that part doesn't require extra code).
I don't like adding yet another "#ifdef __ia64 && ..." though. It
would be nice if there was a cleaner way to get rid of unwanted
syscall-stubs in generic code. How would people feel about replacing
the current #ifdef mess with "#ifdef SYS_NEED_foo" instead? By my
count, that would get rid of about a dozen of those ugly #ifdefs. For
example, in fs/stat.c we could have:
#ifdef SYS_NEED_OLD_STAT
instead of:
#if !defined(__alpha__) && !defined(__sparc__) && !defined(__ia64__) \
&& !defined(CONFIG_ARCH_S390) && !defined(__hppa__) \
&& !defined(__arm__) && !defined(CONFIG_V850) && !defined(__powerpc64__) \
&& !defined(__mips__)
--david
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fixing sendfile on 64bit architectures
2004-05-19 18:17 ` David Mosberger
@ 2004-05-19 19:01 ` Andi Kleen
2004-05-19 19:13 ` David Mosberger
0 siblings, 1 reply; 9+ messages in thread
From: Andi Kleen @ 2004-05-19 19:01 UTC (permalink / raw)
To: davidm; +Cc: davidm, linux-arch, akpm
On Wed, 19 May 2004 11:17:44 -0700
David Mosberger <davidm@napali.hpl.hp.com> wrote:
>
> The patch looks fine to me. My only minor quibble is that it would be
> nice if sys_sendfile() wasn't defined at all when it isn't needed and,
> in that case, do_sendfile() should be inlined (unit-at-a-time
> compilation will take care of the inlining if sys_sendfile() isn't
> defined when not needed, so that part doesn't require extra code).
And I thought IA64 didn't care about code size... ;-)
>
> I don't like adding yet another "#ifdef __ia64 && ..." though. It
> would be nice if there was a cleaner way to get rid of unwanted
> syscall-stubs in generic code. How would people feel about replacing
> the current #ifdef mess with "#ifdef SYS_NEED_foo" instead? By my
> count, that would get rid of about a dozen of those ugly #ifdefs. For
> example, in fs/stat.c we could have:
>
> #ifdef SYS_NEED_OLD_STAT
>
> instead of:
>
> #if !defined(__alpha__) && !defined(__sparc__) && !defined(__ia64__) \
> && !defined(CONFIG_ARCH_S390) && !defined(__hppa__) \
> && !defined(__arm__) && !defined(CONFIG_V850) && !defined(__powerpc64__) \
> && !defined(__mips__)
How about just putting it into an a extra file and using lib-y in the Makefile?
Then it will be only linked when someone references it.
-Andi
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fixing sendfile on 64bit architectures
2004-05-19 19:01 ` Andi Kleen
@ 2004-05-19 19:13 ` David Mosberger
0 siblings, 0 replies; 9+ messages in thread
From: David Mosberger @ 2004-05-19 19:13 UTC (permalink / raw)
To: Andi Kleen; +Cc: davidm, davidm, linux-arch, akpm
>>>>> On Wed, 19 May 2004 21:01:56 +0200, Andi Kleen <ak@suse.de> said:
Andi> How about just putting it into an a extra file and using lib-y
Andi> in the Makefile?
Andi> Then it will be only linked when someone references it.
That may work in some cases, but usually the stubs depend on other
functions which are static only. Moreover, putting them in separate
files prevents inlining.
--david
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fixing sendfile on 64bit architectures
@ 2004-05-19 19:26 Arnd Bergmann
2004-05-20 6:19 ` David Mosberger
0 siblings, 1 reply; 9+ messages in thread
From: Arnd Bergmann @ 2004-05-19 19:26 UTC (permalink / raw)
To: davidm; +Cc: Andi Kleen, linux-arch, akpm
David Mosberger <davidm@napali.hpl.hp.com> schrieb am 19.05.2004,
20:17:44:
> The patch looks fine to me. My only minor quibble is that it would be
> nice if sys_sendfile() wasn't defined at all when it isn't needed and,
> in that case, do_sendfile() should be inlined (unit-at-a-time
> compilation will take care of the inlining if sys_sendfile() isn't
> defined when not needed, so that part doesn't require extra code).
Note that we practically always need sys_sendfile anyway for calling
from sys32_sendfile. The only exception I can see is (CONFIG_64BIT &&
!CONFIG_COMPAT).
[OT: This reminds me that I have a bunch of mostly-finished compat_sys_*
consolidation patches on my disk that need to be completed.
compat_sys_sendfile() could of course use do_sendfile() instead of
sys_sendfile().]
> I don't like adding yet another "#ifdef __ia64 && ..." though. It
> would be nice if there was a cleaner way to get rid of unwanted
> syscall-stubs in generic code. How would people feel about replacing
> the current #ifdef mess with "#ifdef SYS_NEED_foo" instead? By my
> count, that would get rid of about a dozen of those ugly #ifdefs. For
> example, in fs/stat.c we could have:
>
> #ifdef SYS_NEED_OLD_STAT
>
> instead of:
>
> #if !defined(__alpha__) && !defined(__sparc__) && !defined(__ia64__) \
> && !defined(CONFIG_ARCH_S390) && !defined(__hppa__) \
> && !defined(__arm__) && !defined(CONFIG_V850) && !defined(__powerpc64__) \
> && !defined(__mips__)
Seconded. While it may not be that drastic in case of sys_sendfile,
such constructions are always ugly and I suspect many of them would
turn out to be incorrect after closer inspection.
Arnd <><
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: [PATCH] fixing sendfile on 64bit architectures
2004-05-19 19:26 [PATCH] fixing sendfile on 64bit architectures Arnd Bergmann
@ 2004-05-20 6:19 ` David Mosberger
2004-05-20 6:41 ` David S. Miller
2004-05-23 9:37 ` Geert Uytterhoeven
0 siblings, 2 replies; 9+ messages in thread
From: David Mosberger @ 2004-05-20 6:19 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: davidm, Andi Kleen, linux-arch, akpm
>>>>> On Wed, 19 May 2004 21:26:01 +0200, Arnd Bergmann <arnd@arndb.de> said:
>> #ifdef SYS_NEED_OLD_STAT
>> instead of:
>> #if !defined(__alpha__) && !defined(__sparc__) &&
>> !defined(__ia64__) \ && !defined(CONFIG_ARCH_S390) &&
>> !defined(__hppa__) \ && !defined(__arm__) &&
>> !defined(CONFIG_V850) && !defined(__powerpc64__) \ &&
>> !defined(__mips__)
Arnd> Seconded. While it may not be that drastic in case of
Arnd> sys_sendfile, such constructions are always ugly and I suspect
Arnd> many of them would turn out to be incorrect after closer
Arnd> inspection.
How about the attached? I decided to use __ARCH_OMIT_foo instead
of SYS_NEED_foo since that keeps the extra code in those platforms
that want to drop the code.
--david
===== fs/namespace.c 1.56 vs edited =====
--- 1.56/fs/namespace.c Fri Apr 16 08:39:38 2004
+++ edited/fs/namespace.c Wed May 19 22:48:45 2004
@@ -22,6 +22,7 @@
#include <linux/security.h>
#include <linux/mount.h>
#include <asm/uaccess.h>
+#include <asm/unistd.h>
extern int __init init_rootfs(void);
@@ -406,6 +407,8 @@
return retval;
}
+#ifndef __ARCH_OMIT_SYS_OLDUMOUNT
+
/*
* The 2.0 compatible umount. No flags.
*/
@@ -414,6 +417,8 @@
{
return sys_umount(name,0);
}
+
+#endif
static int mount_is_safe(struct nameidata *nd)
{
===== fs/open.c 1.61 vs edited =====
--- 1.61/fs/open.c Mon Apr 12 10:54:51 2004
+++ edited/fs/open.c Wed May 19 22:14:35 2004
@@ -23,6 +23,8 @@
#include <linux/fs.h>
#include <linux/pagemap.h>
+#include <asm/unistd.h>
+
int vfs_statfs(struct super_block *sb, struct kstatfs *buf)
{
int retval = -ENODEV;
@@ -335,7 +337,7 @@
}
#endif
-#if !(defined(__alpha__) || defined(__ia64__))
+#ifndef __ARCH_OMIT_SYS_UTIME
/*
* sys_utime() can be implemented in user-level using sys_utimes().
===== fs/read_write.c 1.38 vs edited =====
--- 1.38/fs/read_write.c Sun Apr 18 10:51:24 2004
+++ edited/fs/read_write.c Wed May 19 23:03:29 2004
@@ -15,6 +15,7 @@
#include <linux/module.h>
#include <asm/uaccess.h>
+#include <asm/unistd.h>
struct file_operations generic_ro_fops = {
.llseek = generic_file_llseek,
@@ -145,7 +146,7 @@
}
EXPORT_SYMBOL_GPL(sys_lseek);
-#if !defined(__alpha__)
+#ifndef __ARCH_OMIT_SYS_LLSEEK
asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
unsigned long offset_low, loff_t __user * result,
unsigned int origin)
===== fs/readdir.c 1.27 vs edited =====
--- 1.27/fs/readdir.c Wed Mar 31 11:12:11 2004
+++ edited/fs/readdir.c Wed May 19 21:20:38 2004
@@ -52,7 +52,7 @@
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))
-#ifndef __ia64__
+#ifndef __ARCH_OMIT_OLD_READDIR
struct old_linux_dirent {
unsigned long d_ino;
@@ -115,7 +115,7 @@
return error;
}
-#endif /* !__ia64__ */
+#endif /* !__ARCH_OMIT_OLD_READDIR */
/*
* New, all-improved, singing, dancing, iBCS2-compliant getdents()
===== fs/stat.c 1.32 vs edited =====
--- 1.32/fs/stat.c Wed Apr 14 18:37:52 2004
+++ edited/fs/stat.c Wed May 19 21:52:21 2004
@@ -16,6 +16,7 @@
#include <linux/security.h>
#include <asm/uaccess.h>
+#include <asm/unistd.h>
void generic_fillattr(struct inode *inode, struct kstat *stat)
{
@@ -105,10 +106,7 @@
EXPORT_SYMBOL(vfs_fstat);
-#if !defined(__alpha__) && !defined(__sparc__) && !defined(__ia64__) \
- && !defined(CONFIG_ARCH_S390) && !defined(__hppa__) \
- && !defined(__arm__) && !defined(CONFIG_V850) && !defined(__powerpc64__) \
- && !defined(__mips__)
+#ifndef __ARCH_OMIT_OLD_STAT
/*
* For backward compatibility? Maybe this should be moved
@@ -178,7 +176,7 @@
return error;
}
-#endif
+#endif /* !__ARCH_OMIT_OLD_STAT */
static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
{
@@ -284,7 +282,7 @@
/* ---------- LFS-64 ----------- */
-#if !defined(__ia64__) && !defined(__mips64) && !defined(__x86_64__) && !defined(CONFIG_ARCH_S390X)
+#ifndef __ARCH_OMIT_STAT64
static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf)
{
@@ -352,7 +350,7 @@
return error;
}
-#endif /* LFS-64 */
+#endif /* !__ARCH_OMIT_STAT64 */
void inode_add_bytes(struct inode *inode, loff_t bytes)
{
===== include/asm-alpha/signal.h 1.7 vs edited =====
--- 1.7/include/asm-alpha/signal.h Sun Sep 21 14:50:25 2003
+++ edited/include/asm-alpha/signal.h Wed May 19 21:42:00 2004
@@ -187,7 +187,6 @@
#include <asm/sigcontext.h>
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
-#define HAVE_ARCH_SYS_PAUSE
#endif
===== include/asm-alpha/unistd.h 1.27 vs edited =====
--- 1.27/include/asm-alpha/unistd.h Mon May 10 21:27:30 2004
+++ edited/include/asm-alpha/unistd.h Wed May 19 22:54:53 2004
@@ -558,6 +558,20 @@
#endif /* __LIBRARY__ && __GNUC__ */
+#ifdef __KERNEL__
+#define __ARCH_OMIT_SYS_UTIME
+#define __ARCH_OMIT_OLD_STAT
+#define __ARCH_OMIT_SYS_WAITPID
+#define __ARCH_OMIT_SYS_SGETMASK
+#define __ARCH_OMIT_SYS_SIGNAL
+#define __ARCH_OMIT_SYS_PAUSE
+#define __ARCH_OMIT_SYS_TIME
+#define __ARCH_OMIT_SYS_ALARM
+#define __ARCH_OMIT_SYS_LLSEEK
+#define __ARCH_OMIT_SYS_NICE
+#define __ARCH_OMIT_SYS_SIGPROCMASK
+#endif
+
#ifdef __KERNEL_SYSCALLS__
#include <linux/compiler.h>
===== include/asm-arm/unistd.h 1.23 vs edited =====
--- 1.23/include/asm-arm/unistd.h Sat Feb 28 01:40:59 2004
+++ edited/include/asm-arm/unistd.h Wed May 19 21:41:23 2004
@@ -448,6 +448,14 @@
__syscall_return(type,__res); \
}
+#ifdef __KERNEL__
+#define __ARCH_OMIT_OLD_STAT
+#define __ARCH_OMIT_SYS_WAITPID
+#define __ARCH_OMIT_SYS_SGETMASK
+#define __ARCH_OMIT_SYS_SIGNAL
+#define __ARCH_OMIT_SYS_PAUSE
+#endif
+
#ifdef __KERNEL_SYSCALLS__
#include <linux/compiler.h>
===== include/asm-ia64/signal.h 1.12 vs edited =====
--- 1.12/include/asm-ia64/signal.h Fri Jan 23 10:52:25 2004
+++ edited/include/asm-ia64/signal.h Wed May 19 21:42:14 2004
@@ -176,7 +176,6 @@
# include <asm/sigcontext.h>
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
-#define HAVE_ARCH_SYS_PAUSE
#endif /* __KERNEL__ */
===== include/asm-ia64/unistd.h 1.41 vs edited =====
--- 1.41/include/asm-ia64/unistd.h Mon May 10 23:44:41 2004
+++ edited/include/asm-ia64/unistd.h Wed May 19 23:08:22 2004
@@ -4,7 +4,7 @@
/*
* IA-64 Linux syscall numbers and inline-functions.
*
- * Copyright (C) 1998-2003 Hewlett-Packard Co
+ * Copyright (C) 1998-2004 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
@@ -257,8 +257,36 @@
#define __NR_mq_timedreceive 1265
#define __NR_mq_notify 1266
#define __NR_mq_getsetattr 1267
+#define __NR_kexec_load 1268
#ifdef __KERNEL__
+
+#include <linux/config.h>
+
+#define __ARCH_OMIT_IPC_PARSE_VERSION
+#define __ARCH_OMIT_OLD_READDIR
+#define __ARCH_OMIT_OLD_STAT
+#define __ARCH_OMIT_STAT64
+#define __ARCH_OMIT_SYS_ALARM
+#define __ARCH_OMIT_SYS_GETHOSTNAME
+#define __ARCH_OMIT_SYS_PAUSE
+#define __ARCH_OMIT_SYS_SGETMASK
+#define __ARCH_OMIT_SYS_SIGNAL
+#define __ARCH_OMIT_SYS_TIME
+#define __ARCH_OMIT_SYS_UTIME
+#define __ARCH_OMIT_SYS_WAITPID
+#define __ARCH_OMIT_SYS_SOCKETCALL
+
+#ifndef CONFIG_IA32_SUPPORT
+# define __ARCH_OMIT_SYS_FADVISE64
+# define __ARCH_OMIT_SYS_GETPGRP
+# define __ARCH_OMIT_SYS_LLSEEK
+# define __ARCH_OMIT_SYS_NICE
+# define __ARCH_OMIT_SYS_OLD_GETRLIMIT
+# define __ARCH_OMIT_SYS_OLDUMOUNT
+# define __ARCH_OMIT_SYS_SIGPENDING
+# define __ARCH_OMIT_SYS_SIGPROCMASK
+#endif
#define NR_syscalls 256 /* length of syscall table */
===== include/asm-mips/unistd.h 1.12 vs edited =====
--- 1.12/include/asm-mips/unistd.h Wed Apr 21 14:35:59 2004
+++ edited/include/asm-mips/unistd.h Wed May 19 21:36:41 2004
@@ -1045,6 +1045,14 @@
#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
+#ifdef __KERNEL__
+#define __ARCH_OMIT_OLD_STAT
+#define __ARCH_OMIT_SYS_SIGNAL
+# ifdef __mips64
+# define __ARCH_OMIT_STAT64
+# endif
+#endif
+
#ifdef __KERNEL_SYSCALLS__
#include <linux/compiler.h>
===== include/asm-parisc/unistd.h 1.14 vs edited =====
--- 1.14/include/asm-parisc/unistd.h Mon Mar 15 22:50:11 2004
+++ edited/include/asm-parisc/unistd.h Wed May 19 21:31:07 2004
@@ -836,6 +836,10 @@
return K_INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6); \
}
+#ifdef __KERNEL__
+#define __ARCH_OMIT_OLD_STAT
+#define __ARCH_OMIT_IPC_PARSE_VERSION
+#endif
#ifdef __KERNEL_SYSCALLS__
===== include/asm-ppc64/unistd.h 1.31 vs edited =====
--- 1.31/include/asm-ppc64/unistd.h Wed Apr 21 14:35:59 2004
+++ edited/include/asm-ppc64/unistd.h Wed May 19 21:24:30 2004
@@ -418,6 +418,8 @@
#include <linux/compiler.h>
#include <linux/linkage.h>
+#define __ARCH_OMIT_OLD_STAT
+
unsigned long sys_mmap(unsigned long addr, size_t len, unsigned long prot,
unsigned long flags, unsigned long fd, off_t offset);
struct pt_regs;
===== include/asm-s390/unistd.h 1.26 vs edited =====
--- 1.26/include/asm-s390/unistd.h Mon May 10 21:27:30 2004
+++ edited/include/asm-s390/unistd.h Wed May 19 21:34:44 2004
@@ -512,6 +512,15 @@
__syscall_return(type,__res); \
}
+#ifdef __KERNEL__
+#define __ARCH_OMIT_OLD_STAT
+#define __ARCH_OMIT_SYS_WAITPID
+#define __ARCH_OMIT_SYS_SGETMASK
+# ifdef CONFIG_ARCH_S390X
+# define __ARCH_OMIT_STAT64
+# endif
+#endif
+
#ifdef __KERNEL_SYSCALLS__
#include <linux/config.h>
===== include/asm-sparc/unistd.h 1.32 vs edited =====
--- 1.32/include/asm-sparc/unistd.h Wed Apr 21 14:36:00 2004
+++ edited/include/asm-sparc/unistd.h Wed May 19 21:21:49 2004
@@ -431,6 +431,11 @@
errno = -__res; \
return -1; \
}
+
+#ifdef __KERNEL__
+#define __ARCH_OMIT_OLD_STAT
+#endif
+
#ifdef __KERNEL_SYSCALLS__
#include <linux/compiler.h>
===== include/asm-sparc64/signal.h 1.11 vs edited =====
--- 1.11/include/asm-sparc64/signal.h Thu Feb 26 22:27:45 2004
+++ edited/include/asm-sparc64/signal.h Wed May 19 21:42:34 2004
@@ -253,8 +253,6 @@
struct pt_regs;
extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
-#define HAVE_ARCH_SYS_PAUSE
-
#endif /* !(__KERNEL__) */
#endif /* !(__ASSEMBLY__) */
===== include/asm-sparc64/unistd.h 1.30 vs edited =====
--- 1.30/include/asm-sparc64/unistd.h Wed Apr 21 14:36:00 2004
+++ edited/include/asm-sparc64/unistd.h Wed May 19 21:42:40 2004
@@ -474,6 +474,10 @@
#define _SC_JOB_CONTROL 6
#define _SC_SAVED_IDS 7
#define _SC_VERSION 8
+
+#define __ARCH_OMIT_OLD_STAT
+#define __ARCH_OMIT_SYS_PAUSE
+
#endif
/*
===== include/asm-v850/unistd.h 1.9 vs edited =====
--- 1.9/include/asm-v850/unistd.h Sat Feb 28 01:41:01 2004
+++ edited/include/asm-v850/unistd.h Wed May 19 22:47:06 2004
@@ -386,6 +386,11 @@
}
+#ifdef __KERNEL__
+#define __ARCH_OMIT_OLD_STAT
+#define __ARCH_OMIT_SYS_OLD_GETRLIMIT
+#endif
+
#ifdef __KERNEL_SYSCALLS__
#include <linux/compiler.h>
===== include/asm-x86_64/unistd.h 1.24 vs edited =====
--- 1.24/include/asm-x86_64/unistd.h Wed Apr 21 14:36:00 2004
+++ edited/include/asm-x86_64/unistd.h Wed May 19 21:30:57 2004
@@ -569,6 +569,11 @@
return (type) (res); \
} while (0)
+#ifdef __KERNEL__
+#define __ARCH_OMIT_STAT64
+#define __ARCH_OMIT_IPC_PARSE_VERSION
+#endif
+
#ifndef __KERNEL_SYSCALLS__
#define __syscall "syscall"
===== ipc/util.c 1.17 vs edited =====
--- 1.17/ipc/util.c Mon Apr 12 10:54:15 2004
+++ edited/ipc/util.c Wed May 19 21:53:04 2004
@@ -25,6 +25,8 @@
#include <linux/rcupdate.h>
#include <linux/workqueue.h>
+#include <asm/unistd.h>
+
#include "util.h"
/**
@@ -507,7 +509,8 @@
return 0;
}
-#if !defined(__ia64__) && !defined(__x86_64__) && !defined(__hppa__)
+#ifndef __ARCH_OMIT_IPC_PARSE_VERSION
+
/**
* ipc_parse_version - IPC call version
@@ -528,4 +531,4 @@
}
}
-#endif /* __ia64__ */
+#endif /* !__ARCH_OMIT_IPC_PARSE_VERSION */
===== kernel/exit.c 1.132 vs edited =====
--- 1.132/kernel/exit.c Tue Apr 13 08:46:49 2004
+++ edited/kernel/exit.c Wed May 19 22:19:33 2004
@@ -24,6 +24,7 @@
#include <linux/proc_fs.h>
#include <asm/uaccess.h>
+#include <asm/unistd.h>
#include <asm/pgtable.h>
#include <asm/mmu_context.h>
@@ -1157,8 +1158,7 @@
return retval;
}
-#if !defined(__alpha__) && !defined(__ia64__) && \
- !defined(__arm__) && !defined(__s390__)
+#ifndef __ARCH_OMIT_SYS_WAITPID
/*
* sys_waitpid() remains for compatibility. waitpid() should be
===== kernel/sched.c 1.218 vs edited =====
--- 1.218/kernel/sched.c Thu Apr 29 14:00:38 2004
+++ edited/kernel/sched.c Wed May 19 23:03:52 2004
@@ -40,6 +40,8 @@
#include <linux/percpu.h>
#include <linux/kthread.h>
+#include <asm/unistd.h>
+
#ifdef CONFIG_NUMA
#define cpu_to_node_mask(cpu) node_to_cpumask(cpu_to_node(cpu))
#else
@@ -2015,7 +2017,7 @@
EXPORT_SYMBOL(set_user_nice);
-#ifndef __alpha__
+#ifndef __ARCH_OMIT_SYS_NICE
/*
* sys_nice - change the priority of the current process.
===== kernel/signal.c 1.108 vs edited =====
--- 1.108/kernel/signal.c Wed Apr 21 14:36:02 2004
+++ edited/kernel/signal.c Wed May 19 23:07:51 2004
@@ -23,6 +23,7 @@
#include <linux/ptrace.h>
#include <asm/param.h>
#include <asm/uaccess.h>
+#include <asm/unistd.h>
#include <asm/siginfo.h>
/*
@@ -2412,14 +2413,19 @@
return error;
}
+#ifndef __ARCH_OMIT_SYS_SIGPENDING
+
asmlinkage long
sys_sigpending(old_sigset_t __user *set)
{
return do_sigpending(set, sizeof(*set));
}
-#if !defined(__alpha__)
-/* Alpha has its own versions with special arguments. */
+#endif
+
+#ifndef __ARCH_OMIT_SYS_SIGPROCMASK
+/* Some platforms have their own version with special arguments others
+ support only sys_rt_sigprocmask. */
asmlinkage long
sys_sigprocmask(int how, old_sigset_t __user *set, old_sigset_t __user *oset)
@@ -2501,8 +2507,8 @@
#endif /* __sparc__ */
#endif
-#if !defined(__alpha__) && !defined(__ia64__) && \
- !defined(__arm__) && !defined(__s390__)
+#ifndef __ARCH_OMIT_SYS_SGETMASK
+
/*
* For backwards compatibility. Functionality superseded by sigprocmask.
*/
@@ -2528,10 +2534,9 @@
return old;
}
-#endif /* !defined(__alpha__) */
+#endif /* !__ARCH_OMIT_SGETMASK */
-#if !defined(__alpha__) && !defined(__ia64__) && !defined(__mips__) && \
- !defined(__arm__)
+#ifndef __ARCH_OMIT_SYS_SIGNAL
/*
* For backwards compatibility. Functionality superseded by sigaction.
*/
@@ -2548,9 +2553,9 @@
return ret ? ret : (unsigned long)old_sa.sa.sa_handler;
}
-#endif /* !alpha && !__ia64__ && !defined(__mips__) && !defined(__arm__) */
+#endif /* !__ARCH_OMIT_SYS_SIGNAL */
-#ifndef HAVE_ARCH_SYS_PAUSE
+#ifndef __ARCH_OMIT_SYS_PAUSE
asmlinkage long
sys_pause(void)
@@ -2560,7 +2565,7 @@
return -ERESTARTNOHAND;
}
-#endif /* HAVE_ARCH_SYS_PAUSE */
+#endif
void __init signals_init(void)
{
===== kernel/sys.c 1.59 vs edited =====
--- 1.59/kernel/sys.c Wed Apr 21 14:36:02 2004
+++ edited/kernel/sys.c Wed May 19 22:47:11 2004
@@ -1056,12 +1056,16 @@
}
}
+#ifndef __ARCH_OMIT_SYS_GETPGRP
+
asmlinkage long sys_getpgrp(void)
{
/* SMP - assuming writes are word atomic this is fine */
return process_group(current);
}
+#endif
+
asmlinkage long sys_getsid(pid_t pid)
{
if (!pid) {
@@ -1402,6 +1406,8 @@
return errno;
}
+#ifndef __ARCH_OMIT_SYS_GETHOSTNAME
+
asmlinkage long sys_gethostname(char __user *name, int len)
{
int i, errno;
@@ -1419,6 +1425,8 @@
return errno;
}
+#endif
+
/*
* Only setdomainname; getdomainname can be implemented by calling
* uname()
@@ -1453,7 +1461,7 @@
? -EFAULT : 0;
}
-#if defined(COMPAT_RLIM_OLD_INFINITY) || !(defined(CONFIG_IA64) || defined(CONFIG_V850))
+#ifndef __ARCH_OMIT_SYS_OLD_GETRLIMIT
/*
* Back compatibility for getrlimit. Needed for some apps.
===== kernel/time.c 1.20 vs edited =====
--- 1.20/kernel/time.c Wed Apr 21 14:36:02 2004
+++ edited/kernel/time.c Wed May 19 22:13:09 2004
@@ -29,6 +29,7 @@
#include <linux/errno.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
+#include <asm/unistd.h>
/*
* The timezone where the local system is located. Used as a default by some
@@ -38,7 +39,7 @@
EXPORT_SYMBOL(sys_tz);
-#if !defined(__alpha__) && !defined(__ia64__)
+#ifndef __ARCH_OMIT_SYS_TIME
/*
* sys_time() can be implemented in user-level using
@@ -84,7 +85,7 @@
return 0;
}
-#endif
+#endif /* !__ARCH_OMIT_SYS_TIME */
asmlinkage long sys_gettimeofday(struct timeval __user *tv, struct timezone __user *tz)
{
===== kernel/timer.c 1.79 vs edited =====
--- 1.79/kernel/timer.c Thu Apr 29 14:00:38 2004
+++ edited/kernel/timer.c Wed May 19 22:11:22 2004
@@ -33,6 +33,7 @@
#include <linux/cpu.h>
#include <asm/uaccess.h>
+#include <asm/unistd.h>
#include <asm/div64.h>
#include <asm/timex.h>
@@ -918,7 +919,7 @@
update_times();
}
-#if !defined(__alpha__) && !defined(__ia64__)
+#ifndef __ARCH_OMIT_SYS_ALARM
/*
* For backwards compatibility? This can be done in libc so Alpha
===== mm/fadvise.c 1.13 vs edited =====
--- 1.13/mm/fadvise.c Fri Apr 30 21:28:49 2004
+++ edited/mm/fadvise.c Wed May 19 22:25:16 2004
@@ -16,6 +16,8 @@
#include <linux/pagevec.h>
#include <linux/fadvise.h>
+#include <asm/unistd.h>
+
/*
* POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could
* deactivate the pages and clear PG_Referenced.
@@ -98,8 +100,11 @@
return ret;
}
+#ifndef __ARCH_OMIT_SYS_FADVISE64
+
asmlinkage long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
{
return sys_fadvise64_64(fd, offset, len, advice);
}
+#endif
===== net/socket.c 1.77 vs edited =====
--- 1.77/net/socket.c Sat May 8 16:00:54 2004
+++ edited/net/socket.c Wed May 19 22:59:20 2004
@@ -87,6 +87,8 @@
#endif /* CONFIG_NET_RADIO */
#include <asm/uaccess.h>
+#include <asm/unistd.h>
+
#include <net/compat.h>
#include <net/sock.h>
@@ -1817,6 +1819,8 @@
return err;
}
+#ifndef __ARCH_OMIT_SYS_SOCKETCALL
+
/* Argument list sizes for sys_socketcall */
#define AL(x) ((x) * sizeof(unsigned long))
static unsigned char nargs[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
@@ -1909,6 +1913,8 @@
}
return err;
}
+
+#endif /* !__ARCH_OMIT_SYS_SOCKETCALL */
/*
* This function is called by a protocol handler that wants to
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fixing sendfile on 64bit architectures
2004-05-20 6:19 ` David Mosberger
@ 2004-05-20 6:41 ` David S. Miller
2004-05-23 9:37 ` Geert Uytterhoeven
1 sibling, 0 replies; 9+ messages in thread
From: David S. Miller @ 2004-05-20 6:41 UTC (permalink / raw)
To: davidm; +Cc: davidm, arnd, ak, linux-arch, akpm
On Wed, 19 May 2004 23:19:55 -0700
David Mosberger <davidm@napali.hpl.hp.com> wrote:
> How about the attached? I decided to use __ARCH_OMIT_foo instead
> of SYS_NEED_foo since that keeps the extra code in those platforms
> that want to drop the code.
This looks OK to me.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: [PATCH] fixing sendfile on 64bit architectures
2004-05-20 6:19 ` David Mosberger
2004-05-20 6:41 ` David S. Miller
@ 2004-05-23 9:37 ` Geert Uytterhoeven
1 sibling, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2004-05-23 9:37 UTC (permalink / raw)
To: davidm; +Cc: Arnd Bergmann, Andi Kleen, linux-arch, Andrew Morton
On Wed, 19 May 2004, David Mosberger wrote:
> >>>>> On Wed, 19 May 2004 21:26:01 +0200, Arnd Bergmann <arnd@arndb.de> said:
>
> >> #ifdef SYS_NEED_OLD_STAT
>
> >> instead of:
>
> >> #if !defined(__alpha__) && !defined(__sparc__) &&
> >> !defined(__ia64__) \ && !defined(CONFIG_ARCH_S390) &&
> >> !defined(__hppa__) \ && !defined(__arm__) &&
> >> !defined(CONFIG_V850) && !defined(__powerpc64__) \ &&
> >> !defined(__mips__)
>
> Arnd> Seconded. While it may not be that drastic in case of
> Arnd> sys_sendfile, such constructions are always ugly and I suspect
> Arnd> many of them would turn out to be incorrect after closer
> Arnd> inspection.
>
> How about the attached? I decided to use __ARCH_OMIT_foo instead
> of SYS_NEED_foo since that keeps the extra code in those platforms
> that want to drop the code.
Are you sure this logic is correct for obsolete features you want to keep for
backwards compatibility reasons on old^H^H^Hlong-existing architectures?
To me it sounds more logical if a new architecture would not get e.g.
sys_oldumount() by default.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2004-05-23 9:52 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-19 19:26 [PATCH] fixing sendfile on 64bit architectures Arnd Bergmann
2004-05-20 6:19 ` David Mosberger
2004-05-20 6:41 ` David S. Miller
2004-05-23 9:37 ` Geert Uytterhoeven
-- strict thread matches above, loose matches on Subject: below --
2004-05-19 9:49 Andi Kleen
2004-05-19 12:21 ` Arnd Bergmann
2004-05-19 18:17 ` David Mosberger
2004-05-19 19:01 ` Andi Kleen
2004-05-19 19:13 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox