x86/mce/dev-mcelog: Dynamically allocate space for machine check records
authorTony Luck <tony.luck@intel.com>
Tue, 18 Feb 2020 18:44:08 +0000 (10:44 -0800)
committerBorislav Petkov <bp@suse.de>
Tue, 10 Mar 2020 09:25:14 +0000 (10:25 +0100)
commitd8ecca4043f2d9d89daab7915eca8c2ec6254d0f
tree8c2f8fc25eec3c76eecb2aecfd0cbe1a16e60f40
parent2976908e4198aa02fc3f76802358f69396267189
x86/mce/dev-mcelog: Dynamically allocate space for machine check records

We have had a hard coded limit of 32 machine check records since the
dawn of time.  But as numbers of cores increase, it is possible for
more than 32 errors to be reported before a user process reads from
/dev/mcelog. In this case the additional errors are lost.

Keep 32 as the minimum. But tune the maximum value up based on the
number of processors.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200218184408.GA23048@agluck-desk2.amr.corp.intel.com
arch/x86/include/asm/mce.h
arch/x86/kernel/cpu/mce/dev-mcelog.c