1. 23 2月, 2009 2 次提交
  2. 21 2月, 2009 5 次提交
    • S
      ftrace: break out modify loop immediately on detection of error · 4377245a
      Steven Rostedt 提交于
      Impact: added precaution on failure detection
      
      Break out of the modifying loop as soon as a failure is detected.
      This is just an added precaution found by code review and was not
      found by any bug chasing.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      4377245a
    • S
      ftrace: immediately stop code modification if failure is detected · 90c7ac49
      Steven Rostedt 提交于
      Impact: fix to prevent NMI lockup
      
      If the page fault handler produces a WARN_ON in the modifying of
      text, and the system is setup to have a high frequency of NMIs,
      we can lock up the system on a failure to modify code.
      
      The modifying of code with NMIs allows all NMIs to modify the code
      if it is about to run. This prevents a modifier on one CPU from
      modifying code running in NMI context on another CPU. The modifying
      is done through stop_machine, so only NMIs must be considered.
      
      But if the write causes the page fault handler to produce a warning,
      the print can slow it down enough that as soon as it is done
      it will take another NMI before going back to the process context.
      The new NMI will perform the write again causing another print and
      this will hang the box.
      
      This patch turns off the writing as soon as a failure is detected
      and does not wait for it to be turned off by the process context.
      This will keep NMIs from getting stuck in this back and forth
      of print outs.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      90c7ac49
    • S
      ftrace, x86: make kernel text writable only for conversions · 16239630
      Steven Rostedt 提交于
      Impact: keep kernel text read only
      
      Because dynamic ftrace converts the calls to mcount into and out of
      nops at run time, we needed to always keep the kernel text writable.
      
      But this defeats the point of CONFIG_DEBUG_RODATA. This patch converts
      the kernel code to writable before ftrace modifies the text, and converts
      it back to read only afterward.
      
      The kernel text is converted to read/write, stop_machine is called to
      modify the code, then the kernel text is converted back to read only.
      
      The original version used SYSTEM_STATE to determine when it was OK
      or not to change the code to rw or ro. Andrew Morton pointed out that
      using SYSTEM_STATE is a bad idea since there is no guarantee to what
      its state will actually be.
      
      Instead, I moved the check into the set_kernel_text_* functions
      themselves, and use a local variable to determine when it is
      OK to change the kernel text RW permissions.
      
      [ Update: Ingo Molnar suggested moving the prototypes to cacheflush.h ]
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      16239630
    • F
      tracing/markers: make markers select tracepoints · 91f73f90
      Frederic Weisbecker 提交于
      Sometimes it happens that KConfig dependencies are not handled
      like in the following scenario:
      
      - config A
         bool
      
      - config B
         bool
         depends on A
      
      - config C
         bool
         select B
      
      If one selects C, then it will select B without checking its
      dependency to A, if A hasn't been selected elsewhere, it will
      result in a build failure.
      
      This is what happens on the following build error:
      
       kernel/built-in.o: In function `marker_update_probe_range':
       (.text+0x52f64): undefined reference to `tracepoint_probe_register_noupdate'
       kernel/built-in.o: In function `marker_update_probe_range':
       (.text+0x52f74): undefined reference to `tracepoint_probe_unregister_noupdate'
       kernel/built-in.o: In function `marker_update_probe_range':
       (.text+0x52fb9): undefined reference to `tracepoint_probe_unregister_noupdate'
       kernel/built-in.o: In function `marker_update_probes':
       marker.c:(.text+0x530ba): undefined reference to `tracepoint_probe_update_all'
      
      CONFIG_KVM_TRACE will select CONFIG_MARKER, but the latter
      depends on CONFIG_TRACEPOINTS which will not be selected.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      91f73f90
    • S
      ftrace: allow archs to preform pre and post process for code modification · 000ab691
      Steven Rostedt 提交于
      This patch creates the weak functions: ftrace_arch_code_modify_prepare
      and ftrace_arch_code_modify_post_process that are called before and
      after the stop machine is called to modify the kernel text.
      
      If the arch needs to do pre or post processing, it only needs to define
      these functions.
      
      [ Update: Ingo Molnar suggested using the name ftrace_arch_code_modify_*
                over using ftrace_arch_modify_* ]
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      000ab691
  3. 20 2月, 2009 12 次提交
  4. 19 2月, 2009 21 次提交