30 Sep, 2010

1 commit

  • Commit c52c2ddc1dfa ("alpha: switch osf_sigprocmask() to use of
    sigprocmask()") had several problems. The more obvious compile issues
    got fixed in commit 0f44fbd297e1 ("alpha: fix compile problem in
    arch/alpha/kernel/signal.c"), but it also caused a regression.

    Since _BLOCKABLE is already the set of signals that can be blocked, the
    code should do "newmask & _BLOCKABLE" rather than inverting _BLOCKABLE
    before masking.

    Reported-by: Michael Cree
    Patch-by: Al Viro
    Patch-by: Ivan Kokshaysky
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

29 Sep, 2010

1 commit


28 Sep, 2010

2 commits


26 Sep, 2010

2 commits

  • rdusp() gives us the right value only for the current thread...

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • We want interrupts disabled on all paths leading to RESTORE_ALL;
    otherwise, we are risking an IRQ coming between the updates of
    alpha_mv->hae_cache and *alpha_mv->hae_register and set_hae()
    within the IRQ getting badly confused.

    RESTORE_ALL used to play with disabling IRQ itself, but that got
    removed back in 2002, without making sure we had them disabled
    on all paths. It's cheaper to make sure we have them disabled than
    to revert to original variant...

    Remove the detritus left from that commit back in 2002; we used to
    need a reload of $0 and $1 since swpipl would change those, but
    doing that had become pointless when we stopped doing swpipl in
    there...

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

19 Sep, 2010

10 commits

  • Unlike the other targets, alpha sets _one_ sigframe and
    buggers off until the next syscall/interrupt, even if
    more signals are pending. It leads to quite a few unpleasant
    inconsistencies, starting with SIGSEGV potentially arriving
    not where it should and including e.g. mess with sigsuspend();
    consider two pending signals blocked until sigsuspend()
    unblocks them. We pick the first one; then, if we are hit
    by interrupt while in the handler, we process the second one
    as well. If we are not, and if no syscalls had been made,
    we get out of the first handler and leave the second signal
    pending; normally sigreturn() would've picked it anyway, but
    here it starts with restoring the original mask and voila -
    the second signal is blocked again. On everything else we
    get both delivered consistently.

    It's actually easy to fix; the only thing to watch out for
    is prevention of double syscall restart. Fortunately, the
    idea I've nicked from arm fix by rmk works just fine...

    Testcase demonstrating the behaviour in question; on alpha
    we get one or both flags set (usually one), on everything
    else both are always set.
    #include
    #include
    int had1, had2;
    void f1(int sig) { had1 = 1; }
    void f2(int sig) { had2 = 1; }
    main()
    {
    sigset_t set1, set2;
    sigemptyset(&set1);
    sigemptyset(&set2);
    sigaddset(&set2, 1);
    sigaddset(&set2, 2);
    signal(1, f1);
    signal(2, f2);
    sigprocmask(SIG_SETMASK, &set2, NULL);
    raise(1);
    raise(2);
    sigsuspend(&set1);
    printf("had1:%d had2:%d\n", had1, had2);
    }

    Tested-by: Michael Cree
    Signed-off-by: Al Viro
    Signed-off-by: Matt Turner

    Al Viro
     
  • The way sigreturn() is implemented on alpha breaks PTRACE_SYSCALL,
    all way back to 1.3.95 when alpha has grown PTRACE_SYSCALL support.

    What happens is direct return to ret_from_syscall, in order to bypass
    mangling of a3 (error indicator) and prevent other mutilations of
    registers (e.g. by syscall restart). That's fine, but... the entire
    TIF_SYSCALL_TRACE codepath is kept separate on alpha and post-syscall
    stopping/notifying the tracer is after the syscall. And the normal
    path we are forcibly switching to doesn't have it.

    So we end up with *one* stop in traced sigreturn() vs. two in other
    syscalls. And yes, strace is visibly broken by that; try to strace
    the following
    #include
    #include
    void f(int sig) {}
    main()
    {
    signal(SIGHUP, f);
    raise(SIGHUP);
    write(1, "eeeek\n", 6);
    }
    and watch the show. The
    close(1) = 405
    in the end of strace output is coming from return value of write() (6 ==
    __NR_close on alpha) and syscall number of exit_group() (__NR_exit_group ==
    405 there).

    The fix is fairly simple - the only thing we end up missing is the call
    of syscall_trace() and we can tell whether we'd been called from the
    SYSCALL_TRACE path by checking ra value. Since we are setting the
    switch_stack up (that's what sys_sigreturn() does), we have the right
    environment for calling syscall_trace() - just before we call
    undo_switch_stack() and return. Since undo_switch_stack() will overwrite
    s0 anyway, we can use it to store the result of "has it been called from
    SYSCALL_TRACE path?" check. The same thing applies in rt_sigreturn().

    Tested-by: Michael Cree
    Signed-off-by: Al Viro
    Signed-off-by: Matt Turner

    Al Viro
     
  • Old code used to set regs->r0 and regs->r19 to force the right
    return value. Leaving that after switch to ERESTARTNOHAND
    was a Bad Idea(tm), since now that screws the restart - if we
    hit the case when get_signal_to_deliver() returns 0, we will
    step back to syscall insn, with v0 set to EINTR and a3 to 1.
    The latter won't matter, since EINTR is 4, aka __NR_write.

    Testcase:

    #include
    #define _GNU_SOURCE
    #include
    #include

    main()
    {
    sigset_t mask;
    sigemptyset(&mask);
    sigaddset(&mask, SIGCONT);
    sigprocmask(SIG_SETMASK, &mask, NULL);
    kill(0, SIGCONT);
    syscall(__NR_sigsuspend, 1, "b0rken\n", 7);
    }

    results on alpha in immediate message to stdout...

    Fix is obvious; moreover, since we don't need regs anymore, we can
    switch to normal prototypes for these guys and lose the wrappers.
    Even better, rt_sigsuspend() is identical to generic version in
    kernel/signal.c now.

    Tested-by: Michael Cree
    Signed-off-by: Al Viro
    Signed-off-by: Matt Turner

    Al Viro
     
  • same thing as had been done on other targets back in 2003 -
    move setting ->restart_block.fn into {rt_,}sigreturn().

    Tested-by: Michael Cree
    Signed-off-by: Al Viro
    Signed-off-by: Matt Turner

    Al Viro
     
  • Pending work from the performance event subsystem is executed in
    the timer interrupt. This patch shifts the call to
    perf_event_do_pending() before the call to update_process_times()
    as the latter may call back into the perf event subsystem and it
    is prudent to have the pending work executed first.

    Signed-off-by: Michael Cree
    Signed-off-by: Matt Turner

    Michael Cree
     
  • The 2.6.36-rc kernel added three new system calls:
    fanotify_init, fanotify_mark, and prlimit64. This
    patch wires them up on Alpha.

    Built and booted on an XP900. Untested beyond that.

    Signed-off-by: Mikael Pettersson
    Signed-off-by: Matt Turner

    Mikael Pettersson
     
  • All uses of the BKL on alpha are totally bogus, nothing
    is really protected by this. Remove the remaining users
    so we don't have to mark alpha as 'depends on BKL'.

    Signed-off-by: Arnd Bergmann
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: linux-alpha@vger.kernel.org
    Signed-off-by: Matt Turner

    Arnd Bergmann
     
  • Alpha SMP flush_icache_user_range() is implemented as an inline
    function inside include/asm/cacheflush.h. It dereferences @current
    but doesn't include linux/sched.h and thus causes build failure if
    linux/sched.h wasn't included previously. Fix it by including the
    needed header file explicitly.

    Signed-off-by: Tejun Heo
    Reported-by: Stephen Rothwell
    Signed-off-by: Matt Turner

    Tejun Heo
     
  • Acked-by: Jan-Benedict Glaw
    Signed-off-by: matt mooney
    Signed-off-by: Matt Turner

    matt mooney
     
  • Acked-by: Richard Henderson
    Signed-off-by: Joe Perches
    Signed-off-by: Matt Turner

    Joe Perches
     

01 Sep, 2010

4 commits


29 Aug, 2010

1 commit

  • Fix a comma that got accidentally deleted from sys_osf_statfs() leading to the
    following warning:

    arch/alpha/kernel/osf_sys.c: In function 'SYSC_osf_statfs':
    arch/alpha/kernel/osf_sys.c:255: error: syntax error before 'buffer'

    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    David Howells
     

18 Aug, 2010

1 commit

  • Make do_execve() take a const filename pointer so that kernel_execve() compiles
    correctly on ARM:

    arch/arm/kernel/sys_arm.c:88: warning: passing argument 1 of 'do_execve' discards qualifiers from pointer target type

    This also requires the argv and envp arguments to be consted twice, once for
    the pointer array and once for the strings the array points to. This is
    because do_execve() passes a pointer to the filename (now const) to
    copy_strings_kernel(). A simpler alternative would be to cast the filename
    pointer in do_execve() when it's passed to copy_strings_kernel().

    do_execve() may not change any of the strings it is passed as part of the argv
    or envp lists as they are some of them in .rodata, so marking these strings as
    const should be fine.

    Further kernel_execve() and sys_execve() need to be changed to match.

    This has been test built on x86_64, frv, arm and mips.

    Signed-off-by: David Howells
    Tested-by: Ralf Baechle
    Acked-by: Russell King
    Signed-off-by: Linus Torvalds

    David Howells
     

15 Aug, 2010

2 commits


14 Aug, 2010

1 commit

  • Mark arguments to certain system calls as being const where they should be but
    aren't. The list includes:

    (*) The filename arguments of various stat syscalls, execve(), various utimes
    syscalls and some mount syscalls.

    (*) The filename arguments of some syscall helpers relating to the above.

    (*) The buffer argument of various write syscalls.

    Signed-off-by: David Howells
    Acked-by: David S. Miller
    Signed-off-by: Linus Torvalds

    David Howells
     

11 Aug, 2010

6 commits

  • Architectures implement dma_is_consistent() in different ways (some
    misinterpret the definition of API in DMA-API.txt). So it hasn't been so
    useful for drivers. We have only one user of the API in tree. Unlikely
    out-of-tree drivers use the API.

    Even if we fix dma_is_consistent() in some architectures, it doesn't look
    useful at all. It was invented long ago for some old systems that can't
    allocate coherent memory at all. It's better to export only APIs that are
    definitely necessary for drivers.

    Let's remove this API.

    Signed-off-by: FUJITA Tomonori
    Cc: James Bottomley
    Reviewed-by: Konrad Rzeszutek Wilk
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • dma_get_cache_alignment returns the minimum DMA alignment. Architectures
    defines it as ARCH_DMA_MINALIGN (formally ARCH_KMALLOC_MINALIGN). So we
    can unify dma_get_cache_alignment implementations.

    Note that some architectures implement dma_get_cache_alignment wrongly.
    dma_get_cache_alignment() should return the minimum DMA alignment. So
    fully-coherent architectures should return 1. This patch also fixes this
    issue.

    Signed-off-by: FUJITA Tomonori
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • * 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block: (149 commits)
    block: make sure that REQ_* types are seen even with CONFIG_BLOCK=n
    xen-blkfront: fix missing out label
    blkdev: fix blkdev_issue_zeroout return value
    block: update request stacking methods to support discards
    block: fix missing export of blk_types.h
    writeback: fix bad _bh spinlock nesting
    drbd: revert "delay probes", feature is being re-implemented differently
    drbd: Initialize all members of sync_conf to their defaults [Bugz 315]
    drbd: Disable delay probes for the upcomming release
    writeback: cleanup bdi_register
    writeback: add new tracepoints
    writeback: remove unnecessary init_timer call
    writeback: optimize periodic bdi thread wakeups
    writeback: prevent unnecessary bdi threads wakeups
    writeback: move bdi threads exiting logic to the forker thread
    writeback: restructure bdi forker loop a little
    writeback: move last_active to bdi
    writeback: do not remove bdi from bdi_list
    writeback: simplify bdi code a little
    writeback: do not lose wake-ups in bdi threads
    ...

    Fixed up pretty trivial conflicts in drivers/block/virtio_blk.c and
    drivers/scsi/scsi_error.c as per Jens.

    Linus Torvalds
     
  • This patch is against the 2.6.34 source.

    Paraphrased from the 1989 BSD patch by David Borman @ cray.com:

    These are the changes needed for the kernel to support
    LINEMODE in the server.

    There is a new bit in the termios local flag word, EXTPROC.
    When this bit is set, several aspects of the terminal driver
    are disabled. Input line editing, character echo, and mapping
    of signals are all disabled. This allows the telnetd to turn
    off these functions when in linemode, but still keep track of
    what state the user wants the terminal to be in.

    New ioctl:
    TIOCSIG Generate a signal to processes in the
    current process group of the pty.

    There is a new mode for packet driver, the TIOCPKT_IOCTL bit.
    When packet mode is turned on in the pty, and the EXTPROC bit
    is set, then whenever the state of the pty is changed, the
    next read on the master side of the pty will have the TIOCPKT_IOCTL
    bit set. This allows the process on the server side of the pty
    to know when the state of the terminal has changed; it can then
    issue the appropriate ioctl to retrieve the new state.

    Since the original BSD patches accompanied the source code for telnet
    I've left that reference here, but obviously the feature is useful for
    any remote terminal protocol, including ssh.

    The corresponding feature has existed in the BSD tty driver since 1989.
    For historical reference, a good copy of the relevant files can be found
    here:

    http://anonsvn.mit.edu/viewvc/krb5/trunk/src/appl/telnet/?pathrev=17741

    Signed-off-by: Howard Chu
    Cc: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    hyc@symas.com
     
  • As Jeff Dike pointed out, the Hayes ESP driver was removed in commit
    f53a2ade0bb9f2a81f473e6469155172a96b7c38, so these ioctl definitions
    should also be removed. This cleans up the remaining arch-specific
    locations of this ioctl value.

    Thanks to Arnd for pointing these out.

    Cc: Jeff Dike
    Cc: Arnd Bergmann
    Cc: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (96 commits)
    no need for list_for_each_entry_safe()/resetting with superblock list
    Fix sget() race with failing mount
    vfs: don't hold s_umount over close_bdev_exclusive() call
    sysv: do not mark superblock dirty on remount
    sysv: do not mark superblock dirty on mount
    btrfs: remove junk sb_dirt change
    BFS: clean up the superblock usage
    AFFS: wait for sb synchronization when needed
    AFFS: clean up dirty flag usage
    cifs: truncate fallout
    mbcache: fix shrinker function return value
    mbcache: Remove unused features
    add f_flags to struct statfs(64)
    pass a struct path to vfs_statfs
    update VFS documentation for method changes.
    All filesystems that need invalidate_inode_buffers() are doing that explicitly
    convert remaining ->clear_inode() to ->evict_inode()
    Make ->drop_inode() just return whether inode needs to be dropped
    fs/inode.c:clear_inode() is gone
    fs/inode.c:evict() doesn't care about delete vs. non-delete paths now
    ...

    Fix up trivial conflicts in fs/nilfs2/super.c

    Linus Torvalds
     

10 Aug, 2010

5 commits

  • Removal of these started in 2.3.43pre3, ca. 10 years ago.

    Reported-by: Arnd Bergmann
    Signed-off-by: Geert Uytterhoeven
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     
  • This implements hardware performance events for the EV67 and later CPUs
    within the Linux performance events subsystem. Only using the performance
    monitoring unit in HP/Compaq's so called "Aggregrate mode" is supported.

    The code has been implemented in a manner that makes extension to other
    older Alpha CPUs relatively straightforward should some mug wish to
    indulge themselves.

    Signed-off-by: Michael Cree
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Jay Estabrook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Cree
     
  • Signed-off-by: Michael Cree
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Jay Estabrook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Cree
     
  • The following patches implement hardware performance events for the Alpha
    EV67 and later CPUs. I have had this running on a Compaq XP1000 (EV67,
    single CPU) for a few days now. Pretty cool -- discovered that the glibc
    exp2() library routine uses on average 985 cycles to execute 777 CPU
    instructions whereas Compaq's CPML library version of exp2() uses on
    average 32 cycles to execute 47 CPU instructions to achieve the same
    thing!

    This patch:

    Add performance monitor interrupt counternd and export the count to user
    space via /proc/interrupts.

    Signed-off-by: Michael Cree
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Jay Estabrook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Cree
     
  • We'll need the path to implement the flags field for statvfs support.
    We do have it available in all callers except:

    - ecryptfs_statfs. This one doesn't actually need vfs_statfs but just
    needs to do a caller to the lower filesystem statfs method.
    - sys_ustat. Add a non-exported statfs_by_dentry helper for it which
    doesn't won't be able to fill out the flags field later on.

    In addition rename the helpers for statfs vs fstatfs to do_*statfs instead
    of the misleading vfs prefix.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

08 Aug, 2010

1 commit


07 Aug, 2010

1 commit

  • …x/kernel/git/tip/linux-2.6-tip

    * 'timers-timekeeping-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    um: Fix read_persistent_clock fallout
    kgdb: Do not access xtime directly
    powerpc: Clean up obsolete code relating to decrementer and timebase
    powerpc: Rework VDSO gettimeofday to prevent time going backwards
    clocksource: Add __clocksource_updatefreq_hz/khz methods
    x86: Convert common clocksources to use clocksource_register_hz/khz
    timekeeping: Make xtime and wall_to_monotonic static
    hrtimer: Cleanup direct access to wall_to_monotonic
    um: Convert to use read_persistent_clock
    timkeeping: Fix update_vsyscall to provide wall_to_monotonic offset
    powerpc: Cleanup xtime usage
    powerpc: Simplify update_vsyscall
    time: Kill off CONFIG_GENERIC_TIME
    time: Implement timespec_add
    x86: Fix vtime/file timestamp inconsistencies

    Trivial conflicts in Documentation/feature-removal-schedule.txt

    Much less trivial conflicts in arch/powerpc/kernel/time.c resolved as
    per Thomas' earlier merge commit 47916be4e28c ("Merge branch
    'powerpc.cherry-picks' into timers/clocksource")

    Linus Torvalds
     

27 Jul, 2010

1 commit

  • Now that all arches have been converted over to use generic time via
    clocksources or arch_gettimeoffset(), we can remove the GENERIC_TIME
    config option and simplify the generic code.

    Signed-off-by: John Stultz
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    John Stultz
     

29 Jun, 2010

1 commit