diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2010-03-17 06:37:01 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-18 12:03:22 -0400 |
commit | 7335f75e9ca166044e38a96abad422d8e6e364b5 (patch) | |
tree | ecd34b9a8de260a7863e47bb4fa18e492d1722fe /arch/x86 | |
parent | d674cd1963129b70bc5f631c51fb30fb73213fb2 (diff) |
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: Cyrill 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: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_p4.c | 2 |
2 files changed, 0 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index c97d5b52d12a..14eca80918dc 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -1136,7 +1136,6 @@ void set_perf_event_pending(void) | |||
1136 | 1136 | ||
1137 | void perf_events_lapic_init(void) | 1137 | void perf_events_lapic_init(void) |
1138 | { | 1138 | { |
1139 | #ifdef CONFIG_X86_LOCAL_APIC | ||
1140 | if (!x86_pmu.apic || !x86_pmu_initialized()) | 1139 | if (!x86_pmu.apic || !x86_pmu_initialized()) |
1141 | return; | 1140 | return; |
1142 | 1141 | ||
@@ -1144,7 +1143,6 @@ void perf_events_lapic_init(void) | |||
1144 | * Always use NMI for PMU | 1143 | * Always use NMI for PMU |
1145 | */ | 1144 | */ |
1146 | apic_write(APIC_LVTPC, APIC_DM_NMI); | 1145 | apic_write(APIC_LVTPC, APIC_DM_NMI); |
1147 | #endif | ||
1148 | } | 1146 | } |
1149 | 1147 | ||
1150 | static int __kprobes | 1148 | static int __kprobes |
@@ -1168,9 +1166,7 @@ perf_event_nmi_handler(struct notifier_block *self, | |||
1168 | 1166 | ||
1169 | regs = args->regs; | 1167 | regs = args->regs; |
1170 | 1168 | ||
1171 | #ifdef CONFIG_X86_LOCAL_APIC | ||
1172 | apic_write(APIC_LVTPC, APIC_DM_NMI); | 1169 | apic_write(APIC_LVTPC, APIC_DM_NMI); |
1173 | #endif | ||
1174 | /* | 1170 | /* |
1175 | * Can't rely on the handled return value to say it was our NMI, two | 1171 | * Can't rely on the handled return value to say it was our NMI, two |
1176 | * events could trigger 'simultaneously' raising two back-to-back NMIs. | 1172 | * events could trigger 'simultaneously' raising two back-to-back NMIs. |
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index a11ce73a93c9..0367889b4ae0 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
@@ -363,10 +363,8 @@ static int p4_pmu_handle_irq(struct pt_regs *regs) | |||
363 | } | 363 | } |
364 | 364 | ||
365 | if (handled) { | 365 | if (handled) { |
366 | #ifdef CONFIG_X86_LOCAL_APIC | ||
367 | /* p4 quirk: unmask it again */ | 366 | /* p4 quirk: unmask it again */ |
368 | apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED); | 367 | apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED); |
369 | #endif | ||
370 | inc_irq_stat(apic_perf_irqs); | 368 | inc_irq_stat(apic_perf_irqs); |
371 | } | 369 | } |
372 | 370 | ||