mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 08:52:27 +00:00
This patch adds the __irq_entry annotation to the default x86
platform IRQ handlers. ftrace's function_graph tracer uses the
__irq_entry annotation to notify the entry and return of IRQ
handlers.
For example, before the patch:
354549.667252 | 3) d..1 | default_idle_call() {
354549.667252 | 3) d..1 | arch_cpu_idle() {
354549.667253 | 3) d..1 | default_idle() {
354549.696886 | 3) d..1 | smp_trace_reschedule_interrupt() {
354549.696886 | 3) d..1 | irq_enter() {
354549.696886 | 3) d..1 | rcu_irq_enter() {
After the patch:
366416.254476 | 3) d..1 | arch_cpu_idle() {
366416.254476 | 3) d..1 | default_idle() {
366416.261566 | 3) d..1 ==========> |
366416.261566 | 3) d..1 | smp_trace_reschedule_interrupt() {
366416.261566 | 3) d..1 | irq_enter() {
366416.261566 | 3) d..1 | rcu_irq_enter() {
KASAN also uses this annotation. The smp_apic_timer_interrupt()
was already annotated.
Signed-off-by: Daniel Bristot de Oliveira <[email protected]>
Acked-by: Steven Rostedt (VMware) <[email protected]>
Cc: Aaron Lu <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Claudio Fontana <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: Dou Liyang <[email protected]>
Cc: Gu Zheng <[email protected]>
Cc: Hidehiro Kawai <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Nicolai Stange <[email protected]>
Cc: Peter Zijlstra (Intel) <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Wanpeng Li <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/059fdf437c2f0c09b13c18c8fe4e69999d3ffe69.1483528431.git.bristot@redhat.com
Signed-off-by: Ingo Molnar <[email protected]>
46 lines
932 B
C
46 lines
932 B
C
/*
|
|
* x86 specific code for irq_work
|
|
*
|
|
* Copyright (C) 2010 Red Hat, Inc., Peter Zijlstra
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/irq_work.h>
|
|
#include <linux/hardirq.h>
|
|
#include <asm/apic.h>
|
|
#include <asm/trace/irq_vectors.h>
|
|
#include <linux/interrupt.h>
|
|
|
|
static inline void __smp_irq_work_interrupt(void)
|
|
{
|
|
inc_irq_stat(apic_irq_work_irqs);
|
|
irq_work_run();
|
|
}
|
|
|
|
__visible void __irq_entry smp_irq_work_interrupt(struct pt_regs *regs)
|
|
{
|
|
ipi_entering_ack_irq();
|
|
__smp_irq_work_interrupt();
|
|
exiting_irq();
|
|
}
|
|
|
|
__visible void __irq_entry smp_trace_irq_work_interrupt(struct pt_regs *regs)
|
|
{
|
|
ipi_entering_ack_irq();
|
|
trace_irq_work_entry(IRQ_WORK_VECTOR);
|
|
__smp_irq_work_interrupt();
|
|
trace_irq_work_exit(IRQ_WORK_VECTOR);
|
|
exiting_irq();
|
|
}
|
|
|
|
void arch_irq_work_raise(void)
|
|
{
|
|
#ifdef CONFIG_X86_LOCAL_APIC
|
|
if (!arch_irq_work_has_interrupt())
|
|
return;
|
|
|
|
apic->send_IPI_self(IRQ_WORK_VECTOR);
|
|
apic_wait_icr_idle();
|
|
#endif
|
|
}
|