06 Sep, 2013

1 commit

  • The functions

    __down_read
    __down_read_trylock
    __down_write
    __down_write_trylock
    __up_read
    __up_write
    __downgrade_write

    are implemented inline, so remove corresponding EXPORT_SYMBOLs
    (They lead to compile errors on RT kernel).

    Signed-off-by: Kirill Tkhai
    CC: David Miller
    Signed-off-by: David S. Miller

    Kirill Tkhai
     

01 May, 2013

1 commit

  • The help text for this config is duplicated across the x86, parisc, and
    s390 Kconfig.debug files. Arnd Bergman noted that the help text was
    slightly misleading and should be fixed to state that enabling this
    option isn't a problem when using pre 4.4 gcc.

    To simplify the rewording, consolidate the text into lib/Kconfig.debug
    and modify it there to be more explicit about when you should say N to
    this config.

    Also, make the text a bit more generic by stating that this option
    enables compile time checks so we can cover architectures which emit
    warnings vs. ones which emit errors. The details of how an
    architecture decided to implement the checks isn't as important as the
    concept of compile time checking of copy_from_user() calls.

    While we're doing this, remove all the copy_from_user_overflow() code
    that's duplicated many times and place it into lib/ so that any
    architecture supporting this option can get the function for free.

    Signed-off-by: Stephen Boyd
    Acked-by: Arnd Bergmann
    Acked-by: Ingo Molnar
    Acked-by: H. Peter Anvin
    Cc: Arjan van de Ven
    Acked-by: Helge Deller
    Cc: Heiko Carstens
    Cc: Stephen Rothwell
    Cc: Chris Metcalf
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     

01 Apr, 2013

1 commit

  • srmmu_nocache_bitmap is cleared by bit_map_init(). But bit_map_init()
    attempts to clear by memset(), so it can't clear the trailing edge of
    bitmap properly on big-endian architecture if the number of bits is not
    a multiple of BITS_PER_LONG.

    Actually, the number of bits in srmmu_nocache_bitmap is not always
    a multiple of BITS_PER_LONG. It is calculated as below:

    bitmap_bits = srmmu_nocache_size >> SRMMU_NOCACHE_BITMAP_SHIFT;

    srmmu_nocache_size is decided proportionally by the amount of system RAM
    and it is rounded to a multiple of PAGE_SIZE. SRMMU_NOCACHE_BITMAP_SHIFT
    is defined as (PAGE_SHIFT - 4). So it can only be said that bitmap_bits
    is a multiple of 16.

    This fixes the problem by using bitmap_clear() instead of memset()
    in bit_map_init() and this also uses BITS_TO_LONGS() to calculate correct
    size at bitmap allocation time.

    Signed-off-by: Akinobu Mita
    Cc: "David S. Miller"
    Cc: sparclinux@vger.kernel.org
    Signed-off-by: David S. Miller

    Akinobu Mita
     

10 Nov, 2012

1 commit

  • Sparc32 already supported it, as a consequence of using the
    generic atomic64 implementation. And the sparc64 implementation
    is rather trivial.

    This allows us to set ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE for all
    of sparc, and avoid the annoying warning from lib/atomic64_test.c

    Signed-off-by: David S. Miller

    David S. Miller
     

06 Oct, 2012

1 commit

  • This adds optimized memset/bzero/page-clear routines for Niagara-4.

    We basically can do what powerpc has been able to do for a decade (via
    the "dcbz" instruction), which is use cache line clearing stores for
    bzero and memsets with a 'c' argument of zero.

    As long as we make the cache initializing store to each 32-byte
    subblock of the L2 cache line, it works.

    As with other Niagara-4 optimized routines, the key is to make sure to
    avoid any usage of the %asi register, as reads and writes to it cost
    at least 50 cycles.

    For the user clear cases, we don't use these new routines, we use the
    Niagara-1 variants instead. Those have to use %asi in an unavoidable
    way.

    A Niagara-4 8K page clear costs just under 600 cycles.

    Add definitions of the MRU variants of the cache initializing store
    ASIs. By default, cache initializing stores install the line as Least
    Recently Used. If we know we're going to use the data immediately
    (which is true for page copies and clears) we can use the Most
    Recently Used variant, to decrease the likelyhood of the lines being
    evicted before they get used.

    Signed-off-by: David S. Miller

    David S. Miller
     

03 Oct, 2012

1 commit


29 Sep, 2012

1 commit


28 Sep, 2012

1 commit


27 Sep, 2012

2 commits


21 Aug, 2012

1 commit


27 Jun, 2012

1 commit


27 May, 2012

1 commit


25 May, 2012

3 commits


24 May, 2012

1 commit

  • Compute a mask that will only have 0x80 in the bytes which
    had a zero in them. The formula is:

    ~(((x & 0x7f7f7f7f) + 0x7f7f7f7f) | x | 0x7f7f7f7f)

    In the inner word iteration, we have to compute the "x | 0x7f7f7f7f"
    part, so we can reuse that in the above calculation.

    Once we have this mask, we perform divide and conquer to find the
    highest 0x80 location.

    Signed-off-by: David S. Miller

    David S. Miller
     

23 May, 2012

1 commit

  • Linus removed the end-of-address-space hackery from
    fs/namei.c:do_getname() so we really have to validate these edge
    conditions and cannot cheat any more (as x86 used to as well).

    Move to a common C implementation like x86 did. And if both
    src and dst are sufficiently aligned we'll do word at a time
    copies and checks as well.

    Signed-off-by: David S. Miller

    David S. Miller
     

20 May, 2012

2 commits

  • Otherwise if no references exist in the static kernel image,
    we won't export the symbol properly to modules.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Based on copy from microblaze add ucmpdi2 implementation.
    This fixes build of niu driver which failed with:

    drivers/built-in.o: In function `niu_get_nfc':
    niu.c:(.text+0x91494): undefined reference to `__ucmpdi2'

    This driver will never be used on a sparc32 system,
    but patch added to fix build breakage with all*config builds.

    Signed-off-by: Sam Ravnborg
    Signed-off-by: David S. Miller

    Sam Ravnborg
     

16 May, 2012

1 commit

  • For the explicit calls to .udiv/.umul in assembler, I made a
    mechanical (read as: safe) transformation. I didn't attempt
    to make any simplifications.

    In particular, __ndelay and __udelay can be simplified significantly.
    Some of the %y reads are unnecessary and these routines have no need
    any longer for allocating a register window, they can be leaf
    functions.

    Signed-off-by: David S. Miller

    David S. Miller
     

14 May, 2012

1 commit


12 May, 2012

3 commits


02 Feb, 2012

1 commit

  • Both sparc 32-bit's software divide assembler and MPILIB provide
    clz_tab[] with identical contents.

    Break it out into a seperate object file and select it when
    SPARC32 or MPILIB is set.

    Reported-by: Al Viro
    Signed-off-by: David S. Miller
    Signed-off-by: James Morris

    David Miller
     

11 Jan, 2012

1 commit

  • lib: use generic pci_iomap on all architectures

    Many architectures don't want to pull in iomap.c,
    so they ended up duplicating pci_iomap from that file.
    That function isn't trivial, and we are going to modify it
    https://lkml.org/lkml/2011/11/14/183
    so the duplication hurts.

    This reduces the scope of the problem significantly,
    by moving pci_iomap to a separate file and
    referencing that from all architectures.

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    alpha: drop pci_iomap/pci_iounmap from pci-noop.c
    mn10300: switch to GENERIC_PCI_IOMAP
    mn10300: add missing __iomap markers
    frv: switch to GENERIC_PCI_IOMAP
    tile: switch to GENERIC_PCI_IOMAP
    tile: don't panic on iomap
    sparc: switch to GENERIC_PCI_IOMAP
    sh: switch to GENERIC_PCI_IOMAP
    powerpc: switch to GENERIC_PCI_IOMAP
    parisc: switch to GENERIC_PCI_IOMAP
    mips: switch to GENERIC_PCI_IOMAP
    microblaze: switch to GENERIC_PCI_IOMAP
    arm: switch to GENERIC_PCI_IOMAP
    alpha: switch to GENERIC_PCI_IOMAP
    lib: add GENERIC_PCI_IOMAP
    lib: move GENERIC_IOMAP to lib/Kconfig

    Fix up trivial conflicts due to changes nearby in arch/{m68k,score}/Kconfig

    Linus Torvalds
     

28 Dec, 2011

1 commit


04 Dec, 2011

1 commit


21 Oct, 2011

3 commits


04 Aug, 2011

1 commit


03 Aug, 2011

3 commits


28 Jul, 2011

1 commit

  • Should have been done in commit 1af08a1407f4 ("This is in preparation
    for more generic atomic").

    Signed-off-by: Stephen Rothwell
    Cc: Arun Sharma
    Cc: David Miller
    Cc: "Hans-Christian Egtvedt"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     

27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     

21 May, 2011

1 commit


12 May, 2011

1 commit

  • When we are in the label cc_dword_align, registers %o0 and %o1 have the same last 2 bits,
    but it's not guaranteed one of them is zero. So we can get unaligned memory access
    in label ccte. Example of parameters which lead to this:
    %o0=0x7ff183e9, %o1=0x8e709e7d, %g1=3

    With the parameters I had a memory corruption, when the additional 5 bytes were rewritten.
    This patch corrects the error.

    One comment to the patch. We don't care about the third bit in %o1, because cc_end_cruft
    stores word or less.

    Signed-off-by: Tkhai Kirill
    Signed-off-by: David S. Miller

    Tkhai Kirill