1. 20 4月, 2008 13 次提交
  2. 19 4月, 2008 4 次提交
  3. 18 4月, 2008 10 次提交
    • R
      ptrace_signal subroutine · 18c98b65
      Roland McGrath 提交于
      This breaks out the ptrace handling from get_signal_to_deliver into a
      new subroutine.  The actual code there doesn't change, and it gets
      inlined into nearly identical compiled code.  This makes the function
      substantially shorter and thus easier to read, and it nicely isolates
      the ptrace magic.
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      Acked-by: NKyle McMartin <kyle@mcmartin.ca>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      18c98b65
    • L
      cgroup: fix a race condition in manipulating tsk->cg_list · 0e04388f
      Li Zefan 提交于
      When I ran a test program to fork mass processes and at the same time
      'cat /cgroup/tasks', I got the following oops:
      
        ------------[ cut here ]------------
        kernel BUG at lib/list_debug.c:72!
        invalid opcode: 0000 [#1] SMP
        Pid: 4178, comm: a.out Not tainted (2.6.25-rc9 #72)
        ...
        Call Trace:
         [<c044a5f9>] ? cgroup_exit+0x55/0x94
         [<c0427acf>] ? do_exit+0x217/0x5ba
         [<c0427ed7>] ? do_group_exit+0.65/0x7c
         [<c0427efd>] ? sys_exit_group+0xf/0x11
         [<c0404842>] ? syscall_call+0x7/0xb
         [<c05e0000>] ? init_cyrix+0x2fa/0x479
        ...
        EIP: [<c04df671>] list_del+0x35/0x53 SS:ESP 0068:ebc7df4
        ---[ end trace caffb7332252612b ]---
        Fixing recursive fault but reboot is needed!
      
      After digging into the code and debugging, I finlly found out a race
      situation:
      
      				do_exit()
      				  ->cgroup_exit()
      				    ->if (!list_empty(&tsk->cg_list))
      				        list_del(&tsk->cg_list);
      
        cgroup_iter_start()
          ->cgroup_enable_task_cg_list()
            ->list_add(&tsk->cg_list, ..);
      
      In this case the list won't be deleted though the process has exited.
      
      We got two bug reports in the past, which seem to be the same bug as
      this one:
      	http://lkml.org/lkml/2008/3/5/332
      	http://lkml.org/lkml/2007/10/17/224
      
      Actually sometimes I got oops on list_del, sometimes oops on list_add.
      And I can change my test program a bit to trigger other oops.
      
      The patch has been tested both on x86_32 and x86_64.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NPaul Menage <menage@google.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0e04388f
    • J
      kgdb: always use icache flush for sw breakpoints · 1a9a3e76
      Jason Wessel 提交于
      On the ppc 4xx architecture the instruction cache must be flushed as
      well as the data cache.  This patch just makes it generic for all
      architectures where CACHE_FLUSH_IS_SAFE is set to 1.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1a9a3e76
    • J
      kgdb: fix SMP NMI kgdb_handle_exception exit race · 56fb7093
      Jason Wessel 提交于
      Fix the problem of protecting the kgdb handle_exception exit
      which had an NMI race condition, while trying to restore
      normal system operation.
      
      There was a small window after the master processor sets cpu_in_debug
      to zero but before it has set kgdb_active to zero where a
      non-master processor in an SMP system could receive an NMI and
      re-enter the kgdb_wait() loop.
      
      As long as the master processor sets the cpu_in_debug before sending
      the cpu roundup the cpu_in_debug variable can also be used to guard
      against the race condition.
      
      The kgdb_wait() function no longer needs to check
      kgdb_active because it is done in the arch specific code
      and handled along with the nmi traps at the low level.
      This also allows kgdb_wait() to exit correctly if it was
      entered for some unknown reason due to a spurious NMI that
      could not be handled by the arch specific code.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      56fb7093
    • J
      kgdb: fix several kgdb regressions · 737a460f
      Jason Wessel 提交于
      kgdb core fixes:
      - Check to see that mm->mmap_cache is not null before calling
        flush_cache_range(), else on arch=ARM it will cause a fatal
        fault.
      
      - Breakpoints should only be restored if they are in the BP_ACTIVE
        state.
      
      - Fix a typo in comments to "kgdb_register_io_module"
      
      x86 kgdb fixes:
      - Fix the x86 arch handler such that on a kill or detach that the
        appropriate cleanup on the single stepping flags gets run.
      
      - Add in the DIE_NMIWATCHDOG call for x86_64
      
      - Touch the nmi watchdog before returning the system to normal
        operation after performing any kind of kgdb operation, else
        the possibility exists to trigger the watchdog.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      737a460f
    • J
      kgdb: fix optional arch functions and probe_kernel_* · b4b8ac52
      Jason Wessel 提交于
      Fix two regressions dealing with the kgdb core.
      
      1) kgdb_skipexception and kgdb_post_primary_code are optional
      functions that are only required on archs that need special exception
      fixups.
      
      2) The kernel address space scope must be set on any probe_kernel_*
      function or archs such as ARCH=arm will not allow access to the kernel
      memory space.  As an example, it is required to allow the full kernel
      address space is when you the kernel debugger to inspect a system
      call.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b4b8ac52
    • J
      kgdb: add x86 HW breakpoints · 64e9ee30
      Jason Wessel 提交于
      Add HW breakpoints into the arch specific portion of x86 kgdb.  In the
      current x86 kernel.org kernels HW breakpoints are changed out in lazy
      fashion because there is no infrastructure around changing them when
      changing to a kernel task or entering the kernel mode via a system
      call.  This lazy approach means that if a user process uses HW
      breakpoints the kgdb will loose out.  This is an acceptable trade off
      because the developer debugging the kernel is assumed to know what is
      going on system wide and would be aware of this trade off.
      
      There is a minor bug fix to the kgdb core so as to correctly call the
      hw breakpoint functions with a valid value from the enum.
      
      There is also a minor change to the x86_64 startup code when using
      early HW breakpoints.  When the debugger is connected, the cpu startup
      code must not zero out the HW breakpoint registers or you cannot hit
      the breakpoints you are interested in, in the first place.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      64e9ee30
    • J
      kgdb: print breakpoint removed on exception · 67baf94c
      Jason Wessel 提交于
      If kgdb does remove a breakpoint that had a problem on the recursion
      check, it should also print the address of the breakpoint.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      67baf94c
    • J
      kgdb: clocksource watchdog · 7c3078b6
      Jason Wessel 提交于
      In order to not trip the clocksource watchdog, kgdb must touch the
      clocksource watchdog on the return to normal system run state.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7c3078b6
    • J
      kgdb: core · dc7d5527
      Jason Wessel 提交于
      kgdb core code. Handles the protocol and the arch details.
      
      [ mingo@elte.hu: heavily modified, simplified and cleaned up. ]
      [ xemul@openvz.org: use find_task_by_pid_ns ]
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NJan Kiszka <jan.kiszka@web.de>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      dc7d5527
  4. 17 4月, 2008 13 次提交