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
     

13 Mar, 2010

2 commits

  • Add generic implementations of the old and really old uname system calls.
    Note that sh only implements sys_olduname but not sys_oldolduname, but I'm
    not going to bother with another ifdef for that special case.

    m32r implemented an old uname but never wired it up, so kill it, too.

    Signed-off-by: Christoph Hellwig
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mundt
    Cc: Jeff Dike
    Cc: Hirokazu Takata
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: H. Peter Anvin
    Cc: Al Viro
    Cc: Arnd Bergmann
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: "Luck, Tony"
    Cc: James Morris
    Cc: Andreas Schwab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Add a generic implementation of the ipc demultiplexer syscall. Except for
    s390 and sparc64 all implementations of the sys_ipc are nearly identical.

    There are slight differences in the types of the parameters, where mips
    and powerpc as the only 64-bit architectures with sys_ipc use unsigned
    long for the "third" argument as it gets casted to a pointer later, while
    it traditionally is an "int" like most other paramters. frv goes even
    further and uses unsigned long for all parameters execept for "ptr" which
    is a pointer type everywhere. The change from int to unsigned long for
    "third" and back to "int" for the others on frv should be fine due to the
    in-register calling conventions for syscalls (we already had a similar
    issue with the generic sys_ptrace), but I'd prefer to have the arch
    maintainers looks over this in details.

    Except for that h8300, m68k and m68knommu lack an impplementation of the
    semtimedop sub call which this patch adds, and various architectures have
    gets used - at least on i386 it seems superflous as the compat code on
    x86-64 and ia64 doesn't even bother to implement it.

    [akpm@linux-foundation.org: add sys_ipc to sys_ni.c]
    Signed-off-by: Christoph Hellwig
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mundt
    Cc: Jeff Dike
    Cc: Hirokazu Takata
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Reviewed-by: H. Peter Anvin
    Cc: Al Viro
    Cc: Arnd Bergmann
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: "Luck, Tony"
    Cc: James Morris
    Cc: Andreas Schwab
    Acked-by: Jesper Nilsson
    Acked-by: Russell King
    Acked-by: David Howells
    Acked-by: Kyle McMartin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

11 Dec, 2009

1 commit


09 May, 2008

2 commits

  • m32r can use the generic sys_pipe implementation.

    The current sys_pipe implementation on m32r only differes from the
    generic one by passing a lot of additional unused registers to sys_pipe.

    Reviewed and tested by Hirokazu Takata.

    Signed-off-by: Christoph Hellwig
    Acked-by: Hirokazu Takata
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Remember to close the files if copy_to_user() failed.

    Spotted by dm.n9107@gmail.com.

    Signed-off-by: Ulrich Drepper
    Cc: DM
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ulrich Drepper
     

20 Oct, 2007

1 commit


17 Oct, 2007

1 commit

  • All asm/ipc.h files do only #include .

    This patch therefore removes all include/asm-*/ipc.h files and moves the
    contents of include/asm-generic/ipc.h to include/linux/ipc.h.

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

    Adrian Bunk
     

31 Jul, 2007

1 commit


09 May, 2007

1 commit


12 Oct, 2006

1 commit


02 Oct, 2006

2 commits

  • This adds the new kernel_execve function on all architectures that were using
    _syscall3() to implement execve.

    The implementation uses code from the _syscall3 macros provided in the
    unistd.h header file. I don't have cross-compilers for any of these
    architectures, so the patch is untested with the exception of i386.

    Most architectures can probably implement this in a nicer way in assembly or
    by combining it with the sys_execve implementation itself, but this should do
    it for now.

    [bunk@stusta.de: m68knommu build fix]
    [markh@osdl.org: build fix]
    [bero@arklinux.org: build fix]
    [ralf@linux-mips.org: mips fix]
    [schwidefsky@de.ibm.com: s390 fix]
    Signed-off-by: Arnd Bergmann
    Cc: Andi Kleen
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Russell King
    Cc: Ian Molton
    Cc: Mikael Starvik
    Cc: David Howells
    Cc: Yoshinori Sato
    Cc: Hirokazu Takata
    Cc: Ralf Baechle
    Cc: Kyle McMartin
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: Paul Mundt
    Cc: Kazumoto Kojima
    Cc: Richard Curnow
    Cc: William Lee Irwin III
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Cc: Miles Bader
    Cc: Chris Zankel
    Cc: "Luck, Tony"
    Cc: Geert Uytterhoeven
    Cc: Roman Zippel
    Signed-off-by: Ralf Baechle
    Signed-off-by: Bernhard Rosenkraenzer
    Signed-off-by: Mark Haverkamp
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     
  • Replace references to system_utsname to the per-process uts namespace
    where appropriate. This includes things like uname.

    Changes: Per Eric Biederman's comments, use the per-process uts namespace
    for ELF_PLATFORM, sunrpc, and parts of net/ipv4/ipconfig.c

    [jdike@addtoit.com: UML fix]
    [clg@fr.ibm.com: cleanup]
    [akpm@osdl.org: build fix]
    Signed-off-by: Serge E. Hallyn
    Cc: Kirill Korotaev
    Cc: "Eric W. Biederman"
    Cc: Herbert Poetzl
    Cc: Andrey Savochkin
    Signed-off-by: Cedric Le Goater
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn
     

01 Jul, 2006

1 commit


21 Feb, 2006

1 commit

  • This patch updates and fixes sys_tas() routine for m32r.

    In the previous implementation, a lockup rarely caused at sys_tas()
    routine in SMP environment.

    > > The problem is that touching *addr will generate an oops if that page isn't
    > > paged in. If we convert it to use get_user() then that's an improvement,
    > > but we must not run get_user() under spinlock or local_irq_disable().

    I rewrote sys_tas() routine by using "lock -> unlock" instructions, and
    utilizing the m32r's interrupt handling characteristics; the m32r processor
    can accept interrupts only at the 32-bit instruction boundary. So, the
    "unlock" instruction can be executed continuously after the "lock"
    instruction execution without any interruptions.

    In addition, to solve such a page_fault problem, I use a fixup code like
    get_user().

    And, as for the kernel lockup problem, we found that a calling
    do_page_fault() routine with disabling interrupts might cause a lockup at
    flush_tlb_others(), because we checked a completion of IPI handler's
    operations in a spin-locked critical section.

    Therefore, by using "lock -> unlock" code, we can implement the sys_tas()
    rouitine without disabling interrupts explicitly, then no lockups would
    happen at flush_tlb_others(), I hope.

    Compile check and some working test in SMP environment have done.

    Signed-off-by: Hirokazu Takata
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hirokazu Takata
     

29 Nov, 2005

1 commit

  • This patch fixes a deadlock problem of the m32r SMP kernel.

    In the m32r kernel, sys_tas() system call is provided as a test-and-set
    function for userspace, for backward compatibility.

    In some multi-threading application program, deadlocks were rarely caused
    at sys_tas() funcion. Such a deadlock was caused due to a collision of
    __pthread_lock() and __pthread_unlock() operations.

    The "tas" syscall is repeatedly called by pthread_mutex_lock() to get a
    lock, while a lock variable's value is not 0. On the other hand,
    pthead_mutex_unlock() sets the lock variable to 0 for unlocking.

    In the previous implementation of sys_tas() routine, there was a
    possibility that a unlock operation was ignored in the following case:

    - Assume a lock variable (*addr) was equal to 1 before sys_tas() execution.
    - __pthread_unlock() operation is executed by the other processor
    and the lock variable (*addr) is set to 0, between a read operation
    ("oldval = *addr;") and the following write operation ("*addr = 1;")
    during a execution of sys_tas().

    In this case, the following write operation ("*addr = 1;") overwrites the
    __pthread_unlock() result, and sys_tas() fails to get a lock in the next
    turn and after that.

    According to the attatched patch, sys_tas() returns 0 value in the next
    turn and deadlocks never happen.

    Signed-off-by: Hitoshi Yamamoto
    Signed-off-by: Hirokazu Takata
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hirokazu Takata
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds