Commit 3e6b6433 authored by Philippe Gerum's avatar Philippe Gerum

lockdep: ipipe: improve detection of out-of-band contexts

trace_hardirqs_on_virt[_caller]() must be invoked instead of
trace_hardirqs_on[_caller]() from assembly sites before returning from
an interrupt/fault, so that the virtual IRQ disable state is checked
for before switching the tracer's logic state to ON.

This is required as an interrupt may be received and handled by the
pipeline core although not forwarded to the root domain, when
interrupts are virtually disabled. In such a case, we want to
reconcile the tracer's logic with the effect of interrupt pipelining.
parent 393ce342
......@@ -2931,6 +2931,12 @@ __visible void trace_hardirqs_on_caller(unsigned long ip)
}
EXPORT_SYMBOL(trace_hardirqs_on_caller);
void trace_hardirqs_on(void)
{
trace_hardirqs_on_caller(CALLER_ADDR0);
}
EXPORT_SYMBOL(trace_hardirqs_on);
__visible void trace_hardirqs_on_virt_caller(unsigned long ip)
{
/*
......@@ -2938,15 +2944,14 @@ __visible void trace_hardirqs_on_virt_caller(unsigned long ip)
* must consider the virtual disable flag exclusively when
* leaving an interrupt/fault context.
*/
if (ipipe_root_p && !raw_irqs_disabled())
if (ipipe_root_p && !irqs_disabled())
trace_hardirqs_on_caller(ip);
}
void trace_hardirqs_on(void)
__visible void trace_hardirqs_on_virt(void)
{
trace_hardirqs_on_caller(CALLER_ADDR0);
trace_hardirqs_on_virt_caller(CALLER_ADDR0);
}
EXPORT_SYMBOL(trace_hardirqs_on);
/*
* Hardirqs were disabled:
......
......@@ -502,10 +502,20 @@ __visible void trace_hardirqs_on_caller(unsigned long caller_addr)
}
EXPORT_SYMBOL(trace_hardirqs_on_caller);
__visible void trace_hardirqs_on_virt_caller(unsigned long caller_addr)
__visible void trace_hardirqs_on_virt_caller(unsigned long ip)
{
if (ipipe_root_p && !raw_irqs_disabled())
trace_hardirqs_on_caller(caller_addr);
/*
* The IRQ tracing logic only applies to the root domain, and
* must consider the virtual disable flag exclusively when
* leaving an interrupt/fault context.
*/
if (ipipe_root_p && !irqs_disabled())
trace_hardirqs_on_caller(ip);
}
__visible void trace_hardirqs_on_virt(void)
{
trace_hardirqs_on_virt_caller(CALLER_ADDR0);
}
__visible void trace_hardirqs_off_caller(unsigned long caller_addr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment