Patch "x86/irq, trace: Add __irq_entry annotation to x86's platform IRQ handlers" has been added to the 4.9-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
x86/irq, trace: Add __irq_entry annotation to x86's platform IRQ handlers
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
x86-irq-trace-add-__irq_entry-annotation-to-x86-s-platform-irq-handlers.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Sun Nov 19 11:32:28 CET 2017
From: Daniel Bristot de Oliveira <[email protected]>
Date: Wed, 4 Jan 2017 12:20:33 +0100
Subject: x86/irq, trace: Add __irq_entry annotation to x86's platform IRQ handlers
From: Daniel Bristot de Oliveira <[email protected]>
[ Upstream commit c4158ff536439619fa342810cc575ae2c809f03f ]
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.
--- arch/x86/kernel/apic/apic.c | 8 ++++---- arch/x86/kernel/apic/vector.c | 2 +- arch/x86/kernel/cpu/mcheck/mce_amd.c | 4 ++-- arch/x86/kernel/cpu/mcheck/therm_throt.c | 6 ++++-- arch/x86/kernel/cpu/mcheck/threshold.c | 4 ++-- arch/x86/kernel/irq.c | 4 ++-- arch/x86/kernel/irq_work.c | 5 +++-- arch/x86/kernel/smp.c | 15 +++++++++------ 8 files changed, 27 insertions(+), 21 deletions(-)
arch/x86/kernel/apic/apic.c +4 -4
@@ -1863,14 +1863,14 @@ static void __smp_spurious_interrupt(u8 "should never happen.\n", vector, smp_processor_id()); } -__visible void smp_spurious_interrupt(struct pt_regs *regs) +__visible void __irq_entry smp_spurious_interrupt(struct pt_regs *regs) {entering_irq ();__smp_spurious_interrupt (~regs->orig_ax);exiting_irq (); } -__visible void smp_trace_spurious_interrupt(struct pt_regs *regs) +__visible void __irq_entry smp_trace_spurious_interrupt(struct pt_regs *regs) {u8 vector = ~regs->orig_ax;
@@ -1921,14 +1921,14 @@ static void __smp_error_interrupt(struct } -__visible void smp_error_interrupt(struct pt_regs *regs) +__visible void __irq_entry smp_error_interrupt(struct pt_regs *regs) {entering_irq ();__smp_error_interrupt (regs);exiting_irq (); } -__visible void smp_trace_error_interrupt(struct pt_regs *regs) +__visible void __irq_entry smp_trace_error_interrupt(struct pt_regs *regs) {entering_irq ();trace_error_apic_entry (ERROR_APIC_VECTOR );
arch/x86/kernel/apic/vector.c +1 -1
@@ -559,7 +559,7 @@ void send_cleanup_vector(struct irq_cfg__send_cleanup_vector (data); } -asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) +asmlinkage __visible void __irq_entry smp_irq_move_cleanup_interrupt(void) {unsigned vector, me;
arch/x86/kernel/cpu/mcheck/mce_amd.c +2 -2
@@ -593,14 +593,14 @@ static inline void __smp_deferred_error_deferred_error_int_vector (); } -asmlinkage __visible void smp_deferred_error_interrupt(void) +asmlinkage __visible void __irq_entry smp_deferred_error_interrupt(void) {entering_irq ();__smp_deferred_error_interrupt ();exiting_ack_irq (); } -asmlinkage __visible void smp_trace_deferred_error_interrupt(void) +asmlinkage __visible void __irq_entry smp_trace_deferred_error_interrupt(void) {entering_irq ();trace_deferred_error_apic_entry (DEFERRED_ERROR_VECTOR );
arch/x86/kernel/cpu/mcheck/therm_throt.c +4 -2
@@ -431,14 +431,16 @@ static inline void __smp_thermal_interrusmp_thermal_vector (); } -asmlinkage __visible void smp_thermal_interrupt(struct pt_regs *regs) +asmlinkage __visible void __irq_entry +smp_thermal_interrupt (struct pt_regs *regs) {entering_irq ();__smp_thermal_interrupt ();exiting_ack_irq (); } -asmlinkage __visible void smp_trace_thermal_interrupt(struct pt_regs *regs) +asmlinkage __visible void __irq_entry +smp_trace_thermal_interrupt (struct pt_regs *regs) {entering_irq ();trace_thermal_apic_entry (THERMAL_APIC_VECTOR );
arch/x86/kernel/cpu/mcheck/threshold.c +2 -2
@@ -24,14 +24,14 @@ static inline void __smp_threshold_intermce_threshold_vector (); } -asmlinkage __visible void smp_threshold_interrupt(void) +asmlinkage __visible void __irq_entry smp_threshold_interrupt(void) {entering_irq ();__smp_threshold_interrupt ();exiting_ack_irq (); } -asmlinkage __visible void smp_trace_threshold_interrupt(void) +asmlinkage __visible void __irq_entry smp_trace_threshold_interrupt(void) {entering_irq ();trace_threshold_apic_entry (THRESHOLD_APIC_VECTOR );
arch/x86/kernel/irq.c +2 -2
@@ -265,7 +265,7 @@ void __smp_x86_platform_ipi(void)x86_platform_ipi_callback (); } -__visible void smp_x86_platform_ipi(struct pt_regs *regs) +__visible void __irq_entry smp_x86_platform_ipi(struct pt_regs *regs) {struct pt_regs *old_regs =set_irq_regs (regs);
@@ -316,7 +316,7 @@ __visible void smp_kvm_posted_intr_wakeu }#endif -__visible void smp_trace_x86_platform_ipi(struct pt_regs *regs) +__visible void __irq_entry smp_trace_x86_platform_ipi(struct pt_regs *regs) {struct pt_regs *old_regs =set_irq_regs (regs);
arch/x86/kernel/irq_work.c +3 -2
@@ -9,6 +9,7 @@#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 ) {
@@ -16,14 +17,14 @@ static inline void __smp_irq_work_interrirq_work_run (); } -__visible void smp_irq_work_interrupt(struct pt_regs *regs) +__visible void __irq_entry smp_irq_work_interrupt(struct pt_regs *regs) {ipi_entering_ack_irq ();__smp_irq_work_interrupt ();exiting_irq (); } -__visible void smp_trace_irq_work_interrupt(struct pt_regs *regs) +__visible void __irq_entry smp_trace_irq_work_interrupt(struct pt_regs *regs) {ipi_entering_ack_irq ();trace_irq_work_entry (IRQ_WORK_VECTOR );
arch/x86/kernel/smp.c +9 -6
@@ -259,7 +259,7 @@ static inline void __smp_reschedule_intescheduler_ipi (); } -__visible void smp_reschedule_interrupt(struct pt_regs *regs) +__visible void __irq_entry smp_reschedule_interrupt(struct pt_regs *regs) {irq_enter ();ack_APIC_irq ();
@@ -270,7 +270,7 @@ __visible void smp_reschedule_interrupt(*/ } -__visible void smp_trace_reschedule_interrupt(struct pt_regs *regs) +__visible void __irq_entry smp_trace_reschedule_interrupt(struct pt_regs *regs) {/* * Need to call irq_enter() before calling the trace point.
@@ -294,14 +294,15 @@ static inline void __smp_call_function_iinc_irq_stat (irq_call_count); } -__visible void smp_call_function_interrupt(struct pt_regs *regs) +__visible void __irq_entry smp_call_function_interrupt(struct pt_regs *regs) {ipi_entering_ack_irq ();__smp_call_function_interrupt ();exiting_irq (); } -__visible void smp_trace_call_function_interrupt(struct pt_regs *regs) +__visible void __irq_entry +smp_trace_call_function_interrupt (struct pt_regs *regs) {ipi_entering_ack_irq ();trace_call_function_entry (CALL_FUNCTION_VECTOR );
@@ -316,14 +317,16 @@ static inline void __smp_call_function_sinc_irq_stat (irq_call_count); } -__visible void smp_call_function_single_interrupt(struct pt_regs *regs) +__visible void __irq_entry +smp_call_function_single_interrupt (struct pt_regs *regs) {ipi_entering_ack_irq ();__smp_call_function_single_interrupt ();exiting_irq (); } -__visible void smp_trace_call_function_single_interrupt(struct pt_regs *regs) +__visible void __irq_entry +smp_trace_call_function_single_interrupt (struct pt_regs *regs) {ipi_entering_ack_irq ();trace_call_function_single_entry (CALL_FUNCTION_SINGLE_VECTOR );
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/x86-irq-trace-add-__irq_entry-annotation-to-x86-s-platform-irq-handlers.patch