25 Jul, 2008

4 commits


24 Jul, 2008

1 commit

  • My copying of linux/init.h didn't go far enough. The definition of
    __used singled out gcc minor version 3, but didn't care what the major
    version was. This broke when unit-at-a-time was added and gcc started
    throwing out initcalls.

    This results in an early boot crash when ptrace tries to initialize a
    process with an empty, uninitialized register set.

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

    Jeff Dike
     

19 Jul, 2008

2 commits

  • Ingo Molnar
     
  • Jack Ren and Eric Miao tracked down the following long standing
    problem in the NOHZ code:

    scheduler switch to idle task
    enable interrupts

    Window starts here

    ----> interrupt happens (does not set NEED_RESCHED)
    irq_exit() stops the tick

    ----> interrupt happens (does set NEED_RESCHED)

    return from schedule()

    cpu_idle(): preempt_disable();

    Window ends here

    The interrupts can happen at any point inside the race window. The
    first interrupt stops the tick, the second one causes the scheduler to
    rerun and switch away from idle again and we end up with the tick
    disabled.

    The fact that it needs two interrupts where the first one does not set
    NEED_RESCHED and the second one does made the bug obscure and extremly
    hard to reproduce and analyse. Kudos to Jack and Eric.

    Solution: Limit the NOHZ functionality to the idle loop to make sure
    that we can not run into such a situation ever again.

    cpu_idle()
    {
    preempt_disable();

    while(1) {
    tick_nohz_stop_sched_tick(1); ,
    Debugged-by: eric miao
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

16 Jul, 2008

1 commit

  • Conflicts:

    arch/powerpc/Kconfig
    arch/s390/kernel/time.c
    arch/x86/kernel/apic_32.c
    arch/x86/kernel/cpu/perfctr-watchdog.c
    arch/x86/kernel/i8259_64.c
    arch/x86/kernel/ldt.c
    arch/x86/kernel/nmi_64.c
    arch/x86/kernel/smpboot.c
    arch/x86/xen/smp.c
    include/asm-x86/hw_irq_32.h
    include/asm-x86/hw_irq_64.h
    include/asm-x86/mach-default/irq_vectors.h
    include/asm-x86/mach-voyager/irq_vectors.h
    include/asm-x86/smp.h
    kernel/Makefile

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

15 Jul, 2008

1 commit


08 Jul, 2008

1 commit

  • There are various constraints on the use of unit-at-a-time:
    - i386 uses no-unit-at-a-time for pre-4.0 (not 4.3)
    - x86_64 uses unit-at-a-time always

    Uli reported a crash on x86_64 with gcc 4.1.2 with unit-at-a-time,
    resulting in commit c0a18111e571138747a98af18b3a2124df56a0d1

    Ingo reported a gcc internal error with gcc 4.3 with no-unit-at-a-timem,
    resulting in 22eecde2f9034764a3fd095eecfa3adfb8ec9a98

    Benny Halevy is seeing extern inlines not resolved with gcc 4.3 with
    no-unit-at-a-time

    This patch reintroduces unit-at-a-time for gcc >= 4.0, bringing back the
    possibility of Uli's crash. If that happens, we'll debug it.

    I started seeing both the internal compiler errors and unresolved
    inlines on Fedora 9. This patch fixes both problems, without so far
    reintroducing the crash reported by Uli.

    Signed-off-by: Jeff Dike
    Cc: Benny Halevy
    Cc: Adrian Bunk
    Cc: Ingo Molnar
    Cc: Ulrich Drepper
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

03 Jul, 2008

3 commits


26 Jun, 2008

1 commit


13 Jun, 2008

2 commits

  • Fedora broke PTRACE_SYSEMU again, and UML crashes as a result when it
    doesn't need to. This patch makes the PTRACE_SYSEMU check fail gracefully
    and makes UML fall back to PTRACE_SYSCALL.

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

    Jeff Dike
     
  • I allowed an include of asm/user.h to sneak back in. This patch replaces
    it with sys/user.h.

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

    Jeff Dike
     

07 Jun, 2008

6 commits

  • Include limits.h to get a definition of PATH_MAX.

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

    Ingo Molnar
     
  • We lost the marking of SIGWINCH as being OK to receive during stub
    execution, causing a panic should that happen.

    Cc: Benedict Verheyen
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • x86_64 defines either memcpy or __memcpy depending on the gcc version, and
    it looks like UML needs to follow that in its exporting.

    Cc: Gabriel C
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This patch makes os_get_task_size locate the bottom of the address space,
    as well as the top. This is for systems which put a lower limit on mmap
    addresses. It works by manually scanning pages from zero onwards until a
    valid page is found.

    Because the bottom of the address space may not be zero, it's not
    sufficient to assume the top of the address space is the size of the
    address space. The size is the difference between the top address and
    bottom address.

    [jdike@addtoit.com: changed the name to reflect that this function is
    supposed to return the top of the process address space, not its size and
    changed the return value to reflect that. Also some minor formatting
    changes]
    Signed-off-by: Tom Spink
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tom Spink
     
  • Removed duplicated include file "kern_util.h" in
    arch/um/drivers/ubd_kern.c.

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

    Huang Weiyi
     
  • Protection against the host's time going backwards (eg, ntp activity on
    the host) by keeping track of the time at the last tick and if it's
    greater than the current time, keep time stopped until the host catches
    up.

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

    Jeff Dike
     

22 May, 2008

5 commits


17 May, 2008

1 commit


13 May, 2008

12 commits

  • Alarm delivery could be noticably late in the !CONFIG_NOHZ case because lost
    ticks weren't being taken into account. This is now treated more carefully,
    with the time between ticks being calculated and the appropriate number of
    ticks delivered to the timekeeping system.

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

    Jeff Dike
     
  • Give random.c a style workover while I'm changing it.

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

    Jeff Dike
     
  • The random driver would essentially hang if the host's /dev/random returned
    -EAGAIN. There was a test of need_resched followed by a schedule inside the
    loop, but that didn't help and it's the wrong way to work anyway.

    The right way is to ask for an interrupt when there is input available from
    the host and handle it then rather than polling.

    Now, when the host's /dev/random returns -EAGAIN, the driver asks for a wakeup
    when there's randomness available again and sleeps. The interrupt routine
    just wakes up whatever processes are sleeping on host_read_wait.

    There is an atomic_t, host_sleep_count, which counts the number of processes
    waiting for randomness. When this reaches zero, the interrupt is disabled.

    An added complication is that async I/O notification was only recently added
    to /dev/random (by me), so essentially all hosts will lack it. So, we use the
    sigio workaround here, which is to have a separate thread poll on the
    descriptor and send an interrupt when there is input on it. This mechanism is
    activated when a process gets -EAGAIN (activating this multiple times is
    harmless, if a bit wasteful) and deactivated by the last process still
    waiting.

    The module name was changed from "random" to "hw_random" in order for udev to
    recognize it.

    The sigio workaround needed some changes. sigio_broken was added for cases
    when we know that async notification doesn't work. This is now called from
    maybe_sigio_broken, which deals with pts devices.

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

    Jeff Dike
     
  • The top of physical memory should be below the initial process stack, not the
    top of the address space, at least for as long as the stack isn't known to the
    kernel VM system and appropriately reserved.

    Cc: "Christopher S. Aker"
    Signed-off-by: Jeff Dike
    Cc: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • This patch includes page.h header into linker scripts that allow us to
    use PAGE_SIZE macro instead of numeric constant.

    To be able to include page.h into linker scripts page.h is needed for
    some modification - i.e. we need to use __ASSEMBLY__ and _AC macro

    [jdike@linux.intel.com - fixed conflict with as-layout.h]
    Signed-off-by: Cyrill Gorcunov
    Signed-off-by: Jeff Dike
    Cc: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cyrill Gorcunov
     
  • I just saw similar patches in the janitor kernel's list, and spotted place it
    fits.

    Signed-off-by: Jiri Olsa
    Signed-off-by: Jeff Dike
    Cc: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Olsa
     
  • Add the BLOCK dependency for RAW_DRIVER, to match what's in
    drivers/char/Kconfig. Also, while we're there, update the alleged
    obsolesence of RAW_DRIVER since it doesn't seem to be going away any
    time soon.

    Signed-off-by: Robert P. J. Day
    Signed-off-by: Jeff Dike
    Cc: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • From: Robert P. J. Day

    Use newer, non-deprecated __SPIN_LOCK_UNLOCKED macro.

    Signed-off-by: Robert P. J. Day
    Signed-off-by: Jeff Dike
    Cc: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • UML's supposed nanosecond clock interacts badly with NTP when NTP
    decides that the clock has drifted ahead and needs to be slowed down.
    Slowing down the clock is done by decrementing the cycle-to-nanosecond
    multiplier, which is 1. Decrementing that gives you 0 and time is
    stopped.

    This is fixed by switching to a microsecond clock, with a multiplier
    of 1000.

    Signed-off-by: Jeff Dike
    Cc: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Reintroduce uml_kmalloc for the benefit of UML libc code. The
    previous tactic of declaring __kmalloc so it could be called directly
    from the libc side of the house turned out to be getting too intimate
    with slab, and it doesn't work with slob.

    So, the uml_kmalloc wrapper is back. It calls kmalloc or whatever
    that translates into, and libc code calls it.

    kfree is left alone since that still works, leaving a somewhat
    inconsistent API.

    Signed-off-by: Jeff Dike
    Cc: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Error returns are negative.

    Signed-off-by: Johann Felix Soden
    Signed-off-by: Jeff Dike
    Cc: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johann Felix Soden
     
  • Tidy the ptrace interface code. Removed a bunch of unused macros.
    Started converting register sets from arrays of longs to structures.

    Signed-off-by: Jeff Dike
    Cc: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike