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: Seiji Aguchi <seiji.aguchi@hds.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 v1.1] arch, x86, irq: enable tracing of irq_move_cleanup_interrupt vector
Date: Tue, 09 Feb 2016 02:37:33 +0100	[thread overview]
Message-ID: <87mvra1x5u.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>
---
 Changes in v1.1: take CC list matching the actual patch sent out.

 Fully tested on x86_64, compiled on i386.

 I do have analogue patches for the
   kvm_posted_intr_ipi
   kvm_posted_intr_wakeup_ipi
 vectors as well. Due to lack of hardware, I'm unable to test them though.
 If anybody with (/sys/module/kvm_intel/parameters/enable_apic='Y') is
 willing to help out, I'll gladly post them, too.

 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 8cb3e43..f7db1e0 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -771,7 +771,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 6615032..8fef2ac 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 f813261..d0c1057 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;
@@ -532,12 +533,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();
-
 	me = smp_processor_id();
 	for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
 		int irq;
@@ -587,7 +586,21 @@ asmlinkage __visible void smp_irq_move_cleanup_interrupt(void)
 unlock:
 		raw_spin_unlock(&desc->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.0

             reply	other threads:[~2016-02-09  1:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09  1:37 Nicolai Stange [this message]
2016-02-18 16:18 ` [PATCH v1.1] arch, x86, irq: enable tracing of irq_move_cleanup_interrupt vector Nicolai Stange

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=87mvra1x5u.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).