11 Apr, 2006

2 commits

  • While cleaning up parisc_ksyms.c earlier, I noticed that strpbrk wasn't
    being exported from lib/string.c. Investigating further, I noticed a
    changeset that removed its export and added it to _ksyms.c on a few more
    architectures. The justification was that "other arches do it."

    I think this is wrong, since no architecture currently defines
    __HAVE_ARCH_STRPBRK, there's no reason for any of them to be exporting it
    themselves. Therefore, consolidate the export to lib/string.c.

    Signed-off-by: Kyle McMartin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kyle McMartin
     
  • For some architectures, a few syscalls are not linked in noMMU mode. In
    that case, the MMU depending syscalls are needed to be defined as
    'cond_syscall'. For example, ARM architecture selectively links sys_mlock
    by the mode configuration.

    In case of FRV, it has been managed by #ifdef CONFIG_MMU macro in
    arch/frv/kernel/entry.S. However these conditional macros are just
    duplicates if they were defined as cond_syscall. Compilation test is done
    with FRV toolchains for both of MMU and noMMU mode.

    Signed-off-by: Hyok S. Choi
    Cc: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hyok S. Choi
     

01 Apr, 2006

1 commit


27 Mar, 2006

2 commits

  • - remove ffz()
    - remove find_{next,first}{,_zero}_bit()
    - remove generic_ffs()
    - remove __ffs()
    - remove generic_fls64()
    - remove sched_find_first_bit()
    - remove generic_hweight{32,16,8}()
    - remove ext2_{set,clear,test,find_first_zero,find_next_zero}_bit()
    - remove minix_{test,set,test_and_clear,test,find_first_zero}_bit()

    Signed-off-by: Akinobu Mita
    Cc: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Fix warning messages triggered by bitops code consolidation patches.
    cxn_bitmap is the array of unsigned long. '&' is unnesesary for the argument
    of *_bit() routins.

    Signed-off-by: Akinobu Mita
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

24 Mar, 2006

1 commit


23 Mar, 2006

1 commit

  • When we stop allocating percpu memory for not-possible CPUs we must not touch
    the percpu data for not-possible CPUs at all. The correct way of doing this
    is to test cpu_possible() or to use for_each_cpu().

    This patch is a kernel-wide sweep of all instances of NR_CPUS. I found very
    few instances of this bug, if any. But the patch converts lots of open-coded
    test to use the preferred helper macros.

    Cc: Mikael Starvik
    Cc: David Howells
    Acked-by: Kyle McMartin
    Cc: Anton Blanchard
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Paul Mundt
    Cc: "David S. Miller"
    Cc: William Lee Irwin III
    Cc: Andi Kleen
    Cc: Christian Zankel
    Cc: Philippe Elie
    Cc: Nathan Scott
    Cc: Jens Axboe
    Cc: Eric Dumazet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

22 Mar, 2006

3 commits

  • set_page_count usage outside mm/ is limited to setting the refcount to 1.
    Remove set_page_count from outside mm/, and replace those users with
    init_page_count() and set_page_refcounted().

    This allows more debug checking, and tighter control on how code is allowed
    to play around with page->_count.

    Signed-off-by: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • Have an explicit mm call to split higher order pages into individual pages.
    Should help to avoid bugs and be more explicit about the code's intention.

    Signed-off-by: Nick Piggin
    Cc: Russell King
    Cc: David Howells
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mundt
    Cc: "David S. Miller"
    Cc: Chris Zankel
    Signed-off-by: Yoichi Yuasa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • Sam's tree includes a new check, which found that we're exporting strpbrk()
    multiple times.

    It seems that the convention is that this is exported from the arch files, so
    reove the lib/string.c export.

    Cc: Sam Ravnborg
    Cc: Yoshinori Sato
    Cc: David Howells
    Cc: Greg Ungerer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

15 Feb, 2006

3 commits

  • Make the FRV arch use virtual interrupt disablement because accesses to the
    processor status register (PSR) are relatively slow and because we will
    soon have the need to deal with multiple interrupt controls at the same
    time (separate h/w and inter-core interrupts).

    The way this is done is to dedicate one of the four integer condition code
    registers (ICC2) to maintaining a virtual interrupt disablement state
    whilst inside the kernel. This uses the ICC2.Z flag (Zero) to indicate
    whether the interrupts are virtually disabled and the ICC2.C flag (Carry)
    to indicate whether the interrupts are physically disabled.

    ICC2.Z is set to indicate interrupts are virtually disabled. ICC2.C is set
    to indicate interrupts are physically enabled. Under normal running
    conditions Z==0 and C==1.

    Disabling interrupts with local_irq_disable() doesn't then actually
    physically disable interrupts - it merely sets ICC2.Z to 1. Should an
    interrupt then happen, the exception prologue will note ICC2.Z is set and
    branch out of line using one instruction (an unlikely BEQ). Here it will
    physically disable interrupts and clear ICC2.C.

    When it comes time to enable interrupts (local_irq_enable()), this simply
    clears the ICC2.Z flag and invokes a trap #2 if both Z and C flags are
    clear (the HI integer condition). This can be done with the TIHI
    conditional trap instruction.

    The trap then physically reenables interrupts and sets ICC2.C again. Upon
    returning the interrupt will be taken as interrupts will then be enabled.
    Note that whilst processing the trap, the whole exceptions system is
    disabled, and so an interrupt can't happen till it returns.

    If no pending interrupt had happened, ICC2.C would still be set, the HI
    condition would not be fulfilled, and no trap will happen.

    Saving interrupts (local_irq_save) is simply a matter of pulling the ICC2.Z
    flag out of the CCR register, shifting it down and masking it off. This
    gives a result of 0 if interrupts were enabled and 1 if they weren't.

    Restoring interrupts (local_irq_restore) is then a matter of taking the
    saved value mentioned previously and XOR'ing it against 1. If it was one,
    the result will be zero, and if it was zero the result will be non-zero.
    This result is then used to affect the ICC2.Z flag directly (it is a
    condition code flag after all). An XOR instruction does not affect the
    Carry flag, and so that bit of state is unchanged. The two flags can then
    be sampled to see if they're both zero using the trap (TIHI) as for the
    unconditional reenablement (local_irq_enable).

    This patch also:

    (1) Modifies the debugging stub (break.S) to handle single-stepping crossing
    into the trap #2 handler and into virtually disabled interrupts.

    (2) Removes superseded fixup pointers from the second instructions in the trap
    tables (there's no a separate fixup table for this).

    (3) Declares the trap #3 vector for use in .org directives in the trap table.

    (4) Moves irq_enter() and irq_exit() in do_IRQ() to avoid problems with
    virtual interrupt handling, and removes the duplicate code that has now
    been folded into irq_exit() (softirq and preemption handling).

    (5) Tells the compiler in the arch Makefile that ICC2 is now reserved.

    (6) Documents the in-kernel ABI, including the virtual interrupts.

    (7) Renames the old irq management functions to different names.

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

    David Howells
     
  • Make various alterations and fixes to the FRV arch:

    (1) Resyncs the FRV system call collection with the i386 arch.

    (2) Discards __iounmap() as it's not used.

    (3) Fixes the use of the SWAP/SWAPI instruction to get the arguments the right
    way around in atomic.h, and also to get the asm constraints correct.

    (4) Moves copy_to/from_user_page() to asm/cacheflush.h to be consistent with
    other archs.

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

    David Howells
     
  • CONFIG_TIME_LOW_RES is a temporary way for architectures to signal that
    they simply return xtime in do_gettimeoffset(). In this corner-case we
    want to round up by resolution when starting a relative timer, to avoid
    short timeouts. This will go away with the GTOD framework.

    Signed-off-by: Ingo Molnar
    Cc: Roman Zippel
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

19 Jan, 2006

1 commit

  • Handle TIF_RESTORE_SIGMASK as added by David Woodhouse's patch entitled:

    [PATCH] 2/3 Add TIF_RESTORE_SIGMASK support for arch/powerpc
    [PATCH] 3/3 Generic sys_rt_sigsuspend

    It does the following:

    (1) Declares TIF_RESTORE_SIGMASK for FRV.

    (2) Invokes it over to do_signal() when TIF_RESTORE_SIGMASK is set.

    (3) Makes do_signal() support TIF_RESTORE_SIGMASK, using the signal mask saved
    in current->saved_sigmask.

    (4) Discards sys_rt_sigsuspend() from the arch, using the generic one instead.

    (5) Makes sys_sigsuspend() save the signal mask and set TIF_RESTORE_SIGMASK
    rather than attempting to fudge the return registers.

    (6) Makes sys_sigsuspend() return -ERESTARTNOHAND rather than looping
    intrinsically.

    (7) Makes setup_frame(), setup_rt_frame() and handle_signal() return 0 or
    -EFAULT rather than true/false to be consistent with the rest of the
    kernel.

    Due to the fact do_signal() is then only called from one place:

    (8) Make do_signal() no longer have a return value is it was just being
    ignored; force_sig() takes care of this.

    (9) Discards the old sigmask argument to do_signal() as it's no longer
    necessary.

    This patch depends on the FRV signalling patches as well as the
    sys_rt_sigsuspend patch.

    Signed-off-by: David Howells
    Signed-off-by: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

13 Jan, 2006

1 commit


11 Jan, 2006

3 commits

  • Fix up some trivial conflicts in {i386|ia64}/Makefile

    Linus Torvalds
     
  • )

    From: Adrian Bunk

    - create one common dump_thread() prototype in kernel.h

    - dump_thread() is only used in fs/binfmt_aout.c and can therefore be
    removed on all architectures where CONFIG_BINFMT_AOUT is not
    available

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    akpm@osdl.org
     
  • It seems the "make UID16 support optional" patch was checked when it
    edited the -tiny tree some time ago, but it wasn't checked whether it
    still matches the current situation when it was submitted for inclusion
    in -mm. This patch fixes the following bugs:
    - ARCH_S390X does no longer exist, nowadays this has to be expressed
    through (S390 && 64BIT)
    - in five architecture specific Kconfig files the UID16 options
    weren't removed

    Additionally, it changes the fragile negative dependencies of UID16 to
    positive dependencies (new architectures are more likely to not require
    UID16 support).

    Signed-off-by: Adrian Bunk
    Acked-by: Matt Mackall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

10 Jan, 2006

2 commits


09 Jan, 2006

10 commits

  • Fix a number of miscellanous items:

    (1) Declare lock sections in the linker script.

    (2) Recurse in the correct manner in the arch makefile.

    (3) asm/bug.h requires asm/linkage.h to be included first. One C file puts
    asm/bug.h first.

    (4) Add an empty RTC header file to avoid missing header file errors.

    (5) sg_dma_address() should use the dma_address member of a scatter list.

    (6) Add trivial pci_unmap support.

    (7) Add pgprot_noncached()

    (8) Discard u_quad_t.

    (9) Use ~0UL rather than ULONG_MAX in unistd.h in case the latter isn't
    declared.

    (10) Add an empty VGA header file to avoid missing header file errors.

    (11) Add an XOR header file to use the generic XOR stuff.

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

    David Howells
     
  • Force the 8230 serial driver to be built in if the on-CPU UARTs are to be
    used. It can't be used as a module because the arch setup needs to call into
    it.

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

    David Howells
     
  • Fix PCMCIA configuration for FRV by including the stock PCMCIA configuration
    description file.

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

    David Howells
     
  • Implement pci_iomap() for FRV.

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

    David Howells
     
  • Add stubs for FRV module support.

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

    David Howells
     
  • Fix the exception table handling so that modules exceptions are dealt with.

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

    David Howells
     
  • Export a number of features required to build all the modules. It also
    implements the following simple features:

    (*) csum_partial_copy_from_user() for MMU as well as no-MMU.

    (*) __ucmpdi2().

    so that they can be exported too.

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

    David Howells
     
  • Drop support for debugging features that aren't supported on FRV:

    (*) EARLY_PRINTK

    The on-chip UARTs are set up early enough that this isn't required,
    and VGA support isn't available. There's also a gdbstub available.

    (*) DEBUG_PAGEALLOC

    This can't be easily be done since we use huge static mappings to
    cover the kernel, not pages.

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

    David Howells
     
  • Drop support for 8-bit and 16-bit xchg and cmpxchg emulation and implements
    32-bit xchg with the SWAP/SWAPI instruction.

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

    David Howells
     
  • Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

07 Jan, 2006

3 commits

  • The attached patch improves the signal handling:

    (1) It makes do_signal() static as it isn't called from anywhere outside of
    the arch code.

    (2) It removes the regs argument to all the static functions within that file,
    using __frame instead (which is the same thing held in a global register).

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

    David Howells
     
  • The attached patch makes FRV signal handling work properly:

    (1) After do_notify_resume() has been called, the work flags must be checked
    again (there may be another signal to deliver or the process might require
    rescheduling for instance).

    (2) After the signal frame is set up on the userspace stack, ptrace() should
    be given an opportunity to single-step into the signal handler.

    (3) The error state from setting up a signal frame should be passed back up
    the call chain.

    (4) The segfault handler shouldn't be preemptively reset in the arch if we
    fail to deliver a SEGV signal: force_sig() will take care of that.

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

    David Howells
     
  • The attached patch implements futex operations for the FRV architecture. The
    operations are applicable to both MMU and no-MMU modes; though the EFAULT
    handling will be a little bit of wasted space on the latter.

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

    David Howells
     

29 Nov, 2005

1 commit

  • The attached patch implements a bunch of small changes to the FRV arch to
    make it work again.

    It deals with the following problems:

    (1) SEM_DEBUG should be SEMAPHORE_DEBUG.

    (2) The argument list to pcibios_penalize_isa_irq() has changed.

    (3) CONFIG_HIGHMEM can't be used directly in #if as it may not be defined.

    (4) page->private is no longer directly accessible.

    (5) linux/hardirq.h assumes asm/hardirq.h will include linux/irq.h

    (6) The IDE MMIO access functions are given pointers, not integers, and so
    get type casting errors.

    (7) __pa() is passed an explicit u64 type in drivers/char/mem.c, but that
    can't be cast directly to a pointer on a 32-bit platform.

    (8) SEMAPHORE_DEBUG should not be contingent on WAITQUEUE_DEBUG as that no
    longer exists.

    (9) PREEMPT_ACTIVE is too low a value.

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

    David Howells
     

14 Nov, 2005

1 commit


09 Nov, 2005

1 commit

  • Run idle threads with preempt disabled.

    Also corrected a bugs in arm26's cpu_idle (make it actually call schedule()).
    How did it ever work before?

    Might fix the CPU hotplugging hang which Nigel Cunningham noted.

    We think the bug hits if the idle thread is preempted after checking
    need_resched() and before going to sleep, then the CPU offlined.

    After calling stop_machine_run, the CPU eventually returns from preemption and
    into the idle thread and goes to sleep. The CPU will continue executing
    previous idle and have no chance to call play_dead.

    By disabling preemption until we are ready to explicitly schedule, this bug is
    fixed and the idle threads generally become more robust.

    From: alexs

    PPC build fix

    From: Yoichi Yuasa

    MIPS build fix

    Signed-off-by: Nick Piggin
    Signed-off-by: Yoichi Yuasa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

07 Nov, 2005

1 commit

  • The sys_ptrace boilerplate code (everything outside the big switch
    statement for the arch-specific requests) is shared by most architectures.
    This patch moves it to kernel/ptrace.c and leaves the arch-specific code as
    arch_ptrace.

    Some architectures have a too different ptrace so we have to exclude them.
    They continue to keep their implementations. For sh64 I had to add a
    sh64_ptrace wrapper because it does some initialization on the first call.
    For um I removed an ifdefed SUBARCH_PTRACE_SPECIAL block, but
    SUBARCH_PTRACE_SPECIAL isn't defined anywhere in the tree.

    Signed-off-by: Christoph Hellwig
    Acked-by: Paul Mackerras
    Acked-by: Ralf Baechle
    Acked-By: David Howells
    Acked-by: Russell King
    Acked-by: Paul Mundt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

31 Oct, 2005

2 commits


30 Oct, 2005

1 commit

  • Christoph Lameter demonstrated very poor scalability on the SGI 512-way, with
    a many-threaded application which concurrently initializes different parts of
    a large anonymous area.

    This patch corrects that, by using a separate spinlock per page table page, to
    guard the page table entries in that page, instead of using the mm's single
    page_table_lock. (But even then, page_table_lock is still used to guard page
    table allocation, and anon_vma allocation.)

    In this implementation, the spinlock is tucked inside the struct page of the
    page table page: with a BUILD_BUG_ON in case it overflows - which it would in
    the case of 32-bit PA-RISC with spinlock debugging enabled.

    Splitting the lock is not quite for free: another cacheline access. Ideally,
    I suppose we would use split ptlock only for multi-threaded processes on
    multi-cpu machines; but deciding that dynamically would have its own costs.
    So for now enable it by config, at some number of cpus - since the Kconfig
    language doesn't support inequalities, let preprocessor compare that with
    NR_CPUS. But I don't think it's worth being user-configurable: for good
    testing of both split and unsplit configs, split now at 4 cpus, and perhaps
    change that to 8 later.

    There is a benefit even for singly threaded processes: kswapd can be attacking
    one part of the mm while another part is busy faulting.

    Signed-off-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins