x86/mce: Dynamically size space for machine check records
authorTony Luck <tony.luck@intel.com>
Thu, 7 Mar 2024 19:27:04 +0000 (11:27 -0800)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 26 Mar 2024 11:40:42 +0000 (12:40 +0100)
commit108c6494bdf1dfeaefc0a506e2f471aa92fafdd6
treef3745f26c1dd0565bbee10d5b6714c9a877816f0
parent4cece764965020c22cff7665b18a012006359095
x86/mce: Dynamically size space for machine check records

Systems with a large number of CPUs may generate a large number of
machine check records when things go seriously wrong. But Linux has
a fixed-size buffer that can only capture a few dozen errors.

Allocate space based on the number of CPUs (with a minimum value based
on the historical fixed buffer that could store 80 records).

  [ bp: Rename local var from tmpp to something more telling: gpool. ]

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>
Reviewed-by: Avadhut Naik <avadhut.naik@amd.com>
Link: https://lore.kernel.org/r/20240307192704.37213-1-tony.luck@intel.com
arch/x86/kernel/cpu/mce/genpool.c