30 May, 2008

1 commit


26 May, 2008

1 commit


20 May, 2008

2 commits

  • When a cpu really is stuck in the kernel, it can be often
    impossible to figure out which cpu is stuck where. The
    worst case is when the stuck cpu has interrupts disabled.

    Therefore, implement a global cpu state capture that uses
    SMP message interrupts which are not disabled by the
    normal IRQ enable/disable APIs of the kernel.

    As long as we can get a sysrq 'y' to the kernel, we can
    get a dump. Even if the console interrupt cpu is wedged,
    we can trigger it from userspace using /proc/sysrq-trigger

    The output is made compact so that this facility is more
    useful on high cpu count systems, which is where this
    facility will likely find itself the most useful :)

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This patch removes the CVS keywords that weren't updated for a long time
    from comments.

    Signed-off-by: Adrian Bunk
    Signed-off-by: David S. Miller

    Adrian Bunk
     

13 May, 2008

2 commits


11 May, 2008

2 commits

  • So, forever, we've had this ptrace_signal_deliver implementation
    which tries to handle all of the nasties that can occur when the
    debugger looks at a process about to take a signal. It's meant
    to address all of these issues inside of the kernel so that the
    debugger need not be mindful of such things.

    Problem is, this doesn't work.

    The idea was that we should do the syscall restart business first, so
    that the debugger captures that state. Otherwise, if the debugger for
    example saves the child's state, makes the child execute something
    else, then restores the saved state, we won't handle the syscall
    restart properly because we lose the "we're in a syscall" state.

    The code here worked for most cases, but if the debugger actually
    passes the signal through to the child unaltered, it's possible that
    we would do a syscall restart when we shouldn't have.

    In particular this breaks the case of debugging a process under a gdb
    which is being debugged by yet another gdb. gdb uses sigsuspend
    to wait for SIGCHLD of the inferior, but if gdb itself is being
    debugged by a top-level gdb we get a ptrace_stop(). The top-level gdb
    does a PTRACE_CONT with SIGCHLD to let the inferior gdb see the
    signal. But ptrace_signal_deliver() assumed the debugger would cancel
    out the signal and therefore did a syscall restart, because the return
    error was ERESTARTNOHAND.

    Fix this by simply making ptrace_signal_deliver() a nop, and providing
    a way for the debugger to control system call restarting properly:

    1) Report a "in syscall" software bit in regs->{tstate,psr}.
    It is set early on in trap entry to a system call and is fully
    visible to the debugger via ptrace() and regsets.

    2) Test this bit right before doing a syscall restart. We have
    to do a final recheck right after get_signal_to_deliver() in
    case the debugger cleared the bit during ptrace_stop().

    3) Clear the bit in trap return so we don't accidently try to set
    that bit in the real register.

    As a result we also get a ptrace_{is,clear}_syscall() for sparc32 just
    like sparc64 has.

    M68K has this same exact bug, and is now the only other user of the
    ptrace_signal_deliver hook. It needs to be fixed in the same exact
    way as sparc.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Forever we had a PTRACE_SUNOS_DETACH which was unconditionally
    recognized, regardless of the personality of the process.

    Unfortunately, this value is what ended up in the GLIBC sys/ptrace.h
    header file on sparc as PTRACE_DETACH and PT_DETACH.

    So continue to recognize this old value. Luckily, it doesn't conflict
    with anything we actually care about.

    Signed-off-by: David S. Miller

    David S. Miller
     

03 May, 2008

1 commit


30 Apr, 2008

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
    sparc64: remove duplicated include
    sparc: Add kgdb support.
    kgdbts: Sparc needs sstep emulation.
    sparc32: Kill smp_message_pass() and related code.
    sparc64: Kill PIL_RESERVED, unused.
    sparc64: Split entry.S up into seperate files.

    Linus Torvalds
     
  • Lots of asm-*/futex.h call pagefault_enable and pagefault_disable, which
    are declared in linux/uaccess.h, without including linux/uaccess.h.

    They all include asm/uaccess.h, so this patch replaces asm/uaccess.h
    with linux/uaccess.h.

    Signed-off-by: Jeff Dike
    Cc: "Luck, Tony"
    Cc: Ralf Baechle
    Cc: Kyle McMartin
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mundt
    Cc: "David S. Miller"
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

29 Apr, 2008

3 commits

  • Unaligned access is ok for the following arches:
    cris, m68k, mn10300, powerpc, s390, x86

    Arches that use the memmove implementation for native endian, and
    the byteshifting for the opposite endianness.
    h8300, m32r, xtensa

    Packed struct for native endian, byteshifting for other endian:
    alpha, blackfin, ia64, parisc, sparc, sparc64, mips, sh

    m86knommu is generic_be for Coldfire, otherwise unaligned access is ok.

    frv, arm chooses endianness based on compiler settings, uses the byteshifting
    versions. Remove the unaligned trap handler from frv as it is now unused.

    v850 is le, uses the byteshifting versions for both be and le.

    Remove the now unused asm-generic implementation.

    Signed-off-by: Harvey Harrison
    Acked-by: David S. Miller
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Current limitations:

    1) On SMP single stepping has some fundamental issues,
    shared with other sw single-step architectures such
    as mips and arm.

    2) On 32-bit sparc we don't support SMP kgdb yet. That
    requires some reworking of the IPI mechanisms and
    infrastructure on that platform.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
    sparc: video drivers: add facility level
    sparc: tcx.c make tcx_init and tcx_exit static
    sparc: ffb.c make ffb_init and ffb_exit static
    sparc: cg14.c make cg14_init and cg15_exit static
    sparc: bw2.c fix bw2_exit
    sparc64: Fix accidental syscall restart on child return from clone/fork/vfork.
    sparc64: Clean up handling of pt_regs trap type encoding.
    sparc: Remove old style signal frame support.
    sparc64: Kill bogus RT_ALIGNEDSZ macro from signal.c
    sparc: sunzilog.c remove unused argument
    sparc: fix drivers/video/tcx.c warning
    sparc64: Kill unused local ISA bus layer.
    input: Rewrite sparcspkr device probing.
    sparc64: Do not ignore 'pmu' device ranges.
    sparc64: Kill ISA_FLOPPY_WORKS code.
    sparc64: Kill CONFIG_SPARC32_COMPAT
    sparc64: Cleanups and corrections for arch/sparc64/Kconfig
    sparc64: Fix wedged irq regression.

    Linus Torvalds
     

28 Apr, 2008

6 commits

  • Huge ptes have a special type on s390 and cannot be handled with the standard
    pte functions in certain cases, e.g. because of a different location of the
    invalid bit. This patch adds some new architecture- specific functions to
    hugetlb common code, as a prerequisite for the s390 large page support.

    This won't affect other architectures in functionality, but I need to add some
    new dummy inline functions to the headers.

    Acked-by: Martin Schwidefsky
    Signed-off-by: Gerald Schaefer
    Cc: Paul Mundt
    Cc: "Luck, Tony"
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gerald Schaefer
     
  • A cow break on a hugetlbfs page with page_count > 1 will set a new pte with
    set_huge_pte_at(), w/o any tlb flush operation. The old pte will remain in
    the tlb and subsequent write access to the page will result in a page fault
    loop, for as long as it may take until the tlb is flushed from somewhere else.
    This patch introduces an architecture-specific huge_ptep_clear_flush()
    function, which is called before the the set_huge_pte_at() in hugetlb_cow().

    ATTENTION: This is just a nop on all architectures for now, the s390
    implementation will come with our large page patch later. Other architectures
    should define their own huge_ptep_clear_flush() if needed.

    Acked-by: Martin Schwidefsky
    Signed-off-by: Gerald Schaefer
    Cc: Paul Mundt
    Cc: "Luck, Tony"
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gerald Schaefer
     
  • This patch moves all architecture functions for hugetlb to architecture header
    files (include/asm-foo/hugetlb.h) and converts all macros to inline functions.
    It also removes (!) ARCH_HAS_HUGEPAGE_ONLY_RANGE,
    ARCH_HAS_HUGETLB_FREE_PGD_RANGE, ARCH_HAS_PREPARE_HUGEPAGE_RANGE,
    ARCH_HAS_SETCLEAR_HUGE_PTE and ARCH_HAS_HUGETLB_PREFAULT_HOOK.

    Getting rid of the ARCH_HAS_xxx #ifdef and macro fugliness should increase
    readability and maintainability, at the price of some code duplication. An
    asm-generic common part would have reduced the loc, but we would end up with
    new ARCH_HAS_xxx defines eventually.

    Acked-by: Martin Schwidefsky
    Signed-off-by: Gerald Schaefer
    Cc: Paul Mundt
    Cc: "Luck, Tony"
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gerald Schaefer
     
  • s390 for one, cannot implement VM_MIXEDMAP with pfn_valid, due to their memory
    model (which is more dynamic than most). Instead, they had proposed to
    implement it with an additional path through vm_normal_page(), using a bit in
    the pte to determine whether or not the page should be refcounted:

    vm_normal_page()
    {
    ...
    if (unlikely(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP))) {
    if (vma->vm_flags & VM_MIXEDMAP) {
    #ifdef s390
    if (!mixedmap_refcount_pte(pte))
    return NULL;
    #else
    if (!pfn_valid(pfn))
    return NULL;
    #endif
    goto out;
    }
    ...
    }

    This is fine, however if we are allowed to use a bit in the pte to determine
    refcountedness, we can use that to _completely_ replace all the vma based
    schemes. So instead of adding more cases to the already complex vma-based
    scheme, we can have a clearly seperate and simple pte-based scheme (and get
    slightly better code generation in the process):

    vm_normal_page()
    {
    #ifdef s390
    if (!mixedmap_refcount_pte(pte))
    return NULL;
    return pte_page(pte);
    #else
    ...
    #endif
    }

    And finally, we may rather make this concept usable by any architecture rather
    than making it s390 only, so implement a new type of pte state for this.
    Unfortunately the old vma based code must stay, because some architectures may
    not be able to spare pte bits. This makes vm_normal_page a little bit more
    ugly than we would like, but the 2 cases are clearly seperate.

    So introduce a pte_special pte state, and use it in mm/memory.c. It is
    currently a noop for all architectures, so this doesn't actually result in any
    compiled code changes to mm/memory.o.

    BTW:
    I haven't put vm_normal_page() into arch code as-per an earlier suggestion.
    The reason is that, regardless of where vm_normal_page is actually
    implemented, the *abstraction* is still exactly the same. Also, while it
    depends on whether the architecture has pte_special or not, that is the
    only two possible cases, and it really isn't an arch specific function --
    the role of the arch code should be to provide primitive functions and
    accessors with which to build the core code; pte_special does that. We do
    not want architectures to know or care about vm_normal_page itself, and
    we definitely don't want them being able to invent something new there
    out of sight of mm/ code. If we made vm_normal_page an arch function, then
    we have to make vm_insert_mixed (next patch) an arch function too. So I
    don't think moving it to arch code fundamentally improves any abstractions,
    while it does practically make the code more difficult to follow, for both
    mm and arch developers, and easier to misuse.

    [akpm@linux-foundation.org: build fix]
    Signed-off-by: Nick Piggin
    Acked-by: Carsten Otte
    Cc: Jared Hulbert
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • Signed-off-by: David S. Miller

    David S. Miller
     
  • If we use this from more than one place, it's better to
    have helpers instead of twiddling magic constants all
    over.

    Add pt_regs_trap_type(), pt_regs_clear_trap_type(), and
    pt_regs_is_syscall().

    Use them in do_signal().

    Signed-off-by: David S. Miller

    David S. Miller
     

27 Apr, 2008

4 commits

  • Back around the same time we were bootstrapping the first 32-bit sparc
    Linux kernel with a SunOS userland, we made the signal frame match
    that of SunOS.

    By the time we even started putting together a native Linux userland
    for 32-bit Sparc we realized this layout wasn't sufficient for Linux's
    needs.

    Therefore we changed the layout, yet kept support for the old style
    signal frame layout in there. The detection mechanism is that we had
    sys_sigaction() start passing in a negative signal number to indicate
    "new style signal frames please".

    Anyways, no binaries exist in the world that use the old stuff. In
    fact, I bet Jakub Jelinek and myself are the only two people who ever
    had such binaries to be honest.

    So let's get rid of this stuff.

    I added an assertion using WARN_ON_ONCE() that makes sure 32-bit
    applications are passing in that negative signal number still.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • No more drivers use this, and therefore it can die.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This never was enabled, I could never get it working, and if anyone
    wants to try and get it's very easy to reference this code in the
    history.

    It's the only thing referencing the silly ISA device layer in the
    sparc64 tree. OF device layer infrastructure is what should be used
    for these things.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Implement __fls on all 64-bit archs:

    alpha has an implementation of fls64.
    Added __fls(x) = fls64(x) - 1.

    ia64 has fls, but not __fls.
    Added __fls based on code of fls.

    mips and powerpc have __ilog2, which is the same as __fls.
    Added __fls = __ilog2.

    parisc, s390, sh and sparc64:
    Include generic __fls.

    x86_64 already has __fls.

    Signed-off-by: Alexander van Heukelum
    Signed-off-by: Ingo Molnar

    Alexander van Heukelum
     

24 Apr, 2008

6 commits


22 Apr, 2008

3 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
    [SPARC]: Remove SunOS and Solaris binary support.

    Linus Torvalds
     
  • * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (202 commits)
    [POWERPC] Fix compile breakage for 64-bit UP configs
    [POWERPC] Define copy_siginfo_from_user32
    [POWERPC] Add compat handler for PTRACE_GETSIGINFO
    [POWERPC] i2c: Fix build breakage introduced by OF helpers
    [POWERPC] Optimize fls64() on 64-bit processors
    [POWERPC] irqtrace support for 64-bit powerpc
    [POWERPC] Stacktrace support for lockdep
    [POWERPC] Move stackframe definitions to common header
    [POWERPC] Fix device-tree locking vs. interrupts
    [POWERPC] Make pci_bus_to_host()'s struct pci_bus * argument const
    [POWERPC] Remove unused __max_memory variable
    [POWERPC] Simplify xics direct/lpar irq_host setup
    [POWERPC] Use pseries_setup_i8259_cascade() in pseries_mpic_init_IRQ()
    [POWERPC] Turn xics_setup_8259_cascade() into a generic pseries_setup_i8259_cascade()
    [POWERPC] Move xics_setup_8259_cascade() into platforms/pseries/setup.c
    [POWERPC] Use asm-generic/bitops/find.h in bitops.h
    [POWERPC] 83xx: mpc8315 - fix USB UTMI Host setup
    [POWERPC] 85xx: Fix the size of qe muram for MPC8568E
    [POWERPC] 86xx: mpc86xx_hpcn - Temporarily accept old dts node identifier.
    [POWERPC] 86xx: mark functions static, other minor cleanups
    ...

    Linus Torvalds
     
  • As per Documentation/feature-removal-schedule.txt

    Signed-off-by: David S. Miller

    David S. Miller
     

18 Apr, 2008

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (58 commits)
    ide: remove ide_init_default_irq() macro
    ide: move default IDE ports setup to ide_generic host driver
    ide: remove obsoleted "idex=noprobe" kernel parameter (take 2)
    ide: remove needless hwif->irq check from ide_hwif_configure()
    ide: init hwif->{io_ports,irq} explicitly in legacy VLB host drivers
    ide: limit legacy VLB host drivers to alpha, x86 and mips
    cmd640: init hwif->{io_ports,irq} explicitly
    cmd640: cleanup setup_device_ptrs()
    ide: add ide-4drives host driver (take 3)
    ide: remove ppc ifdef from init_ide_data()
    ide: remove ide_default_io_ctl() macro
    ide: remove CONFIG_IDE_ARCH_OBSOLETE_INIT
    ide: add CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS (take 2)
    ppc/pmac: remove no longer needed IDE quirk
    ppc: don't include
    ppc: remove ppc_ide_md
    ppc/pplus: remove ppc_ide_md.ide_init_hwif hook
    ppc/sandpoint: remove ppc_ide_md hooks
    ppc/lopec: remove ppc_ide_md hooks
    ppc/mpc8xx: remove ppc_ide_md hooks
    ...

    Linus Torvalds
     
  • It is always == '((base) + 0x206)' if CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS=y
    and it is not needed otherwise (arm, blackfin, parisc, ppc64, sh, sparc[64]).

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

17 Apr, 2008

1 commit

  • Semaphores are no longer performance-critical, so a generic C
    implementation is better for maintainability, debuggability and
    extensibility. Thanks to Peter Zijlstra for fixing the lockdep
    warning. Thanks to Harvey Harrison for pointing out that the
    unlikely() was unnecessary.

    Signed-off-by: Matthew Wilcox
    Acked-by: Ingo Molnar

    Matthew Wilcox
     

14 Apr, 2008

1 commit


03 Apr, 2008

1 commit

  • Currently include/linux/kvm.h is not considered by make headers_install,
    because Kbuild cannot handle " unifdef-$(CONFIG_FOO) += foo.h. This problem
    was introduced by

    commit fb56dbb31c4738a3918db81fd24da732ce3b4ae6
    Author: Avi Kivity
    Date: Sun Dec 2 10:50:06 2007 +0200

    KVM: Export include/linux/kvm.h only if $ARCH actually supports KVM

    Currently, make headers_check barfs due to , which
    includes, not existing. Rather than add a zillion s, export kvm.
    only if the arch actually supports it.

    Signed-off-by: Avi Kivity

    which makes this an 2.6.25 regression.

    One way of solving the issue is to enhance Kbuild, but Avi and David conviced
    me, that changing headers_install is not the way to go. This patch changes
    the definition for linux/kvm.h to unifdef-y.

    If  unifdef-y is used for linux/kvm.h "make headers_check" will fail on all
    architectures without asm/kvm.h. Therefore, this patch also provides
    asm/kvm.h on all architectures.

    Signed-off-by: Christian Borntraeger
    Acked-by: Avi Kivity
    Cc: Sam Ravnborg
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christian Borntraeger
     

27 Mar, 2008

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
    [SPARC64]: Define TASK_SIZE_OF()
    [SPARC64]: flush_ptrace_access() needs preemption disable.
    [SPARC64]: Update defconfig.
    [SPARC64]: Fix allnoconfig build, ptrace.c missing CONFIG_COMPAT checks.
    [SPARC64]: Fix __get_cpu_var in preemption-enabled area.
    [SPARC64]: Fix sparse warnings in arch/sparc64/kernel/signal.c
    [SPARC64]: Fix most sparse warnings in arch/sparc64/kernel/sys_sparc.c
    [SPARC64]: Fix sparse warnings in arch/sparc64/kernel/time.c
    [SPARC64]: Fix sparse warnings in arch/sparc64/kernel/ptrace.c
    [SPARC64]: Fix sparse warnings in arch/sparc64/kernel/irq.c
    [SPARC64]: Fix sparse warnings in arch/sparc64/kernel/iommu.c
    [SPARC64]: Fix sparse errors in arch/sparc64/kernel/traps.c
    [SPARC64]: Fix sparse warnings in arch/sparc64/kernel/{cpu,setup}.c
    [SPARC64]: Adjust {TLBTEMP,TSBMAP}_BASE.
    [SPARC64]: Make save_stack_trace() more efficient.

    Linus Torvalds
     
  • This make "cat /proc/${PID}/pagemap" more efficient for
    32-bit tasks.

    Based upon a report by Mariusz Kozlowski.

    Signed-off-by: David S. Miller

    David S. Miller