1. 30 10月, 2010 5 次提交
    • S
      jump label: Add work around to i386 gcc asm goto bug · 45f81b1c
      Steven Rostedt 提交于
      On i386 (not x86_64) early implementations of gcc would have a bug
      with asm goto causing it to produce code like the following:
      
      (This was noticed by Peter Zijlstra)
      
         56 pushl 0
         67 nopl         jmp 0x6f
            popl
            jmp 0x8c
      
         6f              mov
                         test
                         je 0x8c
      
         8c mov
            call *(%esp)
      
      The jump added in the asm goto skipped over the popl that matched
      the pushl 0, which lead up to a quick crash of the system when
      the jump was enabled. The nopl is defined in the asm goto () statement
      and when tracepoints are enabled, the nop changes to a jump to the label
      that was specified by the asm goto. asm goto is suppose to tell gcc that
      the code in the asm might jump to an external label. Here gcc obviously
      fails to make that work.
      
      The bug report for gcc is here:
      
        http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46226
      
      The bug only appears on x86 when not compiled with
      -maccumulate-outgoing-args. This option is always set on x86_64 and it
      is also the work around for a function graph tracer i386 bug.
      (See commit: 746357d6)
      This explains why the bug only showed up on i386 when function graph
      tracer was not enabled.
      
      This patch now adds a CONFIG_JUMP_LABEL option that is default
      off instead of using jump labels by default. When jump labels are
      enabled, the -maccumulate-outgoing-args will be used (causing a
      slightly larger kernel image on i386). This option will exist
      until we have a way to detect if the gcc compiler in use is safe
      to use on all configurations without the work around.
      
      Note, there exists such a test, but for now we will keep the enabling
      of jump label as a manual option.
      
      Archs that know the compiler is safe with asm goto, may choose to
      select JUMP_LABEL and enable it by default.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Cause-discovered-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: David Daney <ddaney@caviumnetworks.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Miller <davem@davemloft.net>
      Cc: Richard Henderson <rth@redhat.com>
      LKML-Reference: <1288028746.3673.11.camel@laptop>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      45f81b1c
    • H
      x86, ftrace: Use safe noops, drop trap test · 2d1d7126
      H. Peter Anvin 提交于
      Always use a safe 5-byte noop sequence.  Drop the trap test, since it
      is known to return false negatives on some virtualization platforms on
      32 bits.  The resulting code is both simpler and safer.
      
      Cc: Daniel Drake <dsd@laptop.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      2d1d7126
    • D
      jump_label: Fix unaligned traps on sparc. · f0daed02
      David Miller 提交于
      The vmlinux.lds.h knobs to emit the __jump_table section in the main
      kernel image takes care to align the section, but this doesn't help
      for the __jump_table section that gets emitted into modules.
      
      Fix the resulting lack of section alignment by explicitly specifying
      it in the assembler.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      LKML-Reference: <20101023.110624.226758370.davem@davemloft.net>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      f0daed02
    • S
      jump label: Make arch_jump_label_text_poke_early() optional · 95bcd683
      Steven Rostedt 提交于
      Some archs do not need to do anything special for jump labels on
      startup (like MIPS).  This patch adds a weak function stub for
      arch_jump_label_text_poke_early();
      
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: David Miller <davem@davemloft.net>
      Cc: David Daney <ddaney@caviumnetworks.com>
      Suggested-by: NThomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1286218615-24011-2-git-send-email-ddaney@caviumnetworks.com>
      LKML-Reference: <20101015201037.703989993@goodmis.org>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      95bcd683
    • S
      jump label: Fix error with preempt disable holding mutex · de31c3ca
      Steven Rostedt 提交于
      Kprobes and jump label were having a race between mutexes that
      was fixed by reordering the jump label. But this reordering
      moved the jump label mutex into a preempt disable location.
      
      This patch does a little fiddling to move the grabbing of
      the jump label mutex from inside the preempt disable section
      and still keep the order correct between the mutex and the
      kprobes lock.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      de31c3ca
  2. 28 10月, 2010 35 次提交