1. 09 2月, 2009 1 次提交
  2. 08 2月, 2009 4 次提交
    • S
      ring-buffer: use generic version of in_nmi · a81bd80a
      Steven Rostedt 提交于
      Impact: clean up
      
      Now that a generic in_nmi is available, this patch removes the
      special code in the ring_buffer and implements the in_nmi generic
      version instead.
      
      With this change, I was also able to rename the "arch_ftrace_nmi_enter"
      back to "ftrace_nmi_enter" and remove the code from the ring buffer.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      a81bd80a
    • S
      ftrace: change function graph tracer to use new in_nmi · 9a5fd902
      Steven Rostedt 提交于
      The function graph tracer piggy backed onto the dynamic ftracer
      to use the in_nmi custom code for dynamic tracing. The problem
      was (as Andrew Morton pointed out) it really only wanted to bail
      out if the context of the current CPU was in NMI context. But the
      dynamic ftrace in_nmi custom code was true if _any_ CPU happened
      to be in NMI context.
      
      Now that we have a generic in_nmi interface, this patch changes
      the function graph code to use it instead of the dynamic ftarce
      custom code.
      Reported-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      9a5fd902
    • S
      ftrace, x86: rename in_nmi variable · 4e6ea144
      Steven Rostedt 提交于
      Impact: clean up
      
      The in_nmi variable in x86 arch ftrace.c is a misnomer.
      Andrew Morton pointed out that the in_nmi variable is incremented
      by all CPUS. It can be set when another CPU is running an NMI.
      
      Since this is actually intentional, the fix is to rename it to
      what it really is: "nmi_running"
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      4e6ea144
    • S
      ring-buffer: add NMI protection for spinlocks · 78d904b4
      Steven Rostedt 提交于
      Impact: prevent deadlock in NMI
      
      The ring buffers are not yet totally lockless with writing to
      the buffer. When a writer crosses a page, it grabs a per cpu spinlock
      to protect against a reader. The spinlocks taken by a writer are not
      to protect against other writers, since a writer can only write to
      its own per cpu buffer. The spinlocks protect against readers that
      can touch any cpu buffer. The writers are made to be reentrant
      with the spinlocks disabling interrupts.
      
      The problem arises when an NMI writes to the buffer, and that write
      crosses a page boundary. If it grabs a spinlock, it can be racing
      with another writer (since disabling interrupts does not protect
      against NMIs) or with a reader on the same CPU. Luckily, most of the
      users are not reentrant and protects against this issue. But if a
      user of the ring buffer becomes reentrant (which is what the ring
      buffers do allow), if the NMI also writes to the ring buffer then
      we risk the chance of a deadlock.
      
      This patch moves the ftrace_nmi_enter called by nmi_enter() to the
      ring buffer code. It replaces the current ftrace_nmi_enter that is
      used by arch specific code to arch_ftrace_nmi_enter and updates
      the Kconfig to handle it.
      
      When an NMI is called, it will set a per cpu variable in the ring buffer
      code and will clear it when the NMI exits. If a write to the ring buffer
      crosses page boundaries inside an NMI, a trylock is used on the spin
      lock instead. If the spinlock fails to be acquired, then the entry
      is discarded.
      
      This bug appeared in the ftrace work in the RT tree, where event tracing
      is reentrant. This workaround solved the deadlocks that appeared there.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      78d904b4
  3. 07 2月, 2009 1 次提交
    • R
      x86-64: fix int $0x80 -ENOSYS return · c09249f8
      Roland McGrath 提交于
      One of my past fixes to this code introduced a different new bug.
      When using 32-bit "int $0x80" entry for a bogus syscall number,
      the return value is not correctly set to -ENOSYS.  This only happens
      when neither syscall-audit nor syscall tracing is enabled (i.e., never
      seen if auditd ever started).  Test program:
      
      	/* gcc -o int80-badsys -m32 -g int80-badsys.c
      	   Run on x86-64 kernel.
      	   Note to reproduce the bug you need auditd never to have started.  */
      
      	#include <errno.h>
      	#include <stdio.h>
      
      	int
      	main (void)
      	{
      	  long res;
      	  asm ("int $0x80" : "=a" (res) : "0" (99999));
      	  printf ("bad syscall returns %ld\n", res);
      	  return res != -ENOSYS;
      	}
      
      The fix makes the int $0x80 path match the sysenter and syscall paths.
      Reported-by: NDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      c09249f8
  4. 06 2月, 2009 2 次提交
  5. 05 2月, 2009 1 次提交
  6. 04 2月, 2009 31 次提交