[Bugme-janitors] [Bug 16322] WARNING: at /arch/x86/include/asm/processor.h:1005 read_measured_perf_ctrs+0x5a/0x70()

bugzilla-daemon at bugzilla.kernel.org bugzilla-daemon at bugzilla.kernel.org
Mon Sep 20 09:49:15 PDT 2010


https://bugzilla.kernel.org/show_bug.cgi?id=16322





--- Comment #48 from Anonymous Emailer <anonymous at kernel-bugs.osdl.org>  2010-09-20 16:49:00 ---
Reply-To: bp at amd64.org

From: "H. Peter Anvin" <hpa at zytor.com>
Date: Mon, Sep 20, 2010 at 11:22:08AM -0400

> [Resending since Bugzilla seems to have spat it out]

Yeah this message somehow got delayed - I just got it so this is why I
didn't know that you've asked for information.

> I'm confused - I don't see CPB set in the CPUID dump that the posted, so
> how could this be a misdetect of CPB?  Furthermore:
> 
> a) I'd really like to verify that there is a non-AMD CPU which uses this
> bit for another purpose and
> b) If that is, rather than duplicating code it would be better to add an
> optional vendor ID to the scatter table.

Here's the whole story as I see it:

1) I just thought that the CPB bit should be in AMD-only path, since
Intel's turbo boost bit is somewhere else, i.e. Function 06h, EAX[1] and
I'd rather put the AMD-one of Fn8000_0007_EDX[9] in AMD-only path. But
I'm fine with you wanting to keep it in scattered.c for brevity too.

2) Totally unrelated, obviously, the couple users on the bugzilla have
conflicting features reported over CPUID: core 0 reports, for example,
max base level for base CPUID functions as being 0x0000000b while the
remaining cores 1,2,3 report as max level 0x00000002 and therefore the
APERFMPERF check fails since boot_cpu_data's bitmasks get cleared when
AND-ing it with the capabilities of the remaining cores at the end of
identify_cpu().

For example, https://bugzilla.kernel.org/attachment.cgi?id=29642,
has aperfmperf set only on core0 but not on core1. The
initial reporter has it set on cores 0,2,3 but not on 1:
https://bugzilla.kernel.org/attachment.cgi?id=27159 One other user sent
me the debug output after applying

---
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c
b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 10fa568..8037c7a 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -45,6 +45,9 @@ void __cpuinit init_scattered_cpuid_features(struct
cpuinfo_x86 *c)

                /* Verify that the level is valid */
                max_level = cpuid_eax(cb->level & 0xffff0000);
+               pr_err("%s: cpu %d: max_level: 0x%08x for 0x%08x\n",
+                       __func__, smp_processor_id(), max_level, cb->level);
+
                if (max_level < cb->level ||
                    max_level > (cb->level | 0xffff))
                        continue;
@@ -52,6 +55,9 @@ void __cpuinit init_scattered_cpuid_features(struct
cpuinfo_x86 *c)
                cpuid(cb->level, &regs[CR_EAX], &regs[CR_EBX],
                        &regs[CR_ECX], &regs[CR_EDX]);

+               pr_err("%s: cpu %d: reg: %d, value 0x%08x\n",
+                       __func__, smp_processor_id(), cb->reg, regs[cb->reg]);
+
                if (regs[cb->reg] & (1 << cb->bit))
                        set_cpu_cap(c, cb->feature);
        }
---

and very strangely, max_level is different on core0 vs the remaining ones:

[    0.000282] init_scattered_cpuid_features: cpu 0: max_level: 0x0000000b for
0x00000006
[    0.000357] init_scattered_cpuid_features: cpu 0: reg: 0, value 0x00000007
[    0.000410] init_scattered_cpuid_features: cpu 0: max_level: 0x0000000b for
0x00000006
[    0.000484] init_scattered_cpuid_features: cpu 0: reg: 0, value 0x00000007
[    0.000537] init_scattered_cpuid_features: cpu 0: max_level: 0x0000000b for
0x00000006
[    0.000612] init_scattered_cpuid_features: cpu 0: reg: 1, value 0x00000001
[    0.000666] init_scattered_cpuid_features: cpu 0: max_level: 0x80000008 for
0x80000007
[    0.000740] init_scattered_cpuid_features: cpu 0: reg: 2, value 0x00000100
[    0.000794] init_scattered_cpuid_features: cpu 0: max_level: 0x80000008 for
0x8000000a
[    0.000868] init_scattered_cpuid_features: cpu 0: max_level: 0x80000008 for
0x8000000a
[    0.000942] init_scattered_cpuid_features: cpu 0: max_level: 0x80000008 for
0x8000000a
[    0.001016] init_scattered_cpuid_features: cpu 0: max_level: 0x80000008 for
0x8000000a

...

[    0.051000] CPU0: Intel(R) Core(TM) i5 CPU         650  @ 3.20GHz stepping
02
[    0.157410] Booting Node   0, Processors  #1
[    0.167758] Initializing CPU#1
[    0.245379] init_scattered_cpuid_features: cpu 1: max_level: 0x00000002 for
0x00000006
[    0.245380] init_scattered_cpuid_features: cpu 1: max_level: 0x00000002 for
0x00000006
[    0.245382] init_scattered_cpuid_features: cpu 1: max_level: 0x00000002 for
0x00000006
[    0.245384] init_scattered_cpuid_features: cpu 1: max_level: 0x80000008 for
0x80000007
[    0.245385] init_scattered_cpuid_features: cpu 1: reg: 2, value 0x00000100
[    0.245387] init_scattered_cpuid_features: cpu 1: max_level: 0x80000008 for
0x8000000a
[    0.245388] init_scattered_cpuid_features: cpu 1: max_level: 0x80000008 for
0x8000000a
[    0.245390] init_scattered_cpuid_features: cpu 1: max_level: 0x80000008 for
0x8000000a
[    0.245391] init_scattered_cpuid_features: cpu 1: max_level: 0x80000008 for
0x8000000a
[    0.265526]  #2
[    0.276404] Initializing CPU#2
[    0.353381] init_scattered_cpuid_features: cpu 2: max_level: 0x00000002 for
0x00000006
[    0.353382] init_scattered_cpuid_features: cpu 2: max_level: 0x00000002 for
0x00000006
[    0.353384] init_scattered_cpuid_features: cpu 2: max_level: 0x00000002 for
0x00000006
[    0.353385] init_scattered_cpuid_features: cpu 2: max_level: 0x80000008 for
0x80000007
[    0.353387] init_scattered_cpuid_features: cpu 2: reg: 2, value 0x00000100
[    0.353389] init_scattered_cpuid_features: cpu 2: max_level: 0x80000008 for
0x8000000a
[    0.353390] init_scattered_cpuid_features: cpu 2: max_level: 0x80000008 for
0x8000000a
[    0.353392] init_scattered_cpuid_features: cpu 2: max_level: 0x80000008 for
0x8000000a
[    0.353394] init_scattered_cpuid_features: cpu 2: max_level: 0x80000008 for
0x8000000a
...

so it doesn't look like some kind of software issue but like
inconsistent values between core0 and the remaining cores.

Hmmm...

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.


More information about the Bugme-janitors mailing list