* [2.6.32] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x30/0x3c() @ 2009-12-10 15:48 Ralf Hildebrandt 2009-12-10 16:13 ` Cyrill Gorcunov 0 siblings, 1 reply; 9+ messages in thread From: Ralf Hildebrandt @ 2009-12-10 15:48 UTC (permalink / raw) To: linux-kernel 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 -- 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 ralf.hildebrandt@charite.de | http://www.charite.de ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [2.6.32] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x30/0x3c() 2009-12-10 15:48 [2.6.32] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x30/0x3c() Ralf Hildebrandt @ 2009-12-10 16:13 ` Cyrill Gorcunov 2009-12-10 16:30 ` Cyrill Gorcunov 0 siblings, 1 reply; 9+ messages in thread From: Cyrill Gorcunov @ 2009-12-10 16:13 UTC (permalink / raw) To: Ralf Hildebrandt, linux-kernel On Thu, Dec 10, 2009 at 04:48:37PM +0100, Ralf Hildebrandt wrote: > 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 > It seems amd_pmu_init() do not check if apic is enabled :( Thanks for report! -- Cyrill ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [2.6.32] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x30/0x3c() 2009-12-10 16:13 ` Cyrill Gorcunov @ 2009-12-10 16:30 ` Cyrill Gorcunov 2009-12-10 16:37 ` Ingo Molnar 0 siblings, 1 reply; 9+ messages in thread From: Cyrill Gorcunov @ 2009-12-10 16:30 UTC (permalink / raw) To: Ralf Hildebrandt, linux-kernel, Ingo Molnar, x86team On Thu, Dec 10, 2009 at 07:13:35PM +0300, Cyrill Gorcunov wrote: > On Thu, Dec 10, 2009 at 04:48:37PM +0100, Ralf Hildebrandt wrote: > > 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. Reported-by: Ralf Hildebrandt <Ralf.Hildebrandt@charite.de> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> --- 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 ===================================================================== --- linux-2.6.git.orig/arch/x86/kernel/cpu/perf_event.c +++ linux-2.6.git/arch/x86/kernel/cpu/perf_event.c @@ -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; } ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [2.6.32] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x30/0x3c() 2009-12-10 16:30 ` Cyrill Gorcunov @ 2009-12-10 16:37 ` Ingo Molnar 2009-12-10 16:49 ` Cyrill Gorcunov 0 siblings, 1 reply; 9+ messages in thread From: Ingo Molnar @ 2009-12-10 16:37 UTC (permalink / raw) To: Cyrill Gorcunov; +Cc: Ralf Hildebrandt, linux-kernel, x86team * Cyrill Gorcunov <gorcunov@openvz.org> wrote: > On Thu, Dec 10, 2009 at 07:13:35PM +0300, Cyrill Gorcunov wrote: > > On Thu, Dec 10, 2009 at 04:48:37PM +0100, Ralf Hildebrandt wrote: > > > 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. > > Reported-by: Ralf Hildebrandt <Ralf.Hildebrandt@charite.de> > Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> > --- > 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 > ===================================================================== > --- linux-2.6.git.orig/arch/x86/kernel/cpu/perf_event.c > +++ linux-2.6.git/arch/x86/kernel/cpu/perf_event.c > @@ -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; > } 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [2.6.32] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x30/0x3c() 2009-12-10 16:37 ` Ingo Molnar @ 2009-12-10 16:49 ` Cyrill Gorcunov 2009-12-10 16:56 ` Cyrill Gorcunov 0 siblings, 1 reply; 9+ messages in thread From: Cyrill Gorcunov @ 2009-12-10 16:49 UTC (permalink / raw) To: Ingo Molnar; +Cc: Ralf Hildebrandt, linux-kernel, x86team On Thu, Dec 10, 2009 at 05:37:45PM +0100, Ingo Molnar wrote: ... > > > > + 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]) > > 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 > OK, will update and resend. Thanks for comments! -- Cyrill ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [2.6.32] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x30/0x3c() 2009-12-10 16:49 ` Cyrill Gorcunov @ 2009-12-10 16:56 ` Cyrill Gorcunov 2009-12-10 17:18 ` [tip:perf/urgent] x86, perf events: Check if we have APIC enabled tip-bot for Cyrill Gorcunov 0 siblings, 1 reply; 9+ messages in thread From: Cyrill Gorcunov @ 2009-12-10 16:56 UTC (permalink / raw) To: Ingo Molnar, Ralf Hildebrandt, linux-kernel, x86team On Thu, Dec 10, 2009 at 07:49:04PM +0300, Cyrill Gorcunov wrote: ... > > 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). Reported-by: Ralf Hildebrandt <Ralf.Hildebrandt@charite.de> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> --- arch/x86/kernel/cpu/perf_event.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) Index: linux-2.6.git/arch/x86/kernel/cpu/perf_event.c ===================================================================== --- linux-2.6.git.orig/arch/x86/kernel/cpu/perf_event.c +++ linux-2.6.git/arch/x86/kernel/cpu/perf_event.c @@ -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) { ^ permalink raw reply [flat|nested] 9+ messages in thread
* [tip:perf/urgent] x86, perf events: Check if we have APIC enabled 2009-12-10 16:56 ` Cyrill Gorcunov @ 2009-12-10 17:18 ` tip-bot for Cyrill Gorcunov 2009-12-10 18:15 ` Cyrill Gorcunov 2009-12-11 8:39 ` Christian Hartmann 0 siblings, 2 replies; 9+ messages in thread From: tip-bot for Cyrill Gorcunov @ 2009-12-10 17:18 UTC (permalink / raw) To: linux-tip-commits Cc: linux-kernel, acme, paulus, hpa, mingo, gorcunov, a.p.zijlstra, efault, fweisbec, Ralf.Hildebrandt, tglx, mingo Commit-ID: 125580380f418000b1a06d9a54700f1191b6e561 Gitweb: http://git.kernel.org/tip/125580380f418000b1a06d9a54700f1191b6e561 Author: Cyrill Gorcunov <gorcunov@openvz.org> AuthorDate: Thu, 10 Dec 2009 19:56:34 +0300 Committer: Ingo Molnar <mingo@elte.hu> 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. 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> --- arch/x86/kernel/cpu/perf_event.c | 18 ++++++++++++------ 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 1342f23..18f05ec 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) 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) { ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [tip:perf/urgent] x86, perf events: Check if we have APIC enabled 2009-12-10 17:18 ` [tip:perf/urgent] x86, perf events: Check if we have APIC enabled tip-bot for Cyrill Gorcunov @ 2009-12-10 18:15 ` Cyrill Gorcunov 2009-12-11 8:39 ` Christian Hartmann 1 sibling, 0 replies; 9+ messages in thread From: Cyrill Gorcunov @ 2009-12-10 18:15 UTC (permalink / raw) To: mingo, hpa, paulus, acme, linux-kernel, a.p.zijlstra, efault, fweisbec, Ralf.Hildebrandt, tglx, mingo Cc: linux-tip-commits On Thu, Dec 10, 2009 at 05:18:32PM +0000, tip-bot for Cyrill Gorcunov wrote: > Commit-ID: 125580380f418000b1a06d9a54700f1191b6e561 > Gitweb: http://git.kernel.org/tip/125580380f418000b1a06d9a54700f1191b6e561 > Author: Cyrill Gorcunov <gorcunov@openvz.org> > AuthorDate: Thu, 10 Dec 2009 19:56:34 +0300 > Committer: Ingo Molnar <mingo@elte.hu> > 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. > > 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> > --- > 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [tip:perf/urgent] x86, perf events: Check if we have APIC enabled 2009-12-10 17:18 ` [tip:perf/urgent] x86, perf events: Check if we have APIC enabled tip-bot for Cyrill Gorcunov 2009-12-10 18:15 ` Cyrill Gorcunov @ 2009-12-11 8:39 ` Christian Hartmann 1 sibling, 0 replies; 9+ messages in thread From: Christian Hartmann @ 2009-12-11 8:39 UTC (permalink / raw) To: linux-kernel, Ralf.Hildebrandt Hello 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 <gorcunov@openvz.org>: > Commit-ID: 125580380f418000b1a06d9a54700f1191b6e561 > Gitweb: http://git.kernel.org/tip/125580380f418000b1a06d9a54700f1191b6e561 > Author: Cyrill Gorcunov <gorcunov@openvz.org> > AuthorDate: Thu, 10 Dec 2009 19:56:34 +0300 > Committer: Ingo Molnar <mingo@elte.hu> > 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. > > 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> > --- > arch/x86/kernel/cpu/perf_event.c | 18 ++++++++++++------ > 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 1342f23..18f05ec 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) > > 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 majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > -- -- ......oooO.............. .....(....).....Oooo... ......)../.....(....).... .....(_/.......)../..... ...............(_/....... ... I WAS .............. .......... HERE...... ;) ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-12-11 8:39 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-12-10 15:48 [2.6.32] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy+0x30/0x3c() Ralf Hildebrandt 2009-12-10 16:13 ` Cyrill Gorcunov 2009-12-10 16:30 ` Cyrill Gorcunov 2009-12-10 16:37 ` Ingo Molnar 2009-12-10 16:49 ` Cyrill Gorcunov 2009-12-10 16:56 ` Cyrill Gorcunov 2009-12-10 17:18 ` [tip:perf/urgent] x86, perf events: Check if we have APIC enabled tip-bot for Cyrill Gorcunov 2009-12-10 18:15 ` Cyrill Gorcunov 2009-12-11 8:39 ` Christian Hartmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox