aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2009-12-10 11:56:34 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-10 12:00:30 -0500
commit125580380f418000b1a06d9a54700f1191b6e561 (patch)
tree86254f20e7a7931eab94c653720cc2c0b22ffbb5
parent5e855db5d8fec44e6604eb245aa9077bbd3f0d05 (diff)
x86, perf events: Check if we have APIC enabled
Ralf Hildebrandt reported this boot warning: | Running a vanilla 2.6.32 as Xen DomU, I'm getting: | | [ 0.000999] CPU: Physical Processor ID: 0 | [ 0.000999] CPU: Processor Core ID: 1 | [ 0.000999] Performance Events: AMD PMU driver. | [ 0.000999] ------------[ cut here ]------------ | [ 0.000999] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy So we need to check if APIC functionality is available, and not just in the P6 driver but elsewhere as well. Reported-by: Ralf Hildebrandt <Ralf.Hildebrandt@charite.de> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <20091210165634.GF5086@lenovo> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/cpu/perf_event.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 1342f236e32a..18f05eccbb62 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -2066,12 +2066,6 @@ static __init int p6_pmu_init(void)
2066 2066
2067 x86_pmu = p6_pmu; 2067 x86_pmu = p6_pmu;
2068 2068
2069 if (!cpu_has_apic) {
2070 pr_info("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n");
2071 pr_info("no hardware sampling interrupt available.\n");
2072 x86_pmu.apic = 0;
2073 }
2074
2075 return 0; 2069 return 0;
2076} 2070}
2077 2071
@@ -2163,6 +2157,16 @@ static __init int amd_pmu_init(void)
2163 return 0; 2157 return 0;
2164} 2158}
2165 2159
2160static void __init pmu_check_apic(void)
2161{
2162 if (cpu_has_apic)
2163 return;
2164
2165 x86_pmu.apic = 0;
2166 pr_info("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n");
2167 pr_info("no hardware sampling interrupt available.\n");
2168}
2169
2166void __init init_hw_perf_events(void) 2170void __init init_hw_perf_events(void)
2167{ 2171{
2168 int err; 2172 int err;
@@ -2184,6 +2188,8 @@ void __init init_hw_perf_events(void)
2184 return; 2188 return;
2185 } 2189 }
2186 2190
2191 pmu_check_apic();
2192
2187 pr_cont("%s PMU driver.\n", x86_pmu.name); 2193 pr_cont("%s PMU driver.\n", x86_pmu.name);
2188 2194
2189 if (x86_pmu.num_events > X86_PMC_MAX_GENERIC) { 2195 if (x86_pmu.num_events > X86_PMC_MAX_GENERIC) {