提交 a7e1e001 编写于 作者: L Linus Torvalds

Merge branch 'v2.6.24-rc1-lockdep' of...

Merge branch 'v2.6.24-rc1-lockdep' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep

* 'v2.6.24-rc1-lockdep' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep:
  lockdep: fix a typo in the __lock_acquire comment
  sched: fix unconditional irq lock
  lockdep: fixup irq tracing
...@@ -564,12 +564,7 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs) ...@@ -564,12 +564,7 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs)
resume_execution(cur, regs, kcb); resume_execution(cur, regs, kcb);
regs->eflags |= kcb->kprobe_saved_eflags; regs->eflags |= kcb->kprobe_saved_eflags;
#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT trace_hardirqs_fixup_flags(regs->eflags);
if (raw_irqs_disabled_flags(regs->eflags))
trace_hardirqs_off();
else
trace_hardirqs_on();
#endif
/*Restore back the original saved kprobes variables and continue. */ /*Restore back the original saved kprobes variables and continue. */
if (kcb->kprobe_status == KPROBE_REENTER) { if (kcb->kprobe_status == KPROBE_REENTER) {
......
...@@ -551,12 +551,7 @@ int __kprobes post_kprobe_handler(struct pt_regs *regs) ...@@ -551,12 +551,7 @@ int __kprobes post_kprobe_handler(struct pt_regs *regs)
resume_execution(cur, regs, kcb); resume_execution(cur, regs, kcb);
regs->eflags |= kcb->kprobe_saved_rflags; regs->eflags |= kcb->kprobe_saved_rflags;
#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT trace_hardirqs_fixup_flags(regs->eflags);
if (raw_irqs_disabled_flags(regs->eflags))
trace_hardirqs_off();
else
trace_hardirqs_on();
#endif
/* Restore the original saved kprobes variables and continue. */ /* Restore the original saved kprobes variables and continue. */
if (kcb->kprobe_status == KPROBE_REENTER) { if (kcb->kprobe_status == KPROBE_REENTER) {
......
...@@ -789,6 +789,8 @@ void restart_nmi(void) ...@@ -789,6 +789,8 @@ void restart_nmi(void)
#ifdef CONFIG_KPROBES #ifdef CONFIG_KPROBES
fastcall void __kprobes do_int3(struct pt_regs *regs, long error_code) fastcall void __kprobes do_int3(struct pt_regs *regs, long error_code)
{ {
trace_hardirqs_fixup();
if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP)
== NOTIFY_STOP) == NOTIFY_STOP)
return; return;
......
...@@ -807,6 +807,8 @@ asmlinkage __kprobes void default_do_nmi(struct pt_regs *regs) ...@@ -807,6 +807,8 @@ asmlinkage __kprobes void default_do_nmi(struct pt_regs *regs)
/* runs on IST stack. */ /* runs on IST stack. */
asmlinkage void __kprobes do_int3(struct pt_regs * regs, long error_code) asmlinkage void __kprobes do_int3(struct pt_regs * regs, long error_code)
{ {
trace_hardirqs_fixup();
if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) { if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) {
return; return;
} }
......
...@@ -303,6 +303,11 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs, ...@@ -303,6 +303,11 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs,
int write, si_code; int write, si_code;
int fault; int fault;
/*
* We can fault from pretty much anywhere, with unknown IRQ state.
*/
trace_hardirqs_fixup();
/* get the address */ /* get the address */
address = read_cr2(); address = read_cr2();
......
...@@ -304,6 +304,11 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, ...@@ -304,6 +304,11 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
unsigned long flags; unsigned long flags;
siginfo_t info; siginfo_t info;
/*
* We can fault from pretty much anywhere, with unknown IRQ state.
*/
trace_hardirqs_fixup();
tsk = current; tsk = current;
mm = tsk->mm; mm = tsk->mm;
prefetchw(&mm->mmap_sem); prefetchw(&mm->mmap_sem);
......
...@@ -129,6 +129,27 @@ static inline int raw_irqs_disabled(void) ...@@ -129,6 +129,27 @@ static inline int raw_irqs_disabled(void)
return raw_irqs_disabled_flags(flags); return raw_irqs_disabled_flags(flags);
} }
/*
* makes the traced hardirq state match with the machine state
*
* should be a rarely used function, only in places where its
* otherwise impossible to know the irq state, like in traps.
*/
static inline void trace_hardirqs_fixup_flags(unsigned long flags)
{
if (raw_irqs_disabled_flags(flags))
trace_hardirqs_off();
else
trace_hardirqs_on();
}
static inline void trace_hardirqs_fixup(void)
{
unsigned long flags = __raw_local_save_flags();
trace_hardirqs_fixup_flags(flags);
}
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
/* /*
......
...@@ -111,6 +111,26 @@ static inline int raw_irqs_disabled(void) ...@@ -111,6 +111,26 @@ static inline int raw_irqs_disabled(void)
return raw_irqs_disabled_flags(flags); return raw_irqs_disabled_flags(flags);
} }
/*
* makes the traced hardirq state match with the machine state
*
* should be a rarely used function, only in places where its
* otherwise impossible to know the irq state, like in traps.
*/
static inline void trace_hardirqs_fixup_flags(unsigned long flags)
{
if (raw_irqs_disabled_flags(flags))
trace_hardirqs_off();
else
trace_hardirqs_on();
}
static inline void trace_hardirqs_fixup(void)
{
unsigned long flags = __raw_local_save_flags();
trace_hardirqs_fixup_flags(flags);
}
/* /*
* Used in the idle loop; sti takes one instruction cycle * Used in the idle loop; sti takes one instruction cycle
* to complete: * to complete:
......
...@@ -2424,7 +2424,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, ...@@ -2424,7 +2424,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
return 0; return 0;
/* /*
* Calculate the chain hash: it's the combined has of all the * Calculate the chain hash: it's the combined hash of all the
* lock keys along the dependency chain. We save the hash value * lock keys along the dependency chain. We save the hash value
* at every step so that we can get the current hash easily * at every step so that we can get the current hash easily
* after unlock. The chain hash is then used to cache dependency * after unlock. The chain hash is then used to cache dependency
......
...@@ -80,6 +80,7 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p) ...@@ -80,6 +80,7 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu) static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)
{ {
struct task_struct *g, *p; struct task_struct *g, *p;
unsigned long flags;
SEQ_printf(m, SEQ_printf(m,
"\nrunnable tasks:\n" "\nrunnable tasks:\n"
...@@ -88,7 +89,7 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu) ...@@ -88,7 +89,7 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)
"------------------------------------------------------" "------------------------------------------------------"
"----------------------------------------------------\n"); "----------------------------------------------------\n");
read_lock_irq(&tasklist_lock); read_lock_irqsave(&tasklist_lock, flags);
do_each_thread(g, p) { do_each_thread(g, p) {
if (!p->se.on_rq || task_cpu(p) != rq_cpu) if (!p->se.on_rq || task_cpu(p) != rq_cpu)
...@@ -97,7 +98,7 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu) ...@@ -97,7 +98,7 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)
print_task(m, rq, p); print_task(m, rq, p);
} while_each_thread(g, p); } while_each_thread(g, p);
read_unlock_irq(&tasklist_lock); read_unlock_irqrestore(&tasklist_lock, flags);
} }
void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册