提交 7335f75e 编写于 作者: C Cyrill Gorcunov 提交者: Ingo Molnar

x86, perf: Use apic_write unconditionally

Since apic_write() maps to a plain noop in the !CONFIG_X86_LOCAL_APIC
case we're safe to remove this conditional compilation and clean up
the code a bit.
Signed-off-by: NCyrill Gorcunov <gorcunov@openvz.org>
Cc: fweisbec@gmail.com
Cc: acme@redhat.com
Cc: eranian@google.com
Cc: peterz@infradead.org
LKML-Reference: <20100317104356.232371479@openvz.org>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 d674cd19
...@@ -1136,7 +1136,6 @@ void set_perf_event_pending(void) ...@@ -1136,7 +1136,6 @@ void set_perf_event_pending(void)
void perf_events_lapic_init(void) void perf_events_lapic_init(void)
{ {
#ifdef CONFIG_X86_LOCAL_APIC
if (!x86_pmu.apic || !x86_pmu_initialized()) if (!x86_pmu.apic || !x86_pmu_initialized())
return; return;
...@@ -1144,7 +1143,6 @@ void perf_events_lapic_init(void) ...@@ -1144,7 +1143,6 @@ void perf_events_lapic_init(void)
* Always use NMI for PMU * Always use NMI for PMU
*/ */
apic_write(APIC_LVTPC, APIC_DM_NMI); apic_write(APIC_LVTPC, APIC_DM_NMI);
#endif
} }
static int __kprobes static int __kprobes
...@@ -1168,9 +1166,7 @@ perf_event_nmi_handler(struct notifier_block *self, ...@@ -1168,9 +1166,7 @@ perf_event_nmi_handler(struct notifier_block *self,
regs = args->regs; regs = args->regs;
#ifdef CONFIG_X86_LOCAL_APIC
apic_write(APIC_LVTPC, APIC_DM_NMI); apic_write(APIC_LVTPC, APIC_DM_NMI);
#endif
/* /*
* Can't rely on the handled return value to say it was our NMI, two * Can't rely on the handled return value to say it was our NMI, two
* events could trigger 'simultaneously' raising two back-to-back NMIs. * events could trigger 'simultaneously' raising two back-to-back NMIs.
......
...@@ -363,10 +363,8 @@ static int p4_pmu_handle_irq(struct pt_regs *regs) ...@@ -363,10 +363,8 @@ static int p4_pmu_handle_irq(struct pt_regs *regs)
} }
if (handled) { if (handled) {
#ifdef CONFIG_X86_LOCAL_APIC
/* p4 quirk: unmask it again */ /* p4 quirk: unmask it again */
apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED); apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
#endif
inc_irq_stat(apic_perf_irqs); inc_irq_stat(apic_perf_irqs);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册