x86/mce: Provide boot argument to honour bios-set CMCI threshold
[cascardo/linux.git] / arch / x86 / kernel / cpu / mcheck / mce.c
index c311122..29e87d3 100644 (file)
@@ -83,6 +83,7 @@ static int                    mce_dont_log_ce         __read_mostly;
 int                            mce_cmci_disabled       __read_mostly;
 int                            mce_ignore_ce           __read_mostly;
 int                            mce_ser                 __read_mostly;
+int                            mce_bios_cmci_threshold __read_mostly;
 
 struct mce_bank                *mce_banks              __read_mostly;
 
@@ -1946,6 +1947,7 @@ static struct miscdevice mce_chrdev_device = {
  *     check, or 0 to not wait
  * mce=bootlog Log MCEs from before booting. Disabled by default on AMD.
  * mce=nobootlog Don't log MCEs from before booting.
+ * mce=bios_cmci_threshold Don't program the CMCI threshold
  */
 static int __init mcheck_enable(char *str)
 {
@@ -1965,6 +1967,8 @@ static int __init mcheck_enable(char *str)
                mce_ignore_ce = 1;
        else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog"))
                mce_bootlog = (str[0] == 'b');
+       else if (!strcmp(str, "bios_cmci_threshold"))
+               mce_bios_cmci_threshold = 1;
        else if (isdigit(str[0])) {
                get_option(&str, &tolerant);
                if (*str == ',') {
@@ -2205,6 +2209,11 @@ static struct dev_ext_attribute dev_attr_cmci_disabled = {
        &mce_cmci_disabled
 };
 
+static struct dev_ext_attribute dev_attr_bios_cmci_threshold = {
+       __ATTR(bios_cmci_threshold, 0444, device_show_int, NULL),
+       &mce_bios_cmci_threshold
+};
+
 static struct device_attribute *mce_device_attrs[] = {
        &dev_attr_tolerant.attr,
        &dev_attr_check_interval.attr,
@@ -2213,6 +2222,7 @@ static struct device_attribute *mce_device_attrs[] = {
        &dev_attr_dont_log_ce.attr,
        &dev_attr_ignore_ce.attr,
        &dev_attr_cmci_disabled.attr,
+       &dev_attr_bios_cmci_threshold.attr,
        NULL
 };