Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719964 > unrolled thread

[patch 00/41] x86: Cleanup IDT code

Started byThomas Gleixner <tglx@linutronix.de>
First post2017-08-25 13:10 +0200
Last post2017-08-25 23:30 +0200
Articles 6 on this page of 46 — 6 participants

Back to article view | Back to linux.kernel


Contents

  [patch 00/41] x86: Cleanup IDT code Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
    [patch 01/41] x86/irq: Remove vector_used_by_percpu_irq() Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
    [patch 26/41] x86/idt: Consolidate IDT invalidation Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
    [patch 06/41] x86/traps: Simplify pagefault tracing logic Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
      Re: [patch 06/41] x86/traps: Simplify pagefault tracing logic Andy Lutomirski <luto@kernel.org> - 2017-08-25 17:00 +0200
      Re: [patch 06/41] x86/traps: Simplify pagefault tracing logic Steven Rostedt <rostedt@goodmis.org> - 2017-08-25 17:20 +0200
        Re: [patch 06/41] x86/traps: Simplify pagefault tracing logic Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 17:20 +0200
    [patch 07/41] x86/apic: Remove the duplicated tracing version of  local_timer_interrupt Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
      Re: [patch 07/41] x86/apic: Remove the duplicated tracing version  of local_timer_interrupt Steven Rostedt <rostedt@goodmis.org> - 2017-08-25 17:30 +0200
    [patch 14/41] x86/smp: Use static key for reschedule interrupt tracing Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
      Re: [patch 14/41] x86/smp: Use static key for reschedule interrupt  tracing Steven Rostedt <rostedt@goodmis.org> - 2017-08-25 21:50 +0200
        Re: [patch 14/41] x86/smp: Use static key for reschedule interrupt  tracing Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 22:10 +0200
          Re: [patch 14/41] x86/smp: Use static key for reschedule interrupt  tracing Steven Rostedt <rostedt@goodmis.org> - 2017-08-25 23:20 +0200
    [patch 05/41] x86/tracing: Introduce a static key for exception  tracing Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
      Re: [patch 05/41] x86/tracing: Introduce a static key for exception  tracing Steven Rostedt <rostedt@goodmis.org> - 2017-08-25 17:30 +0200
    [patch 10/41] x86/apic: Remove the duplicated tracing versions of  interrupts Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
      Re: [patch 10/41] x86/apic: Remove the duplicated tracing versions  of interrupts Steven Rostedt <rostedt@goodmis.org> - 2017-08-25 17:50 +0200
        Re: [patch 10/41] x86/apic: Remove the duplicated tracing versions  of interrupts Peter Zijlstra <peterz@infradead.org> - 2017-08-28 10:00 +0200
    [patch 11/41] x86/irqwork: Get rid of duplicated tracing interrupt  code Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
      Re: [patch 11/41] x86/irqwork: Get rid of duplicated tracing  interrupt code Steven Rostedt <rostedt@goodmis.org> - 2017-08-25 18:00 +0200
    [patch 23/41] x86/idt: Create file for IDT related code Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
    [patch 03/41] x86/irq: Move ifdeffery to header file Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
      Re: [patch 03/41] x86/irq: Move ifdeffery to header file Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 14:50 +0200
    [patch 24/41] x86/idt: Move 32bit idt_descr to C code Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
    [patch 16/41] x86/tracing: Disentangle pagefault and resched IPI  tracing key Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
    [patch 09/41] x86/irq: Get rid of duplicated trace_x86_platform_ipi()  code Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
      Re: [patch 09/41] x86/irq: Get rid of duplicated  trace_x86_platform_ipi() code Steven Rostedt <rostedt@goodmis.org> - 2017-08-25 17:50 +0200
    [patch 12/41] x86/mce: Remove duplicated tracing interrupt code Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
      Re: [patch 12/41] x86/mce: Remove duplicated tracing interrupt code Steven Rostedt <rostedt@goodmis.org> - 2017-08-25 18:10 +0200
        Re: [patch 12/41] x86/mce: Remove duplicated tracing interrupt  code Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 18:20 +0200
    [patch 21/41] x86/gdt: Use bitfields for initialization Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
    [patch 28/41] x86/idt: Move early IDT setup out of 32bit asm Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
    [patch 22/41] x86/ldttss: Cleanup 32bit descriptors Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
    [patch 20/41] x86: Replace access to desc_struct:a/b fields Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
      Re: [patch 20/41] x86: Replace access to desc_struct:a/b fields Juergen Gross <jgross@suse.com> - 2017-08-25 13:20 +0200
      Re: [patch 20/41] x86: Replace access to desc_struct:a/b fields Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-08-25 16:00 +0200
        Re: [patch 20/41] x86: Replace access to desc_struct:a/b fields Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 16:10 +0200
          Re: [patch 20/41] x86: Replace access to desc_struct:a/b fields Steven Rostedt <rostedt@goodmis.org> - 2017-08-25 16:20 +0200
    [patch 04/41] x86/boot: Move EISA setup to a proper place Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
      Re: [patch 04/41] x86/boot: Move EISA setup to a proper place Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 14:00 +0200
    [patch 25/41] x86/idt: Remove unused set_trap_gate() Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
    [patch 08/41] x86/apic: Use this_cpu_ptr in local_timer_interrupt Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
    [patch 15/41] x86/idt: Remove tracing idt completely Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 13:10 +0200
      Re: [patch 15/41] x86/idt: Remove tracing idt completely Steven Rostedt <rostedt@goodmis.org> - 2017-08-25 23:20 +0200
        Re: [patch 15/41] x86/idt: Remove tracing idt completely Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 23:30 +0200
        Re: [patch 15/41] x86/idt: Remove tracing idt completely Thomas Gleixner <tglx@linutronix.de> - 2017-08-25 23:30 +0200

Page 3 of 3 — ← Prev page 1 2 [3]


#1719987 — [patch 25/41] x86/idt: Remove unused set_trap_gate()

FromThomas Gleixner <tglx@linutronix.de>
Date2017-08-25 13:10 +0200
Subject[patch 25/41] x86/idt: Remove unused set_trap_gate()
Message-ID<uikEX-3hj-57@gated-at.bofh.it>
In reply to#1719964
This inline is not used at all.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/desc.h |   12 ------------
 1 file changed, 12 deletions(-)

--- a/arch/x86/include/asm/desc.h
+++ b/arch/x86/include/asm/desc.h
@@ -455,18 +455,6 @@ static inline void set_system_intr_gate(
 	_set_gate(n, GATE_INTERRUPT, addr, 0x3, 0, __KERNEL_CS);
 }
 
-static inline void set_system_trap_gate(unsigned int n, void *addr)
-{
-	BUG_ON((unsigned)n > 0xFF);
-	_set_gate(n, GATE_TRAP, addr, 0x3, 0, __KERNEL_CS);
-}
-
-static inline void set_trap_gate(unsigned int n, void *addr)
-{
-	BUG_ON((unsigned)n > 0xFF);
-	_set_gate(n, GATE_TRAP, addr, 0, 0, __KERNEL_CS);
-}
-
 static inline void set_task_gate(unsigned int n, unsigned int gdt_entry)
 {
 	BUG_ON((unsigned)n > 0xFF);

[toc] | [prev] | [next] | [standalone]


#1719988 — [patch 08/41] x86/apic: Use this_cpu_ptr in local_timer_interrupt

FromThomas Gleixner <tglx@linutronix.de>
Date2017-08-25 13:10 +0200
Subject[patch 08/41] x86/apic: Use this_cpu_ptr in local_timer_interrupt
Message-ID<uikEX-3hj-59@gated-at.bofh.it>
In reply to#1719964
Accessing the per cpu data via per_cpu(, smp_processor_id()) is
pointless. Use this_cpu_ptr() instead.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/apic/apic.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -990,8 +990,7 @@ void setup_secondary_APIC_clock(void)
  */
 static void local_apic_timer_interrupt(void)
 {
-	int cpu = smp_processor_id();
-	struct clock_event_device *evt = &per_cpu(lapic_events, cpu);
+	struct clock_event_device *evt = this_cpu_ptr(&lapic_events);
 
 	/*
 	 * Normally we should not be here till LAPIC has been initialized but
@@ -1005,7 +1004,8 @@ static void local_apic_timer_interrupt(v
 	 * spurious.
 	 */
 	if (!evt->event_handler) {
-		pr_warning("Spurious LAPIC timer interrupt on cpu %d\n", cpu);
+		pr_warning("Spurious LAPIC timer interrupt on cpu %d\n",
+			   smp_processor_id());
 		/* Switch it off */
 		lapic_timer_shutdown(evt);
 		return;

[toc] | [prev] | [next] | [standalone]


#1719989 — [patch 15/41] x86/idt: Remove tracing idt completely

FromThomas Gleixner <tglx@linutronix.de>
Date2017-08-25 13:10 +0200
Subject[patch 15/41] x86/idt: Remove tracing idt completely
Message-ID<uikEX-3hj-61@gated-at.bofh.it>
In reply to#1719964
No more users of the tracing idt. All exception tracepoints have been moved
into the regular handlers. Get rid of the mess which shouldn't have been
created in the first place.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/entry/entry_32.S         |   12 -----
 arch/x86/entry/entry_64.S         |   13 ------
 arch/x86/include/asm/desc.h       |   82 ++------------------------------------
 arch/x86/include/asm/entry_arch.h |   14 ++----
 arch/x86/include/asm/hw_irq.h     |   20 ---------
 arch/x86/include/asm/segment.h    |    3 -
 arch/x86/kernel/tracepoint.c      |   43 -------------------
 arch/x86/kernel/traps.c           |    6 --
 8 files changed, 14 insertions(+), 179 deletions(-)

--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -673,16 +673,8 @@ ENTRY(name)				\
 	jmp	ret_from_intr;		\
 ENDPROC(name)
 
-
-#ifdef CONFIG_TRACING
-# define TRACE_BUILD_INTERRUPT(name, nr)	BUILD_INTERRUPT3(trace_##name, nr, smp_trace_##name)
-#else
-# define TRACE_BUILD_INTERRUPT(name, nr)
-#endif
-
 #define BUILD_INTERRUPT(name, nr)		\
 	BUILD_INTERRUPT3(name, nr, smp_##name);	\
-	TRACE_BUILD_INTERRUPT(name, nr)
 
 /* The include is where all of the SMP etc. interrupts come from */
 #include <asm/entry_arch.h>
@@ -880,14 +872,14 @@ ENTRY(xen_failsafe_callback)
 ENDPROC(xen_failsafe_callback)
 
 BUILD_INTERRUPT3(xen_hvm_callback_vector, HYPERVISOR_CALLBACK_VECTOR,
-		xen_evtchn_do_upcall)
+		 xen_evtchn_do_upcall)
 
 #endif /* CONFIG_XEN */
 
 #if IS_ENABLED(CONFIG_HYPERV)
 
 BUILD_INTERRUPT3(hyperv_callback_vector, HYPERVISOR_CALLBACK_VECTOR,
-	hyperv_vector_handler)
+		 hyperv_vector_handler)
 
 #endif /* CONFIG_HYPERV */
 
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -748,18 +748,6 @@ ENTRY(\sym)
 END(\sym)
 .endm
 
-#ifdef CONFIG_TRACING
-#define trace(sym) trace_##sym
-#define smp_trace(sym) smp_trace_##sym
-
-.macro trace_apicinterrupt num sym
-apicinterrupt3 \num trace(\sym) smp_trace(\sym)
-.endm
-#else
-.macro trace_apicinterrupt num sym do_sym
-.endm
-#endif
-
 /* Make sure APIC interrupt handlers end up in the irqentry section: */
 #if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
 # define PUSH_SECTION_IRQENTRY	.pushsection .irqentry.text, "ax"
@@ -772,7 +760,6 @@ apicinterrupt3 \num trace(\sym) smp_trac
 .macro apicinterrupt num sym do_sym
 PUSH_SECTION_IRQENTRY
 apicinterrupt3 \num \sym \do_sym
-trace_apicinterrupt \num \sym
 POP_SECTION_IRQENTRY
 .endm
 
--- a/arch/x86/include/asm/desc.h
+++ b/arch/x86/include/asm/desc.h
@@ -420,35 +420,7 @@ static inline void set_nmi_gate(int gate
 }
 #endif
 
-#ifdef CONFIG_TRACING
-extern struct desc_ptr trace_idt_descr;
-extern gate_desc trace_idt_table[];
-static inline void write_trace_idt_entry(int entry, const gate_desc *gate)
-{
-	write_idt_entry(trace_idt_table, entry, gate);
-}
-
-static inline void _trace_set_gate(int gate, unsigned type, void *addr,
-				   unsigned dpl, unsigned ist, unsigned seg)
-{
-	gate_desc s;
-
-	pack_gate(&s, type, (unsigned long)addr, dpl, ist, seg);
-	/*
-	 * does not need to be atomic because it is only done once at
-	 * setup time
-	 */
-	write_trace_idt_entry(gate, &s);
-}
-#else
-static inline void write_trace_idt_entry(int entry, const gate_desc *gate)
-{
-}
-
-#define _trace_set_gate(gate, type, addr, dpl, ist, seg)
-#endif
-
-static inline void _set_gate(int gate, unsigned type, void *addr,
+static inline void _set_gate(int gate, unsigned type, const void *addr,
 			     unsigned dpl, unsigned ist, unsigned seg)
 {
 	gate_desc s;
@@ -459,28 +431,13 @@ static inline void _set_gate(int gate, u
 	 * setup time
 	 */
 	write_idt_entry(idt_table, gate, &s);
-	write_trace_idt_entry(gate, &s);
 }
 
-/*
- * This needs to use 'idt_table' rather than 'idt', and
- * thus use the _nonmapped_ version of the IDT, as the
- * Pentium F0 0F bugfix can have resulted in the mapped
- * IDT being write-protected.
- */
-#define set_intr_gate_notrace(n, addr)					\
-	do {								\
-		BUG_ON((unsigned)n > 0xFF);				\
-		_set_gate(n, GATE_INTERRUPT, (void *)addr, 0, 0,	\
-			  __KERNEL_CS);					\
-	} while (0)
-
-#define set_intr_gate(n, addr)						\
-	do {								\
-		set_intr_gate_notrace(n, addr);				\
-		_trace_set_gate(n, GATE_INTERRUPT, (void *)trace_##addr,\
-				0, 0, __KERNEL_CS);			\
-	} while (0)
+static inline void set_intr_gate(unsigned int n, const void *addr)
+{
+	BUG_ON((unsigned)n > 0xFF);
+	_set_gate(n, GATE_INTERRUPT, addr, 0, 0, __KERNEL_CS);
+}
 
 #ifdef CONFIG_X86_LOCAL_APIC
 extern int first_system_vector;
@@ -572,31 +529,6 @@ static inline void load_debug_idt(void)
 }
 #endif
 
-#ifdef CONFIG_TRACING
-extern atomic_t trace_idt_ctr;
-static inline bool is_trace_idt_enabled(void)
-{
-	if (atomic_read(&trace_idt_ctr))
-		return true;
-
-	return false;
-}
-
-static inline void load_trace_idt(void)
-{
-	load_idt((const struct desc_ptr *)&trace_idt_descr);
-}
-#else
-static inline bool is_trace_idt_enabled(void)
-{
-	return false;
-}
-
-static inline void load_trace_idt(void)
-{
-}
-#endif
-
 /*
  * The load_current_idt() must be called with interrupts disabled
  * to avoid races. That way the IDT will always be set back to the expected
@@ -608,8 +540,6 @@ static inline void load_current_idt(void
 {
 	if (is_debug_idt_enabled())
 		load_debug_idt();
-	else if (is_trace_idt_enabled())
-		load_trace_idt();
 	else
 		load_idt((const struct desc_ptr *)&idt_descr);
 }
--- a/arch/x86/include/asm/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -13,20 +13,16 @@
 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_INTERRUPT3(reboot_interrupt, REBOOT_VECTOR, smp_reboot_interrupt)
+BUILD_INTERRUPT(irq_move_cleanup_interrupt, IRQ_MOVE_CLEANUP_VECTOR)
+BUILD_INTERRUPT(reboot_interrupt, REBOOT_VECTOR)
 #endif
 
 BUILD_INTERRUPT(x86_platform_ipi, X86_PLATFORM_IPI_VECTOR)
 
 #ifdef CONFIG_HAVE_KVM
-BUILD_INTERRUPT3(kvm_posted_intr_ipi, POSTED_INTR_VECTOR,
-		 smp_kvm_posted_intr_ipi)
-BUILD_INTERRUPT3(kvm_posted_intr_wakeup_ipi, POSTED_INTR_WAKEUP_VECTOR,
-		 smp_kvm_posted_intr_wakeup_ipi)
-BUILD_INTERRUPT3(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR,
-		 smp_kvm_posted_intr_nested_ipi)
+BUILD_INTERRUPT(kvm_posted_intr_ipi, POSTED_INTR_VECTOR)
+BUILD_INTERRUPT(kvm_posted_intr_wakeup_ipi, POSTED_INTR_WAKEUP_VECTOR)
+BUILD_INTERRUPT(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR)
 #endif
 
 /*
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -46,26 +46,6 @@ extern asmlinkage void deferred_error_in
 extern asmlinkage void call_function_interrupt(void);
 extern asmlinkage void call_function_single_interrupt(void);
 
-#ifdef CONFIG_TRACING
-/* Interrupt handlers registered during init_IRQ */
-#define trace_reschedule_interrupt	reschedule_interrupt
-#define trace_call_function_interrupt	call_function_interrupt
-#define trace_call_function_single_interrupt	call_function_single_interrupt
-#define trace_thermal_interrupt	thermal_interrupt
-#define trace_threshold_interrupt	threshold_interrupt
-#define trace_deferred_error_interrupt	deferred_error_interrupt
-#define trace_irq_work_interrupt irq_work_interrupt
-#define trace_error_interrupt error_interrupt
-#define trace_spurious_interrupt spurious_interrupt
-#define trace_x86_platform_ipi	x86_platform_ipi
-#define trace_apic_timer_interrupt	apic_timer_interrupt
-#define trace_irq_move_cleanup_interrupt  irq_move_cleanup_interrupt
-#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
-#define trace_kvm_posted_intr_nested_ipi kvm_posted_intr_nested_ipi
-#endif /* CONFIG_TRACING */
-
 #ifdef	CONFIG_X86_LOCAL_APIC
 struct irq_data;
 struct pci_dev;
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
@@ -238,9 +238,6 @@
 #ifndef __ASSEMBLY__
 
 extern const char early_idt_handler_array[NUM_EXCEPTION_VECTORS][EARLY_IDT_HANDLER_SIZE];
-#ifdef CONFIG_TRACING
-# define trace_early_idt_handler_array early_idt_handler_array
-#endif
 
 /*
  * Load a segment. Fall back on loading the zero segment if something goes
--- a/arch/x86/kernel/tracepoint.c
+++ b/arch/x86/kernel/tracepoint.c
@@ -10,58 +10,15 @@
 #include <asm/hw_irq.h>
 #include <asm/desc.h>
 
-atomic_t trace_idt_ctr = ATOMIC_INIT(0);
-struct desc_ptr trace_idt_descr = { NR_VECTORS * 16 - 1,
-				(unsigned long) trace_idt_table };
-
-/* No need to be aligned, but done to keep all IDTs defined the same way. */
-gate_desc trace_idt_table[NR_VECTORS] __page_aligned_bss;
-
 DEFINE_STATIC_KEY_FALSE(trace_irqvectors_key);
-static int trace_irq_vector_refcount;
-static DEFINE_MUTEX(irq_vector_mutex);
-
-static void set_trace_idt_ctr(int val)
-{
-	atomic_set(&trace_idt_ctr, val);
-	/* Ensure the trace_idt_ctr is set before sending IPI */
-	wmb();
-}
-
-static void switch_idt(void *arg)
-{
-	unsigned long flags;
-
-	local_irq_save(flags);
-	load_current_idt();
-	local_irq_restore(flags);
-}
 
 int trace_irq_vector_regfunc(void)
 {
 	static_branch_inc(&trace_irqvectors_key);
-
-	mutex_lock(&irq_vector_mutex);
-	if (!trace_irq_vector_refcount) {
-		set_trace_idt_ctr(1);
-		smp_call_function(switch_idt, NULL, 0);
-		switch_idt(NULL);
-	}
-	trace_irq_vector_refcount++;
-	mutex_unlock(&irq_vector_mutex);
 	return 0;
 }
 
 void trace_irq_vector_unregfunc(void)
 {
 	static_branch_dec(&trace_irqvectors_key);
-
-	mutex_lock(&irq_vector_mutex);
-	trace_irq_vector_refcount--;
-	if (!trace_irq_vector_refcount) {
-		set_trace_idt_ctr(0);
-		smp_call_function(switch_idt, NULL, 0);
-		switch_idt(NULL);
-	}
-	mutex_unlock(&irq_vector_mutex);
 }
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -939,12 +939,8 @@ void __init early_trap_init(void)
 	 * stack.  Using the original stack works well enough at this
 	 * early stage. DEBUG_STACK will be equipped after cpu_init() in
 	 * trap_init().
-	 *
-	 * We don't need to set trace_idt_table like set_intr_gate(),
-	 * since we don't have trace_debug and it will be reset to
-	 * 'debug' in trap_init() by set_intr_gate_ist().
 	 */
-	set_intr_gate_notrace(X86_TRAP_DB, debug);
+	set_intr_gate(X86_TRAP_DB, debug);
 	/* int3 can be called from all */
 	set_system_intr_gate(X86_TRAP_BP, &int3);
 #ifdef CONFIG_X86_32

[toc] | [prev] | [next] | [standalone]


#1720420 — Re: [patch 15/41] x86/idt: Remove tracing idt completely

FromSteven Rostedt <rostedt@goodmis.org>
Date2017-08-25 23:20 +0200
SubjectRe: [patch 15/41] x86/idt: Remove tracing idt completely
Message-ID<uiubg-L8-17@gated-at.bofh.it>
In reply to#1719989
On Fri, 25 Aug 2017 12:31:18 +0200
Thomas Gleixner <tglx@linutronix.de> wrote:

> No more users of the tracing idt. All exception tracepoints have been moved
> into the regular handlers. Get rid of the mess which shouldn't have been
> created in the first place.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
>  arch/x86/entry/entry_32.S         |   12 -----
>  arch/x86/entry/entry_64.S         |   13 ------
>  arch/x86/include/asm/desc.h       |   82 ++------------------------------------
>  arch/x86/include/asm/entry_arch.h |   14 ++----
>  arch/x86/include/asm/hw_irq.h     |   20 ---------
>  arch/x86/include/asm/segment.h    |    3 -
>  arch/x86/kernel/tracepoint.c      |   43 -------------------
>  arch/x86/kernel/traps.c           |    6 --
>  8 files changed, 14 insertions(+), 179 deletions(-)

> --- a/arch/x86/include/asm/entry_arch.h
> +++ b/arch/x86/include/asm/entry_arch.h
> @@ -13,20 +13,16 @@
>  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_INTERRUPT3(reboot_interrupt, REBOOT_VECTOR, smp_reboot_interrupt)
> +BUILD_INTERRUPT(irq_move_cleanup_interrupt, IRQ_MOVE_CLEANUP_VECTOR)
> +BUILD_INTERRUPT(reboot_interrupt, REBOOT_VECTOR)
>  #endif
>  
>  BUILD_INTERRUPT(x86_platform_ipi, X86_PLATFORM_IPI_VECTOR)
>  
>  #ifdef CONFIG_HAVE_KVM
> -BUILD_INTERRUPT3(kvm_posted_intr_ipi, POSTED_INTR_VECTOR,
> -		 smp_kvm_posted_intr_ipi)
> -BUILD_INTERRUPT3(kvm_posted_intr_wakeup_ipi, POSTED_INTR_WAKEUP_VECTOR,
> -		 smp_kvm_posted_intr_wakeup_ipi)
> -BUILD_INTERRUPT3(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR,
> -		 smp_kvm_posted_intr_nested_ipi)
> +BUILD_INTERRUPT(kvm_posted_intr_ipi, POSTED_INTR_VECTOR)
> +BUILD_INTERRUPT(kvm_posted_intr_wakeup_ipi, POSTED_INTR_WAKEUP_VECTOR)
> +BUILD_INTERRUPT(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR)
>  #endif


This looks like a different change than what is specified in the change
log. It looks like a clean up. Shouldn't it be a separate patch?

-- Steve

[toc] | [prev] | [next] | [standalone]


#1720422 — Re: [patch 15/41] x86/idt: Remove tracing idt completely

FromThomas Gleixner <tglx@linutronix.de>
Date2017-08-25 23:30 +0200
SubjectRe: [patch 15/41] x86/idt: Remove tracing idt completely
Message-ID<uiukW-Oo-5@gated-at.bofh.it>
In reply to#1720420
On Fri, 25 Aug 2017, Thomas Gleixner wrote:
> On Fri, 25 Aug 2017, Steven Rostedt wrote:
> > On Fri, 25 Aug 2017 12:31:18 +0200
> > Thomas Gleixner <tglx@linutronix.de> wrote:
> > 
> > > No more users of the tracing idt. All exception tracepoints have been moved
> > > into the regular handlers. Get rid of the mess which shouldn't have been
> > > created in the first place.
> > > 
> > > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > > ---
> > >  arch/x86/entry/entry_32.S         |   12 -----
> > >  arch/x86/entry/entry_64.S         |   13 ------
> > >  arch/x86/include/asm/desc.h       |   82 ++------------------------------------
> > >  arch/x86/include/asm/entry_arch.h |   14 ++----
> > >  arch/x86/include/asm/hw_irq.h     |   20 ---------
> > >  arch/x86/include/asm/segment.h    |    3 -
> > >  arch/x86/kernel/tracepoint.c      |   43 -------------------
> > >  arch/x86/kernel/traps.c           |    6 --
> > >  8 files changed, 14 insertions(+), 179 deletions(-)
> > 
> > > --- a/arch/x86/include/asm/entry_arch.h
> > > +++ b/arch/x86/include/asm/entry_arch.h
> > > @@ -13,20 +13,16 @@
> > >  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_INTERRUPT3(reboot_interrupt, REBOOT_VECTOR, smp_reboot_interrupt)
> > > +BUILD_INTERRUPT(irq_move_cleanup_interrupt, IRQ_MOVE_CLEANUP_VECTOR)
> > > +BUILD_INTERRUPT(reboot_interrupt, REBOOT_VECTOR)
> > >  #endif
> > >  
> > >  BUILD_INTERRUPT(x86_platform_ipi, X86_PLATFORM_IPI_VECTOR)
> > >  
> > >  #ifdef CONFIG_HAVE_KVM
> > > -BUILD_INTERRUPT3(kvm_posted_intr_ipi, POSTED_INTR_VECTOR,
> > > -		 smp_kvm_posted_intr_ipi)
> > > -BUILD_INTERRUPT3(kvm_posted_intr_wakeup_ipi, POSTED_INTR_WAKEUP_VECTOR,
> > > -		 smp_kvm_posted_intr_wakeup_ipi)
> > > -BUILD_INTERRUPT3(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR,
> > > -		 smp_kvm_posted_intr_nested_ipi)
> > > +BUILD_INTERRUPT(kvm_posted_intr_ipi, POSTED_INTR_VECTOR)
> > > +BUILD_INTERRUPT(kvm_posted_intr_wakeup_ipi, POSTED_INTR_WAKEUP_VECTOR)
> > > +BUILD_INTERRUPT(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR)
> > >  #endif
> > 
> > 
> > This looks like a different change than what is specified in the change
> > log. It looks like a clean up. Shouldn't it be a separate patch?
> 
> Let me split it up.

OTOH, the BUILD_INTERRUPT3 users were explicit to avoid the
TRACE_BUILD_INTERRUPT() extra which was hidden behind BUILD_INTERRUPT. So
yes, it's a cleanup, but related.

Thanks,

	tglx

[toc] | [prev] | [next] | [standalone]


#1720423 — Re: [patch 15/41] x86/idt: Remove tracing idt completely

FromThomas Gleixner <tglx@linutronix.de>
Date2017-08-25 23:30 +0200
SubjectRe: [patch 15/41] x86/idt: Remove tracing idt completely
Message-ID<uiukW-Oo-7@gated-at.bofh.it>
In reply to#1720420
On Fri, 25 Aug 2017, Steven Rostedt wrote:
> On Fri, 25 Aug 2017 12:31:18 +0200
> Thomas Gleixner <tglx@linutronix.de> wrote:
> 
> > No more users of the tracing idt. All exception tracepoints have been moved
> > into the regular handlers. Get rid of the mess which shouldn't have been
> > created in the first place.
> > 
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > ---
> >  arch/x86/entry/entry_32.S         |   12 -----
> >  arch/x86/entry/entry_64.S         |   13 ------
> >  arch/x86/include/asm/desc.h       |   82 ++------------------------------------
> >  arch/x86/include/asm/entry_arch.h |   14 ++----
> >  arch/x86/include/asm/hw_irq.h     |   20 ---------
> >  arch/x86/include/asm/segment.h    |    3 -
> >  arch/x86/kernel/tracepoint.c      |   43 -------------------
> >  arch/x86/kernel/traps.c           |    6 --
> >  8 files changed, 14 insertions(+), 179 deletions(-)
> 
> > --- a/arch/x86/include/asm/entry_arch.h
> > +++ b/arch/x86/include/asm/entry_arch.h
> > @@ -13,20 +13,16 @@
> >  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_INTERRUPT3(reboot_interrupt, REBOOT_VECTOR, smp_reboot_interrupt)
> > +BUILD_INTERRUPT(irq_move_cleanup_interrupt, IRQ_MOVE_CLEANUP_VECTOR)
> > +BUILD_INTERRUPT(reboot_interrupt, REBOOT_VECTOR)
> >  #endif
> >  
> >  BUILD_INTERRUPT(x86_platform_ipi, X86_PLATFORM_IPI_VECTOR)
> >  
> >  #ifdef CONFIG_HAVE_KVM
> > -BUILD_INTERRUPT3(kvm_posted_intr_ipi, POSTED_INTR_VECTOR,
> > -		 smp_kvm_posted_intr_ipi)
> > -BUILD_INTERRUPT3(kvm_posted_intr_wakeup_ipi, POSTED_INTR_WAKEUP_VECTOR,
> > -		 smp_kvm_posted_intr_wakeup_ipi)
> > -BUILD_INTERRUPT3(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR,
> > -		 smp_kvm_posted_intr_nested_ipi)
> > +BUILD_INTERRUPT(kvm_posted_intr_ipi, POSTED_INTR_VECTOR)
> > +BUILD_INTERRUPT(kvm_posted_intr_wakeup_ipi, POSTED_INTR_WAKEUP_VECTOR)
> > +BUILD_INTERRUPT(kvm_posted_intr_nested_ipi, POSTED_INTR_NESTED_VECTOR)
> >  #endif
> 
> 
> This looks like a different change than what is specified in the change
> log. It looks like a clean up. Shouldn't it be a separate patch?

Let me split it up.

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | linux.kernel


csiph-web