aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2018-02-21 05:18:54 -0500
committerIngo Molnar <mingo@kernel.org>2018-02-21 11:00:53 -0500
commit09933946643bcc8e0a9bd4ede192ed854e22db8f (patch)
treed9facec29ce4fa17c8f683e23d87f814b64c63ee
parenta189c03235639a31343215f82b83b49985c55336 (diff)
x86/mce: Convert 'struct mca_config' bools to a bitfield
... to save space when future flags are added. No functionality change. Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Borislav Petkov <bp@alien8.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Cc: linux-edac <linux-edac@vger.kernel.org> Link: http://lkml.kernel.org/r/20180221101900.10326-3-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-internal.h13
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c16
2 files changed, 16 insertions, 13 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce-internal.h b/arch/x86/kernel/cpu/mcheck/mce-internal.h
index ed3c5aee22cf..374d1aa66952 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-internal.h
+++ b/arch/x86/kernel/cpu/mcheck/mce-internal.h
@@ -131,12 +131,15 @@ static inline void mce_unmap_kpfn(unsigned long pfn) {}
131struct mca_config { 131struct mca_config {
132 bool dont_log_ce; 132 bool dont_log_ce;
133 bool cmci_disabled; 133 bool cmci_disabled;
134 bool lmce_disabled;
135 bool ignore_ce; 134 bool ignore_ce;
136 bool disabled; 135
137 bool ser; 136 __u64 lmce_disabled : 1,
138 bool recovery; 137 disabled : 1,
139 bool bios_cmci_threshold; 138 ser : 1,
139 recovery : 1,
140 bios_cmci_threshold : 1,
141 __reserved : 59;
142
140 u8 banks; 143 u8 banks;
141 s8 bootlog; 144 s8 bootlog;
142 int tolerant; 145 int tolerant;
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 8ff94d1e2dce..db5b1e4ebfd8 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1511,7 +1511,7 @@ static int __mcheck_cpu_cap_init(void)
1511 mca_cfg.rip_msr = MSR_IA32_MCG_EIP; 1511 mca_cfg.rip_msr = MSR_IA32_MCG_EIP;
1512 1512
1513 if (cap & MCG_SER_P) 1513 if (cap & MCG_SER_P)
1514 mca_cfg.ser = true; 1514 mca_cfg.ser = 1;
1515 1515
1516 return 0; 1516 return 0;
1517} 1517}
@@ -1819,12 +1819,12 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)
1819 return; 1819 return;
1820 1820
1821 if (__mcheck_cpu_cap_init() < 0 || __mcheck_cpu_apply_quirks(c) < 0) { 1821 if (__mcheck_cpu_cap_init() < 0 || __mcheck_cpu_apply_quirks(c) < 0) {
1822 mca_cfg.disabled = true; 1822 mca_cfg.disabled = 1;
1823 return; 1823 return;
1824 } 1824 }
1825 1825
1826 if (mce_gen_pool_init()) { 1826 if (mce_gen_pool_init()) {
1827 mca_cfg.disabled = true; 1827 mca_cfg.disabled = 1;
1828 pr_emerg("Couldn't allocate MCE records pool!\n"); 1828 pr_emerg("Couldn't allocate MCE records pool!\n");
1829 return; 1829 return;
1830 } 1830 }
@@ -1902,11 +1902,11 @@ static int __init mcheck_enable(char *str)
1902 if (*str == '=') 1902 if (*str == '=')
1903 str++; 1903 str++;
1904 if (!strcmp(str, "off")) 1904 if (!strcmp(str, "off"))
1905 cfg->disabled = true; 1905 cfg->disabled = 1;
1906 else if (!strcmp(str, "no_cmci")) 1906 else if (!strcmp(str, "no_cmci"))
1907 cfg->cmci_disabled = true; 1907 cfg->cmci_disabled = true;
1908 else if (!strcmp(str, "no_lmce")) 1908 else if (!strcmp(str, "no_lmce"))
1909 cfg->lmce_disabled = true; 1909 cfg->lmce_disabled = 1;
1910 else if (!strcmp(str, "dont_log_ce")) 1910 else if (!strcmp(str, "dont_log_ce"))
1911 cfg->dont_log_ce = true; 1911 cfg->dont_log_ce = true;
1912 else if (!strcmp(str, "ignore_ce")) 1912 else if (!strcmp(str, "ignore_ce"))
@@ -1914,9 +1914,9 @@ static int __init mcheck_enable(char *str)
1914 else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog")) 1914 else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog"))
1915 cfg->bootlog = (str[0] == 'b'); 1915 cfg->bootlog = (str[0] == 'b');
1916 else if (!strcmp(str, "bios_cmci_threshold")) 1916 else if (!strcmp(str, "bios_cmci_threshold"))
1917 cfg->bios_cmci_threshold = true; 1917 cfg->bios_cmci_threshold = 1;
1918 else if (!strcmp(str, "recovery")) 1918 else if (!strcmp(str, "recovery"))
1919 cfg->recovery = true; 1919 cfg->recovery = 1;
1920 else if (isdigit(str[0])) { 1920 else if (isdigit(str[0])) {
1921 if (get_option(&str, &cfg->tolerant) == 2) 1921 if (get_option(&str, &cfg->tolerant) == 2)
1922 get_option(&str, &(cfg->monarch_timeout)); 1922 get_option(&str, &(cfg->monarch_timeout));
@@ -2381,7 +2381,7 @@ device_initcall_sync(mcheck_init_device);
2381 */ 2381 */
2382static int __init mcheck_disable(char *str) 2382static int __init mcheck_disable(char *str)
2383{ 2383{
2384 mca_cfg.disabled = true; 2384 mca_cfg.disabled = 1;
2385 return 1; 2385 return 1;
2386} 2386}
2387__setup("nomce", mcheck_disable); 2387__setup("nomce", mcheck_disable);