[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
Re: [uml-devel] [-mm Patch] uml: fix a building error
On Thu, Jan 17, 2008 at 09:56:41PM +0800, WANG Cong wrote: > > 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]> ACK Jeff -- Work email - jdike at linux dot intel dot com - 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] [-mm Patch] UML: fix a building error
On Thu, Jan 17, 2008 at 09:21:08PM +0800, WANG Cong wrote: > 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]> ACK Jeff -- Work email - jdike at linux dot intel dot com - 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] IA32_EMULATION support
On Tue, Jan 15, 2008 at 08:45:37AM -0800, Ryan Finnie wrote: > At the moment there is no 32-bit object > support in x86_64 UML kernels, and of course knowing my luck, the day > we introduce an x86_64 UML guest at work is the day it needs some > 32-bit blob or something. I believe you mentioned on IRC a few months > ago that you once had a semi-working patch to add IA32_EMULATION a > long time ago. Would this be something you would be willing to work > on again once things settle down? I'm thinking about it - the 32-bit compat skas4 work has got me thinking about how much work it is, and it might not be too bad. Jeff -- Work email - jdike at linux dot intel dot com - 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] [-mm Patch] uml: fix a building error
On Thu, Jan 17, 2008 at 07:11:13PM +0100, Mariusz Kozlowski wrote: > I see this on sparc64 as well: > > CC drivers/char/mem.o > drivers/char/mem.c: In function 'read_mem': > drivers/char/mem.c:136: error: implicit declaration of function > 'unxlate_dev_mem_ptr' > make[2]: *** [drivers/char/mem.o] Error 1 > make[1]: *** [drivers/char] Error 2 > make: *** [drivers] Error 2 > > Does sparc64 need similar fix? Probably - it seems that xlate_dev_mem_ptr can now introduce side-effects which need to be undone with unxlate_dev_mem_ptr. Jeff -- Work email - jdike at linux dot intel dot com - 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] [-mm Patch] uml: fix a building error
On Thu, 17 Jan 2008 19:11:13 +0100 Mariusz Kozlowski <[EMAIL PROTECTED]> wrote: > Hello, > > > 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’ > > ... > > I see this on sparc64 as well: > > CC drivers/char/mem.o > drivers/char/mem.c: In function 'read_mem': > drivers/char/mem.c:136: error: implicit declaration of function > 'unxlate_dev_mem_ptr' > make[2]: *** [drivers/char/mem.o] Error 1 > make[1]: *** [drivers/char] Error 2 > make: *** [drivers] Error 2 > > Does sparc64 need similar fix? > The PAT patches strike again. Ingo, I think you might need to toss some cross-compilers into that build test setup of yours. - 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] [-mm Patch] uml: fix a building error
Hello, > 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’ > ... I see this on sparc64 as well: CC drivers/char/mem.o drivers/char/mem.c: In function 'read_mem': drivers/char/mem.c:136: error: implicit declaration of function 'unxlate_dev_mem_ptr' make[2]: *** [drivers/char/mem.o] Error 1 make[1]: *** [drivers/char] Error 2 make: *** [drivers] Error 2 Does sparc64 need similar fix? Regards, Mariusz - 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] [-mm Patch] uml: fix a building error
>-Original Message- >From: Andrew Morton [mailto:[EMAIL PROTECTED] >Sent: Thursday, January 17, 2008 10:56 AM >To: Mariusz Kozlowski >Cc: WANG Cong; [EMAIL PROTECTED]; Jeff Dike; >user-mode-linux-devel@lists.sourceforge.net; David Miller; >[EMAIL PROTECTED]; Ingo Molnar; Thomas Gleixner; >Pallipadi, Venkatesh >Subject: Re: [-mm Patch] uml: fix a building error > >On Thu, 17 Jan 2008 19:11:13 +0100 Mariusz Kozlowski ><[EMAIL PROTECTED]> wrote: > >> Hello, >> >> > 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' >> > ... >> >> I see this on sparc64 as well: >> >> CC drivers/char/mem.o >> drivers/char/mem.c: In function 'read_mem': >> drivers/char/mem.c:136: error: implicit declaration of >function 'unxlate_dev_mem_ptr' >> make[2]: *** [drivers/char/mem.o] Error 1 >> make[1]: *** [drivers/char] Error 2 >> make: *** [drivers] Error 2 >> >> Does sparc64 need similar fix? >> > >The PAT patches strike again. > >Ingo, I think you might need to toss some cross-compilers into >that build >test setup of yours. > These functions were defined for other archs in asm-generic/iomap.h. We need all archs including it in io.h. I now see only few archs are including it.. Apart from unxlate, there is also ioremap_wc which is defined in the same way. I can send a patch for this. But, I don't have cross compiler setup for all archs to test. Andrew, I will need your help. Thanks, Venki - 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 0/20] UML - Lots of patches for 2.6.25
This is a lot of cleanup. There are style fixes, printk fixes, spelling fixes, mutex conversions, and small bug fixes. This is all obviously for 2.6.25. Jeff -- Work email - jdike at linux dot intel dot com - 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 2/20] UML - Style fixes in arch/um/os-LInux
Style changes under arch/um/os-Linux: include trimming CodingStyle fixes some printks needed severity indicators make_tempfile turns out not to be used outside of mem.c, so it is now static. Its declaration in tempfile.h is no longer needed, and tempfile.h itself is no longer needed. create_tmp_file was also made static. checkpatch moans about an EXPORT_SYMBOL in user_syms.c which is part of a macro definition - this is copying a bit of kernel infrastructure into the libc side of UML because the kernel headers can't be included there. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/include/tempfile.h | 11 --- arch/um/os-Linux/aio.c |2 arch/um/os-Linux/drivers/ethertap_kern.c |8 +- arch/um/os-Linux/drivers/tuntap_kern.c |6 - arch/um/os-Linux/include/file.h | 13 --- arch/um/os-Linux/mem.c | 101 +++ arch/um/os-Linux/process.c |2 arch/um/os-Linux/signal.c|2 arch/um/os-Linux/skas/process.c |6 - arch/um/os-Linux/sys-i386/registers.c|4 - arch/um/os-Linux/sys-x86_64/registers.c | 21 +++--- arch/um/os-Linux/uaccess.c |4 - arch/um/os-Linux/user_syms.c |4 - arch/um/os-Linux/util.c | 43 - 14 files changed, 98 insertions(+), 129 deletions(-) Index: linux-2.6.22/arch/um/os-Linux/user_syms.c === --- linux-2.6.22.orig/arch/um/os-Linux/user_syms.c 2007-12-14 11:21:17.0 -0500 +++ linux-2.6.22/arch/um/os-Linux/user_syms.c 2007-12-14 11:23:36.0 -0500 @@ -34,8 +34,8 @@ EXPORT_SYMBOL(printf); * good; so the versions of these symbols will always match */ #define EXPORT_SYMBOL_PROTO(sym) \ - int sym(void); \ - EXPORT_SYMBOL(sym); + int sym(void); \ + EXPORT_SYMBOL(sym); extern void readdir64(void) __attribute__((weak)); EXPORT_SYMBOL(readdir64); Index: linux-2.6.22/arch/um/include/tempfile.h === --- linux-2.6.22.orig/arch/um/include/tempfile.h2007-12-14 11:21:17.0 -0500 +++ /dev/null 1970-01-01 00:00:00.0 + @@ -1,11 +0,0 @@ -/* - * Copyright (C) 2000, 2001, 2002 Jeff Dike ([EMAIL PROTECTED]) - * Licensed under the GPL - */ - -#ifndef __TEMPFILE_H__ -#define __TEMPFILE_H__ - -extern int make_tempfile(const char *template, char **tempname, int do_unlink); - -#endif Index: linux-2.6.22/arch/um/os-Linux/aio.c === --- linux-2.6.22.orig/arch/um/os-Linux/aio.c2007-12-14 11:21:17.0 -0500 +++ linux-2.6.22/arch/um/os-Linux/aio.c 2007-12-14 11:28:05.0 -0500 @@ -142,7 +142,7 @@ static int do_not_aio(struct aio_thread_ if (actual != req->offset) return -errno; - switch(req->type) { + switch (req->type) { case AIO_READ: n = read(req->io_fd, req->buf, req->len); break; Index: linux-2.6.22/arch/um/os-Linux/include/file.h === --- linux-2.6.22.orig/arch/um/os-Linux/include/file.h 2007-12-14 11:21:17.0 -0500 +++ linux-2.6.22/arch/um/os-Linux/include/file.h2007-12-14 11:23:36.0 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002 Jeff Dike ([EMAIL PROTECTED]) + * Copyright (C) 2002 - 2007 Jeff Dike ([EMAIL PROTECTED],linux.intel}.com) * Licensed under the GPL */ @@ -9,14 +9,3 @@ #define DEV_NULL "/dev/null" #endif - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --- - * Local variables: - * c-file-style: "linux" - * End: - */ Index: linux-2.6.22/arch/um/os-Linux/mem.c === --- linux-2.6.22.orig/arch/um/os-Linux/mem.c2007-12-14 11:21:17.0 -0500 +++ linux-2.6.22/arch/um/os-Linux/mem.c 2007-12-14 11:35:12.0 -0500 @@ -1,22 +1,21 @@ +/* + * Copyright (C) 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 "user.h" -#include "mem_user.h" +#include #include "init.h" -#include "os.h" -#include "tempfile.h" #include "kern_constants.h" - -#include +#include "os.h" +#include "user.h" /* Modified by which_tmpdir, which is called during early boot */ static char *default_tmpdir = "/tmp"; @@ -33,18 +32,19 @@ static void __init find_tem
[uml-devel] [PATCH 7/20] UML - Add back CONFIG_HZ
avoid-overflows-in-kernel-timec.patch makes CONFIG_HZ necessary for a successful build. UML lacks a definition, so this patch adds one. It also changes the hard-wired definition of HZ to CONFIG_HZ. Note: this patch is a good idea even in the absence of hpa's time fixes. Cc: "H. Peter Anvin" <[EMAIL PROTECTED]> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/Kconfig|4 include/asm-um/param.h |2 +- 2 files changed, 5 insertions(+), 1 deletion(-) Index: linux-2.6.22/arch/um/Kconfig === --- linux-2.6.22.orig/arch/um/Kconfig 2008-01-01 17:32:04.0 -0500 +++ linux-2.6.22/arch/um/Kconfig2008-01-02 11:16:44.0 -0500 @@ -68,6 +68,10 @@ config IRQ_RELEASE_METHOD bool default y +config HZ + int + default 100 + menu "UML-specific options" config STATIC_LINK Index: linux-2.6.22/include/asm-um/param.h === --- linux-2.6.22.orig/include/asm-um/param.h2007-07-08 19:32:17.0 -0400 +++ linux-2.6.22/include/asm-um/param.h 2008-01-02 11:18:44.0 -0500 @@ -10,7 +10,7 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ #ifdef __KERNEL__ -#define HZ 100 +#define HZ CONFIG_HZ #define USER_HZ100/* .. some user interfaces are in "ticks" */ #define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ #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] [PATCH 4/20] UML - Implement O_APPEND
The .a flags in openflags never had an implementation. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/os-Linux/file.c |2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6.22/arch/um/os-Linux/file.c === --- linux-2.6.22.orig/arch/um/os-Linux/file.c 2007-12-13 13:50:52.0 -0500 +++ linux-2.6.22/arch/um/os-Linux/file.c2007-12-13 15:23:13.0 -0500 @@ -191,6 +191,8 @@ int os_open_file(const char *file, struc f |= O_TRUNC; if (flags.e) f |= O_EXCL; + if (flags.a) + f |= O_APPEND; fd = open64(file, f, mode); if (fd < 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 6/20] UML - DEBUG_SHIRQ fixes
A couple more DEBUG_SHIRQ fixes. The previous mconsole blocking fix exposed the lack of O_NONBLOCK on the mconsole socket. Also, winch_interrupt started crashing because it is called at irq free time and it tries to dereference tty->driver_data, which has already been set to NULL. I added some error cleanup in mconsole_init while I was there. Cc: "Karol Swietlicki" <[EMAIL PROTECTED]> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/drivers/line.c |8 +--- arch/um/drivers/mconsole_kern.c |8 +++- 2 files changed, 12 insertions(+), 4 deletions(-) Index: linux-2.6.22/arch/um/drivers/line.c === --- linux-2.6.22.orig/arch/um/drivers/line.c2007-12-14 11:28:06.0 -0500 +++ linux-2.6.22/arch/um/drivers/line.c 2007-12-14 12:47:43.0 -0500 @@ -774,9 +774,11 @@ static irqreturn_t winch_interrupt(int i tty = winch->tty; if (tty != NULL) { line = tty->driver_data; - chan_window_size(&line->chan_list, &tty->winsize.ws_row, -&tty->winsize.ws_col); - kill_pgrp(tty->pgrp, SIGWINCH, 1); + if (line != NULL) { + chan_window_size(&line->chan_list, &tty->winsize.ws_row, +&tty->winsize.ws_col); + kill_pgrp(tty->pgrp, SIGWINCH, 1); + } } out: if (winch->fd != -1) Index: linux-2.6.22/arch/um/drivers/mconsole_kern.c === --- linux-2.6.22.orig/arch/um/drivers/mconsole_kern.c 2007-12-14 11:28:06.0 -0500 +++ linux-2.6.22/arch/um/drivers/mconsole_kern.c2007-12-14 12:53:49.0 -0500 @@ -792,6 +792,8 @@ static int __init mconsole_init(void) printk(KERN_ERR "Failed to initialize management console\n"); return 1; } + if (os_set_fd_block(sock, 0)) + goto out; register_reboot_notifier(&reboot_notifier); @@ -800,7 +802,7 @@ static int __init mconsole_init(void) "mconsole", (void *)sock); if (err) { printk(KERN_ERR "Failed to get IRQ for management console\n"); - return 1; + goto out; } if (notify_socket != NULL) { @@ -816,6 +818,10 @@ static int __init mconsole_init(void) printk(KERN_INFO "mconsole (version %d) initialized on %s\n", MCONSOLE_VERSION, mconsole_socket_name); return 0; + + out: + os_close_file(sock); + return 1; } __initcall(mconsole_init); - 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 8/20] UML - Style fixes in arch/um/sys-x86_64
Style fixes in arch/um/sys-x86_64: updated copyrights CodingStyle fixes added severities to printks which needed them A bunch of functions in sys-*/ptrace_user.c turn out to be unused, so they and their declarations are gone. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/include/ptrace_user.h | 11 ++-- arch/um/sys-i386/ptrace_user.c | 14 --- arch/um/sys-x86_64/bug.c |3 +- arch/um/sys-x86_64/ptrace.c| 29 --- arch/um/sys-x86_64/ptrace_user.c | 46 - arch/um/sys-x86_64/syscall_table.c | 31 arch/um/sys-x86_64/sysrq.c | 29 --- arch/um/sys-x86_64/um_module.c |8 -- 8 files changed, 65 insertions(+), 106 deletions(-) Index: linux-2.6.22/arch/um/include/ptrace_user.h === --- linux-2.6.22.orig/arch/um/include/ptrace_user.h 2007-12-14 11:28:07.0 -0500 +++ linux-2.6.22/arch/um/include/ptrace_user.h 2007-12-14 11:47:57.0 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2002 Jeff Dike ([EMAIL PROTECTED]) + * Copyright (C) 2000 - 2007 Jeff Dike ([EMAIL PROTECTED],linux.intel}.com) * Licensed under the GPL */ @@ -10,12 +10,6 @@ extern int ptrace_getregs(long pid, unsigned long *regs_out); extern int ptrace_setregs(long pid, unsigned long *regs_in); -extern int ptrace_getfpregs(long pid, unsigned long *regs_out); -extern int ptrace_setfpregs(long pid, unsigned long *regs); -extern void arch_enter_kernel(void *task, int pid); -extern void arch_leave_kernel(void *task, int pid); -extern void ptrace_pokeuser(unsigned long addr, unsigned long data); - /* syscall emulation path in ptrace */ @@ -54,7 +48,8 @@ extern int sysemu_supported; (((int[3][3] ) { \ { PTRACE_SYSCALL, PTRACE_SYSCALL, PTRACE_SINGLESTEP }, \ { PTRACE_SYSEMU, PTRACE_SYSEMU, PTRACE_SINGLESTEP }, \ - { PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP, PTRACE_SYSEMU_SINGLESTEP }}) \ + { PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP, \ + PTRACE_SYSEMU_SINGLESTEP } }) \ [sysemu_mode][singlestep_mode]) #endif Index: linux-2.6.22/arch/um/sys-i386/ptrace_user.c === --- linux-2.6.22.orig/arch/um/sys-i386/ptrace_user.c2007-12-14 11:28:07.0 -0500 +++ linux-2.6.22/arch/um/sys-i386/ptrace_user.c 2007-12-14 11:38:28.0 -0500 @@ -19,17 +19,3 @@ int ptrace_setregs(long pid, unsigned lo return -errno; return 0; } - -int ptrace_getfpregs(long pid, unsigned long *regs) -{ - if (ptrace(PTRACE_GETFPREGS, pid, 0, regs) < 0) - return -errno; - return 0; -} - -int ptrace_setfpregs(long pid, unsigned long *regs) -{ - if (ptrace(PTRACE_SETFPREGS, pid, 0, regs) < 0) - return -errno; - return 0; -} Index: linux-2.6.22/arch/um/sys-x86_64/bug.c === --- linux-2.6.22.orig/arch/um/sys-x86_64/bug.c 2007-12-14 11:28:07.0 -0500 +++ linux-2.6.22/arch/um/sys-x86_64/bug.c 2007-12-14 11:38:28.0 -0500 @@ -5,7 +5,8 @@ #include -/* Mostly copied from i386/x86_86 - eliminated the eip < PAGE_OFFSET because +/* + * Mostly copied from i386/x86_86 - eliminated the eip < PAGE_OFFSET because * that's not relevant in skas mode. */ Index: linux-2.6.22/arch/um/sys-x86_64/ptrace.c === --- linux-2.6.22.orig/arch/um/sys-x86_64/ptrace.c 2007-12-14 11:28:07.0 -0500 +++ linux-2.6.22/arch/um/sys-x86_64/ptrace.c2007-12-14 11:47:21.0 -0500 @@ -5,13 +5,12 @@ * Licensed under the GPL */ -#define __FRAME_OFFSETS -#include +#include #include #include -#include +#define __FRAME_OFFSETS +#include #include -#include /* * determines which flags the user has access to. @@ -24,12 +23,14 @@ int putreg(struct task_struct *child, in unsigned long tmp; #ifdef TIF_IA32 - /* Some code in the 64bit emulation may not be 64bit clean. - Don't take any chances. */ + /* +* Some code in the 64bit emulation may not be 64bit clean. +* Don't take any chances. +*/ if (test_tsk_thread_flag(child, TIF_IA32)) value &= 0x; #endif - switch (regno){ + switch (regno) { case FS: case GS: case DS: @@ -66,7 +67,7 @@ int poke_user(struct task_struct *child, if (addr < MAX_REG_OFFSET) return putreg(child, addr, data); else if ((addr >= offsetof(struct user, u_debugreg[0])) && - (addr <= offsetof(struct user, u_debugreg[7]))){ + (addr <= offsetof(struct user, u_debugreg[7]))) {
[uml-devel] [PATCH 5/20] UML - Remove fakehd
The fakehd switch lost its implementation at some point. Since no one is screaming for it, we might as well remove it. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/drivers/ubd_kern.c | 20 1 file changed, 4 insertions(+), 16 deletions(-) Index: linux-2.6.22/arch/um/drivers/ubd_kern.c === --- linux-2.6.22.orig/arch/um/drivers/ubd_kern.c2007-12-14 11:28:06.0 -0500 +++ linux-2.6.22/arch/um/drivers/ubd_kern.c 2007-12-14 12:33:26.0 -0500 @@ -460,20 +460,6 @@ __uml_help(udb_setup, "in the boot output.\n\n" ); -static int fakehd_set = 0; -static int fakehd(char *str) -{ - printk(KERN_INFO "fakehd : Changing ubd name to \"hd\".\n"); - fakehd_set = 1; - return 1; -} - -__setup("fakehd", fakehd); -__uml_help(fakehd, -"fakehd\n" -"Change the ubd device name to \"hd\".\n\n" -); - static void do_ubd_request(struct request_queue * q); /* Only changed by ubd_init, which is an initcall. */ @@ -730,8 +716,10 @@ static int ubd_add(int n, char **error_o ubd_disk_register(fake_major, ubd_dev->size, n, &fake_gendisk[n]); - /* perhaps this should also be under the "if (fake_major)" above */ - /* using the fake_disk->disk_name and also the fakehd_set name */ + /* +* Perhaps this should also be under the "if (fake_major)" above +* using the fake_disk->disk_name +*/ if (fake_ide) make_ide_entries(ubd_gendisk[n]->disk_name); - 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 3/20] UML - SMP locking commentary
Add some more commentary about various pieces of global data not needing locking. Also got rid of unmap_physmem since that is no longer used. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/drivers/net_kern.c |7 ++- arch/um/include/mem_user.h |1 - arch/um/kernel/mem.c | 13 - arch/um/kernel/physmem.c |6 +++--- 4 files changed, 17 insertions(+), 10 deletions(-) Index: linux-2.6.22/arch/um/include/mem_user.h === --- linux-2.6.22.orig/arch/um/include/mem_user.h2007-12-14 10:45:27.0 -0500 +++ linux-2.6.22/arch/um/include/mem_user.h 2007-12-14 11:19:06.0 -0500 @@ -56,7 +56,6 @@ extern void setup_physmem(unsigned long unsigned long len, unsigned long long highmem); extern void add_iomem(char *name, int fd, unsigned long size); extern unsigned long phys_offset(unsigned long phys); -extern void unmap_physmem(void); extern void map_memory(unsigned long virt, unsigned long phys, unsigned long len, int r, int w, int x); Index: linux-2.6.22/arch/um/kernel/mem.c === --- linux-2.6.22.orig/arch/um/kernel/mem.c 2007-12-14 10:45:27.0 -0500 +++ linux-2.6.22/arch/um/kernel/mem.c 2007-12-14 11:20:01.0 -0500 @@ -22,17 +22,20 @@ unsigned long *empty_zero_page = NULL; /* allocated in paging_init and unchanged thereafter */ unsigned long *empty_bad_page = NULL; + +/* + * Initialized during boot, and readonly for initializing page tables + * afterwards + */ pgd_t swapper_pg_dir[PTRS_PER_PGD]; + +/* Initialized at boot time, and readonly after that */ unsigned long long highmem; int kmalloc_ok = 0; +/* Used during early boot */ static unsigned long brk_end; -void unmap_physmem(void) -{ - os_unmap_memory((void *) brk_end, uml_reserved - brk_end); -} - static void map_cb(void *unused) { map_memory(brk_end, __pa(brk_end), uml_reserved - brk_end, 1, 1, 0); Index: linux-2.6.22/arch/um/kernel/physmem.c === --- linux-2.6.22.orig/arch/um/kernel/physmem.c 2007-12-14 10:45:27.0 -0500 +++ linux-2.6.22/arch/um/kernel/physmem.c 2007-12-14 11:19:06.0 -0500 @@ -164,10 +164,10 @@ __uml_setup("iomem=", parse_iomem, * setup_iomem, both of which run during early boot. Afterwards, it's * unchanged. */ -struct iomem_region *iomem_regions = NULL; +struct iomem_region *iomem_regions; -/* Initialized in parse_iomem */ -int iomem_size = 0; +/* Initialized in parse_iomem and unchanged thereafter */ +int iomem_size; unsigned long find_iomem(char *driver, unsigned long *len_out) { Index: linux-2.6.22/arch/um/drivers/net_kern.c === --- linux-2.6.22.orig/arch/um/drivers/net_kern.c2007-12-14 10:45:27.0 -0500 +++ linux-2.6.22/arch/um/drivers/net_kern.c 2007-12-14 11:19:06.0 -0500 @@ -368,7 +368,6 @@ static struct platform_driver uml_net_dr .name = DRIVER_NAME, }, }; -static int driver_registered; static void net_device_release(struct device *dev) { @@ -383,6 +382,12 @@ static void net_device_release(struct de free_netdev(netdev); } +/* + * Ensures that platform_driver_register is called only once by + * eth_configure. Will be set in an initcall. + */ +static int driver_registered; + static void eth_configure(int n, void *init, char *mac, struct transport *transport) { - 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 1/20] UML - Runtime detection of host VMSPLIT on i386
Calculate TASK_SIZE at run-time by figuring out the host's VMSPLIT - this is needed on i386 if UML is to run on hosts with varying VMSPLITs without recompilation. TASK_SIZE is now defined in terms of a variable, task_size. This gets rid of an include of pgtable.h from processor.h, which can cause include loops. On i386, task_size is calculated early in boot by probing the address space in a binary search to figure out where the boundary between usable and non-usable memory is. This tries to make sure that a page that is considered to be in userspace is, or can be made, read-write. I'm concerned about a system-global VDSO page in kernel memory being hit and considered to be a userspace page. On x86_64, task_size is just the old value of CONFIG_TOP_ADDR. A bunch of config variable are gone now. CONFIG_TOP_ADDR is directly replaced by TASK_SIZE. NEST_LEVEL is gone since the relocation of the stubs makes it irrelevant. All the HOST_VMSPLIT stuff is gone. All references to these in arch/um/Makefile are also gone. I noticed and fixed a missing extern in os.h when adding os_get_task_size. Note: This has been revised to fix the 32-bit UML on 64-bit host bug that Miklos ran into. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/Kconfig | 11 -- arch/um/Kconfig.i386| 37 - arch/um/Kconfig.x86_64 |4 - arch/um/Makefile| 11 -- arch/um/defconfig |3 arch/um/include/as-layout.h |2 arch/um/include/os.h|5 + arch/um/kernel/exec.c |2 arch/um/kernel/um_arch.c| 16 +++- arch/um/os-Linux/sys-i386/Makefile |2 arch/um/os-Linux/sys-i386/task_size.c | 120 arch/um/os-Linux/sys-x86_64/Makefile|2 arch/um/os-Linux/sys-x86_64/task_size.c |5 + include/asm-um/fixmap.h |3 include/asm-um/processor-generic.h |5 - 15 files changed, 153 insertions(+), 75 deletions(-) Index: linux-2.6-git/arch/um/kernel/um_arch.c === --- linux-2.6-git.orig/arch/um/kernel/um_arch.c 2008-01-17 14:32:56.0 -0500 +++ linux-2.6-git/arch/um/kernel/um_arch.c 2008-01-17 14:34:15.0 -0500 @@ -224,6 +224,11 @@ static void __init uml_postsetup(void) } /* Set during early boot */ +unsigned long task_size; +EXPORT_SYMBOL(task_size); + +unsigned long host_task_size; + unsigned long brk_start; unsigned long end_iomem; EXPORT_SYMBOL(end_iomem); @@ -250,6 +255,13 @@ int __init linux_main(int argc, char **a if (have_root == 0) add_arg(DEFAULT_COMMAND_LINE); + host_task_size = os_get_task_size(); + /* +* TASK_SIZE needs to be PGDIR_SIZE aligned or else exit_mmap craps +* out +*/ + task_size = host_task_size & PGDIR_MASK; + /* OS sanity checks that need to happen before the kernel runs */ os_early_checks(); @@ -286,7 +298,7 @@ int __init linux_main(int argc, char **a highmem = 0; iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK; - max_physmem = CONFIG_TOP_ADDR - uml_physmem - iomem_size - MIN_VMALLOC; + max_physmem = TASK_SIZE - uml_physmem - iomem_size - MIN_VMALLOC; /* * Zones have to begin on a 1 << MAX_ORDER page boundary, @@ -318,7 +330,7 @@ int __init linux_main(int argc, char **a } virtmem_size = physmem_size; - avail = CONFIG_TOP_ADDR - start_vm; + avail = TASK_SIZE - start_vm; if (physmem_size > avail) virtmem_size = avail; end_vm = start_vm + virtmem_size; Index: linux-2.6-git/include/asm-um/processor-generic.h === --- linux-2.6-git.orig/include/asm-um/processor-generic.h 2008-01-17 14:32:56.0 -0500 +++ linux-2.6-git/include/asm-um/processor-generic.h2008-01-17 14:34:15.0 -0500 @@ -11,7 +11,6 @@ struct pt_regs; struct task_struct; #include "asm/ptrace.h" -#include "asm/pgtable.h" #include "registers.h" #include "sysdep/archsetjmp.h" @@ -94,7 +93,9 @@ static inline void mm_copy_segments(stru /* * User space process size: 3GB (default). */ -#define TASK_SIZE (CONFIG_TOP_ADDR & PGDIR_MASK) +extern unsigned long task_size; + +#define TASK_SIZE (task_size) /* This decides where the kernel will search for a free chunk of vm * space during mmap's. Index: linux-2.6-git/arch/um/include/os.h === --- linux-2.6-git.orig/arch/um/include/os.h 2008-01-17 14:32:56.0 -0500 +++ linux-2.6-git/arch/um/include/os.h 2008-01-17 14:34:15.0 -0500 @@ -302,6 +302,9 @@ extern void sig_handler_common_skas(int extern int os_arch_prctl(int pid, int code, unsigned long *addr); /* tty.c */
Re: [uml-devel] [-mm Patch] uml: fix a building error
On Thu, 17 Jan 2008 11:38:53 -0800 "Pallipadi, Venkatesh" <[EMAIL PROTECTED]> wrote: > > > >-Original Message- > >From: Andrew Morton [mailto:[EMAIL PROTECTED] > >Sent: Thursday, January 17, 2008 10:56 AM > >To: Mariusz Kozlowski > >Cc: WANG Cong; [EMAIL PROTECTED]; Jeff Dike; > >user-mode-linux-devel@lists.sourceforge.net; David Miller; > >[EMAIL PROTECTED]; Ingo Molnar; Thomas Gleixner; > >Pallipadi, Venkatesh > >Subject: Re: [-mm Patch] uml: fix a building error > > > >On Thu, 17 Jan 2008 19:11:13 +0100 Mariusz Kozlowski > ><[EMAIL PROTECTED]> wrote: > > > >> Hello, > >> > >> > 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' > >> > ... > >> > >> I see this on sparc64 as well: > >> > >> CC drivers/char/mem.o > >> drivers/char/mem.c: In function 'read_mem': > >> drivers/char/mem.c:136: error: implicit declaration of > >function 'unxlate_dev_mem_ptr' > >> make[2]: *** [drivers/char/mem.o] Error 1 > >> make[1]: *** [drivers/char] Error 2 > >> make: *** [drivers] Error 2 > >> > >> Does sparc64 need similar fix? > >> > > > >The PAT patches strike again. > > > >Ingo, I think you might need to toss some cross-compilers into > >that build > >test setup of yours. > > > > These functions were defined for other archs in asm-generic/iomap.h. > We need all archs including it in io.h. I now see only few archs are > including it.. > > Apart from unxlate, there is also ioremap_wc which is defined in the > same way. > > I can send a patch for this. But, I don't have cross compiler setup for > all archs to test. Andrew, I will need your help. Well. - there are a bunch of cross-compiler binaries in http://userweb.kernel.org/~akpm/cross-compilers/ - I'll (again) encourage Ingo to add cross-compilation testing to his auto-testing setup. - I ran out of steam (and the selinux bug crashed my remote cross-compilation test box) so I didn't do much cross-compilation testing on rc8-mm1: just alpha and ia64 iirc. I'd suggest that you just prepare a best-effort patch and when I next get around to doing more cross-compilation any problems shold get weeded out. - 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] [-mm Patch] uml: fix a building error
Hello, > >> > 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' > >> > ... > >> > >> I see this on sparc64 as well: > >> > >> CC drivers/char/mem.o > >> drivers/char/mem.c: In function 'read_mem': > >> drivers/char/mem.c:136: error: implicit declaration of > >function 'unxlate_dev_mem_ptr' > >> make[2]: *** [drivers/char/mem.o] Error 1 > >> make[1]: *** [drivers/char] Error 2 > >> make: *** [drivers] Error 2 > >> > >> Does sparc64 need similar fix? > >> > > > >The PAT patches strike again. > > > >Ingo, I think you might need to toss some cross-compilers into > >that build > >test setup of yours. > > These functions were defined for other archs in asm-generic/iomap.h. > We need all archs including it in io.h. I now see only few archs are > including it.. > > Apart from unxlate, there is also ioremap_wc which is defined in the > same way. > > I can send a patch for this. But, I don't have cross compiler setup for > all archs to test. Andrew, I will need your help. I can confirm that this fixes the build problem for sparc64 here. Regards, Mariusz - 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] [-mm Patch] uml: fix a building error
On Thu, Jan 17, 2008 at 11:38:53AM -0800, Pallipadi, Venkatesh wrote: > Apart from unxlate, there is also ioremap_wc which is defined in the > same way. And while we're on the subject, what's the deal with these, in include/asm-x86/io.h? #define ioremap_wc ioremap_wc #define unxlate_dev_mem_ptr unxlate_dev_mem_ptr Jeff -- Work email - jdike at linux dot intel dot com - 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 14/20] UML - Remove map_cb
John Reiser noticed that a physical memory region was being mapped twice. This patch fixes that, and it inlines the responsible function, as that had only one caller. Cc: John Reiser <[EMAIL PROTECTED]> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/kernel/mem.c |8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) Index: linux-2.6.22/arch/um/kernel/mem.c === --- linux-2.6.22.orig/arch/um/kernel/mem.c 2008-01-02 11:44:36.0 -0500 +++ linux-2.6.22/arch/um/kernel/mem.c 2008-01-02 12:08:45.0 -0500 @@ -36,11 +36,6 @@ int kmalloc_ok = 0; /* Used during early boot */ static unsigned long brk_end; -static void map_cb(void *unused) -{ - map_memory(brk_end, __pa(brk_end), uml_reserved - brk_end, 1, 1, 0); -} - #ifdef CONFIG_HIGHMEM static void setup_highmem(unsigned long highmem_start, unsigned long highmem_len) @@ -68,8 +63,7 @@ void __init mem_init(void) * to be turned on. */ brk_end = (unsigned long) UML_ROUND_UP(sbrk(0)); - map_cb(NULL); - initial_thread_cb(map_cb, NULL); + map_memory(brk_end, __pa(brk_end), uml_reserved - brk_end, 1, 1, 0); free_bootmem(__pa(brk_end), uml_reserved - brk_end); uml_reserved = brk_end; - 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 16/20] UML - Use of a public MAC is a warning, not an error
Downgrade one of the MAC validity checks. If it's one that could be possibly assigned to a physical NIC, then nothing will break. So, emit a warning in this case, but keep the requested MAC. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/drivers/net_kern.c |9 - 1 file changed, 4 insertions(+), 5 deletions(-) Index: linux-2.6-git/arch/um/drivers/net_kern.c === --- linux-2.6-git.orig/arch/um/drivers/net_kern.c 2008-01-02 13:16:19.0 -0500 +++ linux-2.6-git/arch/um/drivers/net_kern.c2008-01-02 15:37:02.0 -0500 @@ -318,7 +318,7 @@ static void setup_etheraddr(char *str, u if (str == NULL) goto random; - for (i = 0;i < 6; i++) { + for (i = 0; i < 6; i++) { addr[i] = simple_strtoul(str, &end, 16); if ((end == str) || ((*end != ':') && (*end != ',') && (*end != '\0'))) { @@ -343,14 +343,13 @@ static void setup_etheraddr(char *str, u } if (!is_local_ether_addr(addr)) { printk(KERN_WARNING - "Warning: attempt to assign a globally valid ethernet " + "Warning: Assigning a globally valid ethernet " "address to a device\n"); - printk(KERN_WARNING "You should better enable the 2nd " - "rightmost bit in the first byte of the MAC,\n"); + printk(KERN_WARNING "You should set the 2nd rightmost bit in " + "the first byte of the MAC,\n"); printk(KERN_WARNING "i.e. %02x:%02x:%02x:%02x:%02x:%02x\n", addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4], addr[5]); - goto random; } return; - 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 19/20] UML - port mutex conversion
From: Daniel Walker <[EMAIL PROTECTED]> The port_sem is already used as a mutex since it's using DECLARE_MUTEX(), but the underlying construct is still a semaphore .. This patch switches it over to a struct mutex. Signed-off-by: Daniel Walker <[EMAIL PROTECTED]> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/drivers/port_kern.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) Index: linux-2.6.22/arch/um/drivers/port_kern.c === --- linux-2.6.22.orig/arch/um/drivers/port_kern.c 2008-01-17 13:44:46.0 -0500 +++ linux-2.6.22/arch/um/drivers/port_kern.c2008-01-17 13:47:39.0 -0500 @@ -6,6 +6,7 @@ #include "linux/completion.h" #include "linux/interrupt.h" #include "linux/list.h" +#include "linux/mutex.h" #include "asm/atomic.h" #include "init.h" #include "irq_kern.h" @@ -120,7 +121,7 @@ static int port_accept(struct port_list return 0; } -static DECLARE_MUTEX(ports_sem); +static DEFINE_MUTEX(ports_mutex); static LIST_HEAD(ports); static void port_work_proc(struct work_struct *unused) @@ -161,7 +162,7 @@ void *port_data(int port_num) struct port_dev *dev = NULL; int fd; - down(&ports_sem); + mutex_lock(&ports_mutex); list_for_each(ele, &ports) { port = list_entry(ele, struct port_list, list); if (port->port == port_num) @@ -216,7 +217,7 @@ void *port_data(int port_num) out_free: kfree(port); out: - up(&ports_sem); + mutex_unlock(&ports_mutex); return dev; } - 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 10/20] UML - Move register initialization
Calling init_registers inside the skas3 checking causes mysterious crashes if it doesn't happen because the skas3 checking is bypassed. This patch moves it to os_early_checks. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/os-Linux/start_up.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) Index: linux-2.6.22/arch/um/os-Linux/start_up.c === --- linux-2.6.22.orig/arch/um/os-Linux/start_up.c 2007-12-19 13:15:22.0 -0500 +++ linux-2.6.22/arch/um/os-Linux/start_up.c2007-12-19 13:16:08.0 -0500 @@ -342,6 +342,8 @@ static void __init check_coredump_limit( void __init os_early_checks(void) { + int pid; + /* Print out the core dump limits early */ check_coredump_limit(); @@ -351,6 +353,11 @@ void __init os_early_checks(void) * kernel is running. */ check_tmpexec(); + + pid = start_ptraced_child(); + if (init_registers(pid)) + fatal("Failed to initialize default registers"); + stop_ptraced_child(pid, 1, 1); } static int __init noprocmm_cmd_param(char *str, int* add) @@ -412,9 +419,6 @@ static inline void check_skas3_ptrace_fa non_fatal("found\n"); } - if (init_registers(pid)) - fatal("Failed to initialize default registers"); - stop_ptraced_child(pid, 1, 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 9/20] UML - Add newlines to printks
Some printks were missing newlines. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/os-Linux/skas/process.c |8 1 file changed, 4 insertions(+), 4 deletions(-) Index: linux-2.6.22/arch/um/os-Linux/skas/process.c === --- linux-2.6.22.orig/arch/um/os-Linux/skas/process.c 2007-12-19 13:13:54.0 -0500 +++ linux-2.6.22/arch/um/os-Linux/skas/process.c2007-12-19 13:14:16.0 -0500 @@ -273,7 +273,7 @@ int start_userspace(unsigned long stub_s if (stack == MAP_FAILED) { err = -errno; printk(UM_KERN_ERR "start_userspace : mmap failed, " - "errno = %d", errno); + "errno = %d\n", errno); return err; } @@ -289,7 +289,7 @@ int start_userspace(unsigned long stub_s if (pid < 0) { err = -errno; printk(UM_KERN_ERR "start_userspace : clone failed, " - "errno = %d", errno); + "errno = %d\n", errno); return err; } @@ -298,7 +298,7 @@ int start_userspace(unsigned long stub_s if (n < 0) { err = -errno; printk(UM_KERN_ERR "start_userspace : wait failed, " - "errno = %d", errno); + "errno = %d\n", errno); goto out_kill; } } while (WIFSTOPPED(status) && (WSTOPSIG(status) == SIGVTALRM)); @@ -306,7 +306,7 @@ int start_userspace(unsigned long stub_s if (!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGSTOP)) { err = -EINVAL; printk(UM_KERN_ERR "start_userspace : expected SIGSTOP, got " - "status = %d", status); + "status = %d\n", status); goto out_kill; } - 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 15/20] UML - Fix infinite mconsole loop
From: Karol Swietlicki <[EMAIL PROTECTED]> This patch takes care of a problem with the stopping code. The function inside the while condition returns 0 to signify a problem. A problem could be for example a bad command or a bad version of the mconsole client. A bad command would terminate the stopping loop and resume the kernel. This is a problem. A better solution is to make the loop infinite and don't leave it until we are explicitly told to. Signed-off-by: Karol Swietlicki <[EMAIL PROTECTED]> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/drivers/mconsole_kern.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: linux-2.6.22/arch/um/drivers/mconsole_kern.c === --- linux-2.6.22.orig/arch/um/drivers/mconsole_kern.c 2007-12-12 13:44:20.0 -0500 +++ linux-2.6.22/arch/um/drivers/mconsole_kern.c2007-12-12 15:53:08.0 -0500 @@ -305,7 +305,9 @@ void mconsole_stop(struct mc_request *re deactivate_fd(req->originating_fd, MCONSOLE_IRQ); os_set_fd_block(req->originating_fd, 1); mconsole_reply(req, "stopped", 0, 0); - while (mconsole_get_request(req->originating_fd, req)) { + for (;;) { + if (!mconsole_get_request(req->originating_fd, req)) + continue; if (req->cmd->handler == mconsole_go) break; if (req->cmd->handler == mconsole_stop) { - 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 18/20] UML - mconsole mutex conversion
From: Daniel Walker <[EMAIL PROTECTED]> The plug_mem_mutex is already used as a mutex since it's using DECLARE_MUTEX(), but the underlying construct is still a semaphore .. This patch switches it over to a struct mutex. Signed-off-by: Daniel Walker <[EMAIL PROTECTED]> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/drivers/mconsole_kern.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) Index: linux-2.6-git/arch/um/drivers/mconsole_kern.c === --- linux-2.6-git.orig/arch/um/drivers/mconsole_kern.c 2008-01-17 14:35:43.0 -0500 +++ linux-2.6-git/arch/um/drivers/mconsole_kern.c 2008-01-17 14:37:29.0 -0500 @@ -17,6 +17,7 @@ #include "linux/syscalls.h" #include "linux/utsname.h" #include "linux/workqueue.h" +#include "linux/mutex.h" #include "asm/uaccess.h" #include "init.h" #include "irq_kern.h" @@ -360,7 +361,7 @@ struct unplugged_pages { void *pages[UNPLUGGED_PER_PAGE]; }; -static DECLARE_MUTEX(plug_mem_mutex); +static DEFINE_MUTEX(plug_mem_mutex); static unsigned long long unplugged_pages_count = 0; static LIST_HEAD(unplugged_pages); static int unplug_index = UNPLUGGED_PER_PAGE; @@ -396,7 +397,7 @@ static int mem_config(char *str, char ** diff /= PAGE_SIZE; - down(&plug_mem_mutex); + mutex_lock(&plug_mem_mutex); for (i = 0; i < diff; i++) { struct unplugged_pages *unplugged; void *addr; @@ -453,7 +454,7 @@ static int mem_config(char *str, char ** err = 0; out_unlock: - up(&plug_mem_mutex); + mutex_unlock(&plug_mem_mutex); out: return err; } - 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 12/20] UML - Remove TOPDIR
From: WANG Cong <[EMAIL PROTECTED]> TOPDIR is obsolete, use srctree instead. This patch removes TOPDIR from all UML Makefiles. Cc: Sam Ravnborg <[EMAIL PROTECTED]> Signed-off-by: WANG Cong <[EMAIL PROTECTED]> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/Makefile |4 ++-- arch/um/sys-ppc/Makefile | 22 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) Index: linux-2.6.22/arch/um/Makefile === --- linux-2.6.22.orig/arch/um/Makefile 2008-01-01 18:39:11.0 -0500 +++ linux-2.6.22/arch/um/Makefile 2008-01-02 09:59:21.0 -0500 @@ -149,7 +149,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 @@ -159,7 +159,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: Index: linux-2.6.22/arch/um/sys-ppc/Makefile === --- linux-2.6.22.orig/arch/um/sys-ppc/Makefile 2007-11-14 10:33:29.0 -0500 +++ linux-2.6.22/arch/um/sys-ppc/Makefile 2008-01-02 09:59:21.0 -0500 @@ -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 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 20/20] UML - defconfig tweaks
Tweak the UML defconfig - we probably don't need 256 old-style ptys - this slows down udev noticably enable hostfs disable slab debugging - another noticable performance hit Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/defconfig |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Index: linux-2.6.22/arch/um/defconfig === --- linux-2.6.22.orig/arch/um/defconfig 2008-01-17 14:39:06.0 -0500 +++ linux-2.6.22/arch/um/defconfig 2008-01-17 14:40:07.0 -0500 @@ -75,7 +75,7 @@ CONFIG_LD_SCRIPT_DYN=y CONFIG_NET=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=m -# CONFIG_HOSTFS is not set +CONFIG_HOSTFS=y # CONFIG_HPPFS is not set CONFIG_MCONSOLE=y CONFIG_MAGIC_SYSRQ=y @@ -185,7 +185,7 @@ CONFIG_CON_CHAN="xterm" CONFIG_SSL_CHAN="pts" CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LEGACY_PTY_COUNT=32 # CONFIG_WATCHDOG is not set CONFIG_UML_SOUND=m CONFIG_SOUND=m @@ -505,7 +505,7 @@ CONFIG_DEBUG_KERNEL=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set -CONFIG_DEBUG_SLAB=y +# CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SLAB_LEAK is not set # CONFIG_DEBUG_MUTEXES is not set # CONFIG_DEBUG_SPINLOCK is not set - 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 13/20] UML - Spelling fix
From: Joe Perches <[EMAIL PROTECTED]> Spelling fix Signed-off-by: Joe Perches <[EMAIL PROTECTED]> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/sys-x86_64/signal.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-git/arch/um/sys-x86_64/signal.c === --- linux-2.6-git.orig/arch/um/sys-x86_64/signal.c 2008-01-02 11:25:13.0 -0500 +++ linux-2.6-git/arch/um/sys-x86_64/signal.c 2008-01-02 12:01:05.0 -0500 @@ -112,7 +112,7 @@ static int copy_sc_to_user(struct sigcon err |= PUTREG(regs, RSI, to, rsi); err |= PUTREG(regs, RBP, to, rbp); /* -* Must use orignal RSP, which is passed in, rather than what's in +* Must use original RSP, which is passed in, rather than what's in * the pt_regs, because that's already been updated to point at the * signal frame. */ - 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 17/20] UML - LDT mutex conversion
From: Daniel Walker <[EMAIL PROTECTED]> The ldt.semaphore conforms to the new struct mutex requirments, so I converted it to use the new API and changed the name. Signed-off-by: Daniel Walker <[EMAIL PROTECTED]> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/sys-i386/ldt.c | 14 +++--- include/asm-um/ldt.h |4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) Index: linux-2.6.22/arch/um/sys-i386/ldt.c === --- linux-2.6.22.orig/arch/um/sys-i386/ldt.c2008-01-17 13:44:46.0 -0500 +++ linux-2.6.22/arch/um/sys-i386/ldt.c 2008-01-17 13:45:32.0 -0500 @@ -147,7 +147,7 @@ static int read_ldt(void __user * ptr, u if (ptrace_ldt) return read_ldt_from_host(ptr, bytecount); - down(&ldt->semaphore); + mutex_lock(&ldt->lock); if (ldt->entry_count <= LDT_DIRECT_ENTRIES) { size = LDT_ENTRY_SIZE*LDT_DIRECT_ENTRIES; if (size > bytecount) @@ -171,7 +171,7 @@ static int read_ldt(void __user * ptr, u ptr += size; } } - up(&ldt->semaphore); + mutex_unlock(&ldt->lock); if (bytecount == 0 || err == -EFAULT) goto out; @@ -229,7 +229,7 @@ static int write_ldt(void __user * ptr, } if (!ptrace_ldt) - down(&ldt->semaphore); + mutex_lock(&ldt->lock); err = write_ldt_entry(mm_idp, func, &ldt_info, &addr, 1); if (err) @@ -289,7 +289,7 @@ static int write_ldt(void __user * ptr, err = 0; out_unlock: - up(&ldt->semaphore); + mutex_unlock(&ldt->lock); out: return err; } @@ -396,7 +396,7 @@ long init_new_ldt(struct mm_context *new if (!ptrace_ldt) - init_MUTEX(&new_mm->ldt.semaphore); + mutex_init(&new_mm->ldt.lock); if (!from_mm) { memset(&desc, 0, sizeof(desc)); @@ -456,7 +456,7 @@ long init_new_ldt(struct mm_context *new * i.e., we have to use the stub for modify_ldt, which * can't handle the big read buffer of up to 64kB. */ - down(&from_mm->ldt.semaphore); + mutex_lock(&from_mm->ldt.lock); if (from_mm->ldt.entry_count <= LDT_DIRECT_ENTRIES) memcpy(new_mm->ldt.u.entries, from_mm->ldt.u.entries, sizeof(new_mm->ldt.u.entries)); @@ -475,7 +475,7 @@ long init_new_ldt(struct mm_context *new } } new_mm->ldt.entry_count = from_mm->ldt.entry_count; - up(&from_mm->ldt.semaphore); + mutex_unlock(&from_mm->ldt.lock); } out: Index: linux-2.6.22/include/asm-um/ldt.h === --- linux-2.6.22.orig/include/asm-um/ldt.h 2007-11-14 10:33:41.0 -0500 +++ linux-2.6.22/include/asm-um/ldt.h 2008-01-17 13:45:32.0 -0500 @@ -8,7 +8,7 @@ #ifndef __ASM_LDT_H #define __ASM_LDT_H -#include "asm/semaphore.h" +#include #include "asm/host_ldt.h" extern void ldt_host_info(void); @@ -27,7 +27,7 @@ struct ldt_entry { typedef struct uml_ldt { int entry_count; - struct semaphore semaphore; + struct mutex lock; union { struct ldt_entry * pages[LDT_PAGES_MAX]; struct ldt_entry entries[LDT_DIRECT_ENTRIES]; - 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 11/20] UML - Remove unused fields from mm_context
The 3-level page table fixes forgot to remove a couple now-unused fields from struct mm_context. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> --- arch/um/include/um_mmu.h |4 1 file changed, 4 deletions(-) Index: linux-2.6.22/arch/um/include/um_mmu.h === --- linux-2.6.22.orig/arch/um/include/um_mmu.h 2007-12-19 13:17:20.0 -0500 +++ linux-2.6.22/arch/um/include/um_mmu.h 2007-12-19 19:34:49.0 -0500 @@ -12,10 +12,6 @@ typedef struct mm_context { struct mm_id id; - unsigned long last_page_table; -#ifdef CONFIG_3_LEVEL_PGTABLES - unsigned long last_pmd; -#endif struct uml_ldt ldt; } mm_context_t; - 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] [-mm Patch] uml: fix a building error
On Thu, Jan 17, 2008 at 01:41:50PM -0800, Venki Pallipadi wrote: > > And while we're on the subject, what's the deal with these, in > > include/asm-x86/io.h? > > > > #define ioremap_wc ioremap_wc > > #define unxlate_dev_mem_ptr unxlate_dev_mem_ptr > > > > If archs want to override the defaults for these two functions, they define > the above and then include asm-generic/iomap.h. That wasn't really the question. #define X X is a no-op, yes? Jeff -- Work email - jdike at linux dot intel dot com - 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] [-mm Patch] uml: fix a building error
On Thu, Jan 17, 2008 at 04:14:37PM -0500, Jeff Dike wrote: > On Thu, Jan 17, 2008 at 11:38:53AM -0800, Pallipadi, Venkatesh wrote: > > Apart from unxlate, there is also ioremap_wc which is defined in the > > same way. > > And while we're on the subject, what's the deal with these, in > include/asm-x86/io.h? > > #define ioremap_wc ioremap_wc > #define unxlate_dev_mem_ptr unxlate_dev_mem_ptr > If archs want to override the defaults for these two functions, they define the above and then include asm-generic/iomap.h. Archs which doesnt want to implement anything in these new funcs just have to include asm-generic/iomap.h which has the proper stubs. So, a patch like the below is what is required here for all archs to include asm-generic iomap.h (without the other patch that defines null unxlate in asm specific header). Totally untested. Thanks, Venki Signed-off-by: Venkatesh Pallipadi <[EMAIL PROTECTED]> Index: linux-2.6.git/include/asm-arm/io.h === --- linux-2.6.git.orig/include/asm-arm/io.h 2008-01-17 06:28:06.0 -0800 +++ linux-2.6.git/include/asm-arm/io.h 2008-01-17 06:39:13.0 -0800 @@ -27,6 +27,8 @@ #include #include +#include + /* * ISA I/O bus memory addresses are 1:1 with the physical address. */ Index: linux-2.6.git/include/asm-avr32/io.h === --- linux-2.6.git.orig/include/asm-avr32/io.h 2008-01-17 06:28:06.0 -0800 +++ linux-2.6.git/include/asm-avr32/io.h2008-01-17 06:39:13.0 -0800 @@ -10,6 +10,8 @@ #include +#include + /* virt_to_phys will only work when address is in P1 or P2 */ static __inline__ unsigned long virt_to_phys(volatile void *address) { Index: linux-2.6.git/include/asm-blackfin/io.h === --- linux-2.6.git.orig/include/asm-blackfin/io.h2008-01-17 06:28:06.0 -0800 +++ linux-2.6.git/include/asm-blackfin/io.h 2008-01-17 06:39:13.0 -0800 @@ -8,6 +8,8 @@ #endif #include +#include + /* * These are for ISA/PCI shared memory _only_ and should never be used * on any other type of memory, including Zorro memory. They are meant to Index: linux-2.6.git/include/asm-cris/io.h === --- linux-2.6.git.orig/include/asm-cris/io.h2008-01-17 06:28:06.0 -0800 +++ linux-2.6.git/include/asm-cris/io.h 2008-01-17 06:39:13.0 -0800 @@ -5,6 +5,8 @@ #include #include +#include + struct cris_io_operations { u32 (*read_mem)(void *addr, int size); Index: linux-2.6.git/include/asm-frv/io.h === --- linux-2.6.git.orig/include/asm-frv/io.h 2008-01-17 06:28:06.0 -0800 +++ linux-2.6.git/include/asm-frv/io.h 2008-01-17 06:39:13.0 -0800 @@ -23,6 +23,8 @@ #include #include +#include + /* * swap functions are sometimes needed to interface little-endian hardware */ Index: linux-2.6.git/include/asm-h8300/io.h === --- linux-2.6.git.orig/include/asm-h8300/io.h 2008-01-17 06:28:06.0 -0800 +++ linux-2.6.git/include/asm-h8300/io.h2008-01-17 06:39:13.0 -0800 @@ -13,6 +13,8 @@ #error UNKNOWN CPU TYPE #endif +#include + /* * These are for ISA/PCI shared memory _only_ and should never be used Index: linux-2.6.git/include/asm-m32r/io.h === --- linux-2.6.git.orig/include/asm-m32r/io.h2008-01-17 06:28:06.0 -0800 +++ linux-2.6.git/include/asm-m32r/io.h 2008-01-17 06:39:13.0 -0800 @@ -5,6 +5,8 @@ #include #include /* __va */ +#include + #ifdef __KERNEL__ #define IO_SPACE_LIMIT 0x Index: linux-2.6.git/include/asm-m68knommu/io.h === --- linux-2.6.git.orig/include/asm-m68knommu/io.h 2008-01-17 06:28:06.0 -0800 +++ linux-2.6.git/include/asm-m68knommu/io.h2008-01-17 06:39:13.0 -0800 @@ -1,6 +1,8 @@ #ifndef _M68KNOMMU_IO_H #define _M68KNOMMU_IO_H +#include + #ifdef __KERNEL__ Index: linux-2.6.git/include/asm-ppc/io.h === --- linux-2.6.git.orig/include/asm-ppc/io.h 2008-01-17 06:28:06.0 -0800 +++ linux-2.6.git/include/asm-ppc/io.h 2008-01-17 06:39:13.0 -0800 @@ -10,6 +10,8 @@ #include #include +#include + #define SIO_CONFIG_RA 0x398 #define SIO_CONFIG_RD 0x399 Index: linux-2.6.git/include/asm-s390/io.h === --- linux-2.6.git.orig/include/asm-s390/io.h2008-01-17 06:28:06.0 -0800 +++ linux-2.6.git/include/asm-s390/io.h 2008-01-17 06:39:13.0 -0800 @@ -15,6 +15,8 @@ #in
Re: [uml-devel] [-mm Patch] uml: fix a building error
>-Original Message- >From: Jeff Dike [mailto:[EMAIL PROTECTED] >Sent: Thursday, January 17, 2008 3:08 PM >To: Pallipadi, Venkatesh >Cc: Andrew Morton; Mariusz Kozlowski; WANG Cong; >[EMAIL PROTECTED]; >user-mode-linux-devel@lists.sourceforge.net; David Miller; >[EMAIL PROTECTED]; Ingo Molnar; Thomas Gleixner >Subject: Re: [-mm Patch] uml: fix a building error > >On Thu, Jan 17, 2008 at 01:41:50PM -0800, Venki Pallipadi wrote: >> > And while we're on the subject, what's the deal with these, in >> > include/asm-x86/io.h? >> > >> > #define ioremap_wc ioremap_wc >> > #define unxlate_dev_mem_ptr unxlate_dev_mem_ptr >> > >> >> If archs want to override the defaults for these two >functions, they define >> the above and then include asm-generic/iomap.h. > >That wasn't really the question. > >#define X X > >is a no-op, yes? > Later there is code in generic.h which is doing #ifndef ioremap_wc #define ioremap_wc ioremap_nocache #endif Thanks, Venki - 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] [-mm Patch] uml: fix a building error
On Thu, Jan 17, 2008 at 03:17:38PM -0800, Pallipadi, Venkatesh wrote: > >#define X X > > > >is a no-op, yes? > > > > Later there is code in generic.h which is doing > #ifndef ioremap_wc > #define ioremap_wc ioremap_nocache > #endif Ah, that makes a bit more sense. It'd be nice if there was less of a WTF factor there, though. Jeff -- Work email - jdike at linux dot intel dot com - 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