Re: [uml-devel] User Mode Linux still doesn't build in 2.6.23-final.
On Sat, Oct 20, 2007 at 12:41:29PM +0100, Nix wrote: >On 20 Oct 2007, Paolo Giarrusso told this: >> Guess most people are not using SMP right now, and that the error disappears >> without that setting > >It doesn't. It fails with non-SMP as well. > UML still doesn't build on 2.6.23-git16. Gcc threw out many errors, I put them in the web: http://wangcong.org/down/errors.txt My .config is located at: http://wangcong.org/down/uml_config.bak Or I missed something? Regards. -- May the Source Be With You. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] User Mode Linux still doesn't build in 2.6.23-final.
On Sun, Oct 21, 2007 at 09:08:48AM -0400, Jeff Dike wrote: >On Sun, Oct 21, 2007 at 07:48:54PM +0800, WANG Cong wrote: >> UML still doesn't build on 2.6.23-git16. >> >> Gcc threw out many errors, I put them in the web: >> http://wangcong.org/down/errors.txt > >Looks like either you need to run mrproper and try again, or maybe >fallout from the x86 merge, with include/asm-um/arch pointing to >include/asm-i386 instead of include/asm-x86. Although I though Al had >UML building in the presence of the x86 merge. > Hi, Jeff! I have tried `make mrproper' before `make ARCH=um', but it still failed. ;( Regards. -- May the Source Be With You. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] User Mode Linux still doesn't build in 2.6.23-final.
On Sun, Oct 21, 2007 at 04:43:46PM +0100, Al Viro wrote: >On Sun, Oct 21, 2007 at 09:20:32PM +0800, WANG Cong wrote: >> On Sun, Oct 21, 2007 at 09:08:48AM -0400, Jeff Dike wrote: >> >On Sun, Oct 21, 2007 at 07:48:54PM +0800, WANG Cong wrote: >> >> UML still doesn't build on 2.6.23-git16. >> >> >> >> Gcc threw out many errors, I put them in the web: >> >> http://wangcong.org/down/errors.txt >> > >> >Looks like either you need to run mrproper and try again, or maybe >> >fallout from the x86 merge, with include/asm-um/arch pointing to >> >include/asm-i386 instead of include/asm-x86. Although I though Al had >> >UML building in the presence of the x86 merge. >> > >> >> Hi, Jeff! >> >> I have tried `make mrproper' before `make ARCH=um', but it still >> failed. ;( > >Fallout continues; I've got a preliminary patch for it. Basically, we >need to stop doing -U__i386__ et.al. > Hi, Al. I applied your patch and recompiled the kernel. But it failed again. ;( Regards. WANG Cong - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] User Mode Linux still doesn't build in 2.6.23-final.
On Mon, Oct 22, 2007 at 06:22:14AM +0100, Al Viro wrote: >On Mon, Oct 22, 2007 at 12:37:46PM +0800, WANG Cong wrote: >> >Fallout continues; I've got a preliminary patch for it. Basically, we >> >need to stop doing -U__i386__ et.al. >> > >> >> Hi, Al. >> >> I applied your patch and recompiled the kernel. But it failed again. >> ;( > >Details would be welcome... Notes: SMP on UML is no more; UML_NET_VDE >depends on having some userland library installed. Aside of those two >it ought to build. > >Build log on failing build would be nice, along with .config. I build UML for non-SMP x86. But I don't know about UML_NET_VDE. ;( Errors threw out by gcc (too many) are put here: http://wangcong.org/down/errors.txt And my .config is located here: http://wangcong.org/down/dot_config (Errors look like same as without your patch.) -- May the Source Be With You. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] User Mode Linux still doesn't build in 2.6.23-final.
On Mon, Oct 22, 2007 at 07:42:33AM +0100, Nix wrote: >On 22 Oct 2007, WANG Cong uttered the following: >> I build UML for non-SMP x86. But I don't know about UML_NET_VDE. ;( >> >> Errors threw out by gcc (too many) are put here: >> http://wangcong.org/down/errors.txt > >It's hard to tell without LOCALE=C, but those are the sorts of results >I'd expect if you had run make {old,menu,x}config without specifying >ARCH=um, so you've configured for one architecture and are now trying >to build another. > >Where is the include/asm symlink pointing to in your build tree? $ ls -l include/asm lrwxrwxrwx 1 wangcong wangcong 6 2007-10-22 12:34 include/asm -> asm-um OK. Let me do the following: $ make mrproper ... $ make defconfig ARCH=um ... # # configuration written to .config # $ make ARCH=um (Still tons of errors here...) Am I wrong or I missed something? Regards. -- May the Source Be With You. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] User Mode Linux still doesn't build in 2.6.23-final.
On Mon, Oct 22, 2007 at 08:59:43AM +0200, Sam Ravnborg wrote: >On Mon, Oct 22, 2007 at 02:52:02PM +0800, WANG Cong wrote: >> On Mon, Oct 22, 2007 at 07:42:33AM +0100, Nix wrote: >> >On 22 Oct 2007, WANG Cong uttered the following: >> >> I build UML for non-SMP x86. But I don't know about UML_NET_VDE. ;( >> >> >> >> Errors threw out by gcc (too many) are put here: >> >> http://wangcong.org/down/errors.txt >> > >> >It's hard to tell without LOCALE=C, but those are the sorts of results >> >I'd expect if you had run make {old,menu,x}config without specifying >> >ARCH=um, so you've configured for one architecture and are now trying >> >to build another. >> > >> >Where is the include/asm symlink pointing to in your build tree? >> >> $ ls -l include/asm >> lrwxrwxrwx 1 wangcong wangcong 6 2007-10-22 12:34 include/asm -> asm-um >> >> OK. Let me do the following: >> >> $ make mrproper > >Please try >make ARCH=um mrproper > >this will clean up the additional uml symlinks. > Hi, Sam, Al and others. I just followed what Sam told me, errors are much fewer this time, but still exist. Error messages are: CC arch/um/kernel/syscall.o CC arch/um/kernel/sysrq.o arch/um/kernel/sysrq.c: In function ‘show_stack’: arch/um/kernel/sysrq.c:63: error: ‘UESP’ undeclared (first use in this function) arch/um/kernel/sysrq.c:63: error: (Each undeclared identifier is reported only once arch/um/kernel/sysrq.c:63: error: for each function it appears in.) make[1]: *** [arch/um/kernel/sysrq.o] Error 1 make: *** [arch/um/kernel] Error 2 Or I missed something again? And I use `make defconfig ARCH=um' to generate .config, my tree is 2.6.23-git16 (Al, is this OK?). Thanks. -- May the Source Be With You. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] User Mode Linux still doesn't build in 2.6.23-final.
On Mon, Oct 22, 2007 at 12:36:00PM +0100, Al Viro wrote: >On Mon, Oct 22, 2007 at 03:48:23PM +0800, WANG Cong wrote: >> I just followed what Sam told me, errors are much fewer this time, >> but still exist. Error messages are: >> >> CC arch/um/kernel/syscall.o >> CC arch/um/kernel/sysrq.o >> arch/um/kernel/sysrq.c: In function ???show_stack???: >> arch/um/kernel/sysrq.c:63: error: ???UESP??? undeclared (first use in this >> function) >> arch/um/kernel/sysrq.c:63: error: (Each undeclared identifier is reported >> only once >> arch/um/kernel/sysrq.c:63: error: for each function it appears in.) >> make[1]: *** [arch/um/kernel/sysrq.o] Error 1 >> make: *** [arch/um/kernel] Error 2 >> >> Or I missed something again? >> >> And I use `make defconfig ARCH=um' to generate .config, my tree >> is 2.6.23-git16 (Al, is this OK?). > >Now apply the patch upthread, it should've fixed that one (and yes, you >are down to the stuff this patch is supposed to fix - and does so here). Yes, this one is fixed. Thanks for your patch. But another one comes out. ;( CC kernel/sched.o kernel/sched.c:3902: error: conflicting types for ‘wait_for_completion_interruptible’ include/linux/completion.h:46: error: previous declaration of ‘wait_for_completion_interruptible’ was here kernel/sched.c:3908: error: conflicting types for ‘wait_for_completion_interruptible’ include/linux/completion.h:46: error: previous declaration of ‘wait_for_completion_interruptible’ was here make[1]: *** [kernel/sched.o] Error 1 make: *** [kernel] Error 2 CC: Ingo Molar <[EMAIL PROTECTED]> -- May the Source Be With You. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] User Mode Linux still doesn't build in 2.6.23-final.
On Mon, Oct 22, 2007 at 02:30:41PM +0200, Ingo Molnar wrote: > >* WANG Cong <[EMAIL PROTECTED]> wrote: > >> On Mon, Oct 22, 2007 at 12:36:00PM +0100, Al Viro wrote: >> >On Mon, Oct 22, 2007 at 03:48:23PM +0800, WANG Cong wrote: >> >> I just followed what Sam told me, errors are much fewer this time, >> >> but still exist. Error messages are: >> >> >> >> CC arch/um/kernel/syscall.o >> >> CC arch/um/kernel/sysrq.o >> >> arch/um/kernel/sysrq.c: In function ???show_stack???: >> >> arch/um/kernel/sysrq.c:63: error: ???UESP??? undeclared (first use in >> >> this function) >> >> arch/um/kernel/sysrq.c:63: error: (Each undeclared identifier is reported >> >> only once >> >> arch/um/kernel/sysrq.c:63: error: for each function it appears in.) >> >> make[1]: *** [arch/um/kernel/sysrq.o] Error 1 >> >> make: *** [arch/um/kernel] Error 2 >> >> >> >> Or I missed something again? >> >> >> >> And I use `make defconfig ARCH=um' to generate .config, my tree >> >> is 2.6.23-git16 (Al, is this OK?). >> > >> >Now apply the patch upthread, it should've fixed that one (and yes, you >> >are down to the stuff this patch is supposed to fix - and does so here). >> >> Yes, this one is fixed. Thanks for your patch. >> >> But another one comes out. ;( >> >> CC kernel/sched.o >> kernel/sched.c:3902: error: conflicting types for >> ‘wait_for_completion_interruptible’ >> include/linux/completion.h:46: error: previous declaration of >> ‘wait_for_completion_interruptible’ was here >> kernel/sched.c:3908: error: conflicting types for >> ‘wait_for_completion_interruptible’ >> include/linux/completion.h:46: error: previous declaration of >> ‘wait_for_completion_interruptible’ was here >> make[1]: *** [kernel/sched.o] Error 1 >> make: *** [kernel] Error 2 > >does the patch below ontop of latest -git help? > Thanks, Ingo! I am using 2.6.23-git16 plus Al's previous patch. After applying your patch, it builds fine. Regards. WANG Cong - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Git Patch] arch/um/drivers/ubd_kern.c: fix a building error
Fix this uml building error: arch/um/drivers/ubd_kern.c: In function 'do_ubd_request': arch/um/drivers/ubd_kern.c:1118: error: implicit declaration of function 'sg_page' arch/um/drivers/ubd_kern.c:1118: warning: passing argument 6 of 'prepare_request' makes pointer from integer without a cast make[1]: *** [arch/um/drivers/ubd_kern.o] Error 1 make: *** [arch/um/drivers] Error 2 Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/drivers/ubd_kern.c |1 + 1 file changed, 1 insertion(+) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 3a8cd3d..440ed25 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -35,6 +35,7 @@ #include "linux/genhd.h" #include "linux/spinlock.h" #include "linux/platform_device.h" +#include "linux/scatterlist.h" #include "asm/segment.h" #include "asm/uaccess.h" #include "asm/irq.h" - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Git Patch]arch/um/drivers/ubd_kern.c: a warning fix
Fix an incompatible-pointer warning. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/drivers/ubd_kern.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index e184b44..7e6cdde 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -705,7 +705,7 @@ static int ubd_add(int n, char **error_out) ubd_dev->size = ROUND_BLOCK(ubd_dev->size); INIT_LIST_HEAD(&ubd_dev->restart); - sg_init_table(&ubd_dev->sg, MAX_SG); + sg_init_table(ubd_dev->sg, MAX_SG); err = -ENOMEM; ubd_dev->queue = blk_init_queue(do_ubd_request, &ubd_dev->lock); - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] UML building failed in current Linus-tree
Hi, Jeff, Sam! I just pulled from Linus-tree, and got the following error when building uml. $ make defconfig ARCH=um /home/wangcong/projects/linux-2.6/arch/um/Makefile-i386:32: /home/wangcong/projects/linux-2.6/arch/i386/Makefile.cpu: No such file or directory make: *** No rule to make target `/home/wangcong/projects/linux-2.6/arch/i386/Makefile.cpu'. Stop. Is this a known problem? Yesterday's Linus-tree was fine. Regards. -- May the Source Be With You. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] UML building failed in current Linus-tree
On Sun, Oct 28, 2007 at 03:43:43AM +, Al Viro wrote: >On Sun, Oct 28, 2007 at 11:24:41AM +0800, WANG Cong wrote: >> >> Hi, Jeff, Sam! >> >> I just pulled from Linus-tree, and got the following error when building uml. >> >> $ make defconfig ARCH=um >> /home/wangcong/projects/linux-2.6/arch/um/Makefile-i386:32: >> /home/wangcong/projects/linux-2.6/arch/i386/Makefile.cpu: No such file or >> directory >> make: *** No rule to make target >> `/home/wangcong/projects/linux-2.6/arch/i386/Makefile.cpu'. Stop. >> >> Is this a known problem? Yesterday's Linus-tree was fine. > >diff --git a/arch/um/Kconfig.i386 b/arch/um/Kconfig.i386 >index 9876d80..e0ac74e 100644 >--- a/arch/um/Kconfig.i386 >+++ b/arch/um/Kconfig.i386 Thanks, Al. With your patch, it works fine. Jeff, could you please consider pushing this and Al's another patch[1] into Linus-tree? UML in Linus-tree can't work for a long time. ;( [1] http://lkml.org/lkml/2007/10/21/118 Regards. WANG Cong - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Git Patch] arch/um/os-Linux/: varied improvements and fixes
Hi, Jeff. This patch contains varied fixes and improvements for some files under arch/um/os-Linux/, such as a typo fix in a perror message, a missing argument fix for a printf, some constifying for pointers and so on. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/include/os.h| 12 ++-- arch/um/os-Linux/file.c | 14 +++--- arch/um/os-Linux/main.c | 12 arch/um/os-Linux/mem.c |5 - arch/um/os-Linux/signal.c |3 ++- arch/um/os-Linux/start_up.c |2 +- 6 files changed, 28 insertions(+), 20 deletions(-) diff --git a/arch/um/include/os.h b/arch/um/include/os.h index fbf0a87..93f3a70 100644 --- a/arch/um/include/os.h +++ b/arch/um/include/os.h @@ -137,24 +137,24 @@ extern int os_set_owner(int fd, int pid); extern int os_mode_fd(int fd, int mode); extern int os_seek_file(int fd, unsigned long long offset); -extern int os_open_file(char *file, struct openflags flags, int mode); +extern int os_open_file(const 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_modtime(char *file, unsigned long *modtime); +extern int os_file_size(const char *file, unsigned long long *size_out); +extern int os_file_modtime(const 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); extern int os_clear_fd_async(int fd); extern int os_set_fd_block(int fd, int blocking); extern int os_accept_connection(int fd); -extern int os_create_unix_socket(char *file, int len, int close_on_exec); +extern int os_create_unix_socket(const char *file, int len, int close_on_exec); extern int os_shutdown_socket(int fd, int r, int w); extern void os_close_file(int fd); extern int os_rcv_fd(int fd, int *helper_pid_out); extern int create_unix_socket(char *file, int len, int close_on_exec); -extern int os_connect_socket(char *name); +extern int os_connect_socket(const char *name); extern int os_file_type(char *file); -extern int os_file_mode(char *file, struct openflags *mode_out); +extern int os_file_mode(const char *file, struct openflags *mode_out); extern int os_lock_file(int fd, int excl); extern void os_flush_stdout(void); extern int os_stat_filesystem(char *path, long *bsize_out, diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c index b542a3a..d8f26be 100644 --- a/arch/um/os-Linux/file.c +++ b/arch/um/os-Linux/file.c @@ -19,7 +19,7 @@ #include "user.h" #include "kern_util.h" -static void copy_stat(struct uml_stat *dst, struct stat64 *src) +static void copy_stat(struct uml_stat *dst, const struct stat64 *src) { *dst = ((struct uml_stat) { .ust_dev = src->st_dev, /* device */ @@ -168,7 +168,7 @@ int os_file_type(char *file) else return OS_TYPE_FILE; } -int os_file_mode(char *file, struct openflags *mode_out) +int os_file_mode(const char *file, struct openflags *mode_out) { int err; @@ -189,7 +189,7 @@ int os_file_mode(char *file, struct openflags *mode_out) return err; } -int os_open_file(char *file, struct openflags flags, int mode) +int os_open_file(const char *file, struct openflags flags, int mode) { int fd, err, f = 0; @@ -216,7 +216,7 @@ int os_open_file(char *file, struct openflags flags, int mode) return fd; } -int os_connect_socket(char *name) +int os_connect_socket(const char *name) { struct sockaddr_un sock; int fd, err; @@ -277,7 +277,7 @@ int os_write_file(int fd, const void *buf, int len) return n; } -int os_file_size(char *file, unsigned long long *size_out) +int os_file_size(const char *file, unsigned long long *size_out) { struct uml_stat buf; int err; @@ -314,7 +314,7 @@ int os_file_size(char *file, unsigned long long *size_out) return 0; } -int os_file_modtime(char *file, unsigned long *modtime) +int os_file_modtime(const char *file, unsigned long *modtime) { struct uml_stat buf; int err; @@ -515,7 +515,7 @@ int os_rcv_fd(int fd, int *helper_pid_out) return new; } -int os_create_unix_socket(char *file, int len, int close_on_exec) +int os_create_unix_socket(const char *file, int len, int close_on_exec) { struct sockaddr_un addr; int sock, err; diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 82c3778..de664e7 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -73,7 +73,7 @@ static void install_fatal_handler(int sig) action.sa_handler = last_ditch_exit; if (sigaction(sig, &action, NULL) < 0) { printf("failed to install handler for signal %d - errno = %d\n", -
[uml-devel] [git Patch] UML: More varied improvements
Hi, Jeff! This patch also does some improvements for uml code. Improvements include dropping unnecessary cast, killing some unnecessary code and still some constifying for pointers etc.. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/drivers/ubd_kern.c |6 +++--- arch/um/include/kern_util.h|2 +- arch/um/kernel/mem.c |2 +- arch/um/kernel/process.c |4 +--- arch/um/os-Linux/drivers/tuntap_user.c |2 +- arch/um/os-Linux/mem.c |7 --- arch/um/os-Linux/sigio.c |2 +- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index e184b44..7b3271d 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -229,7 +229,7 @@ static int proc_ide_read_media(char *page, char **start, off_t off, int count, return len; } -static void make_ide_entries(char *dev_name) +static void make_ide_entries(const char *dev_name) { struct proc_dir_entry *dir, *ent; char name[64]; @@ -244,7 +244,7 @@ static void make_ide_entries(char *dev_name) ent->data = NULL; ent->read_proc = proc_ide_read_media; ent->write_proc = NULL; - sprintf(name,"ide0/%s", dev_name); + snprintf(name, sizeof(name), "ide0/%s", dev_name); proc_symlink(dev_name, proc_ide_root, name); } @@ -440,7 +440,7 @@ __uml_help(ubd_setup, "an 's' will cause data to be written to disk on the host immediately.\n\n" ); -static int udb_setup(char *str) +static int udb_setup(const char *str) { printk("udb%s specified on command line is almost certainly a ubd -> " "udb TYPO\n", str); diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h index 74ce8e5..aa27eb0 100644 --- a/arch/um/include/kern_util.h +++ b/arch/um/include/kern_util.h @@ -81,7 +81,7 @@ extern void do_uml_exitcalls(void); extern int attach_debugger(int idle_pid, int pid, int stop); extern int config_gdb(char *str); extern int remove_gdb(void); -extern char *uml_strdup(char *string); +extern char *uml_strdup(const char *string); extern void unprotect_kernel_mem(void); extern void protect_kernel_mem(void); extern void uml_cleanup(void); diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 59822de..9edde52 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -65,7 +65,7 @@ static void setup_highmem(unsigned long highmem_start, void __init mem_init(void) { /* clear the zero-page */ - memset((void *) empty_zero_page, 0, PAGE_SIZE); + memset(empty_zero_page, 0, PAGE_SIZE); /* Map in the area just after the brk now that kmalloc is about * to be turned on. diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 0eae00b..35849b5 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -60,8 +60,6 @@ unsigned long alloc_stack(int order, int atomic) if (atomic) flags = GFP_ATOMIC; page = __get_free_pages(flags, order); - if (page == 0) - return 0; return page; } @@ -331,7 +329,7 @@ void do_uml_exitcalls(void) (*call)(); } -char *uml_strdup(char *string) +char *uml_strdup(const char *string) { return kstrdup(string, GFP_KERNEL); } diff --git a/arch/um/os-Linux/drivers/tuntap_user.c b/arch/um/os-Linux/drivers/tuntap_user.c index 6c55d3c..2f0055b 100644 --- a/arch/um/os-Linux/drivers/tuntap_user.c +++ b/arch/um/os-Linux/drivers/tuntap_user.c @@ -148,7 +148,7 @@ static int tuntap_open(void *data) memset(&ifr, 0, sizeof(ifr)); ifr.ifr_flags = IFF_TAP | IFF_NO_PI; strlcpy(ifr.ifr_name, pri->dev_name, sizeof(ifr.ifr_name)); - if (ioctl(pri->fd, TUNSETIFF, (void *) &ifr) < 0) { + if (ioctl(pri->fd, TUNSETIFF, &ifr) < 0) { err = -errno; printk(UM_KERN_ERR "TUNSETIFF failed, errno = %d\n", errno); diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c index 436f8d2..ee13060 100644 --- a/arch/um/os-Linux/mem.c +++ b/arch/um/os-Linux/mem.c @@ -30,7 +30,7 @@ static char *tempdir = NULL; static void __init find_tempdir(void) { - char *dirs[] = { "TMP", "TEMP", "TMPDIR", NULL }; + const char *dirs[] = { "TMP", "TEMP", "TMPDIR", NULL }; int i; char *dir = NULL; @@ -59,9 +59,10 @@ static void __init find_tempdir(void) * read the file as needed. If there's an error, -errno is returned; * if the end of the file is reached, 0 is returned. */ -static int next(int fd, char *buf, int size, char c) +static int n
[uml-devel] UML defconfig building failed again
Hi, Jeff! I used today's linus-tree and defconfig to compile uml, but it failed. Error messages are things like: In file included from include/asm/processor-generic.h:13, from include/asm/processor.h:77, from include/asm/thread_info.h:11, from include/linux/thread_info.h:21, from include/linux/preempt.h:9, from include/linux/spinlock.h:49, from include/linux/seqlock.h:29, from include/linux/time.h:8, from include/linux/timex.h:57, from include/linux/sched.h:53, from arch/um/include/sysdep/kernel-offsets.h:2, from arch/um/kernel/asm-offsets.c:1: include/asm/ptrace.h:50: warning: ‘struct user_fxsr_struct’ declared inside parameter list include/asm/ptrace.h:50: warning: its scope is only this definition or declaration, which is probably not what you want include/asm/ptrace.h:52: warning: ‘struct user_fxsr_struct’ declared inside parameter list In file included from include/linux/timer.h:5, from include/linux/sched.h:87, from arch/um/include/sysdep/kernel-offsets.h:2, from arch/um/kernel/asm-offsets.c:1: include/linux/ktime.h: In function ‘ktime_set’: include/linux/ktime.h:84: warning: comparison is always false due to limited range of data type {snip} It seems like CONFIG_X86_32 was not set. Any ideas? Thanks. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] UML: building error fix
include/asm-um/arch points to the non-existed include/asm-i386 directory. This patch fixed it. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Jeff Dike <[EMAIL PROTECTED]> --- diff --git a/arch/um/Makefile b/arch/um/Makefile index 31999bc..ba6813a 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -168,7 +168,7 @@ ifneq ($(KBUILD_SRC),) $(Q)mkdir -p $(objtree)/include/asm-um $(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) include/asm-um/arch else - $(Q)cd $(TOPDIR)/include/asm-um && ln -fsn ../asm-$(SUBARCH) arch + $(Q)cd $(TOPDIR)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch endif $(objtree)/$(ARCH_DIR)/include: - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [PATCH] Keep UML Kconfig in sync with x86
On Mon, Nov 19, 2007 at 02:02:24PM -0500, Jeff Dike wrote: >Fix a 2.6.24-rc3 UML build breakage introduced by commit >1032c0ba9da5c5b53173ad2dcf8b2a2da78f8b17 - it introduces X86_32, with >many things which UML needs depending on it. > >This patch adds definitions of X86_32 and RWSEM_XCHGADD_ALGORITHM to >the UML/i386 Kconfig. > >Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Tested-by: WANG Cong <[EMAIL PROTECTED]> Thanks, Jeff. With this and that patch[1], uml building works fine. ;) [1] http://lkml.org/lkml/2007/11/15/231 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] uml doesn't work on 2.6.24-rc2
On Fri, Nov 23, 2007 at 11:54:41AM +0100, Jiri Olsa wrote: >Hi, > >after applying following changes, the mainline is working for me. > Hi, I have already mentioned this. Follow this link[1]. ;^) [1] http://lkml.org/lkml/2007/11/20/10 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles
TOPDIR is obsolete, use objtree instead. This patch removes TOPDIR from all UML Makefiles. Cc: Jeff Dike <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/um/Makefile b/arch/um/Makefile index ba6813a..57491af 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -158,7 +158,7 @@ ifneq ($(KBUILD_SRC),) $(Q)mkdir -p $(objtree)/include/asm-um $(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@ else - $(Q)cd $(TOPDIR)/$(dir $@) ; \ + $(Q)cd $(objtree)/$(dir $@) ; \ ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@) endif @@ -168,7 +168,7 @@ ifneq ($(KBUILD_SRC),) $(Q)mkdir -p $(objtree)/include/asm-um $(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) include/asm-um/arch else - $(Q)cd $(TOPDIR)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch + $(Q)cd $(objtree)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch endif $(objtree)/$(ARCH_DIR)/include: diff --git a/arch/um/sys-ppc/Makefile b/arch/um/sys-ppc/Makefile index a9814a7..a3cfae7 100644 --- a/arch/um/sys-ppc/Makefile +++ b/arch/um/sys-ppc/Makefile @@ -6,7 +6,7 @@ OBJ = built-in.o OBJS = ptrace.o sigcontext.o semaphore.o checksum.o miscthings.o misc.o \ ptrace_user.o sysrq.o -EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(TOPDIR)/arch/ppc/kernel +EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(objtree)/arch/ppc/kernel all: $(OBJ) @@ -22,25 +22,25 @@ sigcontext.o: sigcontext.c semaphore.c: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ + ln -s $(objtree)/arch/ppc/kernel/$@ $@ checksum.S: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/lib/$@ $@ + ln -s $(objtree)/arch/ppc/lib/$@ $@ mk_defs.c: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ + ln -s $(objtree)/arch/ppc/kernel/$@ $@ ppc_defs.head: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ + ln -s $(objtree)/arch/ppc/kernel/$@ $@ ppc_defs.h: mk_defs.c ppc_defs.head \ - $(TOPDIR)/include/asm-ppc/mmu.h \ - $(TOPDIR)/include/asm-ppc/processor.h \ - $(TOPDIR)/include/asm-ppc/pgtable.h \ - $(TOPDIR)/include/asm-ppc/ptrace.h + $(objtree)/include/asm-ppc/mmu.h \ + $(objtree)/include/asm-ppc/processor.h \ + $(objtree)/include/asm-ppc/pgtable.h \ + $(objtree)/include/asm-ppc/ptrace.h # $(CC) $(CFLAGS) -S mk_defs.c cp ppc_defs.head ppc_defs.h # for bk, this way we can write to the file even if it's not checked out @@ -56,13 +56,13 @@ ppc_defs.h: mk_defs.c ppc_defs.head \ checksum.o: checksum.S rm -f asm - ln -s $(TOPDIR)/include/asm-ppc asm + ln -s $(objtree)/include/asm-ppc asm $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o rm -f asm misc.o: misc.S ppc_defs.h rm -f asm - ln -s $(TOPDIR)/include/asm-ppc asm + ln -s $(objtree)/include/asm-ppc asm $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o rm -f asm diff --git a/arch/x86/Makefile_32 b/arch/x86/Makefile_32 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] (Try #2) [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles
On Tue, Jan 01, 2008 at 11:49:42AM +0100, Sam Ravnborg wrote: >On Tue, Jan 01, 2008 at 11:33:42AM +0100, Sam Ravnborg wrote: >> On Tue, Jan 01, 2008 at 03:18:46PM +0800, WANG Cong wrote: >> > >> > TOPDIR is obsolete, use objtree instead. >> > This patch removes TOPDIR from all UML Makefiles. >> > >> >> I do not feel confident with these changes. >> In some places I had expected to see srctree and not objtree. >> I would like to see this tested before applying it. >> >> Building a ppc toolchain now to test it... > >It seems that building a ppc based um kernel is not supported >in mainline. >Kconfig.ppc is missing and when creating it um build fails >in sys-ppc/ due to user-offset.c is missing. > >As most of your patch touches ppc specific code I suggest >to just replace TOPDIR with srctree all over (no semantic change) >and the the um people can figure out the ppc stuff when they get to it. You're right. I use srctree instead. And tested with: $ make O=../foobar/ ARCH=um linux It works fine. Thanks for your points! > TOPDIR is obsolete, use srctree instead. This patch removes TOPDIR from all UML Makefiles. Cc: Jeff Dike <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/um/Makefile b/arch/um/Makefile index ba6813a..08a2865 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -158,7 +158,7 @@ ifneq ($(KBUILD_SRC),) $(Q)mkdir -p $(objtree)/include/asm-um $(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@ else - $(Q)cd $(TOPDIR)/$(dir $@) ; \ + $(Q)cd $(srctree)/$(dir $@) ; \ ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@) endif @@ -168,7 +168,7 @@ ifneq ($(KBUILD_SRC),) $(Q)mkdir -p $(objtree)/include/asm-um $(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) include/asm-um/arch else - $(Q)cd $(TOPDIR)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch + $(Q)cd $(srctree)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch endif $(objtree)/$(ARCH_DIR)/include: diff --git a/arch/um/sys-ppc/Makefile b/arch/um/sys-ppc/Makefile index a9814a7..0890152 100644 --- a/arch/um/sys-ppc/Makefile +++ b/arch/um/sys-ppc/Makefile @@ -6,7 +6,7 @@ OBJ = built-in.o OBJS = ptrace.o sigcontext.o semaphore.o checksum.o miscthings.o misc.o \ ptrace_user.o sysrq.o -EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(TOPDIR)/arch/ppc/kernel +EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(srctree)/arch/ppc/kernel all: $(OBJ) @@ -22,25 +22,25 @@ sigcontext.o: sigcontext.c semaphore.c: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ + ln -s $(srctree)/arch/ppc/kernel/$@ $@ checksum.S: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/lib/$@ $@ + ln -s $(srctree)/arch/ppc/lib/$@ $@ mk_defs.c: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ + ln -s $(srctree)/arch/ppc/kernel/$@ $@ ppc_defs.head: rm -f $@ - ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@ + ln -s $(srctree)/arch/ppc/kernel/$@ $@ ppc_defs.h: mk_defs.c ppc_defs.head \ - $(TOPDIR)/include/asm-ppc/mmu.h \ - $(TOPDIR)/include/asm-ppc/processor.h \ - $(TOPDIR)/include/asm-ppc/pgtable.h \ - $(TOPDIR)/include/asm-ppc/ptrace.h + $(srctree)/include/asm-ppc/mmu.h \ + $(srctree)/include/asm-ppc/processor.h \ + $(srctree)/include/asm-ppc/pgtable.h \ + $(srctree)/include/asm-ppc/ptrace.h # $(CC) $(CFLAGS) -S mk_defs.c cp ppc_defs.head ppc_defs.h # for bk, this way we can write to the file even if it's not checked out @@ -56,13 +56,13 @@ ppc_defs.h: mk_defs.c ppc_defs.head \ checksum.o: checksum.S rm -f asm - ln -s $(TOPDIR)/include/asm-ppc asm + ln -s $(srctree)/include/asm-ppc asm $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o rm -f asm misc.o: misc.S ppc_defs.h rm -f asm - ln -s $(TOPDIR)/include/asm-ppc asm + ln -s $(srctree)/include/asm-ppc asm $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o rm -f asm - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [-mm Patch] uml: fix a building error
This patch fixes this building error: ... drivers/char/mem.c: In function ‘read_mem’: drivers/char/mem.c:136: error: implicit declaration of function ‘unxlate_dev_mem_ptr’ ... Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- Index: linux/include/asm-um/io.h === --- linux.orig/include/asm-um/io.h +++ linux/include/asm-um/io.h @@ -27,6 +27,7 @@ static inline void * phys_to_virt(unsign * access */ #define xlate_dev_mem_ptr(p) __va(p) +#define unxlate_dev_mem_ptr(p, ptr) /* * Convert a virtual cached pointer to an uncached pointer - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [-mm Patch] UML: fix a building error
On Thu, Jan 17, 2008 at 02:35:14AM -0800, Andrew Morton wrote: > >ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.24-rc8/2.6.24-rc8-mm1/ > Hi, Andrew! Building uml failed in current -mm tree. ;( The below patch fixes this building error: ... include/asm/arch/system.h:8:22: error: asm/nops.h: No such file or directory ... Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- Index: linux/include/asm-um/nops.h === --- /dev/null +++ linux/include/asm-um/nops.h @@ -0,0 +1,6 @@ +#ifndef __UM_NOPS_H +#define __UM_NOPS_H + +#include "asm/arch/nops.h" + +#endif - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [git Patch] UML: a build error fix
This patch fixed this error: arch/um/kernel/skas/syscall.c: In function 'handle_syscall': arch/um/kernel/skas/syscall.c:33: error: 'NR_syscalls' undeclared (first use in this function) arch/um/kernel/skas/syscall.c:33: error: (Each undeclared identifier is reported only once arch/um/kernel/skas/syscall.c:33: error: for each function it appears in.) make[2]: *** [arch/um/kernel/skas/syscall.o] Error 1 make[1]: *** [arch/um/kernel/skas] Error 2 make: *** [arch/um/kernel] Error 2 Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/um/include/sysdep-i386/kernel-offsets.h b/arch/um/include/sysdep-i386/kernel-offsets.h index 5868526..da820d2 100644 --- a/arch/um/include/sysdep-i386/kernel-offsets.h +++ b/arch/um/include/sysdep-i386/kernel-offsets.h @@ -15,7 +15,11 @@ #define OFFSET(sym, str, mem) \ DEFINE(sym, offsetof(struct str, mem)); +static char syscalls[] = { +#include +}; void foo(void) { #include +DEFINE(UM_NR_syscall_max, sizeof(syscalls) - 1); } diff --git a/arch/um/include/sysdep-i386/syscalls.h b/arch/um/include/sysdep-i386/syscalls.h index 57bd79e..fb1fd94 100644 --- a/arch/um/include/sysdep-i386/syscalls.h +++ b/arch/um/include/sysdep-i386/syscalls.h @@ -5,6 +5,7 @@ #include "asm/unistd.h" #include "sysdep/ptrace.h" +#include "kern_constants.h" typedef long syscall_handler_t(struct pt_regs); @@ -23,3 +24,6 @@ extern syscall_handler_t *sys_call_table[]; extern long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff); + +#define NR_syscalls (UM_NR_syscall_max + 1) + - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] arch/um/include/init.h: Fix missing macro definitions
This patch fixed the following build error in current -git tree. arch/um/kernel/config.c:10: error: expected declaration specifiers or '...' before '.' token ... Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/um/include/init.h b/arch/um/include/init.h index cebc6ca..70982e1 100644 --- a/arch/um/include/init.h +++ b/arch/um/include/init.h @@ -40,6 +40,18 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); +#ifndef __section +# define __section(S) __attribute__ ((__section__(#S))) +#endif + +#ifndef __used +#if __GNUC__ == 3 && __GNUC_MINOR__ == 2 +# define __used __attribute__((__unused__)) +#else +# define __used __attribute__((__used__)) +#endif +#endif + /* These are for everybody (although not all archs will actually discard it in modules) */ #define __init __section(.init.text) - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [-mm Patch] arch/um/kernel/mem.c: fix a shadowed variable
Fix a shadowed variable in arch/um/kernel/mem.c, since there is a global variable has the same name. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- Index: linux/arch/um/kernel/mem.c === --- linux.orig/arch/um/kernel/mem.c +++ linux/arch/um/kernel/mem.c @@ -299,7 +299,7 @@ void show_mem(void) { int pfn, total = 0, reserved = 0; int shared = 0, cached = 0; - int highmem = 0; + int high_mem = 0; struct page *page; printk(KERN_INFO "Mem-info:\n"); @@ -311,7 +311,7 @@ void show_mem(void) page = pfn_to_page(pfn); total++; if (PageHighMem(page)) - highmem++; + high_mem++; if (PageReserved(page)) reserved++; else if (PageSwapCache(page)) @@ -320,7 +320,7 @@ void show_mem(void) shared += page_count(page) - 1; } printk(KERN_INFO "%d pages of RAM\n", total); - printk(KERN_INFO "%d pages of HIGHMEM\n", highmem); + printk(KERN_INFO "%d pages of HIGHMEM\n", high_mem); printk(KERN_INFO "%d reserved pages\n", reserved); printk(KERN_INFO "%d pages shared\n", shared); printk(KERN_INFO "%d pages swap cached\n", cached); - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [-mm Patch] arch/um/kernel/initrd.c: fix a missed conversion specifier
Fix a missed conversion specifier of a printk in arch/um/kernel/initrd.c. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Jeff Dike <[EMAIL PROTECTED]> --- Index: linux/arch/um/kernel/initrd.c === --- linux.orig/arch/um/kernel/initrd.c +++ linux/arch/um/kernel/initrd.c @@ -32,7 +32,7 @@ static int __init read_initrd(void) * ask for no memory. */ if (size == 0) { - printk(KERN_ERR "\"%\" is a zero-size initrd\n"); + printk(KERN_ERR "\"%s\" is a zero-size initrd\n", initrd); return 0; } - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] arch/um/kernel/um_arch.c: some small improvements
Make some small improvements for arch/um/kernel/um_arch.c. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: Jeff Dike <[EMAIL PROTECTED]> --- diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index a6c1dd1..56deed6 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -115,7 +115,7 @@ static int have_root __initdata = 0; /* Set in uml_mem_setup and modified in linux_main */ long long physmem_size = 32 * 1024 * 1024; -static char *usage_string = +static const char *usage_string = "User Mode Linux v%s\n" " available at http://user-mode-linux.sourceforge.net/\n\n";; @@ -202,7 +202,7 @@ static void __init uml_checksetup(char *line, int *add) p = &__uml_setup_start; while (p < &__uml_setup_end) { - int n; + size_t n; n = strlen(p->str); if (!strncmp(line, p->str, n) && p->setup_func(line + n, add)) @@ -258,7 +258,8 @@ int __init linux_main(int argc, char **argv) { unsigned long avail, diff; unsigned long virtmem_size, max_physmem; - unsigned int i, add; + unsigned int i; + int add; char * mode; for (i = 1; i < argc; i++) { - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [PATCH] uml: use DIV_ROUND_UP
From: Jiri Olsa <[EMAIL PROTECTED]> Subject: [PATCH] uml: use DIV_ROUND_UP Date: Tue, 19 Feb 2008 22:49:33 +0100 Message-ID: <[EMAIL PROTECTED]> > Hi, > > I just saw similar patches in the janitor kernel's list, > and spotted place it fits. > > Signed-off-by: Jiri Olsa <[EMAIL PROTECTED]> > --- > arch/um/drivers/ubd_kern.c |3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c > index b1a77b1..1e579e4 100644 > --- a/arch/um/drivers/ubd_kern.c > +++ b/arch/um/drivers/ubd_kern.c > @@ -1020,8 +1020,7 @@ static void cowify_bitmap(__u64 io_offset, int length, > unsigned long *cow_mask, >* by one word. Thanks to Lynn Kerby for the fix and James McMechan >* for the original diagnosis. >*/ > - if(*cow_offset == ((bitmap_len + sizeof(unsigned long) - 1) / > -sizeof(unsigned long) - 1)) > + if(*cow_offset == (DIV_ROUND_UP(bitmap_len, sizeof(unsigned long)) - 1)) Looks good for me. ACK. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [PATCH] arch/um/os-Linux/start_up.c: various improvements.
This patch - lets ptrace_child become void - adds checking for the return value of change_sig - moves errors info into stderr instead of stdout. Cc: [EMAIL PROTECTED] Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/os-Linux/start_up.c | 14 ++ 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c index b616e15..997d019 100644 --- a/arch/um/os-Linux/start_up.c +++ b/arch/um/os-Linux/start_up.c @@ -25,15 +25,15 @@ #include "registers.h" #include "skas_ptrace.h" -static int ptrace_child(void) +static void ptrace_child(void) { int ret; /* Calling os_getpid because some libcs cached getpid incorrectly */ int pid = os_getpid(), ppid = getppid(); int sc_result; - change_sig(SIGWINCH, 0); - if (ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) { + if (change_sig(SIGWINCH, 0) < 0 || + ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) { perror("ptrace"); kill(pid, SIGKILL); } @@ -75,9 +75,8 @@ static void fatal(char *fmt, ...) va_list list; va_start(list, fmt); - vprintf(fmt, list); + vfprintf(stderr, fmt, list); va_end(list); - fflush(stdout); exit(1); } @@ -87,9 +86,8 @@ static void non_fatal(char *fmt, ...) va_list list; va_start(list, fmt); - vprintf(fmt, list); + vfprintf(stderr, fmt, list); va_end(list); - fflush(stdout); } static int start_ptraced_child(void) @@ -495,7 +493,7 @@ int __init parse_iomem(char *str, int *add) driver = str; file = strchr(str,','); if (file == NULL) { - printf("parse_iomem : failed to parse iomem\n"); + fprintf(stderr, "parse_iomem : failed to parse iomem\n"); goto out; } *file = '\0'; -- 1.5.2.4 - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] arch/um/os-Linux/main.c: Fix memory leaks.
This patch fixes possible memory leaks in the main() function of arch/um/os-Linux/main.c. Cc: [EMAIL PROTECTED] Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- Index: linux-2.6/arch/um/os-Linux/main.c === --- linux-2.6.orig/arch/um/os-Linux/main.c +++ linux-2.6/arch/um/os-Linux/main.c @@ -113,14 +113,10 @@ static void setup_env_path(void) extern void scan_elf_aux( char **envp); -int __init main(int argc, char **argv, char **envp) +static char** dup_argv(int argc, char **argv) { + int i; char **new_argv; - int ret, i, err; - - set_stklim(); - - setup_env_path(); new_argv = malloc((argc + 1) * sizeof(char *)); if (new_argv == NULL) { @@ -135,6 +131,28 @@ int __init main(int argc, char **argv, c } } new_argv[argc] = NULL; + return new_argv; +} + +static void free_argv(int argc, char **argv) +{ + int i; + for (i = 0; i < argc; i++) { + free(argv[i]); + } + free(argv); +} + +int __init main(int argc, char **argv, char **envp) +{ + char **new_argv; + int ret, i, err; + + set_stklim(); + + setup_env_path(); + + new_argv = dup_argv(argc, argv); /* * Allow these signals to bring down a UML if all other @@ -185,6 +203,7 @@ int __init main(int argc, char **argv, c perror("Failed to exec kernel"); ret = 1; } + free_argv(argc, new_argv); printf("\n"); return uml_exitcode; } - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [Patch] arch/um/os-Linux/main.c: Fix memory leaks.
From: Jeff Dike <[EMAIL PROTECTED]> Date: Fri, 4 Apr 2008 11:49:01 -0400 > On Tue, Apr 01, 2008 at 11:06:41PM +0800, WANG Cong wrote: > > > > This patch fixes possible memory leaks in the main() function of > > arch/um/os-Linux/main.c. > > I'm somewhat dubious about this - the memory is freed immediately > before exiting, making this patch have no practical effect. > I think all memory leaks indicate our logic is not right, although this one maybe harmless. - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] arch/um/os-Linux/sys-i386/task_size.c: improve a bit
Improve this code a bit: check sigaction's return value and remove a useless fflush(). Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/um/os-Linux/sys-i386/task_size.c b/arch/um/os-Linux/sys-i386/task_size.c index 48d211b..2b5bba5 100644 --- a/arch/um/os-Linux/sys-i386/task_size.c +++ b/arch/um/os-Linux/sys-i386/task_size.c @@ -88,7 +88,10 @@ unsigned long os_get_task_size(void) sa.sa_handler = segfault; sigemptyset(&sa.sa_mask); sa.sa_flags = SA_NODEFER; - sigaction(SIGSEGV, &sa, &old); + if (sigaction(SIGSEGV, &sa, &old)) { + perror("os_get_task_size"); + exit(1); + } if (!page_ok(bottom)) { fprintf(stderr, "Address 0x%x no good?\n", @@ -110,11 +113,12 @@ unsigned long os_get_task_size(void) out: /* Restore the old SIGSEGV handling */ - sigaction(SIGSEGV, &old, NULL); - + if (sigaction(SIGSEGV, &old, NULL)) { + perror("os_get_task_size"); + exit(1); + } top <<= UM_KERN_PAGE_SHIFT; printf("0x%x\n", top); - fflush(stdout); return top; } - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] uml: compile error fix
This patch fixes this error: CC arch/um/kernel/smp.o In file included from /home/wangcong/projects/linux-2.6/arch/um/kernel/smp.c:9: include2/asm/tlb.h: In function ‘tlb_remove_page’: include2/asm/tlb.h:101: error: implicit declaration of function ‘page_cache_release’ make[2]: *** [arch/um/kernel/smp.o] Error 1 make[1]: *** [arch/um/kernel] Error 2 make: *** [sub-make] Error 2 And since including in will break sparc, we add this #include in uml's own header. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/include/asm-um/tlb.h b/include/asm-um/tlb.h index 39fc475..5240fa1 100644 --- a/include/asm-um/tlb.h +++ b/include/asm-um/tlb.h @@ -1,6 +1,7 @@ #ifndef __UM_TLB_H #define __UM_TLB_H +#include #include #include #include - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] UML: Make a function static
arch/um/drivers/chan_kern.c::open_chan() can become static. Compile testing passed. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/drivers/chan_kern.c |2 +- arch/um/include/chan_kern.h |1 - 2 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index db3082b..de22a10 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c @@ -125,7 +125,7 @@ static int open_one_chan(struct chan *chan) return 0; } -int open_chan(struct list_head *chans) +static int open_chan(struct list_head *chans) { struct list_head *ele; struct chan *chan; diff --git a/arch/um/include/chan_kern.h b/arch/um/include/chan_kern.h index 624b510..de5f697 100644 --- a/arch/um/include/chan_kern.h +++ b/arch/um/include/chan_kern.h @@ -31,7 +31,6 @@ extern void chan_interrupt(struct list_head *chans, struct delayed_work *task, struct tty_struct *tty, int irq); extern int parse_chan_pair(char *str, struct line *line, int device, const struct chan_opts *opts, char **error_out); -extern int open_chan(struct list_head *chans); extern int write_chan(struct list_head *chans, const char *buf, int len, int write_irq); extern int console_write_chan(struct list_head *chans, const char *buf, -- 1.5.2.4 - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] UML: Remove a useless function
arch/um/drivers/chan_kern.c::chan_out_fd() is not used by anyone. Remove it. Compile testing passed. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/drivers/chan_kern.c | 13 - arch/um/include/chan_kern.h |1 - 2 files changed, 0 insertions(+), 14 deletions(-) diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index de22a10..6e51424 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c @@ -583,19 +583,6 @@ int parse_chan_pair(char *str, struct line *line, int device, return 0; } -int chan_out_fd(struct list_head *chans) -{ - struct list_head *ele; - struct chan *chan; - - list_for_each(ele, chans) { - chan = list_entry(ele, struct chan, list); - if (chan->primary && chan->output) - return chan->fd; - } - return -1; -} - void chan_interrupt(struct list_head *chans, struct delayed_work *task, struct tty_struct *tty, int irq) { diff --git a/arch/um/include/chan_kern.h b/arch/um/include/chan_kern.h index de5f697..1e65145 100644 --- a/arch/um/include/chan_kern.h +++ b/arch/um/include/chan_kern.h @@ -44,7 +44,6 @@ extern void close_chan(struct list_head *chans, int delay_free_irq); extern int chan_window_size(struct list_head *chans, unsigned short *rows_out, unsigned short *cols_out); -extern int chan_out_fd(struct list_head *chans); extern int chan_config_string(struct list_head *chans, char *str, int size, char **error_out); -- 1.5.2.4 - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] UML: Make three functions static
Make the following three functions static, since they don't need to be global. arch/um/drivers/mcast_kern.c::mcast_setup() arch/um/drivers/mconsole_user.c::mconsole_reply_v0() arch/um/drivers/port_user.c::port_pre_exec() Compile testing passed. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/drivers/mcast_kern.c|2 +- arch/um/drivers/mconsole_user.c |2 +- arch/um/drivers/port_user.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/um/drivers/mcast_kern.c b/arch/um/drivers/mcast_kern.c index 822092f..8c4378a 100644 --- a/arch/um/drivers/mcast_kern.c +++ b/arch/um/drivers/mcast_kern.c @@ -58,7 +58,7 @@ static const struct net_kern_info mcast_kern_info = { .write = mcast_write, }; -int mcast_setup(char *str, char **mac_out, void *data) +static int mcast_setup(char *str, char **mac_out, void *data) { struct mcast_init *init = data; char *port_str = NULL, *ttl_str = NULL, *remain; diff --git a/arch/um/drivers/mconsole_user.c b/arch/um/drivers/mconsole_user.c index 13af2f0..f8cf4c8 100644 --- a/arch/um/drivers/mconsole_user.c +++ b/arch/um/drivers/mconsole_user.c @@ -39,7 +39,7 @@ static struct mconsole_command commands[] = { /* Initialized in mconsole_init, which is an initcall */ char mconsole_socket_name[256]; -int mconsole_reply_v0(struct mc_request *req, char *reply) +static int mconsole_reply_v0(struct mc_request *req, char *reply) { struct iovec iov; struct msghdr msg; diff --git a/arch/um/drivers/port_user.c b/arch/um/drivers/port_user.c index addd759..d269ca3 100644 --- a/arch/um/drivers/port_user.c +++ b/arch/um/drivers/port_user.c @@ -153,7 +153,7 @@ struct port_pre_exec_data { int pipe_fd; }; -void port_pre_exec(void *arg) +static void port_pre_exec(void *arg) { struct port_pre_exec_data *data = arg; -- 1.5.2.4 - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] UML: Fix another build error
This patch fixes the following build error. CC arch/um/drivers/mconsole_kern.o /home/wangcong/projects/linux-2.6/arch/um/drivers/mconsole_kern.c:337: error: redefinition of ‘mconsole_register_dev’ /home/wangcong/projects/linux-2.6/arch/um/include/mconsole_kern.h:47: error: previous definition of ‘mconsole_register_dev’ was here make[2]: *** [arch/um/drivers/mconsole_kern.o] Error 1 make[1]: *** [arch/um/drivers/mconsole_kern.ko] Error 2 make: *** [sub-make] Error 2 Compile testing passed. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/drivers/mconsole_kern.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index 19d579d..e94ccb8 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c @@ -330,9 +330,12 @@ void mconsole_stop(struct mc_request *req) mconsole_reply(req, "", 0, 0); } -static DEFINE_SPINLOCK(mc_devices_lock); static LIST_HEAD(mconsole_devices); +#ifdef CONFIG_MCONSOLE + +static DEFINE_SPINLOCK(mc_devices_lock); + void mconsole_register_dev(struct mc_device *new) { spin_lock(&mc_devices_lock); @@ -340,6 +343,7 @@ void mconsole_register_dev(struct mc_device *new) list_add(&new->list, &mconsole_devices); spin_unlock(&mc_devices_lock); } +#endif static struct mc_device *mconsole_find_dev(char *name) { -- 1.5.2.4 - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] UML: Make several things static.
Make several things static, because they no longer need to be global. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/drivers/net_kern.c |6 +++--- arch/um/drivers/slip_kern.c |4 ++-- arch/um/drivers/stdio_console.c |4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index 1d43bdf..5b4ca8d 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c @@ -116,7 +116,7 @@ static void uml_dev_close(struct work_struct *work) dev_close(lp->dev); } -irqreturn_t uml_net_interrupt(int irq, void *dev_id) +static irqreturn_t uml_net_interrupt(int irq, void *dev_id) { struct net_device *dev = dev_id; struct uml_net_private *lp = dev->priv; @@ -296,7 +296,7 @@ static struct ethtool_ops uml_net_ethtool_ops = { .get_link = ethtool_op_get_link, }; -void uml_net_user_timer_expire(unsigned long _conn) +static void uml_net_user_timer_expire(unsigned long _conn) { #ifdef undef struct connection *conn = (struct connection *)_conn; @@ -786,7 +786,7 @@ static int uml_inetaddr_event(struct notifier_block *this, unsigned long event, } /* uml_net_init shouldn't be called twice on two CPUs at the same time */ -struct notifier_block uml_inetaddr_notifier = { +static struct notifier_block uml_inetaddr_notifier = { .notifier_call = uml_inetaddr_event, }; diff --git a/arch/um/drivers/slip_kern.c b/arch/um/drivers/slip_kern.c index 6b4a0f9..d19faec 100644 --- a/arch/um/drivers/slip_kern.c +++ b/arch/um/drivers/slip_kern.c @@ -13,7 +13,7 @@ struct slip_init { char *gate_addr; }; -void slip_init(struct net_device *dev, void *data) +static void slip_init(struct net_device *dev, void *data) { struct uml_net_private *private; struct slip_data *spri; @@ -57,7 +57,7 @@ static int slip_write(int fd, struct sk_buff *skb, struct uml_net_private *lp) (struct slip_data *) &lp->user); } -const struct net_kern_info slip_kern_info = { +static const struct net_kern_info slip_kern_info = { .init = slip_init, .protocol = slip_protocol, .read = slip_read, diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c index cec0c33..49266f6 100644 --- a/arch/um/drivers/stdio_console.c +++ b/arch/um/drivers/stdio_console.c @@ -34,7 +34,7 @@ static struct tty_driver *console_driver; -void stdio_announce(char *dev_name, int dev) +static void stdio_announce(char *dev_name, int dev) { printk(KERN_INFO "Virtual console %d assigned device '%s'\n", dev, dev_name); @@ -158,7 +158,7 @@ static struct console stdiocons = { .index = -1, }; -int stdio_init(void) +static int stdio_init(void) { char *new_title; -- 1.5.2.4 - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] UML: Clean up arch/um/drivers/ubd_kern.c
Make some global functions and variables static. And remove some useless declarations for local functions, since we just need to move their definitions ahead. Compile testing passed. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/drivers/ubd_kern.c | 379 +--- 1 files changed, 184 insertions(+), 195 deletions(-) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index be3a279..df5aa37 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -72,18 +72,6 @@ struct io_thread_req { int error; }; -extern int open_ubd_file(char *file, struct openflags *openflags, int shared, -char **backing_file_out, int *bitmap_offset_out, -unsigned long *bitmap_len_out, int *data_offset_out, -int *create_cow_out); -extern int create_cow_file(char *cow_file, char *backing_file, - struct openflags flags, int sectorsize, - int alignment, int *bitmap_offset_out, - unsigned long *bitmap_len_out, - int *data_offset_out); -extern int read_cow_bitmap(int fd, void *buf, int offset, int len); -extern void do_io(struct io_thread_req *req); - static inline int ubd_test_bit(__u64 bit, unsigned char *data) { __u64 n; @@ -200,7 +188,7 @@ struct ubd { } /* Protected by ubd_lock */ -struct ubd ubd_devs[MAX_DEV] = { [ 0 ... MAX_DEV - 1 ] = DEFAULT_UBD }; +static struct ubd ubd_devs[MAX_DEV] = { [ 0 ... MAX_DEV - 1 ] = DEFAULT_UBD }; /* Only changed by fake_ide_setup which is a setup */ static int fake_ide = 0; @@ -463,7 +451,7 @@ __uml_help(udb_setup, static void do_ubd_request(struct request_queue * q); /* Only changed by ubd_init, which is an initcall. */ -int thread_fd = -1; +static int thread_fd = -1; static void ubd_end_request(struct request *req, int bytes, int error) { @@ -531,7 +519,7 @@ static irqreturn_t ubd_intr(int irq, void *dev) /* Only changed by ubd_init, which is an initcall. */ static int io_pid = -1; -void kill_io_thread(void) +static void kill_io_thread(void) { if(io_pid != -1) os_kill_process(io_pid, 1); @@ -547,6 +535,186 @@ static inline int ubd_file_size(struct ubd *ubd_dev, __u64 *size_out) return os_file_size(file, size_out); } +static int read_cow_bitmap(int fd, void *buf, int offset, int len) +{ + int err; + + err = os_seek_file(fd, offset); + if(err < 0) + return err; + + err = os_read_file(fd, buf, len); + if(err < 0) + return err; + + return 0; +} + +static int backing_file_mismatch(char *file, __u64 size, time_t mtime) +{ + unsigned long modtime; + unsigned long long actual; + int err; + + err = os_file_modtime(file, &modtime); + if(err < 0){ + printk("Failed to get modification time of backing file " + "\"%s\", err = %d\n", file, -err); + return err; + } + + err = os_file_size(file, &actual); + if(err < 0){ + printk("Failed to get size of backing file \"%s\", " + "err = %d\n", file, -err); + return err; + } + + if(actual != size){ + /*__u64 can be a long on AMD64 and with %lu GCC complains; so +* the typecast.*/ + printk("Size mismatch (%llu vs %llu) of COW header vs backing " + "file\n", (unsigned long long) size, actual); + return -EINVAL; + } + if(modtime != mtime){ + printk("mtime mismatch (%ld vs %ld) of COW header vs backing " + "file\n", mtime, modtime); + return -EINVAL; + } + return 0; +} + +static int path_requires_switch(char *from_cmdline, char *from_cow, char *cow) +{ + struct uml_stat buf1, buf2; + int err; + + if(from_cmdline == NULL) + return 0; + if(!strcmp(from_cmdline, from_cow)) + return 0; + + err = os_stat_file(from_cmdline, &buf1); + if(err < 0){ + printk("Couldn't stat '%s', err = %d\n", from_cmdline, -err); + return 0; + } + err = os_stat_file(from_cow, &buf2); + if(err < 0){ + printk("Couldn't stat '%s', err = %d\n", from_cow, -err); + return 1; + } + if((buf1.ust_dev == buf2.ust_dev) && (buf1.ust_ino == buf2.ust_ino)) + return 0; + + printk("Backing file mismatch - \"%s\" requested,\n" + "\"%s\" specified i
Re: [uml-devel] [Patch] UML: Clean up arch/um/drivers/ubd_kern.c
From: Jeff Dike <[EMAIL PROTECTED]> Date: Tue, 15 Apr 2008 09:33:25 -0400 > On Mon, Apr 14, 2008 at 11:42:37PM -0700, Andrew Morton wrote: > > omg, when checkpatch bit into this patch my CPU melted. > > Yeah, I've been scared to do a checkpatch run over that file. I think > it's the only core file left in UML which hasn't been tidied. Sorry. Oh, I thought I have checked all the patch with checkpatch.pl, it seems that this one was missing. Sorry. ;( > > Drop this one, and I'll send a another one which at least is tidied up > around the changed areas. > Please feel free to do that. - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [Patch] UML: Fix another build error
From: Jeff Dike <[EMAIL PROTECTED]> Date: Mon, 14 Apr 2008 11:43:42 -0400 > On Sat, Apr 12, 2008 at 11:39:14PM +0800, WANG Cong wrote: > > > > This patch fixes the following build error. > > > > CC arch/um/drivers/mconsole_kern.o > > /home/wangcong/projects/linux-2.6/arch/um/drivers/mconsole_kern.c:337: > > error: redefinition of ‘mconsole_register_dev’ > > /home/wangcong/projects/linux-2.6/arch/um/include/mconsole_kern.h:47: > > error: previous definition of ‘mconsole_register_dev’ was here > > make[2]: *** [arch/um/drivers/mconsole_kern.o] Error 1 > > make[1]: *** [arch/um/drivers/mconsole_kern.ko] Error 2 > > make: *** [sub-make] Error 2 > > This one is fishy. For one thing, it looks like you reproduce this > with !CONFIG_MCONSOLE, but I just successfully built a > !CONFIG_MCONSOLE UML. > > Second, the arch/um/drivers/Makefile looks to me (and the build log > confirms) that mconsole_kern.c isn't compiled with !CONFIG_MCONSOLE. > > Third, you should ask yourself if there might be a deeper problem that > needs fixing if you find yourself putting #ifdef CONFIG_FOO in files > which implement FOO. Thanks for teaching this! I will try if it's possible to reproduce this. Cong - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [Patch] UML: Clean up arch/um/drivers/ubd_kern.c
From: Jeff Dike <[EMAIL PROTECTED]> Date: Wed, 16 Apr 2008 11:20:19 -0400 > On Wed, Apr 16, 2008 at 01:39:19PM +0800, WANG Cong wrote: > > From: Jeff Dike <[EMAIL PROTECTED]> > > Date: Tue, 15 Apr 2008 09:33:25 -0400 > > > On Mon, Apr 14, 2008 at 11:42:37PM -0700, Andrew Morton wrote: > > > > omg, when checkpatch bit into this patch my CPU melted. > > Here's a cleaned up version. > > Jeff Looks OK for me. Thank you! - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] arch/um/kernel/irq.c: clean up some functions
Make activate_fd() and free_irq_by_irq_and_dev() static. Remove init_aio_irq() since it has no users. Compile testing passed. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/include/irq_kern.h |2 -- arch/um/include/irq_user.h |2 -- arch/um/kernel/irq.c | 35 ++- 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/arch/um/include/irq_kern.h b/arch/um/include/irq_kern.h index 4f77559..fba3895 100644 --- a/arch/um/include/irq_kern.h +++ b/arch/um/include/irq_kern.h @@ -13,8 +13,6 @@ extern int um_request_irq(unsigned int irq, int fd, int type, irq_handler_t handler, unsigned long irqflags, const char * devname, void *dev_id); -extern int init_aio_irq(int irq, char *name, - irq_handler_t handler); #endif diff --git a/arch/um/include/irq_user.h b/arch/um/include/irq_user.h index e60b318..c6c784d 100644 --- a/arch/um/include/irq_user.h +++ b/arch/um/include/irq_user.h @@ -21,8 +21,6 @@ struct irq_fd { enum { IRQ_READ, IRQ_WRITE }; extern void sigio_handler(int sig, struct uml_pt_regs *regs); -extern int activate_fd(int irq, int fd, int type, void *dev_id); -extern void free_irq_by_irq_and_dev(unsigned int irq, void *dev_id); extern void free_irq_by_fd(int fd); extern void reactivate_fd(int fd, int irqnum); extern void deactivate_fd(int fd, int irqnum); diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 91587f8..3d7aad0 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -102,7 +102,7 @@ void sigio_handler(int sig, struct uml_pt_regs *regs) static DEFINE_SPINLOCK(irq_lock); -int activate_fd(int irq, int fd, int type, void *dev_id) +static int activate_fd(int irq, int fd, int type, void *dev_id) { struct pollfd *tmp_pfd; struct irq_fd *new_fd, *irq_fd; @@ -216,7 +216,7 @@ static int same_irq_and_dev(struct irq_fd *irq, void *d) return ((irq->irq == data->irq) && (irq->id == data->dev)); } -void free_irq_by_irq_and_dev(unsigned int irq, void *dev) +static void free_irq_by_irq_and_dev(unsigned int irq, void *dev) { struct irq_and_dev data = ((struct irq_and_dev) { .irq = irq, .dev = dev }); @@ -403,37 +403,6 @@ void __init init_IRQ(void) } } -int init_aio_irq(int irq, char *name, irq_handler_t handler) -{ - int fds[2], err; - - err = os_pipe(fds, 1, 1); - if (err) { - printk(KERN_ERR "init_aio_irq - os_pipe failed, err = %d\n", - -err); - goto out; - } - - err = um_request_irq(irq, fds[0], IRQ_READ, handler, -IRQF_DISABLED | IRQF_SAMPLE_RANDOM, name, -(void *) (long) fds[0]); - if (err) { - printk(KERN_ERR "init_aio_irq - : um_request_irq failed, " - "err = %d\n", - err); - goto out_close; - } - - err = fds[1]; - goto out; - - out_close: - os_close_file(fds[0]); - os_close_file(fds[1]); - out: - return err; -} - /* * IRQ stack entry and exit: * -- 1.5.2.4 - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] arch/um/kernel/mem.c: remove arch_validate()
Remove arch_validate(), because no one uses it. Remove useless macro HAVE_ARCH_VALIDATE. Make the variable 'empty_bad_page' static. Compile testing passed. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/kernel/ksyms.c |1 - arch/um/kernel/mem.c | 33 + include/asm-um/page.h |3 --- 3 files changed, 1 insertions(+), 36 deletions(-) diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c index 66e2a30..cc1b5f1 100644 --- a/arch/um/kernel/ksyms.c +++ b/arch/um/kernel/ksyms.c @@ -18,7 +18,6 @@ EXPORT_SYMBOL(get_signals); EXPORT_SYMBOL(kernel_thread); EXPORT_SYMBOL(sys_waitpid); EXPORT_SYMBOL(flush_tlb_range); -EXPORT_SYMBOL(arch_validate); EXPORT_SYMBOL(high_physmem); EXPORT_SYMBOL(empty_zero_page); diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 2eea1ff..88fc1c8 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -21,7 +21,7 @@ /* allocated in paging_init, zeroed in mem_init, and unchanged thereafter */ unsigned long *empty_zero_page = NULL; /* allocated in paging_init and unchanged thereafter */ -unsigned long *empty_bad_page = NULL; +static unsigned long *empty_bad_page = NULL; /* * Initialized during boot, and readonly for initializing page tables @@ -240,37 +240,6 @@ void __init paging_init(void) #endif } -struct page *arch_validate(struct page *page, gfp_t mask, int order) -{ - unsigned long addr, zero = 0; - int i; - - again: - if (page == NULL) - return page; - if (PageHighMem(page)) - return page; - - addr = (unsigned long) page_address(page); - for (i = 0; i < (1 << order); i++) { - current->thread.fault_addr = (void *) addr; - if (__do_copy_to_user((void __user *) addr, &zero, -sizeof(zero), -¤t->thread.fault_addr, -¤t->thread.fault_catcher)) { - if (!(mask & __GFP_WAIT)) - return NULL; - else break; - } - addr += PAGE_SIZE; - } - - if (i == (1 << order)) - return page; - page = alloc_pages(mask, order); - goto again; -} - /* * This can't do anything because nothing in the kernel image can be freed * since it's not in kernel physical memory. diff --git a/include/asm-um/page.h b/include/asm-um/page.h index 381f96b..4b489e3 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h @@ -114,9 +114,6 @@ extern unsigned long uml_physmem; #define pfn_valid(pfn) ((pfn) < max_mapnr) #define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) -extern struct page *arch_validate(struct page *page, gfp_t mask, int order); -#define HAVE_ARCH_VALIDATE - #include #include -- 1.5.2.4 - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] UML: make several things static
Make some variables and functions static, since they don't need to be global. And remove an unused function - arch/um/kernel/time.c::sched_clock(). Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/include/skas/skas.h |1 - arch/um/include/um_uaccess.h|1 - arch/um/kernel/physmem.c|2 +- arch/um/kernel/ptrace.c |2 +- arch/um/kernel/time.c |8 arch/um/kernel/uaccess.c|2 +- arch/um/os-Linux/sigio.c|2 +- arch/um/os-Linux/signal.c |2 +- arch/um/os-Linux/skas/process.c |2 +- arch/um/os-Linux/umid.c |2 +- arch/um/sys-i386/bugs.c |2 +- arch/um/sys-i386/checksum.S |5 ++--- arch/um/sys-i386/ldt.c |4 ++-- include/asm-um/ptrace-generic.h |3 --- 14 files changed, 12 insertions(+), 26 deletions(-) diff --git a/arch/um/include/skas/skas.h b/arch/um/include/skas/skas.h index b073f8a..64d2c74 100644 --- a/arch/um/include/skas/skas.h +++ b/arch/um/include/skas/skas.h @@ -16,7 +16,6 @@ extern int user_thread(unsigned long stack, int flags); extern void new_thread_handler(void); extern void handle_syscall(struct uml_pt_regs *regs); extern int new_mm(unsigned long stack); -extern void get_skas_faultinfo(int pid, struct faultinfo * fi); extern long execute_syscall_skas(void *r); extern unsigned long current_stub_stack(void); diff --git a/arch/um/include/um_uaccess.h b/arch/um/include/um_uaccess.h index 2b6fc8e..45c0499 100644 --- a/arch/um/include/um_uaccess.h +++ b/arch/um/include/um_uaccess.h @@ -34,7 +34,6 @@ extern int copy_to_user(void __user *to, const void *from, int n); extern int __do_copy_to_user(void *to, const void *from, int n, void **fault_addr, jmp_buf **fault_catcher); -extern void __do_copy(void *to, const void *from, int n); /* * strncpy_from_user: - Copy a NUL terminated string from userspace. diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index 9757085..a1a9090 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c @@ -185,7 +185,7 @@ unsigned long find_iomem(char *driver, unsigned long *len_out) return 0; } -int setup_iomem(void) +static int setup_iomem(void) { struct iomem_region *region = iomem_regions; unsigned long iomem_start = high_physmem + PAGE_SIZE; diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c index 47b57b4..15e8b7c 100644 --- a/arch/um/kernel/ptrace.c +++ b/arch/um/kernel/ptrace.c @@ -225,7 +225,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) return ret; } -void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs, +static void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs, int error_code) { struct siginfo info; diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index e066e84..353c174 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -12,14 +12,6 @@ #include "kern_util.h" #include "os.h" -/* - * Scheduler clock - returns current time in nanosec units. - */ -unsigned long long sched_clock(void) -{ - return (unsigned long long)jiffies_64 * (NSEC_PER_SEC / HZ); -} - void timer_handler(int sig, struct uml_pt_regs *regs) { unsigned long flags; diff --git a/arch/um/kernel/uaccess.c b/arch/um/kernel/uaccess.c index f0f4b04..dd33f04 100644 --- a/arch/um/kernel/uaccess.c +++ b/arch/um/kernel/uaccess.c @@ -12,7 +12,7 @@ #include #include "os.h" -void __do_copy(void *to, const void *from, int n) +static void __do_copy(void *to, const void *from, int n) { memcpy(to, from, n); } diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c index abf47a7..07705c1 100644 --- a/arch/um/os-Linux/sigio.c +++ b/arch/um/os-Linux/sigio.c @@ -523,7 +523,7 @@ static void tty_close(int master, int slave) printk(UM_KERN_CONT "No, enabling workaround\n"); } -void __init check_sigio(void) +static void __init check_sigio(void) { if ((access("/dev/ptmx", R_OK) < 0) && (access("/dev/ptyp0", R_OK) < 0)) { diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c index 3f1694b..1a3d233 100644 --- a/arch/um/os-Linux/signal.c +++ b/arch/um/os-Linux/signal.c @@ -125,7 +125,7 @@ void set_sigstack(void *sig_stack, int size) panic("enabling signal stack failed, errno = %d\n", errno); } -void (*handlers[_NSIG])(int sig, struct sigcontext *sc); +static void (*handlers[_NSIG])(int sig, struct sigcontext *sc); void handle_signal(int sig, struct sigcontext *sc) { diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index 1e8cba6..9ec0f2d 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c @@ -96,7 +96,7 @@ bad_wait: ext
Re: [uml-devel] [Patch] UML: make several things static
From: WANG Cong <[EMAIL PROTECTED]> Date: Thu, 24 Apr 2008 16:36:55 +0800 (CST) > > Make some variables and functions static, since they don't need > to be global. > > And remove an unused function - arch/um/kernel/time.c::sched_clock(). > Sorry, Andrew. I forgot to run checkpatch for this one. Please use the following one instead. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/include/skas/skas.h |1 - arch/um/include/um_uaccess.h|1 - arch/um/kernel/physmem.c|2 +- arch/um/kernel/ptrace.c |2 +- arch/um/kernel/time.c |8 arch/um/kernel/uaccess.c|2 +- arch/um/os-Linux/sigio.c|2 +- arch/um/os-Linux/signal.c |2 +- arch/um/os-Linux/skas/process.c |2 +- arch/um/os-Linux/umid.c |2 +- arch/um/sys-i386/bugs.c |2 +- arch/um/sys-i386/checksum.S |5 ++--- arch/um/sys-i386/ldt.c |4 ++-- include/asm-um/ptrace-generic.h |3 --- 14 files changed, 12 insertions(+), 26 deletions(-) diff --git a/arch/um/include/skas/skas.h b/arch/um/include/skas/skas.h index b073f8a..64d2c74 100644 --- a/arch/um/include/skas/skas.h +++ b/arch/um/include/skas/skas.h @@ -16,7 +16,6 @@ extern int user_thread(unsigned long stack, int flags); extern void new_thread_handler(void); extern void handle_syscall(struct uml_pt_regs *regs); extern int new_mm(unsigned long stack); -extern void get_skas_faultinfo(int pid, struct faultinfo * fi); extern long execute_syscall_skas(void *r); extern unsigned long current_stub_stack(void); diff --git a/arch/um/include/um_uaccess.h b/arch/um/include/um_uaccess.h index 2b6fc8e..45c0499 100644 --- a/arch/um/include/um_uaccess.h +++ b/arch/um/include/um_uaccess.h @@ -34,7 +34,6 @@ extern int copy_to_user(void __user *to, const void *from, int n); extern int __do_copy_to_user(void *to, const void *from, int n, void **fault_addr, jmp_buf **fault_catcher); -extern void __do_copy(void *to, const void *from, int n); /* * strncpy_from_user: - Copy a NUL terminated string from userspace. diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index 9757085..a1a9090 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c @@ -185,7 +185,7 @@ unsigned long find_iomem(char *driver, unsigned long *len_out) return 0; } -int setup_iomem(void) +static int setup_iomem(void) { struct iomem_region *region = iomem_regions; unsigned long iomem_start = high_physmem + PAGE_SIZE; diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c index 47b57b4..15e8b7c 100644 --- a/arch/um/kernel/ptrace.c +++ b/arch/um/kernel/ptrace.c @@ -225,7 +225,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) return ret; } -void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs, +static void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs, int error_code) { struct siginfo info; diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index e066e84..353c174 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -12,14 +12,6 @@ #include "kern_util.h" #include "os.h" -/* - * Scheduler clock - returns current time in nanosec units. - */ -unsigned long long sched_clock(void) -{ - return (unsigned long long)jiffies_64 * (NSEC_PER_SEC / HZ); -} - void timer_handler(int sig, struct uml_pt_regs *regs) { unsigned long flags; diff --git a/arch/um/kernel/uaccess.c b/arch/um/kernel/uaccess.c index f0f4b04..dd33f04 100644 --- a/arch/um/kernel/uaccess.c +++ b/arch/um/kernel/uaccess.c @@ -12,7 +12,7 @@ #include #include "os.h" -void __do_copy(void *to, const void *from, int n) +static void __do_copy(void *to, const void *from, int n) { memcpy(to, from, n); } diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c index abf47a7..07705c1 100644 --- a/arch/um/os-Linux/sigio.c +++ b/arch/um/os-Linux/sigio.c @@ -523,7 +523,7 @@ static void tty_close(int master, int slave) printk(UM_KERN_CONT "No, enabling workaround\n"); } -void __init check_sigio(void) +static void __init check_sigio(void) { if ((access("/dev/ptmx", R_OK) < 0) && (access("/dev/ptyp0", R_OK) < 0)) { diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c index 3f1694b..1a3d233 100644 --- a/arch/um/os-Linux/signal.c +++ b/arch/um/os-Linux/signal.c @@ -125,7 +125,7 @@ void set_sigstack(void *sig_stack, int size) panic("enabling signal stack failed, errno = %d\n", errno); } -void (*handlers[_NSIG])(int sig, struct sigcontext *sc); +static void (*handlers[_NSIG])(int sig, struct sigcontext *sc); void handle_signal(int sig, struct sigcontext *sc) { diff -
Re: [uml-devel] [PATCH 6/19] UML - hppfs fixes
From: Jeff Dike <[EMAIL PROTECTED]> Date: Fri, 25 Apr 2008 13:56:09 -0400 > hppfs tidying and fixes noticed during hch's get_inode work - > style fixes > a copy_to_user got its return value checked > hppfs_write no longer fiddles file->f_pos because it gets and > returns pos in its arguments > hppfs_delete_inode dputs the underlyng procfs dentry stored in > its private data and mntputs the vfsmnt stashed in s_fs_info > hppfs_put_super no longer needs to mntput the s_fs_info, so it > no longer needs to exist > hppfs_readlink and hppfs_follow_link were doing a bunch of stuff > with a struct file which they didn't use > there is now a ->permission which calls generic_permission > get_inode was always returning 0 for some reason - it now > returns an inode if nothing bad happened > > Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> > --- > fs/hppfs/hppfs_kern.c | 82 > ++ > 1 file changed, 30 insertions(+), 52 deletions(-) > > Index: linux-2.6.22/fs/hppfs/hppfs_kern.c > === > --- linux-2.6.22.orig/fs/hppfs/hppfs_kern.c 2008-04-24 13:35:54.0 > -0400 > +++ linux-2.6.22/fs/hppfs/hppfs_kern.c2008-04-24 15:31:59.0 > -0400 > @@ -33,7 +33,7 @@ struct hppfs_private { > }; > > struct hppfs_inode_info { > -struct dentry *proc_dentry; > + struct dentry *proc_dentry; > struct inode vfs_inode; > }; > > @@ -52,7 +52,7 @@ static int is_pid(struct dentry *dentry) > int i; > > sb = dentry->d_sb; > - if ((sb->s_op != &hppfs_sbops) || (dentry->d_parent != sb->s_root)) > + if (dentry->d_parent != sb->s_root) > return 0; > > for (i = 0; i < dentry->d_name.len; i++) { > @@ -136,7 +136,7 @@ static int file_removed(struct dentry *d > } > > static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry, > - struct nameidata *nd) > +struct nameidata *nd) > { > struct dentry *proc_dentry, *new, *parent; > struct inode *inode; > @@ -254,6 +254,8 @@ static ssize_t hppfs_read(struct file *f > int err; > > if (hppfs->contents != NULL) { > + int rem; > + > if (*ppos >= hppfs->len) > return 0; > > @@ -267,8 +269,10 @@ static ssize_t hppfs_read(struct file *f > > if (off + count > hppfs->len) > count = hppfs->len - off; > - copy_to_user(buf, &data->contents[off], count); > - *ppos += count; > + rem = copy_to_user(buf, &data->contents[off], count); > + *ppos += count - rem; > + if (rem > 0) > + return -EFAULT; Could you please explain why check 'rem' after using it here? > } else if (hppfs->host_fd != -1) { > err = os_seek_file(hppfs->host_fd, *ppos); > if (err) { > @@ -285,21 +289,15 @@ static ssize_t hppfs_read(struct file *f > return count; > } > > -static ssize_t hppfs_write(struct file *file, const char __user *buf, size_t > len, > -loff_t *ppos) > +static ssize_t hppfs_write(struct file *file, const char __user *buf, > +size_t len, loff_t *ppos) > { > struct hppfs_private *data = file->private_data; > struct file *proc_file = data->proc_file; > ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); > - int err; > > write = proc_file->f_path.dentry->d_inode->i_fop->write; > - > - proc_file->f_pos = file->f_pos; > - err = (*write)(proc_file, buf, len, &proc_file->f_pos); > - file->f_pos = proc_file->f_pos; > - > - return err; > + return (*write)(proc_file, buf, len, ppos); > } > > static int open_host_sock(char *host_file, int *filter_out) > @@ -357,7 +355,7 @@ static struct hppfs_data *hppfs_get_data > > if (filter) { > while ((n = read_proc(proc_file, data->contents, > - sizeof(data->contents), NULL, 0)) > 0) > + sizeof(data->contents), NULL, 0)) > 0) > os_write_file(fd, data->contents, n); > err = os_shutdown_socket(fd, 0, 1); > if (err) { > @@ -429,8 +427,8 @@ static int file_mode(int fmode) > static int hppfs_open(struct inode *inode, struct file *file) > { > struct hppfs_private *data; > - struct dentry *proc_dentry; > struct vfsmount *proc_mnt; > + struct dentry *proc_dentry; And what does this kind of change mean? > char *host_file; > int err, fd, type, filter; > > @@ -492,8 +490,8 @@ static int hppfs_open(struct inode *inod > static int hppfs_dir_open(struct inode *inode, struct file *file) > { > struct hppfs_private *data; > - struct dentry *proc_dentry;
Re: [uml-devel] [PATCH 7/19] UML - Move hppfs_kern.c to hppfs.c
From: Jeff Dike <[EMAIL PROTECTED]> Date: Fri, 25 Apr 2008 13:56:09 -0400 > There's no reason for the _kern in hppfs_kern.c, so move it to hppfs.c. > > Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> > --- > fs/hppfs/Makefile |6 > fs/hppfs/hppfs.c | 771 > ++ > fs/hppfs/hppfs_kern.c | 771 > -- > 3 files changed, 774 insertions(+), 774 deletions(-) > > Index: linux-2.6-git/fs/hppfs/hppfs.c > === > --- /dev/null 1970-01-01 00:00:00.0 + > +++ linux-2.6-git/fs/hppfs/hppfs.c2008-04-24 15:36:51.0 -0400 > @@ -0,0 +1,771 @@ > +/* > + * Copyright (C) 2002 - 2007 Jeff Dike ([EMAIL PROTECTED],linux.intel}.com) > + * Licensed under the GPL > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include "os.h" > + > +static struct inode *get_inode(struct super_block *, struct dentry *); > + > +struct hppfs_data { > + struct list_head list; > + char contents[PAGE_SIZE - sizeof(struct list_head)]; > +}; > + > +struct hppfs_private { > + struct file *proc_file; > + int host_fd; > + loff_t len; > + struct hppfs_data *contents; > +}; > + > +struct hppfs_inode_info { > + struct dentry *proc_dentry; > + struct inode vfs_inode; > +}; > + > +static inline struct hppfs_inode_info *HPPFS_I(struct inode *inode) > +{ > + return container_of(inode, struct hppfs_inode_info, vfs_inode); > +} > + > +#define HPPFS_SUPER_MAGIC 0xb0ee These can be put into a single header, e.g. hppfs.h. > + > +static const struct super_operations hppfs_sbops; > + > +static int is_pid(struct dentry *dentry) > +{ > + struct super_block *sb; > + int i; > + > + sb = dentry->d_sb; > + if (dentry->d_parent != sb->s_root) > + return 0; > + > + for (i = 0; i < dentry->d_name.len; i++) { > + if (!isdigit(dentry->d_name.name[i])) > + return 0; > + } > + return 1; > +} > + > +static char *dentry_name(struct dentry *dentry, int extra) > +{ > + struct dentry *parent; > + char *root, *name; > + const char *seg_name; > + int len, seg_len; > + > + len = 0; > + parent = dentry; These can be put into initialization, I think, that's more readable. > + while (parent->d_parent != parent) { > + if (is_pid(parent)) > + len += strlen("pid") + 1; > + else len += parent->d_name.len + 1; > + parent = parent->d_parent; > + } > + > + root = "proc"; This can be put into initialization of 'root', too. > + len += strlen(root); > + name = kmalloc(len + extra + 1, GFP_KERNEL); > + if (name == NULL) > + return NULL; > + > + name[len] = '\0'; > + parent = dentry; > + while (parent->d_parent != parent) { > + if (is_pid(parent)) { > + seg_name = "pid"; > + seg_len = strlen("pid"); > + } > + else { > + seg_name = parent->d_name.name; > + seg_len = parent->d_name.len; > + } > + > + len -= seg_len + 1; > + name[len] = '/'; > + strncpy(&name[len + 1], seg_name, seg_len); > + parent = parent->d_parent; > + } > + strncpy(name, root, strlen(root)); > + return name; > +} > + > +static int file_removed(struct dentry *dentry, const char *file) > +{ > + char *host_file; > + int extra, fd; > + > + extra = 0; > + if (file != NULL) > + extra += strlen(file) + 1; > + > + host_file = dentry_name(dentry, extra + strlen("/remove")); > + if (host_file == NULL) { > + printk(KERN_ERR "file_removed : allocation failed\n"); > + return -ENOMEM; > + } > + > + if (file != NULL) { > + strcat(host_file, "/"); > + strcat(host_file, file); > + } > + strcat(host_file, "/remove"); > + > + fd = os_open_file(host_file, of_read(OPENFLAGS()), 0); > + kfree(host_file); > + if (fd > 0) { > + os_close_file(fd); > + return 1; > + } How about 'fd < 0' ? > + return 0; > +} > + > +static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry, > +struct nameidata *nd) > +{ > + struct dentry *proc_dentry, *new, *parent; > + struct inode *inode; > + int err, deleted; > + > + deleted = file_removed(dentry, NULL); > + if (deleted < 0) > + return ERR_PTR(deleted); > + else if (deleted) > + return ERR_PTR(-ENOENT); > + > + err = -ENOMEM; > + parent = HPPFS_I(ino)->proc_dentry; > + mutex_lock(&parent->d_inode->i_mutex); > + proc_dentry
Re: [uml-devel] [PATCH 9/19] UML - Tidy ptrace interface
From: Jeff Dike <[EMAIL PROTECTED]> Date: Fri, 25 Apr 2008 13:56:10 -0400 > Tidy the ptrace interface code. Removed a bunch of unused macros. > Started converting register sets from arrays of longs to structures. Could you please explain a bit why do this? I think long arrary is OK. Thanks. Cong - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [PATCH 2/19] UML - Tidy stub management code
From: Jeff Dike <[EMAIL PROTECTED]> Date: Fri, 25 Apr 2008 13:56:06 -0400 > Restructure the stub management code to make it simpler. > > syscall_stub_done is extracted from do_syscall_stub. > > The counters are gone since I never looked at them. > > The common code in run_syscall_stub and syscall_stub_data is extracted > into flush_syscalls. > > Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> > --- > arch/um/os-Linux/skas/mem.c | 162 > +++- > 1 file changed, 85 insertions(+), 77 deletions(-) > > Index: linux-2.6-git/arch/um/os-Linux/skas/mem.c > === > --- linux-2.6-git.orig/arch/um/os-Linux/skas/mem.c2008-04-25 > 11:36:59.0 -0400 > +++ linux-2.6-git/arch/um/os-Linux/skas/mem.c 2008-04-25 11:39:07.0 > -0400 > @@ -40,35 +40,69 @@ static unsigned long syscall_regs[MAX_RE > > static int __init init_syscall_regs(void) > { > + unsigned long *stub_entry; > + > get_safe_registers(syscall_regs); > + stub_entry = &batch_syscall_stub; > + > syscall_regs[REGS_IP_INDEX] = STUB_CODE + > - ((unsigned long) &batch_syscall_stub - > + ((unsigned long) stub_entry - >(unsigned long) &__syscall_stub_start); > return 0; > } > > __initcall(init_syscall_regs); > > -extern int proc_mm; > +static int syscall_stub_done(unsigned long stack) > +{ > + unsigned long *syscall, *data, offset; > + int ret, n; > + > + /* > + * When the stub stops, we find the following values on the > + * beginning of the stack: > + * (long) return_value > + * (long) offset to failed sycall data (0 if no error) > + */ > + ret = *((unsigned long *) stack); I am afraid the value will be truncated on 64bit machine, since 'ret' is 'int' while 'stack' points to an 'unsigned long'. Is this expected? Thanks. - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [PATCH 2/19] UML - Tidy stub management code
On Mon, 28 Apr 2008, Jeff Dike wrote: > On Sat, Apr 26, 2008 at 06:01:12PM +0800, WANG Cong wrote: >> > + /* >> > + * When the stub stops, we find the following values on the >> > + * beginning of the stack: >> > + * (long) return_value >> > + * (long) offset to failed sycall data (0 if no error) >> > + */ >> > + ret = *((unsigned long *) stack); >> >> >> I am afraid the value will be truncated on 64bit machine, since >> 'ret' is 'int' while 'stack' points to an 'unsigned long'. >> >> Is this expected? > > That's dubious, but I don't think it breaks anything. On LE, *(int *) > and *(long *) will give you the same answer, and the value here is an > error code, which fits into 32 bits. So it's safe here. OK. Thanks! -- Hi, I'm a .signature virus, please copy/paste me to help me spread all over the world. - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [PATCH 6/19] UML - hppfs fixes
On Mon, 28 Apr 2008, Jeff Dike wrote: > On Sat, Apr 26, 2008 at 04:31:32PM +0800, WANG Cong wrote: >> > + rem = copy_to_user(buf, &data->contents[off], count); >> > + *ppos += count - rem; >> > + if (rem > 0) >> > + return -EFAULT; >> >> Could you please explain why check 'rem' after using it here? > > Actually, this isn't as wrong as it looks. copy_to_user returns what > hasn't been copied (rem == remaining). So, I think the mistake is to > return -EFAULT here. Returning the short count would be right, unless > rem == count, in which case we return -EFAULT. Yes, thanks. -- Hi, I'm a .signature virus, please copy/paste me to help me spread all over the world. - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [PATCH 7/19] UML - Move hppfs_kern.c to hppfs.c
On Mon, 28 Apr 2008, Jeff Dike wrote: > On Sat, Apr 26, 2008 at 05:17:55PM +0800, WANG Cong wrote: >> > +static struct inode *get_inode(struct super_block *, struct dentry *); >> > + >> > +struct hppfs_data { >> > + struct list_head list; >> > + char contents[PAGE_SIZE - sizeof(struct list_head)]; >> > +}; >> > + >> > +struct hppfs_private { >> > + struct file *proc_file; >> > + int host_fd; >> > + loff_t len; >> > + struct hppfs_data *contents; >> > +}; >> > + >> > +struct hppfs_inode_info { >> > + struct dentry *proc_dentry; >> > + struct inode vfs_inode; >> > +}; >> > + >> > +static inline struct hppfs_inode_info *HPPFS_I(struct inode *inode) >> > +{ >> > + return container_of(inode, struct hppfs_inode_info, vfs_inode); >> > +} >> > + >> > +#define HPPFS_SUPER_MAGIC 0xb0ee >> >> >> These can be put into a single header, e.g. hppfs.h. > > Why, when this one C file is the only user? Just looks cleaner for me. ;-) > > Oops, nice spotting. > > See what you think about the patch below... This patch looks OK for me. Thank you! Cong - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [PATCH 9/19] UML - Tidy ptrace interface
On Mon, 28 Apr 2008, Jeff Dike wrote: > On Sat, Apr 26, 2008 at 05:35:38PM +0800, WANG Cong wrote: >> From: Jeff Dike <[EMAIL PROTECTED]> >> Date: Fri, 25 Apr 2008 13:56:10 -0400 >> > Tidy the ptrace interface code. Removed a bunch of unused macros. >> > Started converting register sets from arrays of longs to structures. >> >> Could you please explain a bit why do this? I think long arrary is OK. > > It's wrong on x86_64. There, FRAME_SIZE is 168 - > #define FRAME_SIZE > and SS is the last register defined - >#define SS 160 > but there are a number of registers beyond that in the user_regs_struct: > unsigned long ss; > unsigned long fs_base; > unsigned long gs_base; > unsigned long ds; > unsigned long es; > unsigned long fs; > unsigned long gs; > > The effect of GETREGS into a long[FRAME_SIZE] will be stack corruption. > Thanks for teaching this. ;-) -- Hi, I'm a .signature virus, please copy/paste me to help me spread all over the world. - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] (Resend) arch/um/kernel/irq.c: clean up some functions
Make activate_fd() and free_irq_by_irq_and_dev() static. Remove init_aio_irq() since it has no users. Compile testing passed. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/include/irq_kern.h |2 -- arch/um/include/irq_user.h |2 -- arch/um/kernel/irq.c | 35 ++- 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/arch/um/include/irq_kern.h b/arch/um/include/irq_kern.h index 4f77559..fba3895 100644 --- a/arch/um/include/irq_kern.h +++ b/arch/um/include/irq_kern.h @@ -13,8 +13,6 @@ extern int um_request_irq(unsigned int irq, int fd, int type, irq_handler_t handler, unsigned long irqflags, const char * devname, void *dev_id); -extern int init_aio_irq(int irq, char *name, - irq_handler_t handler); #endif diff --git a/arch/um/include/irq_user.h b/arch/um/include/irq_user.h index e60b318..c6c784d 100644 --- a/arch/um/include/irq_user.h +++ b/arch/um/include/irq_user.h @@ -21,8 +21,6 @@ struct irq_fd { enum { IRQ_READ, IRQ_WRITE }; extern void sigio_handler(int sig, struct uml_pt_regs *regs); -extern int activate_fd(int irq, int fd, int type, void *dev_id); -extern void free_irq_by_irq_and_dev(unsigned int irq, void *dev_id); extern void free_irq_by_fd(int fd); extern void reactivate_fd(int fd, int irqnum); extern void deactivate_fd(int fd, int irqnum); diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 91587f8..3d7aad0 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -102,7 +102,7 @@ void sigio_handler(int sig, struct uml_pt_regs *regs) static DEFINE_SPINLOCK(irq_lock); -int activate_fd(int irq, int fd, int type, void *dev_id) +static int activate_fd(int irq, int fd, int type, void *dev_id) { struct pollfd *tmp_pfd; struct irq_fd *new_fd, *irq_fd; @@ -216,7 +216,7 @@ static int same_irq_and_dev(struct irq_fd *irq, void *d) return ((irq->irq == data->irq) && (irq->id == data->dev)); } -void free_irq_by_irq_and_dev(unsigned int irq, void *dev) +static void free_irq_by_irq_and_dev(unsigned int irq, void *dev) { struct irq_and_dev data = ((struct irq_and_dev) { .irq = irq, .dev = dev }); @@ -403,37 +403,6 @@ void __init init_IRQ(void) } } -int init_aio_irq(int irq, char *name, irq_handler_t handler) -{ - int fds[2], err; - - err = os_pipe(fds, 1, 1); - if (err) { - printk(KERN_ERR "init_aio_irq - os_pipe failed, err = %d\n", - -err); - goto out; - } - - err = um_request_irq(irq, fds[0], IRQ_READ, handler, -IRQF_DISABLED | IRQF_SAMPLE_RANDOM, name, -(void *) (long) fds[0]); - if (err) { - printk(KERN_ERR "init_aio_irq - : um_request_irq failed, " - "err = %d\n", - err); - goto out_close; - } - - err = fds[1]; - goto out; - - out_close: - os_close_file(fds[0]); - os_close_file(fds[1]); - out: - return err; -} - /* * IRQ stack entry and exit: * -- 1.5.2.4 - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] (Resend) arch/um/kernel/mem.c: remove arch_validate()
Remove arch_validate(), because no one uses it. Remove useless macro HAVE_ARCH_VALIDATE. Make the variable 'empty_bad_page' static. Compile testing passed. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/kernel/ksyms.c |1 - arch/um/kernel/mem.c | 33 + include/asm-um/page.h |3 --- 3 files changed, 1 insertions(+), 36 deletions(-) diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c index 66e2a30..cc1b5f1 100644 --- a/arch/um/kernel/ksyms.c +++ b/arch/um/kernel/ksyms.c @@ -18,7 +18,6 @@ EXPORT_SYMBOL(get_signals); EXPORT_SYMBOL(kernel_thread); EXPORT_SYMBOL(sys_waitpid); EXPORT_SYMBOL(flush_tlb_range); -EXPORT_SYMBOL(arch_validate); EXPORT_SYMBOL(high_physmem); EXPORT_SYMBOL(empty_zero_page); diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 2eea1ff..88fc1c8 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -21,7 +21,7 @@ /* allocated in paging_init, zeroed in mem_init, and unchanged thereafter */ unsigned long *empty_zero_page = NULL; /* allocated in paging_init and unchanged thereafter */ -unsigned long *empty_bad_page = NULL; +static unsigned long *empty_bad_page = NULL; /* * Initialized during boot, and readonly for initializing page tables @@ -240,37 +240,6 @@ void __init paging_init(void) #endif } -struct page *arch_validate(struct page *page, gfp_t mask, int order) -{ - unsigned long addr, zero = 0; - int i; - - again: - if (page == NULL) - return page; - if (PageHighMem(page)) - return page; - - addr = (unsigned long) page_address(page); - for (i = 0; i < (1 << order); i++) { - current->thread.fault_addr = (void *) addr; - if (__do_copy_to_user((void __user *) addr, &zero, -sizeof(zero), -¤t->thread.fault_addr, -¤t->thread.fault_catcher)) { - if (!(mask & __GFP_WAIT)) - return NULL; - else break; - } - addr += PAGE_SIZE; - } - - if (i == (1 << order)) - return page; - page = alloc_pages(mask, order); - goto again; -} - /* * This can't do anything because nothing in the kernel image can be freed * since it's not in kernel physical memory. diff --git a/include/asm-um/page.h b/include/asm-um/page.h index 381f96b..4b489e3 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h @@ -114,9 +114,6 @@ extern unsigned long uml_physmem; #define pfn_valid(pfn) ((pfn) < max_mapnr) #define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) -extern struct page *arch_validate(struct page *page, gfp_t mask, int order); -#define HAVE_ARCH_VALIDATE - #include #include -- 1.5.2.4 - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] (Resend) UML: make several more things static
Make some variables and functions static, since they don't need to be global. Remove an unused function - arch/um/kernel/time.c::sched_clock(). Clean the style a bit as complained by checkpatch.pl. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- arch/um/include/skas/skas.h |1 - arch/um/include/um_uaccess.h|1 - arch/um/kernel/physmem.c|2 +- arch/um/kernel/ptrace.c |2 +- arch/um/kernel/time.c |8 arch/um/kernel/uaccess.c|2 +- arch/um/os-Linux/sigio.c|2 +- arch/um/os-Linux/signal.c |2 +- arch/um/os-Linux/skas/process.c |2 +- arch/um/os-Linux/umid.c |2 +- arch/um/sys-i386/bugs.c |2 +- arch/um/sys-i386/checksum.S |5 ++--- arch/um/sys-i386/ldt.c |4 ++-- include/asm-um/ptrace-generic.h |3 --- 14 files changed, 12 insertions(+), 26 deletions(-) diff --git a/arch/um/include/skas/skas.h b/arch/um/include/skas/skas.h index b073f8a..64d2c74 100644 --- a/arch/um/include/skas/skas.h +++ b/arch/um/include/skas/skas.h @@ -16,7 +16,6 @@ extern int user_thread(unsigned long stack, int flags); extern void new_thread_handler(void); extern void handle_syscall(struct uml_pt_regs *regs); extern int new_mm(unsigned long stack); -extern void get_skas_faultinfo(int pid, struct faultinfo * fi); extern long execute_syscall_skas(void *r); extern unsigned long current_stub_stack(void); diff --git a/arch/um/include/um_uaccess.h b/arch/um/include/um_uaccess.h index 2b6fc8e..45c0499 100644 --- a/arch/um/include/um_uaccess.h +++ b/arch/um/include/um_uaccess.h @@ -34,7 +34,6 @@ extern int copy_to_user(void __user *to, const void *from, int n); extern int __do_copy_to_user(void *to, const void *from, int n, void **fault_addr, jmp_buf **fault_catcher); -extern void __do_copy(void *to, const void *from, int n); /* * strncpy_from_user: - Copy a NUL terminated string from userspace. diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index 9757085..a1a9090 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c @@ -185,7 +185,7 @@ unsigned long find_iomem(char *driver, unsigned long *len_out) return 0; } -int setup_iomem(void) +static int setup_iomem(void) { struct iomem_region *region = iomem_regions; unsigned long iomem_start = high_physmem + PAGE_SIZE; diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c index 47b57b4..15e8b7c 100644 --- a/arch/um/kernel/ptrace.c +++ b/arch/um/kernel/ptrace.c @@ -225,7 +225,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) return ret; } -void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs, +static void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs, int error_code) { struct siginfo info; diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index e066e84..353c174 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -12,14 +12,6 @@ #include "kern_util.h" #include "os.h" -/* - * Scheduler clock - returns current time in nanosec units. - */ -unsigned long long sched_clock(void) -{ - return (unsigned long long)jiffies_64 * (NSEC_PER_SEC / HZ); -} - void timer_handler(int sig, struct uml_pt_regs *regs) { unsigned long flags; diff --git a/arch/um/kernel/uaccess.c b/arch/um/kernel/uaccess.c index f0f4b04..dd33f04 100644 --- a/arch/um/kernel/uaccess.c +++ b/arch/um/kernel/uaccess.c @@ -12,7 +12,7 @@ #include #include "os.h" -void __do_copy(void *to, const void *from, int n) +static void __do_copy(void *to, const void *from, int n) { memcpy(to, from, n); } diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c index abf47a7..07705c1 100644 --- a/arch/um/os-Linux/sigio.c +++ b/arch/um/os-Linux/sigio.c @@ -523,7 +523,7 @@ static void tty_close(int master, int slave) printk(UM_KERN_CONT "No, enabling workaround\n"); } -void __init check_sigio(void) +static void __init check_sigio(void) { if ((access("/dev/ptmx", R_OK) < 0) && (access("/dev/ptyp0", R_OK) < 0)) { diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c index 3f1694b..1a3d233 100644 --- a/arch/um/os-Linux/signal.c +++ b/arch/um/os-Linux/signal.c @@ -125,7 +125,7 @@ void set_sigstack(void *sig_stack, int size) panic("enabling signal stack failed, errno = %d\n", errno); } -void (*handlers[_NSIG])(int sig, struct sigcontext *sc); +static void (*handlers[_NSIG])(int sig, struct sigcontext *sc); void handle_signal(int sig, struct sigcontext *sc) { diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index 1e8cba6..87d05fb 100644 --- a/arch/um/os-Linux/ska
[uml-devel] [Patch] UML: Fix inconsistence due to tty_operation change
'put_char' of 'struct tty_operations' has changed from 'void' into 'int'. This can also shut up comipler warnings. Cc: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 10b86e1..5047490 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -191,9 +191,9 @@ void line_flush_chars(struct tty_struct *tty) line_flush_buffer(tty); } -void line_put_char(struct tty_struct *tty, unsigned char ch) +int line_put_char(struct tty_struct *tty, unsigned char ch) { - line_write(tty, &ch, sizeof(ch)); + return line_write(tty, &ch, sizeof(ch)); } int line_write(struct tty_struct *tty, const unsigned char *buf, int len) diff --git a/arch/um/include/line.h b/arch/um/include/line.h index 1223f2c..979b73e 100644 --- a/arch/um/include/line.h +++ b/arch/um/include/line.h @@ -71,7 +71,7 @@ extern int line_setup(struct line *lines, unsigned int sizeof_lines, char *init, char **error_out); extern int line_write(struct tty_struct *tty, const unsigned char *buf, int len); -extern void line_put_char(struct tty_struct *tty, unsigned char ch); +extern int line_put_char(struct tty_struct *tty, unsigned char ch); extern void line_set_termios(struct tty_struct *tty, struct ktermios * old); extern int line_chars_in_buffer(struct tty_struct *tty); extern void line_flush_buffer(struct tty_struct *tty); - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] um: fix a build error
Fixed this build error: /home/wangcong/Projects/linux-2.6/arch/um/drivers/line.c: In function ‘line_write_interrupt’: /home/wangcong/Projects/linux-2.6/arch/um/drivers/line.c:366: error: ‘struct tty_ldisc’ has no member named ‘write_wakeup’ /home/wangcong/Projects/linux-2.6/arch/um/drivers/line.c:367: error: ‘struct tty_ldisc’ has no member named ‘write_wakeup’ make[2]: *** [arch/um/drivers/line.o] Error 1 make[1]: *** [arch/um/drivers] Error 2 make: *** [sub-make] Error 2 Sigend-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] --- diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 5047490..c872dad 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -363,8 +363,8 @@ static irqreturn_t line_write_interrupt(int irq, void *data) return IRQ_NONE; if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && - (tty->ldisc.write_wakeup != NULL)) - (tty->ldisc.write_wakeup)(tty); + (tty->ldisc.ops->write_wakeup != NULL)) + (tty->ldisc.ops->write_wakeup)(tty); /* * BLOCKING mode - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [Patch] um: fix a build error
On Tue, Jul 22, 2008 at 11:53:54AM +0100, Alan Cox wrote: >> Signed-off-by: Eric Sesterhenn <[EMAIL PROTECTED]> >> >> --- linux-2.6/arch/um/drivers/line.c.orig2008-07-22 12:06:17.0 >> +0200 >> +++ linux-2.6/arch/um/drivers/line.c 2008-07-22 12:06:49.0 +0200 >> @@ -362,10 +362,8 @@ static irqreturn_t line_write_interrupt( >> if (tty == NULL) >> return IRQ_NONE; >> >> -if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && >> - (tty->ldisc.write_wakeup != NULL)) >> -(tty->ldisc.write_wakeup)(tty); >> - >> +if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) >> +tty_wakeup(tty); > >Sorry I should have been clearer - you don't want the test_bit either. > Sure, tty_wakeup() already does that test. And, tty_wakeup() also does wake_up_interruptible(), so I think the wake_up_interruptible() below can also be removed, probably. Thanks. -- The opposite of love is not hate, but indifference. --Elie Wiesel - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [Patch] um: fix a build error
On Tue, Jul 22, 2008 at 11:53:54AM +0100, Alan Cox wrote: >> Signed-off-by: Eric Sesterhenn <[EMAIL PROTECTED]> >> >> --- linux-2.6/arch/um/drivers/line.c.orig2008-07-22 12:06:17.0 >> +0200 >> +++ linux-2.6/arch/um/drivers/line.c 2008-07-22 12:06:49.0 +0200 >> @@ -362,10 +362,8 @@ static irqreturn_t line_write_interrupt( >> if (tty == NULL) >> return IRQ_NONE; >> >> -if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && >> - (tty->ldisc.write_wakeup != NULL)) >> -(tty->ldisc.write_wakeup)(tty); >> - >> +if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) >> +tty_wakeup(tty); > >Sorry I should have been clearer - you don't want the test_bit either. > What about the below one? Signed-off-by: WANG Cong <[EMAIL PROTECTED]> --- diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 5047490..d741f35 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -362,19 +362,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data) if (tty == NULL) return IRQ_NONE; - if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && - (tty->ldisc.write_wakeup != NULL)) - (tty->ldisc.write_wakeup)(tty); - - /* -* BLOCKING mode -* In blocking mode, everything sleeps on tty->write_wait. -* Sleeping in the console driver would break non-blocking -* writes. -*/ - - if (waitqueue_active(&tty->write_wait)) - wake_up_interruptible(&tty->write_wait); + tty_wakeup(tty); return IRQ_HANDLED; } - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] uml: fix another build error
Fixed this error: CC arch/um/drivers/vde_user.o /home/wangcong/Projects/linux-2.6/arch/um/drivers/vde_user.c: In function ‘vde_init_libstuff’: /home/wangcong/Projects/linux-2.6/arch/um/drivers/vde_user.c:81: error: implicit declaration of function ‘kmalloc’ /home/wangcong/Projects/linux-2.6/arch/um/drivers/vde_user.c:81: warning: assignment makes pointer from integer without a cast make[2]: *** [arch/um/drivers/vde_user.o] Error 1 make[1]: *** [arch/um/drivers/vde_user.ko] Error 2 make: *** [sub-make] Error 2 Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] --- diff --git a/arch/um/drivers/vde_user.c b/arch/um/drivers/vde_user.c index 56533db..744eacf 100644 --- a/arch/um/drivers/vde_user.c +++ b/arch/um/drivers/vde_user.c @@ -78,7 +78,7 @@ void vde_init_libstuff(struct vde_data *vpri, struct vde_init *init) { struct vde_open_args *args; - vpri->args = kmalloc(sizeof(struct vde_open_args), UM_GFP_KERNEL); + vpri->args = uml_kmalloc(sizeof(struct vde_open_args), UM_GFP_KERNEL); if (vpri->args == NULL) { printk(UM_KERN_ERR "vde_init_libstuff - vde_open_args " "allocation failed"); - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
[uml-devel] [Patch] UML build: fix missing posix_types.h
When building UML with 'O=foo' specified, I got: CC kernel/bounds.s In file included from /home/wangcong/Projects/linux-2.6/include/linux/types.h:11, from /home/wangcong/Projects/linux-2.6/include/linux/page-flags.h:8, from /home/wangcong/Projects/linux-2.6/kernel/bounds.c:9: /home/wangcong/Projects/linux-2.6/include/linux/posix_types.h:47:29: error: asm/posix_types.h: No such file or directory In file included from /home/wangcong/Projects/linux-2.6/include/linux/page-flags.h:8, from /home/wangcong/Projects/linux-2.6/kernel/bounds.c:9: /home/wangcong/Projects/linux-2.6/include/linux/types.h:12:23: error: asm/types.h: No such file or directory In file included from /home/wangcong/Projects/linux-2.6/include/linux/page-flags.h:8, Below patch fixed it, note, it is only tested for x86 and um. Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] --- diff --git a/Makefile b/Makefile index aa527a4..39130d1 100644 --- a/Makefile +++ b/Makefile @@ -930,7 +930,8 @@ ifneq ($(KBUILD_SRC),) /bin/false; \ fi; $(Q)if [ ! -d include2 ]; then mkdir -p include2; fi; - $(Q)if [ -e $(srctree)/include/asm-$(SRCARCH)/system.h ]; then \ + $(Q)if [ -e $(srctree)/include/asm-$(SRCARCH)/system.h -o \ +-e $(objtree)/include/asm-$(SRCARCH)/system.h ] ; then \ ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm; \ fi endif - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [PATCH 1/14] uml: fix build when SLOB is enabled
On Fri, Aug 01, 2008 at 06:41:25PM -0400, Jeff Dike wrote: >From 94409ded7768e15b0d0a5a172d611073c72308de Mon Sep 17 00:00:00 2001 > >Reintroduce uml_kmalloc for the benefit of UML libc code. The >previous tactic of declaring __kmalloc so it could be called directly >from the libc side of the house turned out to be getting too intimate >with slab, and it doesn't work with slob. > >So, the uml_kmalloc wrapper is back. It calls kmalloc or whatever >that translates into, and libc code calls it. > >kfree is left alone since that still works, leaving a somewhat >inconsistent API. > >Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> >Cc: WANG Cong <[EMAIL PROTECTED]> >Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> >Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> Looks good. Thanks. :) -- The opposite of love is not hate, but indifference. --Elie Wiesel - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] [patch] UML kernels on {i386, x86_64} produce bad coredumps
On Tue, 25 Jan 2011 15:14:33 -0800, Paul Pluzhnikov wrote: ... > Examining the core shows that NT_PRSTATUS notes for all threads other > than the one that crashed are zeroed out. > > I believe this is happening because neither ELF_CORE_COPY_TASK_REGS nor > task_pt_regs are defined under ARCH=um, and so elf_core_copy_task_regs() > becomes a no-op. I think this was missed due to some cleanups of the core elf change, UML is one of the part overlooked by people. :-/ > > Attached patch fixes this for SUBARCH={x86_64,i386}. > > Thanks, > -- > Paul Pluzhnikov > > P.S. Google has blanket FSF copyright assignment. > > > Signed-off-by: Paul Pluzhnikov > Acked-by: WANG Cong Thanks. -- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel