01 Aug, 2006

1 commit

  • The latest toolchains can produce a new ELF section in DSOs and
    dynamically-linked executables. The new section ".gnu.hash" replaces
    ".hash", and allows for more efficient runtime symbol lookups by the
    dynamic linker. The new ld option --hash-style={sysv|gnu|both} controls
    whether to produce the old ".hash", the new ".gnu.hash", or both. In some
    new systems such as Fedora Core 6, gcc by default passes --hash-style=gnu
    to the linker, so that a standard invocation of "gcc -shared" results in
    producing a DSO with only ".gnu.hash". The new ".gnu.hash" sections need
    to be dealt with the same way as ".hash" sections in all respects; only the
    dynamic linker cares about their contents. To work with older dynamic
    linkers (i.e. preexisting releases of glibc), a binary must have the old
    ".hash" section. The --hash-style=both option produces binaries that a new
    dynamic linker can use more efficiently, but an old dynamic linker can
    still handle.

    The new section runs afoul of the custom linker scripts used to build vDSO
    images for the kernel. On ia64, the failure mode for this is a boot-time
    panic because the vDSO's PT_IA_64_UNWIND segment winds up ill-formed.

    This patch addresses the problem in two ways.

    First, it mentions ".gnu.hash" in all the linker scripts alongside ".hash".
    This produces correct vDSO images with --hash-style=sysv (or old tools),
    with --hash-style=gnu, or with --hash-style=both.

    Second, it passes the --hash-style=sysv option when building the vDSO
    images, so that ".gnu.hash" is not actually produced. This is the most
    conservative choice for compatibility with any old userland. There is some
    concern that some ancient glibc builds (though not any known old production
    system) might choke on --hash-style=both binaries. The optimizations
    provided by the new style of hash section do not really matter for a DSO
    with a tiny number of symbols, as the vDSO has. If someone wants to use
    =gnu or =both for their vDSO builds and worry less about that
    compatibility, just change the option and the linker script changes will
    make any choice work fine.

    Signed-off-by: Roland McGrath
    Cc: "Luck, Tony"
    Cc: Kyle McMartin
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Jeff Dike
    Cc: Andi Kleen
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     

16 Jul, 2006

1 commit

  • Some -mm-only material leaked into a patch destined for mainline, and I didn't
    notice.

    This was the replacement of system_utsname with utsname() that's required by
    the uts namespace patch. This patch reverts those changes (which are correct
    in -mm) so that mainline UML builds again.

    Signed-off-by: Jeff Dike
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

15 Jul, 2006

3 commits

  • Clean up whitespace and return syntax in os.h.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • On top of the previous biarch changes for UML, this makes the preprocessor
    changes a bit cleaner. Specify the 64-bit build in CPPFLAGS on the x86_64
    SUBARCH, rather than #undef'ing i386. Compile-tested with i386 and x86_64
    SUBARCHs.

    Signed-off-by: Nishanth Aravamudan
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • The UML_SETJMP macro was requiring its users to pass in a argument which it
    could supply itself, since it wasn't used outside that invocation of the
    macro.

    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

11 Jul, 2006

19 commits

  • Handling a host mconsole version request must be done in a process context
    rather than interrupt context now that utsname information can be
    process-specific rather than global.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • The dedevfsification of UML left an unused variable behind.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Add some more uses of the CATCH_EINTR wrapper.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Fix a bunch of formatting problems.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Move most *_kern.c files in arch/um/kernel to *.c. This makes UML somewhat
    more closely resemble the other arches.

    [akpm@osdl.org: use the new INTF_* flags]
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Eliminate an unused debug option.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • A few sigio-related things can be made static.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This fixes an exitcall ordering bug - calls to ignore_sigio_fd can come from
    exitcalls that come after the sigio thread has been killed. This would cause
    shutdown to hang or crash.

    Fixed by having ignore_sigio_fd check that the thread is present before trying
    to communicate with it.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • os_isatty can be made to disappear by moving maybe_sigio_broken from kernel to
    user code. This also lets write_sigio_workaround become static.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • The irq_spinlock is not needed from user code any more, so the irq_lock and
    irq_unlock wrappers can go away. This also changes the name of the lock to
    irq_lock.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Mark forward_interrupts as being tt-mode only.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • uml_idle_timer is tt-mode only, so ifdef it as such to make it easier to spot
    when tt mode is killed.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Get rid of a user of timer_irq_inited (and first_tick) by observing that
    prev_ticks can be used to decide if this is the first call.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • It turns out that init_new_thread_signals is always called with altstack == 1,
    so we can eliminate the parameter.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • wall_to_monotonic isn't used in this file, so we can remove the declaration.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • When UML is built as a static binary, it segfaults when run. The reason is
    that a memory hole that is present in dynamic binaries isn't there in static
    binaries, and it contains essential stuff.

    This fix removes the code which maps some anonymous memory into that hole and
    cleans up some related code.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Spotted by Al Viro - eliminate a couple useless exports.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This cleans up the mess that is the timer initialization. There used to be
    two timer handlers - one that basically ran during delay loop calibration and
    one that handled the timer afterwards. There were also two sets of timer
    initialization code - one that starts in user code and calls into the kernel
    side of the house, and one that starts in kernel code and calls user code.

    This eliminates one timer handler and consolidates the two sets of
    initialization code.

    [akpm@osdl.org: use new INTF_ flags]
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • I was looking at the code of the UML and more precisely at the functions
    set_task_sizes_tt and set_task_sizes_skas. I noticed that these 2 functions
    take a paramater (arg) which is not used : the function is always called with
    the value 0.

    I suppose that this value might change in the future (or even can be
    configured), so I added a constant in mem_user.h file.

    Also, I rounded CONFIG_HOST_TASk_SIZE to a 4M.

    Signed-off-by: Tyler
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tyler
     

04 Jul, 2006

2 commits

  • cleanup: remove task_t and convert all the uses to struct task_struct. I
    introduced it for the scheduler anno and it was a mistake.

    Conversion was mostly scripted, the result was reviewed and all
    secondary whitespace and style impact (if any) was fixed up by hand.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • This is needed to fix UML compilation given that alternatives_smp_module_add
    and alternatives_smp_module_del are null inline functions if !CONFIG_SMP.

    Signed-off-by: "Theodore Ts'o"
    Cc: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Theodore Tso
     

03 Jul, 2006

1 commit


02 Jul, 2006

4 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
    kbuild: documentation change on allowing checkers besides sparse
    kbuild: warn when a moduled uses a symbol marked UNUSED
    kbuild: fix segv in modpost
    kconfig: enhancing accessibility of lxdialog
    kbuild: fix ia64 breakage after introducing make -rR

    Linus Torvalds
     
  • Rename actually_do_remove() to remove_files_and_dir(), make it call
    closedir(), make it ignore ENOENT (I see it frequently enough).

    ENOENT is probably due to multiple threads calling the exitcall functions
    together*, but fixing that is non-trivial; and ignoring it is perfectly ok
    in any case.

    * it can surely happen: last_ditch_exit() is installed as SIGTERM handler
    at boot, and it's not removed on thread creation. So killall vmlinux
    (which I do) surely causes that. I've seen also a crash which seems to
    do the same.

    Installing the handler on only the main thread would make UML do no cleanup
    when another thread exits, and we're not sure we want that. And mutual
    exclusion in that context is tricky - we can't use spinlock in code not on
    a kernel stack (spinlock debugging uses "current" a lot).

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     
  • The bug occurred to me when a UML left an empty ~/.uml/Sarge-norm folder -
    when trying to reuse not_dead_yet() failed one of its check. The comment
    says that's ok and means that we can take the directory, but while normally
    not_dead_yet() removes it and returns 0 (i.e. go on, use this), on failure
    it returns 0 but forgets to remove it. The fix is to remove it anytime
    we're going to return 0.

    But since "not_dead_yet" didn't make the interface so clear, causing this
    bug, and I couldn't find a convenient name for the mix of things it did, I
    split it into two parts:

    is_umdir_used() - returns a boolean, contains all checks of not_dead_yet()
    umdir_take_if_dead - tries to remove the dir unless it's used - returns
    whether it removed it, that is we now own it.

    With this changes the control flow is IMHO a bit clearer and needs less
    comment for control flow.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     
  • Make __copy_*_user_inatomic really atomic to avoid "Sleeping function called in
    atomic context" warnings, especially from futex code.

    This is made by adding another kmap_atomic slot and making copy_*_user_skas
    use kmap_atomic; also copy_*_user() becomes atomic, but that's true and is not
    a problem for i386 (and we can always add might_sleep there as done
    elsewhere). For TT mode kmap is not used, so there's no need for this.

    I've had to use another slot since both KM_USER0 and KM_USER1 are used
    elsewhere and could cause conflicts. Till now we reused the kmap_atomic slot
    list from the subarch, but that's not needed as that list must contain the
    common ones (used by generic code) + the ones used in architecture specific
    code (and Uml till now used none); so I've taken the i386 one after comparing
    it with ones from other archs, and added KM_UML_USERCOPY.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     

01 Jul, 2006

9 commits

  • kbuild used $¤(*F to get filename of target without extension.
    This was used in several places all over kbuild, but introducing
    make -rR broke his for all cases where we specified full path to
    target/prerequsite. It is assumed that make -rR disables old style
    suffix-rules which is why is suddenly failed.

    ia64 was impacted by this change because several div* routines in
    arch/ia64/lib are build using explicit paths and then kbuild failed.

    Thanks to David Mosberger-Tang for an explanation
    what was the root-cause and for testing on ia64.

    This patch also fixes two uses of $(*F) in arch/um

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial:
    Remove obsolete #include
    remove obsolete swsusp_encrypt
    arch/arm26/Kconfig typos
    Documentation/IPMI typos
    Kconfig: Typos in net/sched/Kconfig
    v9fs: do not include linux/version.h
    Documentation/DocBook/mtdnand.tmpl: typo fixes
    typo fixes: specfic -> specific
    typo fixes in Documentation/networking/pktgen.txt
    typo fixes: occuring -> occurring
    typo fixes: infomation -> information
    typo fixes: disadvantadge -> disadvantage
    typo fixes: aquire -> acquire
    typo fixes: mecanism -> mechanism
    typo fixes: bandwith -> bandwidth
    fix a typo in the RTC_CLASS help text
    smb is no longer maintained

    Manually merged trivial conflict in arch/um/kernel/vmlinux.lds.S

    Linus Torvalds
     
  • I run an x86_64 kernel with i386 userspace (Ubuntu Dapper) and decided to try
    out UML today. I found that UML wasn't quite aware of biarch compilers (which
    Ubuntu i386 ships). A fix similar to what was done for x86_64 should probably
    be committed (see
    http://marc.theaimsgroup.com/?l=linux-kernel&m=113425940204010&w=2). Without
    the FLAGS changes, the build will fail at a number of places and without the
    LINK change, the final link will fail.

    Signed-off-by: Nishanth Aravamudan
    Cc: Paolo 'Blaisorblade' Giarrusso
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Forgot to remove arch/um/kernel/time.c when it was mostly moved to
    arch/um/os-Linux.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Remove um_time() and um_stime() syscalls since they are identical to
    system-wide ones.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • do_timer must be called with xtime_lock held. I'm not sure boot_timer_handler
    needs this, however I don't think it hurts: it simply disables irq and takes a
    spinlock.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • -mm in combination with an FC5 init started dying with 'stderr=1' because init
    didn't like the lack of /dev/console and exited. The problem was that the
    stderr console, which is intended to dump printk output to the terminal before
    the regular console is initialized, isn't a tty, and so can't make
    /dev/console operational.

    However, since it is registered first, the normal console, when it is
    registered, doesn't become the preferred console, and isn't attached to
    /dev/console. Thus, /dev/console is never operational.

    This patch makes the stderr console unregister itself in an initcall, which is
    late enough that the normal console is registered. When that happens, the
    normal console will become the preferred console and will be able to run
    /dev/console.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Fix an off-by-one bug in temp file creation. Seeking to the desired length
    and writing a byte resulted in the file being one byte longer than expected.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • When parsing /proc/mounts looking for a tmpfs mount on /dev/shm, if a string
    that we are looking for if split across reads, then it won't be recognized.

    Fix this by refilling the buffer whenever we advance the cursor.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike