]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag 'byteswap-for-linus-20121219' of git://git.infradead.org/users/dwmw2/byteswap
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 19 Dec 2012 15:52:48 +0000 (07:52 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 19 Dec 2012 15:52:48 +0000 (07:52 -0800)
Pull preparatory gcc intrisics bswap patch from David Woodhouse:
 "This single patch is effectively a no-op for now.  It enables
  architectures to opt in to using GCC's __builtin_bswapXX() intrinsics
  for byteswapping, and if we merge this now then the architecture
  maintainers can enable it for their arch during the next cycle without
  dependency issues.

  It's worth making it a par-arch opt-in, because although in *theory*
  the compiler should never do worse than hand-coded assembler (and of
  course it also ought to do a lot better on platforms like Atom and
  PowerPC which have load-and-swap or store-and-swap instructions), that
  isn't always the case.  See

     http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46453

  for example."

* tag 'byteswap-for-linus-20121219' of git://git.infradead.org/users/dwmw2/byteswap:
  byteorder: allow arch to opt to use GCC intrinsics for byteswapping

1  2 
arch/Kconfig

diff --combined arch/Kconfig
index 54ffd0f9df21b7d9f28789104dd48e5bdcf5a965,c31416b10586f5431c49b2971903299be0efc282..8e9e3246b2b4e0f1a0b2218f5e49a8cacecb24d2
@@@ -80,7 -80,6 +80,7 @@@ config UPROBE
        bool "Transparent user-space probes (EXPERIMENTAL)"
        depends on UPROBE_EVENT && PERF_EVENTS
        default n
 +      select PERCPU_RWSEM
        help
          Uprobes is the user-space counterpart to kprobes: they
          enable instrumentation applications (such as 'perf probe')
@@@ -113,6 -112,25 +113,25 @@@ config HAVE_EFFICIENT_UNALIGNED_ACCES
          See Documentation/unaligned-memory-access.txt for more
          information on the topic of unaligned memory accesses.
  
+ config ARCH_USE_BUILTIN_BSWAP
+        bool
+        help
+        Modern versions of GCC (since 4.4) have builtin functions
+        for handling byte-swapping. Using these, instead of the old
+        inline assembler that the architecture code provides in the
+        __arch_bswapXX() macros, allows the compiler to see what's
+        happening and offers more opportunity for optimisation. In
+        particular, the compiler will be able to combine the byteswap
+        with a nearby load or store and use load-and-swap or
+        store-and-swap instructions if the architecture has them. It
+        should almost *never* result in code which is worse than the
+        hand-coded assembler in <asm/swab.h>.  But just in case it
+        does, the use of the builtins is optional.
+        Any architecture with load-and-swap or store-and-swap
+        instructions should set this. And it shouldn't hurt to set it
+        on architectures that don't have such instructions.
  config HAVE_SYSCALL_WRAPPERS
        bool
  
@@@ -301,16 -319,15 +320,16 @@@ config SECCOMP_FILTE
  
          See Documentation/prctl/seccomp_filter.txt for details.
  
 -config HAVE_RCU_USER_QS
 +config HAVE_CONTEXT_TRACKING
        bool
        help
 -        Provide kernel entry/exit hooks necessary for userspace
 -        RCU extended quiescent state. Syscalls need to be wrapped inside
 -        rcu_user_exit()-rcu_user_enter() through the slow path using
 -        TIF_NOHZ flag. Exceptions handlers must be wrapped as well. Irqs
 -        are already protected inside rcu_irq_enter/rcu_irq_exit() but
 -        preemption or signal handling on irq exit still need to be protected.
 +        Provide kernel/user boundaries probes necessary for subsystems
 +        that need it, such as userspace RCU extended quiescent state.
 +        Syscalls need to be wrapped inside user_exit()-user_enter() through
 +        the slow path using TIF_NOHZ flag. Exceptions handlers must be
 +        wrapped as well. Irqs are already protected inside
 +        rcu_irq_enter/rcu_irq_exit() but preemption or signal handling on
 +        irq exit still need to be protected.
  
  config HAVE_VIRT_CPU_ACCOUNTING
        bool
@@@ -343,18 -360,4 +362,18 @@@ config MODULES_USE_ELF_RE
          Modules only use ELF REL relocations.  Modules with ELF RELA
          relocations will give an error.
  
 +#
 +# ABI hall of shame
 +#
 +config CLONE_BACKWARDS
 +      bool
 +      help
 +        Architecture has tls passed as the 4th argument of clone(2),
 +        not the 5th one.
 +
 +config CLONE_BACKWARDS2
 +      bool
 +      help
 +        Architecture has the first two arguments of clone(2) swapped.
 +
  source "kernel/gcov/Kconfig"