1. 07 4月, 2010 1 次提交
    • B
      x86: Add optimized popcnt variants · d61931d8
      Borislav Petkov 提交于
      Add support for the hardware version of the Hamming weight function,
      popcnt, present in CPUs which advertize it under CPUID, Function
      0x0000_0001_ECX[23]. On CPUs which don't support it, we fallback to the
      default lib/hweight.c sw versions.
      
      A synthetic benchmark comparing popcnt with __sw_hweight64 showed almost
      a 3x speedup on a F10h machine.
      Signed-off-by: NBorislav Petkov <borislav.petkov@amd.com>
      LKML-Reference: <20100318112015.GC11152@aftab>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      d61931d8
  2. 26 2月, 2010 1 次提交
    • M
      x86: Add text_poke_smp for SMP cross modifying code · 3d55cc8a
      Masami Hiramatsu 提交于
      Add generic text_poke_smp for SMP which uses stop_machine()
      to synchronize modifying code.
      This stop_machine() method is officially described at "7.1.3
      Handling Self- and Cross-Modifying Code" on the intel's
      software developer's manual 3A.
      
      Since stop_machine() can't protect code against NMI/MCE, this
      function can not modify those handlers. And also, this function
      is basically for modifying multibyte-single-instruction. For
      modifying multibyte-multi-instructions, we need another special
      trap & detour code.
      
      This code originaly comes from immediate values with
      stop_machine() version. Thanks Jason and Mathieu!
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Anders Kaseorg <andersk@ksplice.com>
      Cc: Tim Abbott <tabbott@ksplice.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133438.6725.80273.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3d55cc8a
  3. 04 2月, 2010 1 次提交
    • M
      ftrace/alternatives: Introducing *_text_reserved functions · 2cfa1978
      Masami Hiramatsu 提交于
      Introducing *_text_reserved functions for checking the text
      address range is partially reserved or not. This patch provides
      checking routines for x86 smp alternatives and dynamic ftrace.
      Since both functions modify fixed pieces of kernel text, they
      should reserve and protect those from other dynamic text
      modifier, like kprobes.
      
      This will also be extended when introducing other subsystems
      which modify fixed pieces of kernel text. Dynamic text modifiers
      should avoid those.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: przemyslaw@pawelczyk.it
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Jason Baron <jbaron@redhat.com>
      LKML-Reference: <20100202214911.4694.16587.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2cfa1978
  4. 30 12月, 2009 1 次提交
    • J
      x86-64: Modify copy_user_generic() alternatives mechanism · 1b1d9258
      Jan Beulich 提交于
      In order to avoid unnecessary chains of branches, rather than
      implementing copy_user_generic() as a function consisting of
      just a single (possibly patched) branch, instead properly deal
      with patching call instructions in the alternative instructions
      framework, and move the patching into the callers.
      
      As a follow-on, one could also introduce something like
      __EXPORT_SYMBOL_ALT() to avoid patching call sites in modules.
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Cc: Nick Piggin <npiggin@suse.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      LKML-Reference: <4B2BB8180200007800026AE7@vpn.id2.novell.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1b1d9258
  5. 02 12月, 2009 1 次提交
    • J
      x86/alternatives: Check replacementlen <= instrlen at build time · 01be50a3
      Jan Beulich 提交于
      Having run into the run-(boot-)time check a couple of times lately,
      I finally took time to find a build-time check so that one doesn't
      need to analyze the register/stack dump and resolve this (through
      manual lookup in vmlinux) to the offending construct.
      
      The assembler will emit a message like "Error: value of <num> too
      large for field of 1 bytes at <offset>", which while not pointing
      out the source location still makes analysis quite a bit easier.
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      LKML-Reference: <4B0FF8AA0200007800022703@vpn.id2.novell.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      01be50a3
  6. 22 8月, 2009 1 次提交
  7. 28 4月, 2009 1 次提交
    • M
      x86: clean up alternative.h · edc953fa
      Mathieu Desnoyers 提交于
      Alternative header duplicates assembly that could be merged in
      one single macro.  Merging this into this macro also allows to
      directly declare ALTERNATIVE() statements within assembly code.
      
      Uses a __stringify() of the feature bits rather than passing a
      "i" operand.  Leave the old %0 operand as-is (set to 0), unused
      to stay compatible with API.
      
      (v2: tab alignment fixes)
      
      [ Impact: cleanup ]
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      LKML-Reference: <20090428151346.GA31212@Krystal>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      edc953fa
  8. 23 10月, 2008 2 次提交
  9. 23 7月, 2008 1 次提交
    • V
      x86: consolidate header guards · 77ef50a5
      Vegard Nossum 提交于
      This patch is the result of an automatic script that consolidates the
      format of all the headers in include/asm-x86/.
      
      The format:
      
      1. No leading underscore. Names with leading underscores are reserved.
      2. Pathname components are separated by two underscores. So we can
         distinguish between mm_types.h and mm/types.h.
      3. Everything except letters and numbers are turned into single
         underscores.
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      77ef50a5
  10. 24 5月, 2008 1 次提交
  11. 17 4月, 2008 2 次提交
    • J
      2ac1ea7c
    • M
      x86: enhance DEBUG_RODATA support - alternatives · e587cadd
      Mathieu Desnoyers 提交于
      Fix a memcpy that should be a text_poke (in apply_alternatives).
      
      Use kernel_wp_save/kernel_wp_restore in text_poke to support DEBUG_RODATA
      correctly and so the CPU HOTPLUG special case can be removed.
      
      Add text_poke_early, for alternatives and paravirt boot-time and module load
      time patching.
      
      Changelog:
      
      - Fix text_set and text_poke alignment check (mixed up bitwise and and or)
      - Remove text_set
      - Export add_nops, so it can be used by others.
      - Document text_poke_early.
      - Remove clflush, since it breaks some VIA architectures and is not strictly
        necessary.
      - Add kerneldoc to text_poke and text_poke_early.
      - Create a second vmap instead of using the WP bit to support Xen and VMI.
      - Move local_irq disable within text_poke and text_poke_early to be able to
        be sleepable in these functions.
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      CC: Andi Kleen <andi@firstfloor.org>
      CC: pageexec@freemail.hu
      CC: H. Peter Anvin <hpa@zytor.com>
      CC: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e587cadd
  12. 30 1月, 2008 1 次提交
  13. 11 10月, 2007 1 次提交