Re: [uml-devel] Re: [RFC] PATCH 0/4 - Time virtualization
On Wednesday 26 April 2006 20:01, Jeff Dike wrote: > On Wed, Apr 19, 2006 at 02:25:00AM -0600, Eric W. Biederman wrote: > > In the case of migration the ugly case to properly handle is the > > monotonic timer. That needs an offset yet it is absolutely forbidden > > to provide that offset from the inside. So this is the one namespace > > that I think is inappropriate to use sys_unshare to create. > > We need a system call so that we can specify the minimum or the > > starting monotonic time base. > For migration, it looks like the container will have to specify the > time base at creation so that everything in it will have a consistent > view of time if they get moved around. > So, maybe it belongs in clone as a "backwards" flag similar to > CLONE_NEWNS. I must note that currently every (?) flag allowed for unshare is also allowed for clone, so you need to do that anyway. -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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] Re: [RFC] PATCH 0/4 - Time virtualization
On Fri, Apr 28, 2006 at 01:33:40PM +0200, Blaisorblade wrote: > > So, maybe it belongs in clone as a "backwards" flag similar to > > CLONE_NEWNS. > > I must note that currently every (?) flag allowed for unshare is also allowed > for clone, so you need to do that anyway. Currently. We are running out of CLONE_ bits - in mainline, there are three left, and two of them are likely to be used by CLONE_TIME and CLONE_UTSNAME (or whatever that turns out to be called). I'm eyeing the low eight bits (CSIGNAL) for future unshare flags, but those would be unusable in clone(). And why should there be any overlap between clone flags and unshare flags? Isn't clone(CLONE_TIME); the same as clone(); unshare(CLONE_TIME); ? Jeff --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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] Re: [RFC] PATCH 0/4 - Time virtualization
On Fri, Apr 28, 2006 at 07:48:23AM -0400, Jeff Dike wrote: > Currently. We are running out of CLONE_ bits - in mainline, there are > three left Errr, make that seven, and I can still see those being used up. Jeff --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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] Re: [RFC] PATCH 0/4 - Time virtualization
On Friday 28 April 2006 13:48, Jeff Dike wrote: > On Fri, Apr 28, 2006 at 01:33:40PM +0200, Blaisorblade wrote: > > > So, maybe it belongs in clone as a "backwards" flag similar to > > > CLONE_NEWNS. > > I must note that currently every (?) flag allowed for unshare is also > > allowed for clone, so you need to do that anyway. > Currently. We are running out of CLONE_ bits - in mainline, there are > three left, and two of them are likely to be used by CLONE_TIME and > CLONE_UTSNAME (or whatever that turns out to be called). > And why should there be any overlap between clone flags and unshare > flags? Isn't > clone(CLONE_TIME); > the same as > clone(); > unshare(CLONE_TIME); > ? Now that unshare() exists, you're right, the current situation is just due to unshare() being an afterthought; the second form (clone() + unshare()) is actually more similar to the classical fork() API conceptually (i.e. you don't need a call with thousands of parameters to create a process, you can specify everything later). So we get back to Eric's objection (which I haven't understood but that's my problem). Additionally, if this flag ever goes into clone, it mustn't be named CLONE_TIME, but CLONE_NEWTIME (or CLONE_NEWUTS). And given CLONE_NEWNS, it's IMHO ok to have unshare(CLONE_NEWTIME) to mean "unshare time namespace", even if it's incoherent with unshare(CLONE_FS) - the incoherency already exists with CLONE_NEWNS. -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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] Re: [RFC] PATCH 0/4 - Time virtualization
On Fri, Apr 28, 2006 at 03:54:31PM +0200, Blaisorblade wrote: > Additionally, if this flag ever goes into clone, it mustn't be named > CLONE_TIME, but CLONE_NEWTIME (or CLONE_NEWUTS). And given CLONE_NEWNS, it's > IMHO ok to have unshare(CLONE_NEWTIME) to mean "unshare time namespace", even > if it's incoherent with unshare(CLONE_FS) - the incoherency already exists > with CLONE_NEWNS. I wonder if they should be CLONE_* at all. Given that we are likely to run out of free CLONE_* bits, unshare will have to reuse bits that don't have anything to do with sharing resources (CSIGNAL, CLONE_VFORK, etc), and it doesn't seem that nice to have two different CLONE_* flags with the same value, different meaning, only one of which can actually be used in clone. It seems better to use UNSHARE_*, with the current bits that are common to unshare and clone being defined the same, i.e. #define UNSHARE_VM CLONE_VM Jeff --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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] Re: [RFC] PATCH 0/4 - Time virtualization
Blaisorblade <[EMAIL PROTECTED]> writes: > So we get back to Eric's objection (which I haven't understood but that's my > problem). My objection is that to handle the monotonic timer we need an additional struct timespec argument when we create the time namespace. There does not appear to be space in clone or unshare to pass that value. Eric --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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/6] UML - Small patches for 2.6.17
These patches are 2.6.17 material. They are small bug fixes and cleanups - the one functional change, skas0 support for 2G/2G hosts, is innocuous and tested. Jeff --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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/6] UML - Clean up after MADVISE_REMOVE
The MADVISE_REMOVE-checking code didn't clean up after itself. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Index: linux-2.6.16/arch/um/os-Linux/process.c === --- linux-2.6.16.orig/arch/um/os-Linux/process.c2006-04-27 20:51:58.0 -0400 +++ linux-2.6.16/arch/um/os-Linux/process.c 2006-04-28 12:20:55.0 -0400 @@ -206,29 +206,36 @@ int os_drop_memory(void *addr, int lengt int can_drop_memory(void) { void *addr; - int fd; + int fd, ok = 0; printk("Checking host MADV_REMOVE support..."); fd = create_mem_file(UM_KERN_PAGE_SIZE); if(fd < 0){ printk("Creating test memory file failed, err = %d\n", -fd); - return 0; + goto out; } addr = mmap64(NULL, UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if(addr == MAP_FAILED){ printk("Mapping test memory file failed, err = %d\n", -errno); - return 0; + goto out_close; } if(madvise(addr, UM_KERN_PAGE_SIZE, MADV_REMOVE) != 0){ printk("MADV_REMOVE failed, err = %d\n", -errno); - return 0; + goto out_unmap; } printk("OK\n"); - return 1; + ok = 1; + +out_unmap: + munmap(addr, UM_KERN_PAGE_SIZE); +out_close: + close(fd); +out: + return ok; } void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)) --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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/6] UML - skas0 support for 2G/2G hosts
From: Joris van Rantwijk <[EMAIL PROTECTED]> A quick hack to allow skas0 mode to run on 2G/2G hosts. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Index: linux-2.6.16/arch/um/Kconfig.i386 === --- linux-2.6.16.orig/arch/um/Kconfig.i386 2006-04-26 11:30:35.0 -0400 +++ linux-2.6.16/arch/um/Kconfig.i386 2006-04-26 11:39:54.0 -0400 @@ -16,6 +16,19 @@ config SEMAPHORE_SLEEPERS bool default y +config HOST_2G_2G + bool "2G/2G host address space split" + default n + help + This is needed when the host on which you run has a 2G/2G memory + split, instead of the customary 3G/1G. + + Note that to enable such a host + configuration, which makes sense only in some cases, you need special + host patches. + + So, if you do not know what to do here, say 'N'. + config TOP_ADDR hex default 0xc000 if !HOST_2G_2G @@ -35,11 +48,13 @@ config 3_LEVEL_PGTABLES config STUB_CODE hex - default 0xbfffe000 + default 0xbfffe000 if !HOST_2G_2G + default 0x7fffe000 if HOST_2G_2G config STUB_DATA hex - default 0xb000 + default 0xb000 if !HOST_2G_2G + default 0x7000 if HOST_2G_2G config STUB_START hex Index: linux-2.6.16/arch/um/Kconfig === --- linux-2.6.16.orig/arch/um/Kconfig 2006-04-25 12:00:49.0 -0400 +++ linux-2.6.16/arch/um/Kconfig2006-04-26 11:39:40.0 -0400 @@ -57,20 +57,6 @@ config STATIC_LINK chroot, and you disable CONFIG_MODE_TT, you probably want to say Y here. -config HOST_2G_2G - bool "2G/2G host address space split" - default n - depends on MODE_TT - help - This is needed when the host on which you run has a 2G/2G memory - split, instead of the customary 3G/1G. - - Note that to enable such a host - configuration, which makes sense only in some cases, you need special - host patches. - - So, if you do not know what to do here, say 'N'. - config KERNEL_HALF_GIGS int "Kernel address space size (in .5G units)" default "1" --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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 5/6] UML - update defconfig
Bring defconfig up to date. Also disable CONFIG_BLK_DEV_UBD_SYNC by default. By performing synchronous I/O to the host, it slows things down, only protects against host crashes, and can make a UML appear to hang while it waits for the host's disk. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Index: linux-2.6.16/arch/um/defconfig === --- linux-2.6.16.orig/arch/um/defconfig 2005-08-28 19:41:01.0 -0400 +++ linux-2.6.16/arch/um/defconfig 2006-04-28 09:31:35.0 -0400 @@ -1,14 +1,13 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.12-rc6-mm1 -# Tue Jun 14 18:22:21 2005 +# Linux kernel version: 2.6.17-rc3 +# Fri Apr 28 09:31:20 2006 # CONFIG_GENERIC_HARDIRQS=y CONFIG_UML=y CONFIG_MMU=y -CONFIG_UID16=y -CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_IRQ_RELEASE_METHOD=y # # UML-specific options @@ -16,8 +15,50 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y # CONFIG_MODE_TT is not set # CONFIG_STATIC_LINK is not set CONFIG_MODE_SKAS=y + +# +# Host processor type and features +# +# CONFIG_M386 is not set +# CONFIG_M486 is not set +# CONFIG_M586 is not set +# CONFIG_M586TSC is not set +# CONFIG_M586MMX is not set +CONFIG_M686=y +# CONFIG_MPENTIUMII is not set +# CONFIG_MPENTIUMIII is not set +# CONFIG_MPENTIUMM is not set +# CONFIG_MPENTIUM4 is not set +# CONFIG_MK6 is not set +# CONFIG_MK7 is not set +# CONFIG_MK8 is not set +# CONFIG_MCRUSOE is not set +# CONFIG_MEFFICEON is not set +# CONFIG_MWINCHIPC6 is not set +# CONFIG_MWINCHIP2 is not set +# CONFIG_MWINCHIP3D is not set +# CONFIG_MGEODEGX1 is not set +# CONFIG_MGEODE_LX is not set +# CONFIG_MCYRIXIII is not set +# CONFIG_MVIAC3_2 is not set +# CONFIG_X86_GENERIC is not set +CONFIG_X86_CMPXCHG=y +CONFIG_X86_XADD=y +CONFIG_X86_L1_CACHE_SHIFT=5 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_X86_PPRO_FENCE=y +CONFIG_X86_WP_WORKS_OK=y +CONFIG_X86_INVLPG=y +CONFIG_X86_BSWAP=y +CONFIG_X86_POPAD_OK=y +CONFIG_X86_CMPXCHG64=y +CONFIG_X86_GOOD_APIC=y +CONFIG_X86_USE_PPRO_CHECKSUM=y +CONFIG_X86_TSC=y CONFIG_UML_X86=y # CONFIG_64BIT is not set +CONFIG_SEMAPHORE_SLEEPERS=y +# CONFIG_HOST_2G_2G is not set CONFIG_TOP_ADDR=0xc000 # CONFIG_3_LEVEL_PGTABLES is not set CONFIG_STUB_CODE=0xbfffe000 @@ -25,22 +66,24 @@ CONFIG_STUB_DATA=0xb000 CONFIG_STUB_START=0xbfffe000 CONFIG_ARCH_HAS_SC_SIGNALS=y CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y +CONFIG_GENERIC_HWEIGHT=y CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y # CONFIG_DISCONTIGMEM_MANUAL is not set # CONFIG_SPARSEMEM_MANUAL is not set CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_LD_SCRIPT_DYN=y CONFIG_NET=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=m # CONFIG_HOSTFS is not set +# CONFIG_HPPFS is not set CONFIG_MCONSOLE=y # CONFIG_MAGIC_SYSRQ is not set -# CONFIG_HOST_2G_2G is not set CONFIG_NEST_LEVEL=0 -CONFIG_KERNEL_HALF_GIGS=1 # CONFIG_HIGHMEM is not set CONFIG_KERNEL_STACK_ORDER=2 CONFIG_UML_REAL_TIME_CLOCK=y @@ -49,7 +92,6 @@ CONFIG_UML_REAL_TIME_CLOCK=y # Code maturity level options # CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 @@ -57,6 +99,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32 # General setup # CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y @@ -64,26 +107,28 @@ CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set -# CONFIG_HOTPLUG is not set -CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y +# CONFIG_RELAY is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_UID16=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set CONFIG_KALLSYMS_EXTRA_PASS=y +CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y +CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SHMEM=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 +CONFIG_SLAB=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 +# CONFIG_SLOB is not set # # Loadable module support @@ -91,18 +136,43 @@ CONFIG_BASE_SMALL=0 CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set -CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # -# Generic Driver Options +# Block layer # -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y -# CONFIG_FW_LOADER is not set -# CONFIG_DEBUG_DRIVER is not set +# CONFIG_LBD is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_LSF is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_AS=y +# CONFIG_DEFAULT_DEADLINE is not set +# CONFIG_DEFAULT_CFQ is not set +# CONFIG_DEFAULT_NOOP is no
[uml-devel] [PATCH 1/6] UML - Fix iomem list traversal
From: "Victor V. Vengerov" <[EMAIL PROTECTED]> We need to walk the region list properly. Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Index: linux-2.6.16/arch/um/kernel/physmem.c === --- linux-2.6.16.orig/arch/um/kernel/physmem.c 2006-04-03 08:48:13.0 -0400 +++ linux-2.6.16/arch/um/kernel/physmem.c 2006-04-05 11:16:38.0 -0400 @@ -407,6 +407,8 @@ unsigned long find_iomem(char *driver, u *len_out = region->size; return(region->virt); } + + region = region->next; } return(0); --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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/6] UML - Error handling fixes
Blairsorblade noticed some confusion between our use of a system call's return value and errno. This patch fixes a number of related bugs - using errno instead of a return value using a return value instead of errno forgetting to negate a error return to get a positive error code Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Index: linux-2.6.16/arch/um/os-Linux/file.c === --- linux-2.6.16.orig/arch/um/os-Linux/file.c 2006-04-27 20:53:08.0 -0400 +++ linux-2.6.16/arch/um/os-Linux/file.c2006-04-27 20:57:20.0 -0400 @@ -171,7 +171,7 @@ int os_sigio_async(int master, int slave flags = fcntl(master, F_GETFL); if(flags < 0) - return errno; + return -errno; if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) || (fcntl(master, F_SETOWN, os_getpid()) < 0)) Index: linux-2.6.16/arch/um/os-Linux/skas/process.c === --- linux-2.6.16.orig/arch/um/os-Linux/skas/process.c 2006-04-27 20:53:08.0 -0400 +++ linux-2.6.16/arch/um/os-Linux/skas/process.c2006-04-27 20:57:20.0 -0400 @@ -344,12 +344,12 @@ int copy_context_skas0(unsigned long new err = ptrace_setregs(pid, regs); if(err < 0) panic("copy_context_skas0 : PTRACE_SETREGS failed, " - "pid = %d, errno = %d\n", pid, errno); + "pid = %d, errno = %d\n", pid, -err); err = ptrace_setfpregs(pid, fp_regs); if(err < 0) panic("copy_context_skas0 : PTRACE_SETFPREGS failed, " - "pid = %d, errno = %d\n", pid, errno); + "pid = %d, errno = %d\n", pid, -err); /* set a well known return code for detection of child write failure */ child_data->err = 12345678; @@ -362,7 +362,7 @@ int copy_context_skas0(unsigned long new pid = data->err; if(pid < 0) panic("copy_context_skas0 - stub-parent reports error %d\n", - pid); + -pid); /* Wait, until child has finished too: read child's result from * child's stack and check it. Index: linux-2.6.16/arch/um/os-Linux/sys-i386/registers.c === --- linux-2.6.16.orig/arch/um/os-Linux/sys-i386/registers.c 2006-04-27 20:53:42.0 -0400 +++ linux-2.6.16/arch/um/os-Linux/sys-i386/registers.c 2006-04-27 20:57:20.0 -0400 @@ -104,7 +104,7 @@ void init_registers(int pid) err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); if(err) panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", - err); + errno); errno = 0; err = ptrace(PTRACE_GETFPXREGS, pid, 0, exec_fpx_regs); @@ -119,7 +119,7 @@ void init_registers(int pid) err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs); if(err) panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d", - err); + errno); } void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) Index: linux-2.6.16/arch/um/os-Linux/sys-x86_64/registers.c === --- linux-2.6.16.orig/arch/um/os-Linux/sys-x86_64/registers.c 2006-04-27 20:53:42.0 -0400 +++ linux-2.6.16/arch/um/os-Linux/sys-x86_64/registers.c2006-04-27 20:57:20.0 -0400 @@ -62,12 +62,12 @@ void init_registers(int pid) err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); if(err) panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", - err); + errno); err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs); if(err) panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d", - err); + errno); } void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) Index: linux-2.6.16/arch/um/os-Linux/umid.c === --- linux-2.6.16.orig/arch/um/os-Linux/umid.c 2006-04-27 20:53:08.0 -0400 +++ linux-2.6.16/arch/um/os-Linux/umid.c2006-04-27 20:57:20.0 -0400 @@ -178,14 +178,14 @@ static void __init create_pid_file(void) fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0644); if(fd < 0){ printk("Open of machine pid file \"%s\" failed: %s\n", - file, strerror(-fd)); + file, strerror(errno)); return; } snprintf(pid, sizeof(pid), "%d\n", getpid()); n = write(fd, pid, strlen(pid)); if(n != strlen(pid)) - printk("Write of pid file failed - err = %d\n", -n); +
[uml-devel] [PATCH 3/6] UML - remove NULL checks and add some CodingStyle
From: Jesper Juhl <[EMAIL PROTECTED]> Remove redundant NULL checks before [kv]free + small CodingStyle cleanup for arch/ Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Index: linux-2.6.16/arch/um/kernel/irq.c === --- linux-2.6.16.orig/arch/um/kernel/irq.c 2006-04-27 18:40:27.0 -0400 +++ linux-2.6.16/arch/um/kernel/irq.c 2006-04-27 19:00:34.0 -0400 @@ -89,16 +89,18 @@ void sigio_handler(int sig, union uml_pt struct irq_fd *irq_fd; int n; - if(smp_sigio_handler()) return; - while(1){ + if (smp_sigio_handler()) + return; + + while (1) { n = os_waiting_for_events(active_fds); if (n <= 0) { if(n == -EINTR) continue; else break; } - for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){ - if(irq_fd->current_events != 0){ + for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) { + if (irq_fd->current_events != 0) { irq_fd->current_events = 0; do_IRQ(irq_fd->irq, regs); } @@ -110,19 +112,17 @@ void sigio_handler(int sig, union uml_pt static void maybe_sigio_broken(int fd, int type) { - if(os_isatty(fd)){ - if((type == IRQ_WRITE) && !pty_output_sigio){ + if (os_isatty(fd)) { + if ((type == IRQ_WRITE) && !pty_output_sigio) { write_sigio_workaround(); add_sigio_fd(fd, 0); - } - else if((type == IRQ_READ) && !pty_close_sigio){ + } else if ((type == IRQ_READ) && !pty_close_sigio) { write_sigio_workaround(); add_sigio_fd(fd, 1); } } } - int activate_fd(int irq, int fd, int type, void *dev_id) { struct pollfd *tmp_pfd; @@ -132,16 +132,18 @@ int activate_fd(int irq, int fd, int typ pid = os_getpid(); err = os_set_fd_async(fd, pid); - if(err < 0) + if (err < 0) goto out; new_fd = um_kmalloc(sizeof(*new_fd)); err = -ENOMEM; - if(new_fd == NULL) + if (new_fd == NULL) goto out; - if(type == IRQ_READ) events = UM_POLLIN | UM_POLLPRI; - else events = UM_POLLOUT; + if (type == IRQ_READ) + events = UM_POLLIN | UM_POLLPRI; + else + events = UM_POLLOUT; *new_fd = ((struct irq_fd) { .next = NULL, .id= dev_id, .fd= fd, @@ -165,8 +167,8 @@ int activate_fd(int irq, int fd, int typ * a semaphore. */ flags = irq_lock(); - for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){ - if((irq_fd->fd == fd) && (irq_fd->type == type)){ + for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) { + if ((irq_fd->fd == fd) && (irq_fd->type == type)) { printk("Registering fd %d twice\n", fd); printk("Irqs : %d, %d\n", irq_fd->irq, irq); printk("Ids : 0x%p, 0x%p\n", irq_fd->id, dev_id); @@ -175,13 +177,13 @@ int activate_fd(int irq, int fd, int typ } /*-*/ - if(type == IRQ_WRITE) + if (type == IRQ_WRITE) fd = -1; tmp_pfd = NULL; n = 0; - while(1){ + while (1) { n = os_create_pollfd(fd, events, tmp_pfd, n); if (n == 0) break; @@ -198,10 +200,8 @@ int activate_fd(int irq, int fd, int typ * then we free the buffer tmp_fds and try again. */ irq_unlock(flags); - if (tmp_pfd != NULL) { - kfree(tmp_pfd); - tmp_pfd = NULL; - } + kfree(tmp_pfd); + tmp_pfd = NULL; tmp_pfd = um_kmalloc(n); if (tmp_pfd == NULL) @@ -249,7 +249,7 @@ static int same_irq_and_dev(struct irq_f { struct irq_and_dev *data = d; - return((irq->irq == data->irq) && (irq->id == data->dev)); + return ((irq->irq == data->irq) && (irq->id == data->dev)); } void free_irq_by_irq_and_dev(unsigned int irq, void *dev) @@ -262,7 +262,7 @@ void free_irq_by_irq_and_dev(unsigned in static int same_fd(struct irq_fd *irq, void *fd) { - return(irq->fd == *((int *) fd)); + return (irq->fd == *((int *)fd)); } void free_irq_by_fd(int fd) @@ -276,16 +276,17 @@ static struct irq_fd *find_irq_by_fd(int int i = 0; int fdi; -
Re: [uml-devel] Re: [RFC] PATCH 0/4 - Time virtualization
On Friday 28 April 2006 17:15, Jeff Dike wrote: > On Fri, Apr 28, 2006 at 03:54:31PM +0200, Blaisorblade wrote: > > Additionally, if this flag ever goes into clone, it mustn't be named > > CLONE_TIME, but CLONE_NEWTIME (or CLONE_NEWUTS). And given CLONE_NEWNS, > > it's IMHO ok to have unshare(CLONE_NEWTIME) to mean "unshare time > > namespace", even if it's incoherent with unshare(CLONE_FS) - the > > incoherency already exists with CLONE_NEWNS. > I wonder if they should be CLONE_* at all. I've wondered about this too. It makes some sense to renforce the relationship with clone, but when you read the call to unshare you must do you get nonsense. Like the above incoherence. > Given that we are likely > to run out of free CLONE_* bits, unshare will have to reuse bits that > don't have anything to do with sharing resources (CSIGNAL, > CLONE_VFORK, etc), and it doesn't seem that nice to have two different > CLONE_* flags with the same value, different meaning, only one of > which can actually be used in clone. > It seems better to use UNSHARE_*, with the current bits that are > common to unshare and clone being defined the same, i.e. > #define UNSHARE_VM CLONE_VM I indeed agree with this. With cg log -r v2.6.16-rc1:v2.6.16 kernel/fork.c We can see the people involved in commits for sys_unshare (there's little other work in there). -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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] [RFC] PATCH 3/4 - Time virtualization : PTRACE_SYSCALL_MASK
On Wednesday 26 April 2006 17:46, Jeff Dike wrote: > On Wed, Apr 26, 2006 at 05:47:54PM +0200, Blaisorblade wrote: > Why not just zero out the bits that the kernel knows about? Then, if > we return -EINVAL, the process just looks at the remaining bits that > are set to see what system calls the kernel didn't know about. Good idea. When you're leaving the whole mask to 1 _except_ some bits set to 0 what do you suggest? Setting everything to 1 so the process sees the invalid 0 bits? However, I've had a new idea for the API form - sigprocmask() is used to either enable or disable some bits in the _signal_ mask. But you pass in both cases the bits to toggle. Making the API more similar to this would be good. Even if the semantics of both settings and clearing bits are unclear. Probably, simply making both calls _set_ the mask but one of them (i.e. MASK_DEFAULT_TRACE) reverse the mask before setting and after zero-extending it to the right. Ok, this gives us a definite proposal, which I finally like: * to exclude sys_tee: bitmask = 0; set_bit(__NR_tee, bitmask); ptrace(PTRACE_SET_NOTRACE, bitmask); * to trace only sys_tee: bitmask = 0; set_bit(__NR_tee, bitmask); ptrace(PTRACE_SET_TRACEONLY, bitmask); Semantics: in both cases, the mask is first zero-extended to the right (for syscalls not known to userspace), bits for syscall not known to the kernel are checked and the call fails if any of them is 1, and in the failure case E2BIG or EOVERFLOW is returned (I want to avoid EINVAL and ENOSYS to avoid confusion) and the part of the mask known to the kernel is 0-ed. In case of success, for NOTRACE (which was DEFAULT_TRACE) the mask is reversed before copying in the kernel syscall mask, for TRACEONLY it's copied there directly. -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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] Re: [PATCH 0/6] UML - Small patches for 2.6.17
Jeff Dike <[EMAIL PROTECTED]> wrote: > > These patches are 2.6.17 material. "remove NULL checks and add some CodingStyle" isn't. Unless one considers UML coding style to be a bug, which is an attractive idea ;) So I gave that one an extra-special look - I'll push it along, thanks. --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ 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] [RFC] PATCH 3/4 - Time virtualization : PTRACE_SYSCALL_MASK
On Fri, Apr 28, 2006 at 10:28:46PM +0200, Blaisorblade wrote: > Ok, this gives us a definite proposal, which I finally like: > > * to exclude sys_tee: > > bitmask = 0; > set_bit(__NR_tee, bitmask); > ptrace(PTRACE_SET_NOTRACE, bitmask); > > * to trace only sys_tee: > > bitmask = 0; > set_bit(__NR_tee, bitmask); > ptrace(PTRACE_SET_TRACEONLY, bitmask); Yup, I like this. > the call fails if any of them is 1, and in the failure case E2BIG or > EOVERFLOW is returned strerror(E2BIG) is "Arg list too long" strerror(EOVERFLOW) is "Value too large for defined data type" Neither of those seems right. I'd just as soon stick with -EINVAL. Jeff --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel