linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolai Stange <nicstange@gmail.com>
To: x86@kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
Cc: Feng Wu <feng.wu@intel.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Nicolai Stange <nicstange@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH v2] arch, x86, irq: enable tracing of irq_move_cleanup_interrupt vector
Date: Thu, 18 Feb 2016 17:18:06 +0100	[thread overview]
Message-ID: <87egcavvpd.fsf@gmail.com> (raw)

In commit cf910e83ae23 ("x86, trace: Add irq vector tracepoints"), support
for the tracing of IRQ vectors had been introduced.

For no apparent reason, irq_move_cleanup_interrupt had been left out from
the list of traceable interrupt vectors, rendering it incomplete.

Introduce support for tracing irq_move_cleanup_interrupt in the same way
as done for the other vectors.

Namely,
- define a tracepoint event by means of DEFINE_IRQ_VECTOR_EVENT(),
- add a tracing capable handler smp_trace_irq_move_cleanup_interrupt(),
- introduce tracing versions of the IDT-referenced stubs which call into
  the tracing version of the handler on both, x86 and x86_64,
- finally, factor out the "real" interrupt handling code into the new
  __smp_irq_move_cleanup_interrupt().

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
---
 Note: the address of commit cf910e83ae23's author,
   Seiji Aguchi <seiji.aguchi@hds.com>,
 bounces.

 Changes to v1.1:
 Rebase against current kernel/git/tip/tip.git x86/core

 arch/x86/entry/entry_64.S                |  2 +-
 arch/x86/include/asm/entry_arch.h        |  3 +--
 arch/x86/include/asm/hw_irq.h            |  2 +-
 arch/x86/include/asm/trace/irq_vectors.h |  6 ++++++
 arch/x86/kernel/apic/vector.c            | 19 ++++++++++++++++---
 5 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 9d34d3c..0676f6b 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -676,7 +676,7 @@ trace_apicinterrupt \num \sym
 .endm
 
 #ifdef CONFIG_SMP
-apicinterrupt3 IRQ_MOVE_CLEANUP_VECTOR		irq_move_cleanup_interrupt	smp_irq_move_cleanup_interrupt
+apicinterrupt IRQ_MOVE_CLEANUP_VECTOR		irq_move_cleanup_interrupt	smp_irq_move_cleanup_interrupt
 apicinterrupt3 REBOOT_VECTOR			reboot_interrupt		smp_reboot_interrupt
 #endif
 
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h
index df00299..a712d82 100644
--- a/arch/x86/include/asm/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -13,8 +13,7 @@
 BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR)
 BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR)
 BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR)
-BUILD_INTERRUPT3(irq_move_cleanup_interrupt, IRQ_MOVE_CLEANUP_VECTOR,
-		 smp_irq_move_cleanup_interrupt)
+BUILD_INTERRUPT(irq_move_cleanup_interrupt, IRQ_MOVE_CLEANUP_VECTOR)
 BUILD_INTERRUPT3(reboot_interrupt, REBOOT_VECTOR, smp_reboot_interrupt)
 #endif
 
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 1815b73..792920a 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -58,7 +58,7 @@ extern void trace_threshold_interrupt(void);
 extern void trace_deferred_error_interrupt(void);
 extern void trace_call_function_interrupt(void);
 extern void trace_call_function_single_interrupt(void);
-#define trace_irq_move_cleanup_interrupt  irq_move_cleanup_interrupt
+extern void trace_irq_move_cleanup_interrupt(void);
 #define trace_reboot_interrupt  reboot_interrupt
 #define trace_kvm_posted_intr_ipi kvm_posted_intr_ipi
 #define trace_kvm_posted_intr_wakeup_ipi kvm_posted_intr_wakeup_ipi
diff --git a/arch/x86/include/asm/trace/irq_vectors.h b/arch/x86/include/asm/trace/irq_vectors.h
index 38a09a1..2dacb55 100644
--- a/arch/x86/include/asm/trace/irq_vectors.h
+++ b/arch/x86/include/asm/trace/irq_vectors.h
@@ -112,6 +112,12 @@ DEFINE_IRQ_VECTOR_EVENT(deferred_error_apic);
  */
 DEFINE_IRQ_VECTOR_EVENT(thermal_apic);
 
+/*
+ * irq_move_cleanup - called when entering/exiting an IRQ move cleanup
+ * vector handler.
+ */
+DEFINE_IRQ_VECTOR_EVENT(irq_move_cleanup);
+
 #undef TRACE_INCLUDE_PATH
 #define TRACE_INCLUDE_PATH .
 #define TRACE_INCLUDE_FILE irq_vectors
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 3b670df..035659d 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -20,6 +20,7 @@
 #include <asm/i8259.h>
 #include <asm/desc.h>
 #include <asm/irq_remapping.h>
+#include <asm/trace/irq_vectors.h>
 
 struct apic_chip_data {
 	struct irq_cfg		cfg;
@@ -557,12 +558,10 @@ void send_cleanup_vector(struct irq_cfg *cfg)
 		__send_cleanup_vector(data);
 }
 
-asmlinkage __visible void smp_irq_move_cleanup_interrupt(void)
+static void __smp_irq_move_cleanup_interrupt(void)
 {
 	unsigned vector, me;
 
-	entering_ack_irq();
-
 	/* Prevent vectors vanishing under us */
 	raw_spin_lock(&vector_lock);
 
@@ -631,7 +630,21 @@ unlock:
 	}
 
 	raw_spin_unlock(&vector_lock);
+}
+
+asmlinkage __visible void smp_irq_move_cleanup_interrupt(void)
+{
+	entering_ack_irq();
+	__smp_irq_move_cleanup_interrupt();
+	exiting_irq();
+}
 
+asmlinkage __visible void smp_trace_irq_move_cleanup_interrupt(void)
+{
+	entering_ack_irq();
+	trace_irq_move_cleanup_entry(IRQ_MOVE_CLEANUP_VECTOR);
+	__smp_irq_move_cleanup_interrupt();
+	trace_irq_move_cleanup_exit(IRQ_MOVE_CLEANUP_VECTOR);
 	exiting_irq();
 }
 
-- 
2.7.1

                 reply	other threads:[~2016-02-18 16:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87egcavvpd.fsf@gmail.com \
    --to=nicstange@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).