[2.6.32] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x30/0x3c()
Subsystems (2)
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+0x30/0x3c() [ 0.000999] Modules linked in: [ 0.000999] Pid: 0, comm: swapper Not tainted 2.6.32 #3 [ 0.000999] Call Trace: [ 0.000999] [<ffffffff8102611a>] ? native_apic_write_dummy+0x30/0x3c [ 0.000999] [<ffffffff8104c5a2>] warn_slowpath_common+0x77/0x8f [ 0.000999] [<ffffffff8104c5c9>] warn_slowpath_null+0xf/0x11 [ 0.000999] [<ffffffff8102611a>] native_apic_write_dummy+0x30/0x3c [ 0.000999] [<ffffffff8101bf49>] perf_events_lapic_init+0x2e/0x30 [ 0.000999] [<ffffffff818cc6fe>] init_hw_perf_events+0x300/0x39d [ 0.000999] [<ffffffff818cc25a>] identify_boot_cpu+0x3c/0x3e [ 0.000999] [<ffffffff818cc3da>] check_bugs+0x9/0x2d [ 0.000999] [<ffffffff818c4cae>] start_kernel+0x37a/0x38f [ 0.000999] [<ffffffff818c42c1>] x86_64_start_reservations+0xac/0xb0 [ 0.000999] [<ffffffff818c7b79>] xen_start_kernel+0x530/0x534 [ 0.000999] ---[ end trace 4eaa2a86a8e2da22 ]--- [ 0.000999] ... version: 0 [ 0.000999] ... bit width: 48 [ 0.000999] ... generic registers: 4 [ 0.000999] ... value mask: 0000ffffffffffff [ 0.000999] ... max period: 00007fffffffffff [ 0.000999] ... fixed-purpose events: 0 [ 0.000999] ... event mask: 000000000000000f [ 0.000999] SMP alternatives: switching to UP code
# uname -a Linux fatush.arschkrebs.de 2.6.32 #3 SMP Tue Dec 8 22:09:42 CET 2009 x86_64 GNU/Linux
# cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 67 model name : AMD Athlon(tm) 64 X2 Dual Core Processor 5600+ stepping : 3 cpu MHz : 2799.966 cache size : 1024 KB fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu de tsc msr pae cx8 cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow up rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy bogomips : 5599.93 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp tm stc
Signature · 7 lines
Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 [email protected] | http://www.charite.de
Quoted 22 lines · Ralf Hildebrandt
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+0x30/0x3c() [ 0.000999] Modules linked in: [ 0.000999] Pid: 0, comm: swapper Not tainted 2.6.32 #3 [ 0.000999] Call Trace: [ 0.000999] [<ffffffff8102611a>] ? native_apic_write_dummy+0x30/0x3c [ 0.000999] [<ffffffff8104c5a2>] warn_slowpath_common+0x77/0x8f [ 0.000999] [<ffffffff8104c5c9>] warn_slowpath_null+0xf/0x11 [ 0.000999] [<ffffffff8102611a>] native_apic_write_dummy+0x30/0x3c [ 0.000999] [<ffffffff8101bf49>] perf_events_lapic_init+0x2e/0x30 [ 0.000999] [<ffffffff818cc6fe>] init_hw_perf_events+0x300/0x39d [ 0.000999] [<ffffffff818cc25a>] identify_boot_cpu+0x3c/0x3e [ 0.000999] [<ffffffff818cc3da>] check_bugs+0x9/0x2d [ 0.000999] [<ffffffff818c4cae>] start_kernel+0x37a/0x38f [ 0.000999] [<ffffffff818c42c1>] x86_64_start_reservations+0xac/0xb0 [ 0.000999] [<ffffffff818c7b79>] xen_start_kernel+0x530/0x534 [ 0.000999] ---[ end trace 4eaa2a86a8e2da22 ]---
Quoted 9 lines
[ 0.000999] ... version: 0 [ 0.000999] ... bit width: 48 [ 0.000999] ... generic registers: 4 [ 0.000999] ... value mask: 0000ffffffffffff [ 0.000999] ... max period: 00007fffffffffff [ 0.000999] ... fixed-purpose events: 0 [ 0.000999] ... event mask: 000000000000000f [ 0.000999] SMP alternatives: switching to UP code
It seems amd_pmu_init() do not check if apic is enabled :( Thanks for report!
-- Cyrill
Quoted 9 lines · Cyrill Gorcunov
Quoted 8 lines · Ralf Hildebrandt
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+0x30/0x3c() [ 0.000999] Modules linked in:
...
I suppose it should be something like the patch below. Please test/review.
---perf_event: check if we have APIC enabled on AMD cpu
Ralf Hildebrandt reported:
| | 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+0x30/0x3c() | [ 0.000999] Modules linked in: | [ 0.000999] Pid: 0, comm: swapper Not tainted 2.6.32 #3 | [ 0.000999] Call Trace: | [ 0.000999] [<ffffffff8102611a>] ? native_apic_write_dummy+0x30/0x3c | [ 0.000999] [<ffffffff8104c5a2>] warn_slowpath_common+0x77/0x8f | [ 0.000999] [<ffffffff8104c5c9>] warn_slowpath_null+0xf/0x11 | [ 0.000999] [<ffffffff8102611a>] native_apic_write_dummy+0x30/0x3c | [ 0.000999] [<ffffffff8101bf49>] perf_events_lapic_init+0x2e/0x30 | [ 0.000999] [<ffffffff818cc6fe>] init_hw_perf_events+0x300/0x39d | [ 0.000999] [<ffffffff818cc25a>] identify_boot_cpu+0x3c/0x3e | [ 0.000999] [<ffffffff818cc3da>] check_bugs+0x9/0x2d | [ 0.000999] [<ffffffff818c4cae>] start_kernel+0x37a/0x38f | [ 0.000999] [<ffffffff818c42c1>] x86_64_start_reservations+0xac/0xb0 | [ 0.000999] [<ffffffff818c7b79>] xen_start_kernel+0x530/0x534 | [ 0.000999] ---[ end trace 4eaa2a86a8e2da22 ]--- |
So we need to check if APIC has a proper state.
--- arch/x86/kernel/cpu/perf_event.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
arch/x86/kernel/cpu/perf_event.c +13 -5
@@ -627,6 +627,16 @@ static __initconst u64 amd_hw_cache_even }, }; +static void __init perfmon_check_apic (struct x86_pmu * pmu) +{ +if (cpu_has_apic) +return ; + + pmu->apic =0 ; +pr_info ("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n" ); +pr_info ("no hardware sampling interrupt available.\n" ); +} +/* * AMD Performance Monitor K7 and later. */
@@ -2062,11 +2072,7 @@ static __init int p6_pmu_init(void) x86_pmu = p6_pmu; -if (!cpu_has_apic) { -pr_info ("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n" ); -pr_info ("no hardware sampling interrupt available.\n" ); - x86_pmu.apic =0 ; - } +perfmon_check_apic (&x86_pmu);return 0 ; }
@@ -2156,6 +2162,8 @@ static __init int amd_pmu_init(void)memcpy (hw_cache_event_ids, amd_hw_cache_event_ids,sizeof (hw_cache_event_ids)); +perfmon_check_apic (&x86_pmu); +return 0 ; }
Quoted 87 lines · Cyrill Gorcunov
Quoted 9 lines · Cyrill Gorcunov
Quoted 8 lines · Ralf Hildebrandt
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+0x30/0x3c() [ 0.000999] Modules linked in:...
I suppose it should be something like the patch below. Please test/review.
---perf_event: check if we have APIC enabled on AMD cpuRalf Hildebrandt reported:
| | 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+0x30/0x3c() | [ 0.000999] Modules linked in: | [ 0.000999] Pid: 0, comm: swapper Not tainted 2.6.32 #3 | [ 0.000999] Call Trace: | [ 0.000999] [<ffffffff8102611a>] ? native_apic_write_dummy+0x30/0x3c | [ 0.000999] [<ffffffff8104c5a2>] warn_slowpath_common+0x77/0x8f | [ 0.000999] [<ffffffff8104c5c9>] warn_slowpath_null+0xf/0x11 | [ 0.000999] [<ffffffff8102611a>] native_apic_write_dummy+0x30/0x3c | [ 0.000999] [<ffffffff8101bf49>] perf_events_lapic_init+0x2e/0x30 | [ 0.000999] [<ffffffff818cc6fe>] init_hw_perf_events+0x300/0x39d | [ 0.000999] [<ffffffff818cc25a>] identify_boot_cpu+0x3c/0x3e | [ 0.000999] [<ffffffff818cc3da>] check_bugs+0x9/0x2d | [ 0.000999] [<ffffffff818c4cae>] start_kernel+0x37a/0x38f | [ 0.000999] [<ffffffff818c42c1>] x86_64_start_reservations+0xac/0xb0 | [ 0.000999] [<ffffffff818c7b79>] xen_start_kernel+0x530/0x534 | [ 0.000999] ---[ end trace 4eaa2a86a8e2da22 ]--- |So we need to check if APIC has a proper state.
Reported-by Ralf Hildebrandt <[email protected]>Signed-off-by Cyrill Gorcunov <[email protected]>--- arch/x86/kernel/cpu/perf_event.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)Index:
linux-2.6.git/arch/x86/kernel/cpu/perf_event.c
=====================================================================arch/x86/kernel/cpu/perf_event.c +11
-5@@ -627,6 +627,16 @@ static __initconst u64 amd_hw_cache_even }, }; +static void __init perfmon_check_apic (struct x86_pmu * pmu) +{ +if (cpu_has_apic) +return ; + + pmu->apic =0 ; +pr_info ("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n" ); +pr_info ("no hardware sampling interrupt available.\n" ); +} +/* * AMD Performance Monitor K7 and later. */ @@ -2062,11 +2072,7 @@ static __init int p6_pmu_init(void) x86_pmu = p6_pmu; -if (!cpu_has_apic) { -pr_info ("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n" ); -pr_info ("no hardware sampling interrupt available.\n" ); - x86_pmu.apic =0 ; - } +perfmon_check_apic (&x86_pmu);return 0 ; }
arch/x86/kernel/cpu/perf_event.c static __init int amd_pmu_init(void) · line 2168
Quoted 7 lines
arch/x86/kernel/cpu/perf_event.c +2
-0@@ -2156,6 +2162,8 @@ static __init int amd_pmu_init(void)memcpy (hw_cache_event_ids, amd_hw_cache_event_ids,sizeof (hw_cache_event_ids)); +perfmon_check_apic (&x86_pmu); +return 0 ; }
Similar check needed in intel_pmu_init() as well? Also, i'd suggest to name it pmu_check_apic() or so - and why call it in the middle of of the PMU init functions? All PMU drivers are APIC based, so this call can be done right after:
if (err != 0) {
pr_cont("no PMU driver, software events only.\n");
return;
}
pmu_check_apic();in a single place. Also, no need to pass in &x86_pmu - we have a single PMU driver.
Thanks,
Ingo
On Thu, Dec 10, 2009 at 05:37:45PM +0100, Ingo Molnar wrote:
...
Quoted 7 lines
arch/x86/kernel/cpu/perf_event.c static __init int amd_pmu_init(void) · line 2168
Quoted 5 lines
arch/x86/kernel/cpu/perf_event.c +2
-0+perfmon_check_apic (&x86_pmu); +return 0 ; }Similar check needed in
intel_pmu_init()as well?
Yes (though p6 model already has such a check [fixed by Peter iirc])
Quoted 13 lines
Also, i'd suggest to
name itpmu_check_apic()or so - and why call it in the middle of of the PMU init functions? All PMU drivers are APIC based, so this call can be done right after:if (err != 0) { pr_cont("no PMU driver, software events only.\n"); return; } pmu_check_apic();
Quoted 7 lines
in a single place. Also, no need to pass in
&x86_pmu- we have a single PMU driver.Thanks,
Ingo
OK, will update and resend. Thanks for comments!
-- Cyrill
On Thu, Dec 10, 2009 at 07:49:04PM +0300, Cyrill Gorcunov wrote:
...
Quoted 4 lines
OK, will update and resend. Thanks for comments!
-- Cyrill
Here is it, please review.
-- Cyrill
---
x86,pmu: check if we have APIC enabled
Ralf Hildebrandt reported:
| | 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+0x30/0x3c() | [ 0.000999] Modules linked in: | [ 0.000999] Pid: 0, comm: swapper Not tainted 2.6.32 #3 | [ 0.000999] Call Trace: | [ 0.000999] [<ffffffff8102611a>] ? native_apic_write_dummy+0x30/0x3c | [ 0.000999] [<ffffffff8104c5a2>] warn_slowpath_common+0x77/0x8f | [ 0.000999] [<ffffffff8104c5c9>] warn_slowpath_null+0xf/0x11 | [ 0.000999] [<ffffffff8102611a>] native_apic_write_dummy+0x30/0x3c | [ 0.000999] [<ffffffff8101bf49>] perf_events_lapic_init+0x2e/0x30 | [ 0.000999] [<ffffffff818cc6fe>] init_hw_perf_events+0x300/0x39d | [ 0.000999] [<ffffffff818cc25a>] identify_boot_cpu+0x3c/0x3e | [ 0.000999] [<ffffffff818cc3da>] check_bugs+0x9/0x2d | [ 0.000999] [<ffffffff818c4cae>] start_kernel+0x37a/0x38f | [ 0.000999] [<ffffffff818c42c1>] x86_64_start_reservations+0xac/0xb0 | [ 0.000999] [<ffffffff818c7b79>] xen_start_kernel+0x530/0x534 | [ 0.000999] ---[ end trace 4eaa2a86a8e2da22 ]--- |
So we need to check if APIC has a proper state (ie enabled).
--- arch/x86/kernel/cpu/perf_event.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
arch/x86/kernel/cpu/perf_event.c +12 -6
@@ -2062,12 +2062,6 @@ static __init int p6_pmu_init(void) x86_pmu = p6_pmu; -if (!cpu_has_apic) { -pr_info ("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n" ); -pr_info ("no hardware sampling interrupt available.\n" ); - x86_pmu.apic =0 ; - } -return 0 ; }
@@ -2159,6 +2153,16 @@ static __init int amd_pmu_init(void)return 0 ; } +static void __init pmu_check_apic (void ) +{ +if (cpu_has_apic) +return ; + + x86_pmu.apic =0 ; +pr_info ("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n" ); +pr_info ("no hardware sampling interrupt available.\n" ); +} +void __init init_hw_perf_events (void ) {int err;
@@ -2180,6 +2184,8 @@ void __init init_hw_perf_events(void)return ; } +pmu_check_apic (); +pr_cont ("%s PMU driver.\n" , x86_pmu.name);if (x86_pmu.num_events >X86_PMC_MAX_GENERIC ) {
[tip:perf/urgent] x86, perf events: Check if we have APIC enabled
Commit-ID: 125580380f418000b1a06d9a54700f1191b6e561 Gitweb: http://git.kernel.org/tip/125580380f418000b1a06d9a54700f1191b6e561 Author: Cyrill Gorcunov <[email protected]> AuthorDate: Thu, 10 Dec 2009 19:56:34 +0300 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 10 Dec 2009 18:00:30 +0100
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.
LKML-Reference: <20091210165634.GF5086@lenovo>
--- arch/x86/kernel/cpu/perf_event.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-)
arch/x86/kernel/cpu/perf_event.c +12 -6
@@ -2066,12 +2066,6 @@ static __init int p6_pmu_init(void) x86_pmu = p6_pmu; -if (!cpu_has_apic) { -pr_info ("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n" ); -pr_info ("no hardware sampling interrupt available.\n" ); - x86_pmu.apic =0 ; - } -return 0 ; }
@@ -2163,6 +2157,16 @@ static __init int amd_pmu_init(void)return 0 ; } +static void __init pmu_check_apic (void ) +{ +if (cpu_has_apic) +return ; + + x86_pmu.apic =0 ; +pr_info ("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n" ); +pr_info ("no hardware sampling interrupt available.\n" ); +} +void __init init_hw_perf_events (void ) {int err;
@@ -2184,6 +2188,8 @@ void __init init_hw_perf_events(void)return ; } +pmu_check_apic (); +pr_cont ("%s PMU driver.\n" , x86_pmu.name);if (x86_pmu.num_events >X86_PMC_MAX_GENERIC ) {
Re: [tip:perf/urgent] x86, perf events: Check if we have APIC enabled
Quoted 29 lines · tip-bot for Cyrill Gorcunov
Commit-ID: 125580380f418000b1a06d9a54700f1191b6e561 Gitweb: http://git.kernel.org/tip/125580380f418000b1a06d9a54700f1191b6e561 Author: Cyrill Gorcunov <[email protected]> AuthorDate: Thu, 10 Dec 2009 19:56:34 +0300 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 10 Dec 2009 18:00:30 +0100x86, 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_dummySo we need to check if APIC functionality is available, and not just in the P6 driver but elsewhere as well.
Reported-by Ralf Hildebrandt <[email protected]>Signed-off-by Cyrill Gorcunov <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Mike Galbraith <[email protected]>Cc Paul Mackerras <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>Cc Frederic Weisbecker <[email protected]>
Quoted 6 lines
LKML-Reference: <20091210165634.GF5086@lenovo>
Signed-off-by Ingo Molnar <[email protected]>--- arch/x86/kernel/cpu/perf_event.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-)
...
Btw, is there some particular reason to have x86_pmu::apic item? Can't we use cpu_has_apic directly? Or there some plans about this item? Or I miss something obvious?
-- Cyrill
Re: [tip:perf/urgent] x86, perf events: Check if we have APIC enabled
In reply to tip-bot for Cyrill GorcunovHello list,
wow, I reported this bug also "PROBLEM: WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x32/0x3e() (git 2.6.32-rc5)" on 22.october 09, this a delay of 1,5 month ;) But anyway, good to know, that they comes now a hint from the kernel by this patch... :)
2009/12/10 tip-bot for Cyrill Gorcunov <[email protected]>:
Quoted 84 lines
Commit-ID: 125580380f418000b1a06d9a54700f1191b6e561
Gitweb: http://git.kernel.org/tip/125580380f418000b1a06d9a54700f1191b6e561
Author: Cyrill Gorcunov <[email protected]>
AuthorDate: Thu, 10 Dec 2009 19:56:34 +0300
Committer: Ingo Molnar <[email protected]>
CommitDate: Thu, 10 Dec 2009 18:00:30 +0100x86, 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_dummySo we need to check if APIC functionality is available, and not just in the P6 driver but elsewhere as well.
Reported-by Ralf Hildebrandt <[email protected]>Signed-off-by Cyrill Gorcunov <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Mike Galbraith <[email protected]>Cc Paul Mackerras <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>Cc Frederic Weisbecker <[email protected]>LKML-Reference: <20091210165634.GF5086@lenovo>
Signed-off-by Ingo Molnar <[email protected]>---
arch/x86/kernel/cpu/perf_event.c | 18 ++++++++++++------1 files changed, 12 insertions(+), 6 deletions(-)arch/x86/kernel/cpu/perf_event.c +12
-7@@ -2066,12 +2066,6 @@ static __init int p6_pmu_init(void) x86_pmu = p6_pmu; - if (!cpu_has_apic) { - pr_info("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n"); - pr_info("no hardware sampling interrupt available.\n"); - x86_pmu.apic = 0; - } - return 0; }@@ -2163,6 +2157,16 @@ static __init int amd_pmu_init(void) return 0; } +static void __init pmu_check_apic (void ) +{ + if (cpu_has_apic) + return; + + x86_pmu.apic = 0; + pr_info("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n"); + pr_info("no hardware sampling interrupt available.\n"); +} + void __init init_hw_perf_events(void) { int err;@@ -2184,6 +2188,8 @@ void __init init_hw_perf_events(void) return; } + pmu_check_apic(); + pr_cont("%s PMU driver.\n", x86_pmu.name); if (x86_pmu.num_events > X86_PMC_MAX_GENERIC) { --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 8 lines
-- ......oooO.............. .....(....).....Oooo... ......)../.....(....).... .....(_/.......)../..... ...............(_/....... ... I WAS .............. .......... HERE...... ;)