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

9 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
     
  • 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

3 commits

  • When compiling alpha generic build get errors such as:
    arch/alpha/kernel/err_marvel.c: In function ‘marvel_print_err_cyc’:
    arch/alpha/kernel/err_marvel.c:119: error: format ‘%ld’ expects type ‘long int’, but argument 6 has type ‘u64’

    Replaced a number of %ld format specifiers with %lld since u64
    is unsigned long long.

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

    Michael Cree
     
  • Updates the Alpha perf_event code to match the changes
    recently made to the core perf_event code in commit
    e78505958cf123048fb48cb56b79cebb8edd15fb.

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

    Michael Cree
     
  • This patch fixes the failure to compile Alpha Generic because of
    previously overlooked calls to ns87312_enable_ide(). The function has
    been replaced by newer SuperIO code.

    Tested-by: Michael Cree
    Signed-off-by: Morten H. Larsen
    Signed-off-by: Matt Turner

    Morten H. Larsen
     

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
     

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

1 commit

  • * '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

3 commits

  • 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
     
  • 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
     

16 Jun, 2010

2 commits


26 May, 2010

1 commit

  • Alpha has a tsc like rpcc counter that it uses to manage time.
    This can be converted to an actual clocksource instead of utilizing
    the arch_gettimeoffset method that is really only there for legacy
    systems with no continuous counter.

    Further cleanups could be made if alpha converted to the clockevent
    model.

    CC: Thomas Gleixner
    CC: Richard Henderson
    Acked-by: Ivan Kokshaysky
    Tested-by: Ivan Kokshaysky
    Signed-off-by: Matt Turner
    Signed-off-by: John Stultz

    John Stultz
     

22 May, 2010

1 commit


20 May, 2010

1 commit

  • …ernel/git/tip/linux-2.6-tip

    * 'timers-for-linus-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    avr32: Fix typo in read_persistent_clock()
    sparc: Convert sparc to use read/update_persistent_clock
    cris: Convert cris to use read/update_persistent_clock
    m68k: Convert m68k to use read/update_persistent_clock
    m32r: Convert m32r to use read/update_peristent_clock
    blackfin: Convert blackfin to use read/update_persistent_clock
    ia64: Convert ia64 to use read/update_persistent_clock
    avr32: Convert avr32 to use read/update_persistent_clock
    h8300: Convert h8300 to use read/update_persistent_clock
    frv: Convert frv to use read/update_persistent_clock
    mn10300: Convert mn10300 to use read/update_persistent_clock
    alpha: Convert alpha to use read/update_persistent_clock
    xtensa: Fix unnecessary setting of xtime
    time: Clean up direct xtime usage in xen

    Linus Torvalds
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

19 Mar, 2010

2 commits


13 Mar, 2010

3 commits

  • This patch converts the alpha architecture to use the generic
    read_persistent_clock and update_persistent_clock interfaces, reducing
    the amount of arch specific code we have to maintain, and allowing for
    further cleanups in the future.

    I have not built or tested this patch, so help from arch maintainers
    would be appreciated.

    igned-off-by: John Stultz
    Cc: Richard Henderson
    Cc: Andrew Morton
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    John Stultz
     
  • This converts Alpha to use include/linux/pci-dma-compat.h. Alpha is the
    only architecutre that implements the PCI DMA API in the own way. That
    makes it difficult to implement the generic DMA API via the PCI bus
    specific DMA API.

    The generic DMA API calls the PCI DMA API implementation in
    arch/alpha/kernel/pci_iommu.c on non Jensen systems. It calls the DMA API
    in arch/alpha/kernel/pci-noop.c on Jensen systems.

    Signed-off-by: FUJITA Tomonori
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Jesse Barnes
    Cc: Greg KH
    Cc: Kay Sievers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • Use the generic ptrace_resume code for PTRACE_SYSCALL, PTRACE_CONT,
    PTRACE_KILL and PTRACE_SINGLESTEP. This implies defining
    arch_has_single_step in and implementing the
    user_enable_single_step and user_disable_single_step functions, which also
    causes the breakpoint information to be cleared on fork, which could be
    considered a bug fix.

    Also the TIF_SYSCALL_TRACE thread flag is now cleared on PTRACE_KILL which
    it previously wasn't, which is consistent with all architectures using the
    modern ptrace code.

    Signed-off-by: Christoph Hellwig
    Cc: Oleg Nesterov
    Cc: Roland McGrath
    Acked-by: Matt Turner
    Cc: Ivan Kokshaysky
    Cc: Richard Henderson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

07 Mar, 2010

1 commit

  • The initial -EINVAL value is overwritten by `retval = PTR_ERR(name)'. If
    this isn't an error pointer and typenr is not 1, 6 or 9, then this retval,
    a pointer cast to a long, is returned.

    Signed-off-by: Roel Kluin
    Acked-by: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roel Kluin
     

23 Feb, 2010

2 commits


18 Dec, 2009

1 commit

  • In the kernel the patch enables configuration of the perf event
    option, adds the perf_event_open syscall, and includes a minimal
    architecture specific asm/perf_event.h header file.

    Signed-off-by: Michael Cree
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Signed-off-by: Matt Turner

    Michael Cree