From nobody Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri Mar 31 19:48:27 2006 -0500 Subject: [PATCH 1/5] bits of uml __user annotations lost in merge Signed-off-by: Al Viro --- arch/um/sys-i386/signal.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) 10d5c11273192e3891259e3a9634813402e54143 diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c index f5d0e1c..723324e 100644 --- a/arch/um/sys-i386/signal.c +++ b/arch/um/sys-i386/signal.c @@ -57,7 +57,7 @@ static int copy_sc_from_user_skas(struct return(0); } -int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate __user *to_fp, +int copy_sc_to_user_skas(struct sigcontext __user *to, struct _fpstate __user *to_fp, struct pt_regs *regs, unsigned long sp) { struct sigcontext sc; @@ -132,7 +132,7 @@ int copy_sc_from_user_tt(struct sigconte return(err); } -int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate __user *fp, +int copy_sc_to_user_tt(struct sigcontext __user *to, struct _fpstate __user *fp, struct sigcontext *from, int fpsize, unsigned long sp) { struct _fpstate __user *to_fp; @@ -167,7 +167,7 @@ static int copy_sc_from_user(struct pt_r return(ret); } -static int copy_sc_to_user(struct sigcontext *to, struct _fpstate __user *fp, +static int copy_sc_to_user(struct sigcontext __user *to, struct _fpstate __user *fp, struct pt_regs *from, unsigned long sp) { return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs), -- 1.2.4.gac74 From nobody Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat Apr 1 23:13:55 2006 -0500 Subject: [PATCH 2/5] uml: fix amd64 build breakage move extern declarations of arch_switch_to_...() from kern_util.h to ptrace-i386.h; they conflict with static inline ones in ptrace-x86_64.h. Signed-off-by: Al Viro --- arch/um/include/kern_util.h | 4 ---- include/asm-um/ptrace-i386.h | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) 7397a51080ded0b7a398772fbfb68ecf9eb49733 diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h index 4255713..efa3d33 100644 --- a/arch/um/include/kern_util.h +++ b/arch/um/include/kern_util.h @@ -117,10 +117,6 @@ extern struct task_struct *get_task(int extern void machine_halt(void); extern int is_syscall(unsigned long addr); -extern void arch_switch_to_tt(struct task_struct *from, struct task_struct *to); - -extern void arch_switch_to_skas(struct task_struct *from, struct task_struct *to); - extern void free_irq(unsigned int, void *); extern int cpu(void); diff --git a/include/asm-um/ptrace-i386.h b/include/asm-um/ptrace-i386.h index 30656c9..746699c 100644 --- a/include/asm-um/ptrace-i386.h +++ b/include/asm-um/ptrace-i386.h @@ -66,6 +66,10 @@ static inline int do_set_thread_area(str return CHOOSE_MODE_PROC(do_set_thread_area_tt, do_set_thread_area_skas, info); } +extern void arch_switch_to_tt(struct task_struct *from, struct task_struct *to); + +extern void arch_switch_to_skas(struct task_struct *from, struct task_struct *to); + struct task_struct; #endif -- 1.2.4.gac74 From nobody Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun Apr 2 00:59:44 2006 -0500 Subject: [PATCH 3/5] uml: build breakage on i386 arch/um/os-Linux/sys-i386/tls.o is not a userland object; it uses kernel headers and expects linux/unistd.h to pull errno.h. Kernel one will do that (by one hell of a chain of includes), /usr/include/linux/unistd.h won't. Signed-off-by: Al Viro --- arch/um/os-Linux/sys-i386/Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 27beb722046a12d4ed5d0d00c4f40b31dc7ce9cb diff --git a/arch/um/os-Linux/sys-i386/Makefile b/arch/um/os-Linux/sys-i386/Makefile index b321361..7136aca 100644 --- a/arch/um/os-Linux/sys-i386/Makefile +++ b/arch/um/os-Linux/sys-i386/Makefile @@ -5,6 +5,6 @@ obj-$(CONFIG_MODE_SKAS) = registers.o tls.o -USER_OBJS := $(obj-y) +USER_OBJS := registers.o include arch/um/scripts/Makefile.rules -- 1.2.4.gac74 From nobody Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun Apr 2 23:35:31 2006 -0400 Subject: [PATCH 4/5] uml: we want to copy sp, not *sp to userland Signed-off-by: Al Viro --- arch/um/sys-i386/signal.c | 2 +- arch/um/sys-x86_64/signal.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 8bb927e70020c3b58fbac64da0d119d82eb05894 diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c index 723324e..0709fc6 100644 --- a/arch/um/sys-i386/signal.c +++ b/arch/um/sys-i386/signal.c @@ -147,7 +147,7 @@ int copy_sc_to_user_tt(struct sigcontext * delivery. The sp passed in is the original, and this needs * to be restored, so we stick it in separately. */ - err |= copy_to_user(&SC_SP(to), sp, sizeof(sp)); + err |= copy_to_user(&SC_SP(to), &sp, sizeof(sp)); if(from_fp != NULL){ err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate)); diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c index e75c4e1..a4c46a8 100644 --- a/arch/um/sys-x86_64/signal.c +++ b/arch/um/sys-x86_64/signal.c @@ -137,7 +137,7 @@ int copy_sc_to_user_tt(struct sigcontext * delivery. The sp passed in is the original, and this needs * to be restored, so we stick it in separately. */ - err |= copy_to_user(&SC_SP(to), sp, sizeof(sp)); + err |= copy_to_user(&SC_SP(to), &sp, sizeof(sp)); if(from_fp != NULL){ err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate)); -- 1.2.4.gac74 From nobody Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat Apr 1 23:34:55 2006 -0500 Subject: [PATCH 5/5] uml: stop mixing pointers to __u64 and to unsigned long long Signed-off-by: Al Viro --- arch/um/drivers/cow.h | 2 +- arch/um/drivers/cow_user.c | 6 +++--- arch/um/drivers/ubd_kern.c | 2 +- arch/um/include/os.h | 2 +- arch/um/kernel/initrd.c | 2 +- arch/um/os-Linux/file.c | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) 539c81d92734b12fdcced91ddd27dd556b3a3fda diff --git a/arch/um/drivers/cow.h b/arch/um/drivers/cow.h index 04e3958..ef58128 100644 --- a/arch/um/drivers/cow.h +++ b/arch/um/drivers/cow.h @@ -51,7 +51,7 @@ extern int read_cow_header(int (*reader) extern int write_cow_header(char *cow_file, int fd, char *backing_file, int sectorsize, int alignment, - unsigned long long *size); + __u64 *size); extern void cow_sizes(int version, __u64 size, int sectorsize, int align, int bitmap_offset, unsigned long *bitmap_len_out, diff --git a/arch/um/drivers/cow_user.c b/arch/um/drivers/cow_user.c index 61951b7..3b18a1a 100644 --- a/arch/um/drivers/cow_user.c +++ b/arch/um/drivers/cow_user.c @@ -161,7 +161,7 @@ static int absolutize(char *to, int size } int write_cow_header(char *cow_file, int fd, char *backing_file, - int sectorsize, int alignment, unsigned long long *size) + int sectorsize, int alignment, __u64 *size) { struct cow_header_v3 *header; unsigned long modtime; @@ -241,7 +241,7 @@ int file_reader(__u64 offset, char *buf, int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg, __u32 *version_out, char **backing_file_out, - time_t *mtime_out, unsigned long long *size_out, + time_t *mtime_out, __u64 *size_out, int *sectorsize_out, __u32 *align_out, int *bitmap_offset_out) { @@ -334,7 +334,7 @@ int init_cow_file(int fd, char *cow_file int alignment, int *bitmap_offset_out, unsigned long *bitmap_len_out, int *data_offset_out) { - unsigned long long size, offset; + __u64 size, offset; char zero = 0; int err; diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 0897852..ff6e2d4 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -1141,7 +1141,7 @@ static int path_requires_switch(char *fr static int backing_file_mismatch(char *file, __u64 size, time_t mtime) { unsigned long modtime; - unsigned long long actual; + __u64 actual; int err; err = os_file_modtime(file, &modtime); diff --git a/arch/um/include/os.h b/arch/um/include/os.h index f88856c..f996fec 100644 --- a/arch/um/include/os.h +++ b/arch/um/include/os.h @@ -143,7 +143,7 @@ extern int os_seek_file(int fd, __u64 of extern int os_open_file(char *file, struct openflags flags, int mode); extern int os_read_file(int fd, void *buf, int len); extern int os_write_file(int fd, const void *buf, int count); -extern int os_file_size(char *file, unsigned long long *size_out); +extern int os_file_size(char *file, __u64 *size_out); extern int os_file_modtime(char *file, unsigned long *modtime); extern int os_pipe(int *fd, int stream, int close_on_exec); extern int os_set_fd_async(int fd, int owner); diff --git a/arch/um/kernel/initrd.c b/arch/um/kernel/initrd.c index 82ecf90..66b28f5 100644 --- a/arch/um/kernel/initrd.c +++ b/arch/um/kernel/initrd.c @@ -19,7 +19,7 @@ static char *initrd __initdata = NULL; static int __init read_initrd(void) { void *area; - long long size; + __u64 size; int err; if(initrd == NULL) return 0; diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c index 3bd10de..f02150b 100644 --- a/arch/um/os-Linux/file.c +++ b/arch/um/os-Linux/file.c @@ -356,7 +356,7 @@ int os_write_file(int fd, const void *bu (int (*)(int, void *, int)) write, copy_to_user_proc)); } -int os_file_size(char *file, unsigned long long *size_out) +int os_file_size(char *file, __u64 *size_out) { struct uml_stat buf; int err; @@ -382,7 +382,7 @@ int os_file_size(char *file, unsigned lo os_close_file(fd); return(err); } - *size_out = ((long long) blocks) * 512; + *size_out = ((__u64) blocks) * 512; os_close_file(fd); return(0); } -- 1.2.4.gac74