Messages in this thread | | | Date | Mon, 17 Aug 2009 13:53:41 +0200 | From | Ingo Molnar <> | Subject | Re: [PATCH] x86, mce: Don't initialize MCEs on unknown CPUs |
| |
* Andi Kleen <ak@linux.intel.com> wrote:
> Ingo Molnar wrote: > >> >> btw., i found the bug - it's due to: >> >> # CONFIG_CPU_SUP_INTEL is not set > > Ah, thanks for debugging. Very tricky and nasty. Perhaps these options are more trouble > than what they save in code. > >> static void __cpuinit mce_ancient_init(struct cpuinfo_x86 *c) >> @@ -1342,11 +1352,10 @@ void __cpuinit mcheck_init(struct cpuinfo_x86 *c) >> if (!mce_available(c)) >> return; >> - if (mce_cap_init() < 0) { >> + if (mce_cap_init() < 0 || mce_cpu_quirks(c) < 0) { >> mce_disabled = 1; >> return; >> } >> - mce_cpu_quirks(c); > > I'm very pedantic here and it's more a theoretical problem, but > mce_cap_init() allocates memory which you leak and this could > rerun on each CPU hotplug. So if you have a unknown CPU and do a > lot of CPU hotadds in a loop then you would eventually fill all > memory. Better kfree() the bank arrays.
Not really, we dont re-run mce_cap_init() if MCE is disabled so there's no memory leak that would fill all memory.
Ingo
| |