]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
x86, mce: implement dynamic machine check banks support
authorAndi Kleen <andi@firstfloor.org>
Tue, 17 Feb 2009 22:07:13 +0000 (23:07 +0100)
committerH. Peter Anvin <hpa@linux.intel.com>
Thu, 19 Feb 2009 22:50:58 +0000 (14:50 -0800)
commit0d7482e3d76522157c9d741d79fce22c401fa0c5
treebe87d0d3dcf9c44c7e706ce40f23515471a0b16e
parente35849e910a6543d37c0d13648ef166678d03565
x86, mce: implement dynamic machine check banks support

Impact: cleanup; making code future proof; memory saving on small systems

This patch replaces the hardcoded max number of machine check banks with
dynamic allocation depending on what the CPU reports. The sysfs
data structures and the banks array are dynamically allocated.

There is still a hard bank limit (128) because the mcelog protocol uses
banks >= 128 as pseudo banks to escape other events. But we expect
that 128 banks is beyond any reasonable CPU for now.

This supersedes an earlier patch by Venki, but it solves the problem
more completely by making the limit fully dynamic (up to the 128
boundary).

This saves some memory on machines with less than 6 banks because
they won't need sysdevs for unused ones and also allows to
use sysfs to control these banks on possible future CPUs with
more than 6 banks.

This is an updated patch addressing Venki's comments.  I also added in
another patch from Thomas which fixed the error allocation path (that
patch was previously separated)

Cc: Venki Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/kernel/cpu/mcheck/mce_64.c