1. 24 10月, 2013 4 次提交
    • H
      s390/bitops: use generic find bit functions / reimplement _left variant · 746479cd
      Heiko Carstens 提交于
      Just like all other architectures we should use out-of-line find bit
      operations, since the inline variant bloat the size of the kernel image.
      And also like all other architecures we should only supply optimized
      variants of the __ffs, ffs, etc. primitives.
      
      Therefore this patch removes the inlined s390 find bit functions and uses
      the generic out-of-line variants instead.
      
      The optimization of the primitives follows with the next patch.
      
      With this patch also the functions find_first_bit_left() and
      find_next_bit_left() have been reimplemented, since logically, they are
      nothing else but a find_first_bit()/find_next_bit() implementation that
      use an inverted __fls() instead of __ffs().
      Also the restriction that these functions only work on machines which
      support the "flogr" instruction is gone now.
      
      This reduces the size of the kernel image (defconfig, -march=z9-109)
      by 144,482 bytes.
      Alone the size of the function build_sched_domains() gets reduced from
      7 KB to 3,5 KB.
      
      We also git rid of unused functions like find_first_bit_le()...
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      746479cd
    • H
      s390/bitops: optimize set_bit() for constant values · 4ae80325
      Heiko Carstens 提交于
      Since zEC12 we have the interlocked-access facility 2 which allows to
      use the instructions ni/oi/xi to update a single byte in storage with
      compare-and-swap semantics.
      So change set_bit(), clear_bit() and change_bit() to generate such code
      instead of a compare-and-swap loop (or using the load-and-* instruction
      family), if possible.
      This reduces the text segment by yet another 8KB (defconfig).
      
      Alternatively the long displacement variants niy/oiy/xiy could have
      been used, but the extended displacement field is usually not needed
      and therefore would only increase the size of the text segment again.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      4ae80325
    • H
      s390/bitops: remove CONFIG_SMP / simplify non-atomic bitops · 370b0b5f
      Heiko Carstens 提交于
      Remove CONFIG_SMP from bitops code. This reduces the C code significantly
      but also generates better code for the SMP case.
      
      This means that for !CONFIG_SMP set_bit() and friends now also have
      compare and swap semantics (read: more code). However nobody really cares
      for !CONFIG_SMP and this is the trade-off to simplify the SMP code which we
      do care about.
      
      The non-atomic bitops like __set_bit() now generate also better code
      because the old code did not have a __builtin_contant_p() check for the
      CONFIG_SMP case and therefore always generated the inline assembly variant.
      However the inline assemblies for the non-atomic case now got completely
      removed since gcc can produce better code, which accesses less memory
      operands.
      
      test_bit() got also a bit simplified since it did have a
      __builtin_constant_p() check, however two identical code pathes for each
      case (written differently).
      
      In result this mainly reduces the to be maintained code but is not very
      relevant for code generation, since there are not many non-atomic bitops
      usages that we care about.
      (code reduction defconfig kernel image before/after: 560 bytes).
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      370b0b5f
    • H
      s390/bitops: make use of interlocked-access facility 1 instructions · e344e52c
      Heiko Carstens 提交于
      Make use of the interlocked-access facility 1 that got added with the
      z196 architecure.
      This facilility added new instructions which can atomically update a
      storage location without a compare-and-swap loop. E.g. setting a bit
      within a "long" can be done with a single instruction.
      
      The size of the kernel image gets ~30kb smaller. Considering that there
      are appr. 1900 bitops call sites this means that each one saves about
      15-16 bytes per call site which is expected.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      e344e52c
  2. 22 8月, 2013 1 次提交
  3. 26 7月, 2013 1 次提交
    • M
      s390/bitops: fix find_next_bit_left · 3b0040a4
      Martin Schwidefsky 提交于
      The find_next_bit_left function is broken if used with an offset which
      is not a multiple of 64. The shift to mask the bits of a 64-bit word
      not to search is in the wrong direction, the result can be either a
      bit found smaller than the offset or failure to find a set bit.
      
      Cc: <stable@vger.kernel.org> # v3.8+
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      3b0040a4
  4. 17 4月, 2013 2 次提交
  5. 30 11月, 2012 1 次提交
  6. 20 7月, 2012 1 次提交
    • H
      s390/comments: unify copyright messages and remove file names · a53c8fab
      Heiko Carstens 提交于
      Remove the file name from the comment at top of many files. In most
      cases the file name was wrong anyway, so it's rather pointless.
      
      Also unify the IBM copyright statement. We did have a lot of sightly
      different statements and wanted to change them one after another
      whenever a file gets touched. However that never happened. Instead
      people start to take the old/"wrong" statements to use as a template
      for new files.
      So unify all of them in one go.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      a53c8fab
  7. 24 5月, 2012 2 次提交
  8. 27 7月, 2011 1 次提交
  9. 27 5月, 2011 2 次提交
  10. 24 3月, 2011 3 次提交
  11. 27 2月, 2010 1 次提交
  12. 26 3月, 2009 2 次提交
  13. 22 8月, 2008 1 次提交
    • E
      [S390] fix ext2_find_next_bit · 152382af
      Eric Sandeen 提交于
      ext4 does not work on s390 because ext2_find_next_bit is broken. Fortunately
      this function is only used by ext4. The function uses ffs which does not work
      analog to ffz. The result of ffs has an offset of 1 which is not taken into
      account. To fix this use the low level __ffs_word function directly instead
      of the ill defined ffs.
      
      In addition the patch improves find_next_zero_bit and ext2_find_next_zero_bit
      by passing the bit offset into __ffz_word instead of adding it after the
      function call returned.
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      152382af
  14. 02 8月, 2008 1 次提交
  15. 27 4月, 2008 1 次提交
  16. 19 2月, 2008 1 次提交
  17. 10 2月, 2008 1 次提交
  18. 05 2月, 2008 2 次提交
  19. 29 1月, 2008 1 次提交
  20. 20 10月, 2007 1 次提交
  21. 19 10月, 2007 1 次提交
    • N
      bitops: introduce lock ops · 26333576
      Nick Piggin 提交于
      Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock semantics.
      Convert all architectures to use the generic implementation.
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Acked-By: NDavid Howells <dhowells@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Bryan Wu <bryan.wu@analog.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Greg Ungerer <gerg@uclinux.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Matthew Wilcox <willy@debian.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
      Cc: Richard Curnow <rc@rc0.org.uk>
      Cc: William Lee Irwin III <wli@holomorphy.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Chris Zankel <chris@zankel.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      26333576
  22. 28 9月, 2006 1 次提交
    • M
      [S390] Inline assembly cleanup. · 94c12cc7
      Martin Schwidefsky 提交于
      Major cleanup of all s390 inline assemblies. They now have a common
      coding style. Quite a few have been shortened, mainly by using register
      asm variables. Use of the EX_TABLE macro helps  as well. The atomic ops,
      bit ops and locking inlines new use the Q-constraint if a newer gcc
      is used.  That results in slightly better code.
      
      Thanks to Christian Borntraeger for proof reading the changes.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      94c12cc7
  23. 29 6月, 2006 1 次提交
  24. 26 4月, 2006 1 次提交
  25. 27 3月, 2006 2 次提交
  26. 12 2月, 2006 1 次提交
  27. 04 1月, 2006 1 次提交
  28. 07 11月, 2005 1 次提交
  29. 28 7月, 2005 1 次提交
    • M
      [PATCH] s390: find_next_{zero}_bit fixes · afff7e2b
      Martin Schwidefsky 提交于
      The find_next_{zero}_bit primitives on s390* should never return a bit number
      bigger then the bit field size.  In the case of a bitfield that doesn't end on
      a word boundary, an offset that makes the search start at the last word of the
      bit field and the last word doesn't contain any zero/one bits the search is
      continued with a call to find_first_bit with a negative size.  The search
      normally ends pretty quickly because the words following the bit field contain
      a mix of zeros and ones.  But the bit number that is returned in this case is
      too big.
      
      To fix this and additional if to check for this case is needed.  To make the
      code easier to read I removed the assembler parts from the
      find_next_{zero}_bit functions, the C-ified code is as good.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      afff7e2b