aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYong Wang <yong.y.wang@linux.intel.com>2009-06-03 01:12:55 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-03 03:53:34 -0400
commita32881066e58346f2901afe0ebdfbf0c562877e5 (patch)
treeacd28c9b659a3df0769eedb32127e9c6ad72def9
parentaddc2785ce92ff05da8edf18317b6b4719e10d9f (diff)
perf_counter/x86: Remove the IRQ (non-NMI) handling bits
Remove the IRQ (non-NMI) handling bits as NMI will be used always. Signed-off-by: Yong Wang <yong.y.wang@intel.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: John Kacur <jkacur@redhat.com> LKML-Reference: <20090603051255.GA2791@ywang-moblin2.bj.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/include/asm/entry_arch.h1
-rw-r--r--arch/x86/include/asm/hw_irq.h1
-rw-r--r--arch/x86/include/asm/irq_vectors.h5
-rw-r--r--arch/x86/kernel/cpu/perf_counter.c21
-rw-r--r--arch/x86/kernel/entry_64.S2
-rw-r--r--arch/x86/kernel/irqinit_32.c1
-rw-r--r--arch/x86/kernel/irqinit_64.c1
7 files changed, 6 insertions, 26 deletions
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h
index fe24d2802490..d750a10ccad6 100644
--- a/arch/x86/include/asm/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -49,7 +49,6 @@ BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR)
49BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR) 49BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR)
50 50
51#ifdef CONFIG_PERF_COUNTERS 51#ifdef CONFIG_PERF_COUNTERS
52BUILD_INTERRUPT(perf_counter_interrupt, LOCAL_PERF_VECTOR)
53BUILD_INTERRUPT(perf_pending_interrupt, LOCAL_PENDING_VECTOR) 52BUILD_INTERRUPT(perf_pending_interrupt, LOCAL_PENDING_VECTOR)
54#endif 53#endif
55 54
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 7309c0ad6902..4b4921d7a28e 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -29,7 +29,6 @@
29extern void apic_timer_interrupt(void); 29extern void apic_timer_interrupt(void);
30extern void generic_interrupt(void); 30extern void generic_interrupt(void);
31extern void error_interrupt(void); 31extern void error_interrupt(void);
32extern void perf_counter_interrupt(void);
33extern void perf_pending_interrupt(void); 32extern void perf_pending_interrupt(void);
34 33
35extern void spurious_interrupt(void); 34extern void spurious_interrupt(void);
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h
index 545bb811ccb5..4492e19f8391 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -107,11 +107,6 @@
107#define LOCAL_TIMER_VECTOR 0xef 107#define LOCAL_TIMER_VECTOR 0xef
108 108
109/* 109/*
110 * Performance monitoring interrupt vector:
111 */
112#define LOCAL_PERF_VECTOR 0xee
113
114/*
115 * Generic system vector for platform specific use 110 * Generic system vector for platform specific use
116 */ 111 */
117#define GENERIC_INTERRUPT_VECTOR 0xed 112#define GENERIC_INTERRUPT_VECTOR 0xed
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index e16e8c13132f..12cc05ed9f48 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -40,7 +40,7 @@ struct cpu_hw_counters {
40struct x86_pmu { 40struct x86_pmu {
41 const char *name; 41 const char *name;
42 int version; 42 int version;
43 int (*handle_irq)(struct pt_regs *, int); 43 int (*handle_irq)(struct pt_regs *);
44 void (*disable_all)(void); 44 void (*disable_all)(void);
45 void (*enable_all)(void); 45 void (*enable_all)(void);
46 void (*enable)(struct hw_perf_counter *, int); 46 void (*enable)(struct hw_perf_counter *, int);
@@ -755,7 +755,7 @@ static void intel_pmu_reset(void)
755 * This handler is triggered by the local APIC, so the APIC IRQ handling 755 * This handler is triggered by the local APIC, so the APIC IRQ handling
756 * rules apply: 756 * rules apply:
757 */ 757 */
758static int intel_pmu_handle_irq(struct pt_regs *regs, int nmi) 758static int intel_pmu_handle_irq(struct pt_regs *regs)
759{ 759{
760 struct cpu_hw_counters *cpuc; 760 struct cpu_hw_counters *cpuc;
761 struct cpu_hw_counters; 761 struct cpu_hw_counters;
@@ -794,7 +794,7 @@ again:
794 if (!intel_pmu_save_and_restart(counter)) 794 if (!intel_pmu_save_and_restart(counter))
795 continue; 795 continue;
796 796
797 if (perf_counter_overflow(counter, nmi, regs, 0)) 797 if (perf_counter_overflow(counter, 1, regs, 0))
798 intel_pmu_disable_counter(&counter->hw, bit); 798 intel_pmu_disable_counter(&counter->hw, bit);
799 } 799 }
800 800
@@ -812,7 +812,7 @@ again:
812 return 1; 812 return 1;
813} 813}
814 814
815static int amd_pmu_handle_irq(struct pt_regs *regs, int nmi) 815static int amd_pmu_handle_irq(struct pt_regs *regs)
816{ 816{
817 int cpu, idx, handled = 0; 817 int cpu, idx, handled = 0;
818 struct cpu_hw_counters *cpuc; 818 struct cpu_hw_counters *cpuc;
@@ -840,22 +840,13 @@ static int amd_pmu_handle_irq(struct pt_regs *regs, int nmi)
840 if (!x86_perf_counter_set_period(counter, hwc, idx)) 840 if (!x86_perf_counter_set_period(counter, hwc, idx))
841 continue; 841 continue;
842 842
843 if (perf_counter_overflow(counter, nmi, regs, 0)) 843 if (perf_counter_overflow(counter, 1, regs, 0))
844 amd_pmu_disable_counter(hwc, idx); 844 amd_pmu_disable_counter(hwc, idx);
845 } 845 }
846 846
847 return handled; 847 return handled;
848} 848}
849 849
850void smp_perf_counter_interrupt(struct pt_regs *regs)
851{
852 irq_enter();
853 apic_write(APIC_LVTPC, LOCAL_PERF_VECTOR);
854 ack_APIC_irq();
855 x86_pmu.handle_irq(regs, 0);
856 irq_exit();
857}
858
859void smp_perf_pending_interrupt(struct pt_regs *regs) 850void smp_perf_pending_interrupt(struct pt_regs *regs)
860{ 851{
861 irq_enter(); 852 irq_enter();
@@ -910,7 +901,7 @@ perf_counter_nmi_handler(struct notifier_block *self,
910 * If the first NMI handles both, the latter will be empty and daze 901 * If the first NMI handles both, the latter will be empty and daze
911 * the CPU. 902 * the CPU.
912 */ 903 */
913 x86_pmu.handle_irq(regs, 1); 904 x86_pmu.handle_irq(regs);
914 905
915 return NOTIFY_STOP; 906 return NOTIFY_STOP;
916} 907}
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 891004619142..7985c010f8ac 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1026,8 +1026,6 @@ apicinterrupt SPURIOUS_APIC_VECTOR \
1026 spurious_interrupt smp_spurious_interrupt 1026 spurious_interrupt smp_spurious_interrupt
1027 1027
1028#ifdef CONFIG_PERF_COUNTERS 1028#ifdef CONFIG_PERF_COUNTERS
1029apicinterrupt LOCAL_PERF_VECTOR \
1030 perf_counter_interrupt smp_perf_counter_interrupt
1031apicinterrupt LOCAL_PENDING_VECTOR \ 1029apicinterrupt LOCAL_PENDING_VECTOR \
1032 perf_pending_interrupt smp_perf_pending_interrupt 1030 perf_pending_interrupt smp_perf_pending_interrupt
1033#endif 1031#endif
diff --git a/arch/x86/kernel/irqinit_32.c b/arch/x86/kernel/irqinit_32.c
index 3190a6b961e6..205bdd880d31 100644
--- a/arch/x86/kernel/irqinit_32.c
+++ b/arch/x86/kernel/irqinit_32.c
@@ -165,7 +165,6 @@ static void __init apic_intr_init(void)
165 alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); 165 alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
166 alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt); 166 alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
167# ifdef CONFIG_PERF_COUNTERS 167# ifdef CONFIG_PERF_COUNTERS
168 alloc_intr_gate(LOCAL_PERF_VECTOR, perf_counter_interrupt);
169 alloc_intr_gate(LOCAL_PENDING_VECTOR, perf_pending_interrupt); 168 alloc_intr_gate(LOCAL_PENDING_VECTOR, perf_pending_interrupt);
170# endif 169# endif
171 170
diff --git a/arch/x86/kernel/irqinit_64.c b/arch/x86/kernel/irqinit_64.c
index 53ceb26f80ff..fa6ef692000f 100644
--- a/arch/x86/kernel/irqinit_64.c
+++ b/arch/x86/kernel/irqinit_64.c
@@ -155,7 +155,6 @@ static void __init apic_intr_init(void)
155 155
156 /* Performance monitoring interrupt: */ 156 /* Performance monitoring interrupt: */
157#ifdef CONFIG_PERF_COUNTERS 157#ifdef CONFIG_PERF_COUNTERS
158 alloc_intr_gate(LOCAL_PERF_VECTOR, perf_counter_interrupt);
159 alloc_intr_gate(LOCAL_PENDING_VECTOR, perf_pending_interrupt); 158 alloc_intr_gate(LOCAL_PENDING_VECTOR, perf_pending_interrupt);
160#endif 159#endif
161} 160}