Lots of UML fixups for 2.6.14
cover Lots of UML fixups for 2.6.14
This is a collection of simple fixes like "fix warning", "rename thing to fix conflict", "remove unused var ", "add comment", "match function and proto", "missing break in switch".
This is the "trivial" part of my UML tree - can this get merged upstream? Thanks.
I'll later send another bunch of more troublesome fixes.
Signature · 11 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it
PATCH 1/10 uml: adapt asm/futex.h to our arch
From: Paolo 'Blaisorblade' Giarrusso <[email protected]>
Follow up to 4732efbeb997189d9f9b04708dc26bf8613ed721 - uml must just reuse as-is the backing architecture support. There is a micro-fixup is needed for the included file, which won't affect i386 behaviour at all.
I've not tested compilation on x86_64, only on x86, but the code is almost the same except the culprit test, so everything should be ok on x86_64 too.
---
include/asm-i386/futex.h | 2 +- include/asm-um/futex.h | 51 +++++----------------------------------------- 2 files changed, 6 insertions(+), 47 deletions(-)
include/asm-i386/futex.h +1 -1
@@ -61,7 +61,7 @@ futex_atomic_op_inuser (int encoded_op,if (op ==FUTEX_OP_SET )__futex_atomic_op1 ("xchgl %0, %2" , ret, oldval, uaddr, oparg);else { -#ifndef CONFIG_X86_BSWAP +#if !defined(CONFIG_X86_BSWAP ) && !defined(CONFIG_UML )if (boot_cpu_data.x86 ==3 ) ret = -ENOSYS ;else
include/asm-um/futex.h +5 -46
58 lines not on this page · raw message
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
PATCH 2/10 Remove unused var from asm/futex.h
In reply to BlaisorbladeFrom: Paolo 'Blaisorblade' Giarrusso <[email protected]>
As recently done by Russell King for ARM, commit 4732efbeb997189d9f9b04708dc26bf8613ed721 introduces a generic asm/futex.h copied along most arches, which includes a "-ENOSYS support" to be changed if needed. However, it includes an unused var (taken from the "real" version) which GCC warns about.
Remove it from all arches having that file version (i.e. same GIT id).
$ git-diff-tree -r HEAD and $ git-ls-tree -r HEAD include/|grep 9feff4ce1424bc390608326240be369eb13aa648
may be more interesting than looking at the patch itself, to make sure I've just copied the arm header to all other archs having the original dummy version of this file.
---
include/asm-alpha/futex.h | 2 +- include/asm-arm26/futex.h | 2 +- include/asm-cris/futex.h | 2 +- include/asm-frv/futex.h | 2 +- include/asm-h8300/futex.h | 2 +- include/asm-ia64/futex.h | 2 +- include/asm-m32r/futex.h | 2 +- include/asm-m68k/futex.h | 2 +- include/asm-m68knommu/futex.h | 2 +- include/asm-parisc/futex.h | 2 +- include/asm-ppc/futex.h | 2 +- include/asm-s390/futex.h | 2 +- include/asm-sh/futex.h | 2 +- include/asm-sh64/futex.h | 2 +- include/asm-sparc/futex.h | 2 +- include/asm-sparc64/futex.h | 2 +- include/asm-v850/futex.h | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-)
include/asm-alpha/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-arm26/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-cris/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-frv/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-h8300/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-ia64/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-m32r/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-m68k/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-m68knommu/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-parisc/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-ppc/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-s390/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-sh/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-sh64/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-sparc/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-sparc64/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
include/asm-v850/futex.h +1 -1
@@ -14,7 +14,7 @@ futex_atomic_op_inuser (int encoded_op,int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int oldval =0 , ret, tem; +int oldval =0 , ret;if (encoded_op & (FUTEX_OP_OPARG_SHIFT <<28 )) oparg =1 << oparg;
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
PATCH 3/10 uml: remove verify_area_{tt,skas}
In reply to BlaisorbladeFrom: Paolo 'Blaisorblade' Giarrusso <[email protected]>
When removing verify_area, verify_area_{tt,skas} were forgotten.
---
arch/um/kernel/skas/include/uaccess-skas.h | 6 ------ arch/um/kernel/tt/include/uaccess-tt.h | 6 ------ 2 files changed, 0 insertions(+), 12 deletions(-)
arch/um/kernel/skas/include/uaccess-skas.h +0 -6
@@ -18,12 +18,6 @@ ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \ ((unsigned long) (addr) + (size) >= (unsigned long)(addr)))) -static inline int verify_area_skas (int type,const void __user * addr, -unsigned long size) -{ -return (access_ok_skas (type, addr, size) ?0 : -EFAULT ); -} -extern int copy_from_user_skas (void *to,const void __user *from,int n);extern int copy_to_user_skas (void __user *to,const void *from,int n);extern int strncpy_from_user_skas (char *dst,const char __user *src,int count);
arch/um/kernel/tt/include/uaccess-tt.h +0 -6
@@ -33,12 +33,6 @@ extern unsigned long uml_physmem; (((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) && \ (under_task_size(addr, size) || is_stack(addr, size)))) -static inline int verify_area_tt (int type,const void __user * addr, -unsigned long size) -{ -return (access_ok_tt (type, addr, size) ?0 : -EFAULT ); -} -extern unsigned long get_fault_addr (void ); extern int __do_copy_from_user(void *to, const void *from, int n,
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
PATCH 4/10 uml: fix modify_ldt - missing break in switch
In reply to BlaisorbladeFrom: Paolo 'Blaisorblade' Giarrusso <[email protected]>
I am a lamer :-(. Luckily, Luo Xin performed LTP testing and found this failure. Btw, the fact that the patch in which I introduced this was merged shows that:
a) I'm really trusted by people
b) sometimes they're wrong about point a).
c) lack of time for reviewers.
---
arch/um/sys-i386/ldt.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/um/sys-i386/ldt.c +1 -0
@@ -83,6 +83,7 @@ int sys_modify_ldt(int func, void __user goto out; } p = buf; +break ;default : res = -ENOSYS ; goto out;
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
PATCH 5/10 uml: fix uname output on 32-bit binary on 64-bit host
In reply to BlaisorbladeFrom: Paolo 'Blaisorblade' Giarrusso <[email protected]>
Translate uname output taken from the host if needed.
---
arch/um/kernel/user_util.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
arch/um/kernel/user_util.c +6 -0
@@ -128,6 +128,12 @@ void setup_machinename(char *machine_outstruct utsname host;uname (&host); +#if defined(UML_CONFIG_UML_X86 ) && !defined(UML_CONFIG_64BIT ) +if (!strcmp (host.machine,"x86_64" )) { +strcpy (machine_out,"i686" ); +return ; + } +#endif strcpy (machine_out, host.machine); }
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
PATCH 6/10 uml: Fix conflict between libc and ipv6
In reply to BlaisorbladeFrom: Paolo 'Blaisorblade' Giarrusso <[email protected]>
gcc is now complaining during link on some hosts - fix it as for other things. Reported by Antoine Martin <[email protected]>.
---
arch/um/Makefile | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
arch/um/Makefile +5 -1
@@ -53,9 +53,13 @@ SYS_DIR := $(ARCH_DIR)/include/sysdep-$ # -Dvmap=kernel_vmap affects everything, and prevents anything from # referencing the libpcap.o symbol so named. +# +# Same things for in6addr_loopback - found in libc. CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ - $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap + $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ + -Din6addr_loopback=kernel_in6addr_loopback + AFLAGS += $(ARCH_INCLUDE) USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
PATCH 7/10 uml: fix bogus HOST_ELF_CLASS symbol name
In reply to BlaisorbladeFrom: Paolo 'Blaisorblade' Giarrusso <[email protected]>
Even if with a bit of misunderstanding, Al fixed this in commit 95608261dae863bc43292e6fbd946a3abd3aa49f.
Well, the symbol was intended to come from userspace (it exists there on normal host), but since some hosts may miss that, using the kernel one is just as fine. However, rename it to be named consistently with the rest.
Actually, he missed converting ELFCLASS32 to coming from kernel headers. For consistence, add ELFCLASS64 too.
---
arch/um/include/common-offsets.h | 4 +++- arch/um/os-Linux/elf_aux.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-)
arch/um/include/common-offsets.h +3 -1
@@ -12,4 +12,6 @@ DEFINE_STR(UM_KERN_WARNING, KERN_WARNINGDEFINE_STR (UM_KERN_NOTICE ,KERN_NOTICE );DEFINE_STR (UM_KERN_INFO ,KERN_INFO );DEFINE_STR (UM_KERN_DEBUG ,KERN_DEBUG ); -DEFINE (HOST_ELF_CLASS ,ELF_CLASS ); +DEFINE (UM_ELF_CLASS ,ELF_CLASS ); +DEFINE (UM_ELFCLASS32 ,ELFCLASS32 ); +DEFINE (UM_ELFCLASS64 ,ELFCLASS64 );
arch/um/os-Linux/elf_aux.c +2 -1
@@ -14,7 +14,8 @@#include "mem_user.h" #include <kernel-offsets.h> -#if HOST_ELF_CLASS ==ELFCLASS32 +/* Use the one from the kernel - the host may miss it, if having old headers. */ +#if UM_ELF_CLASS ==UM_ELFCLASS32 typedef Elf32_auxv_t elf_auxv_t ;#else typedef Elf64_auxv_t elf_auxv_t ;
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
PATCH 8/10 uml: readd removed unistd.h inclusion
In reply to BlaisorbladeFrom: Paolo 'Blaisorblade' Giarrusso <[email protected]>
Readd this header (deleted in 60d339f6fe0831060600c62418b71a62ad26c281). A warning is spit out here about undeclared getpgrp().
---
arch/um/os-Linux/process.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/um/os-Linux/process.c +1 -0
@@ -3,6 +3,7 @@* Licensed under the GPL */ +#include <unistd.h> #include <stdio.h> #include <errno.h> #include <signal.h>
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
PATCH 9/10 uml: comment about cast build fix
In reply to BlaisorbladeFrom: Paolo 'Blaisorblade' Giarrusso <[email protected]>
Explain why the casting we do to silence this warning is indeed safe.
It is because the field we're casting from, though being 64-bit wide, was filled with a pointer in first place by ourselves.
---
arch/um/os-Linux/aio.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/um/os-Linux/aio.c +1 -0
@@ -144,6 +144,7 @@ static int aio_thread(void *arg) "errno = %d\n", errno); }else { +/* This is safe as we've just a pointer here. */ aio = (struct aio_context *) (long ) event.data;if (update_aio (aio, event.res)){do_aio (ctx, aio);
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
PATCH 10/10 uml: fix compile warning after consolidation patch
In reply to BlaisorbladeFrom: Paolo 'Blaisorblade' Giarrusso <[email protected]>
The header declaring this function wasn't included, so the function declaration was totally bogus wrt. the proto - even if this wasn't going to fail at all.
It was so bad that the compile warning I got was "control reaches end of non-void function", i.e. missing return. Actually, this has been there for ages, the consolidation patch just added the warning which was needed to clean it up. Nice. Really.
---
arch/um/kernel/tt/process_kern.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/um/kernel/tt/process_kern.c +2 -1
@@ -23,10 +23,11 @@#include "mem_user.h" #include "tlb.h" #include "mode.h" +#include "mode_kern.h" #include "init.h" #include "tt.h" -int switch_to_tt (void *prev,void *next,void *last) +void switch_to_tt (void *prev,void *next) {struct task_struct *from, *to, *prev_sched;unsigned long flags;
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel