08 May, 2008

2 commits

  • We need to be more liberal about the alignment of the buffer given to
    us by sigaltstack(). The user should not need to be mindful of all of
    the alignment constraints we have for the stack frame.

    This mirrors how we handle this situation in clone() as well.

    Also, we align the stack even in non-SA_ONSTACK cases so that signals
    due to bad stack alignment can be delivered properly. This makes such
    errors easier to debug and recover from.

    Finally, add the sanity check x86 has to make sure we won't overflow
    the signal stack.

    This fixes glibc testcases nptl/tst-cancel20.c and
    nptl/tst-cancelx20.c

    Signed-off-by: David S. Miller

    David S. Miller
     
  • We clobber %i1 as well as %i0 for these system calls,
    because they give two return values.

    Therefore, on error, we have to restore %i1 properly
    or else the restart explodes since it uses the wrong
    arguments.

    This fixes glibc's nptl/tst-eintr1.c testcase.

    Signed-off-by: David S. Miller

    David S. Miller
     

07 May, 2008

1 commit


02 May, 2008

3 commits


30 Apr, 2008

1 commit


29 Apr, 2008

5 commits


27 Apr, 2008

1 commit

  • 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
     

24 Apr, 2008

1 commit


22 Apr, 2008

2 commits


21 Apr, 2008

1 commit


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
     

10 Apr, 2008

1 commit

  • 1) ptrace should pass 'current' to task_user_regset_view()

    2) When fetching general registers using a 64-bit view, and
    the target is 32-bit, we have to convert.

    3) Skip the whole register window get/set code block if
    the user isn't asking to access anything in there.

    Otherwise we have problems if the user doesn't have
    an address space setup. Fetching ptrace register is
    still valid at such a time, and ptrace does not try
    to access the register window area of the regset.

    Signed-off-by: David S. Miller

    David S. Miller
     

18 Mar, 2008

2 commits


04 Mar, 2008

2 commits


29 Feb, 2008

2 commits


25 Feb, 2008

1 commit

  • CC [M] arch/sparc/kernel/led.o
    arch/sparc/kernel/led.c: In function 'led_blink':
    arch/sparc/kernel/led.c:35: error: invalid use of undefined type 'struct
    timer_list'
    arch/sparc/kernel/led.c:35: error: 'jiffies' undeclared (first use in
    this function)
    arch/sparc/kernel/led.c:35: error: (Each undeclared identifier is
    reported only once
    arch/sparc/kernel/led.c:35: error: for each function it appears in.)
    arch/sparc/kernel/led.c:36: error: 'avenrun' undeclared (first use in
    this function)
    arch/sparc/kernel/led.c:36: error: 'FSHIFT' undeclared (first use in
    this function)
    arch/sparc/kernel/led.c:36: error: 'HZ' undeclared (first use in this
    function)
    arch/sparc/kernel/led.c:37: error: invalid use of undefined type 'struct
    timer_list'
    arch/sparc/kernel/led.c:39: error: invalid use of undefined type 'struct
    timer_list'
    arch/sparc/kernel/led.c:40: error: invalid use of undefined type 'struct
    timer_list'
    arch/sparc/kernel/led.c:42: error: implicit declaration of function
    'add_timer'
    arch/sparc/kernel/led.c: In function 'led_write_proc':
    arch/sparc/kernel/led.c:70: error: implicit declaration of function
    'copy_from_user'
    arch/sparc/kernel/led.c:84: error: implicit declaration of function
    'del_timer_sync'
    arch/sparc/kernel/led.c: In function 'led_init':
    arch/sparc/kernel/led.c:109: error: implicit declaration of function
    'init_timer'
    arch/sparc/kernel/led.c:110: error: invalid use of undefined type
    'struct timer_list'
    make[1]: *** [arch/sparc/kernel/led.o] Error 1

    Based upon original patch by Robert Reif.

    Signed-off-by: David S. Miller

    David S. Miller
     

19 Feb, 2008

3 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
    [SPARC64]: Add regs_return_value().
    [SPARC64]: Kill pcic_present().
    [SPARC]: Kill 'prom_palette'.
    [ATYFB]: Kill 'prom_palette' sparc code.
    [SPARC64]: Kill 'prom_keyboard'.
    [SPARC]: Kill extern decl of 'panic_setup'.
    [SPARC64]: Delete 'boot_flags'.
    [SPARC64]: Kill unused function 'kernel_enter_debugger'.
    [SPARC64] arch/sparc64/kernel/unaligned.c: Use time_* macros
    [SPARC64]: Always register a PROM based early console.
    [SPARC64]: Update defconfig.
    [SPARC64]: Add -mtune=ultrasparc3 if possible.
    [SPARC64]: Remove Makefile code for ancient gcc and binutils.
    [SPARC64]: Remove DEBUG_BOOTMEM.
    [SPARC64]: Use shorter "get_zeroed_page" call.
    [SPARC]: Use shorter form of "get_zeroed_page".
    [SPARC]: video/cg14.c and video/sbuslib.c build fixes

    Linus Torvalds
     
  • The idea of this thing is we could save/restore the firmware's
    palette when breaking in and out of the firmware prompt.

    Only one driver implemented this (atyfb) and it's value is
    questionable. If you're just debugging you don't really
    care that the characters end up being purple or whatever.

    And we can provide better debugging and firmware command
    facilities with minimal in-kernel console I/O drivers.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This was made static in kernel/panic.c a long time ago.

    Signed-off-by: David S. Miller

    David S. Miller
     

14 Feb, 2008

1 commit

  • Commit d3d74453c34f8fd87674a8cf5b8a327c68f22e99 ("hrtimer: fixup the
    HRTIMER_CB_IRQSAFE_NO_SOFTIRQ fallback") broke several archs, and since
    only Russell bothered to merge the fix, and Greg to ACK his arch, I'm
    sending this for merger.

    I have confirmation that the Alpha bit results in a booting kernel.
    That leaves: blackfin, frv, sh and sparc untested.

    The deadlock in question was found by Russell:

    IRQ handle
    -> timer_tick() - xtime seqlock held for write
    -> update_process_times()
    -> run_local_timers()
    -> hrtimer_run_queues()
    -> hrtimer_get_softirq_time() - tries to get a read lock

    Now, Thomas assures me the fix is trivial, only do_timer() needs to be
    done under the xtime_lock, and update_process_times() can savely be
    removed from under it.

    Signed-off-by: Peter Zijlstra
    Acked-by: Greg Ungerer
    CC: Richard Henderson
    CC: Bryan Wu
    CC: David Howells
    CC: Paul Mundt
    CC: William Irwin
    Acked-by: Ingo Molnar
    Acked-by: Ivan Kokshaysky
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     

13 Feb, 2008

1 commit


10 Feb, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: (24 commits)
    [SPARC]: Add solaris/sunos binary support to feature removal schedule.
    [SPARC]: Merge asm-sparc{,64}/a.out.h
    [SPARC]: Merge asm-sparc{,64}/fb.h
    [SPARC]: Merge asm-sparc{,64}/errno.h
    [SPARC]: Merge asm-sparc{,64}/emergency-restart.h
    [SPARC]: Merge asm-sparc{,64}/div64.h
    [SPARC]: Merge asm-sparc{,64}/device.h
    [SPARC]: Merge asm-sparc{,64}/current.h
    [SPARC]: Merge asm-sparc{,64}/cputime.h
    [SPARC]: Merge asm-sparc{,64}/cache.h
    [SPARC]: Merge asm-sparc{,64}/byteorder.h
    [SPARC]: Merge asm-sparc{,64}/bugs.h
    [SPARC]: Merge asm-sparc{,64}/bug.h
    [SPARC]: Kill BSD errno translation table and header files.
    [SPARC]: Merge asm-sparc{,64}/bpp.h
    [SPARC]: Merge include/asm-sparc{,64}/auxvec.h
    [SPARC]: Merge include/asm-sparc{,64}/of_device.h
    [SPARC]: Merge include/asm-sparc{,64}/prom.h
    [SPARC]: Remove of_platform_device_create
    [SPARC64]: Add kretprobe support.
    ...

    Linus Torvalds
     

09 Feb, 2008

8 commits

  • Signed-off-by: David S. Miller

    David S. Miller
     
  • Completely unused.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • There are no callers of this on the Sparc platforms.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: David S. Miller

    Stephen Rothwell
     
  • To allow flexible configuration of IDE introduce HAVE_IDE.
    All archs except arm, um and s390 unconditionally select it.
    For arm the actual configuration determine if IDE is supported.

    This is a step towards introducing drivers/Kconfig for arm.

    Signed-off-by: Sam Ravnborg
    Acked-by: Russell King - ARM Linux
    Acked-by: Bartlomiej Zolnierkiewicz

    Sam Ravnborg
     
  • Background: I've implemented 1K/2K page tables for s390. These sub-page
    page tables are required to properly support the s390 virtualization
    instruction with KVM. The SIE instruction requires that the page tables
    have 256 page table entries (pte) followed by 256 page status table entries
    (pgste). The pgstes are only required if the process is using the SIE
    instruction. The pgstes are updated by the hardware and by the hypervisor
    for a number of reasons, one of them is dirty and reference bit tracking.
    To avoid wasting memory the standard pte table allocation should return
    1K/2K (31/64 bit) and 2K/4K if the process is using SIE.

    Problem: Page size on s390 is 4K, page table size is 1K or 2K. That means
    the s390 version for pte_alloc_one cannot return a pointer to a struct
    page. Trouble is that with the CONFIG_HIGHPTE feature on x86 pte_alloc_one
    cannot return a pointer to a pte either, since that would require more than
    32 bit for the return value of pte_alloc_one (and the pte * would not be
    accessible since its not kmapped).

    Solution: The only solution I found to this dilemma is a new typedef: a
    pgtable_t. For s390 pgtable_t will be a (pte *) - to be introduced with a
    later patch. For everybody else it will be a (struct page *). The
    additional problem with the initialization of the ptl lock and the
    NR_PAGETABLE accounting is solved with a constructor pgtable_page_ctor and
    a destructor pgtable_page_dtor. The page table allocation and free
    functions need to call these two whenever a page table page is allocated or
    freed. pmd_populate will get a pgtable_t instead of a struct page pointer.
    To get the pgtable_t back from a pmd entry that has been installed with
    pmd_populate a new function pmd_pgtable is added. It replaces the pmd_page
    call in free_pte_range and apply_to_pte_range.

    Signed-off-by: Martin Schwidefsky
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Schwidefsky
     
  • When the conversion factor between jiffies and milli- or microseconds is
    not a single multiply or divide, as for the case of HZ == 300, we currently
    do a multiply followed by a divide. The intervening result, however, is
    subject to overflows, especially since the fraction is not simplified (for
    HZ == 300, we multiply by 300 and divide by 1000).

    This is exposed to the user when passing a large timeout to poll(), for
    example.

    This patch replaces the multiply-divide with a reciprocal multiplication on
    32-bit platforms. When the input is an unsigned long, there is no portable
    way to do this on 64-bit platforms there is no portable way to do this
    since it requires a 128-bit intermediate result (which gcc does support on
    64-bit platforms but may generate libgcc calls, e.g. on 64-bit s390), but
    since the output is a 32-bit integer in the cases affected, just simplify
    the multiply-divide (*3/10 instead of *300/1000).

    The reciprocal multiply used can have off-by-one errors in the upper half
    of the valid output range. This could be avoided at the expense of having
    to deal with a potential 65-bit intermediate result. Since the intent is
    to avoid overflow problems and most of the other time conversions are only
    semiexact, the off-by-one errors were considered an acceptable tradeoff.

    At Ralf Baechle's suggestion, this version uses a Perl script to compute
    the necessary constants. We already have dependencies on Perl for kernel
    compiles. This does, however, require the Perl module Math::BigInt, which
    is included in the standard Perl distribution starting with version 5.8.0.
    In order to support older versions of Perl, include a table of canned
    constants in the script itself, and structure the script so that
    Math::BigInt isn't required if pulling values from said table.

    Running the script requires that the HZ value is available from the
    Makefile. Thus, this patch also adds the Kconfig variable CONFIG_HZ to the
    architectures which didn't already have it (alpha, cris, frv, h8300, m32r,
    m68k, m68knommu, sparc, v850, and xtensa.) It does *not* touch the sh or
    sh64 architectures, since Paul Mundt has dealt with those separately in the
    sh tree.

    Signed-off-by: H. Peter Anvin
    Cc: Ralf Baechle ,
    Cc: Sam Ravnborg ,
    Cc: Paul Mundt ,
    Cc: Richard Henderson ,
    Cc: Michael Starvik ,
    Cc: David Howells ,
    Cc: Yoshinori Sato ,
    Cc: Hirokazu Takata ,
    Cc: Geert Uytterhoeven ,
    Cc: Roman Zippel ,
    Cc: William L. Irwin ,
    Cc: Chris Zankel ,
    Cc: H. Peter Anvin ,
    Cc: Jan Engelhardt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    H. Peter Anvin
     
  • Remove now unnecessary inclusions of {asm,linux}/a.out.h.

    [akpm@linux-foundation.org: fix alpha build]
    Signed-off-by: David Howells
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Suppress A.OUT library support if CONFIG_ARCH_SUPPORTS_AOUT is not set.

    Not all architectures support the A.OUT binfmt, so the ELF binfmt should not
    be permitted to go looking for A.OUT libraries to load in such a case. Not
    only that, but under such conditions A.OUT core dumps are not produced either.

    To make this work, this patch also does the following:

    (1) Makes the existence of the contents of linux/a.out.h contingent on
    CONFIG_ARCH_SUPPORTS_AOUT.

    (2) Renames dump_thread() to aout_dump_thread() as it's only called by A.OUT
    core dumping code.

    (3) Moves aout_dump_thread() into asm/a.out-core.h and makes it inline. This
    is then included only where needed. This means that this bit of arch
    code will be stored in the appropriate A.OUT binfmt module rather than
    the core kernel.

    (4) Drops A.OUT support for Blackfin (according to Mike Frysinger it's not
    needed) and FRV.

    This patch depends on the previous patch to move STACK_TOP[_MAX] out of
    asm/a.out.h and into asm/processor.h as they're required whether or not A.OUT
    format is available.

    [jdike@addtoit.com: uml: re-remove accidentally restored code]
    Signed-off-by: David Howells
    Cc:
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells