Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull RAS fixes from Thomas Gleixner:
"Two small fixes for RAS/MCE:

- Serialize sysfs changes to avoid concurrent modificaiton of
underlying data

- Add microcode revision to Machine Check records. This should have
been there forever, but now with the broken microcode versions in
the wild it has become important"

* 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/MCE: Serialize sysfs changes
x86/MCE: Save microcode revision in machine check records

+25 -2
+1
arch/x86/include/uapi/asm/mce.h
··· 30 30 __u64 synd; /* MCA_SYND MSR: only valid on SMCA systems */ 31 31 __u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */ 32 32 __u64 ppin; /* Protected Processor Inventory Number */ 33 + __u32 microcode;/* Microcode revision */ 33 34 }; 34 35 35 36 #define MCE_GET_RECORD_LEN _IOR('M', 1, int)
+24 -2
arch/x86/kernel/cpu/mcheck/mce.c
··· 56 56 57 57 static DEFINE_MUTEX(mce_log_mutex); 58 58 59 + /* sysfs synchronization */ 60 + static DEFINE_MUTEX(mce_sysfs_mutex); 61 + 59 62 #define CREATE_TRACE_POINTS 60 63 #include <trace/events/mce.h> 61 64 ··· 133 130 134 131 if (this_cpu_has(X86_FEATURE_INTEL_PPIN)) 135 132 rdmsrl(MSR_PPIN, m->ppin); 133 + 134 + m->microcode = boot_cpu_data.microcode; 136 135 } 137 136 138 137 DEFINE_PER_CPU(struct mce, injectm); ··· 267 262 */ 268 263 pr_emerg(HW_ERR "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x microcode %x\n", 269 264 m->cpuvendor, m->cpuid, m->time, m->socketid, m->apicid, 270 - cpu_data(m->extcpu).microcode); 265 + m->microcode); 271 266 } 272 267 273 268 static void print_mce(struct mce *m) ··· 2091 2086 if (kstrtou64(buf, 0, &new) < 0) 2092 2087 return -EINVAL; 2093 2088 2089 + mutex_lock(&mce_sysfs_mutex); 2094 2090 if (mca_cfg.ignore_ce ^ !!new) { 2095 2091 if (new) { 2096 2092 /* disable ce features */ ··· 2104 2098 on_each_cpu(mce_enable_ce, (void *)1, 1); 2105 2099 } 2106 2100 } 2101 + mutex_unlock(&mce_sysfs_mutex); 2102 + 2107 2103 return size; 2108 2104 } 2109 2105 ··· 2118 2110 if (kstrtou64(buf, 0, &new) < 0) 2119 2111 return -EINVAL; 2120 2112 2113 + mutex_lock(&mce_sysfs_mutex); 2121 2114 if (mca_cfg.cmci_disabled ^ !!new) { 2122 2115 if (new) { 2123 2116 /* disable cmci */ ··· 2130 2121 on_each_cpu(mce_enable_ce, NULL, 1); 2131 2122 } 2132 2123 } 2124 + mutex_unlock(&mce_sysfs_mutex); 2125 + 2133 2126 return size; 2134 2127 } 2135 2128 ··· 2139 2128 struct device_attribute *attr, 2140 2129 const char *buf, size_t size) 2141 2130 { 2142 - ssize_t ret = device_store_int(s, attr, buf, size); 2131 + unsigned long old_check_interval = check_interval; 2132 + ssize_t ret = device_store_ulong(s, attr, buf, size); 2133 + 2134 + if (check_interval == old_check_interval) 2135 + return ret; 2136 + 2137 + if (check_interval < 1) 2138 + check_interval = 1; 2139 + 2140 + mutex_lock(&mce_sysfs_mutex); 2143 2141 mce_restart(); 2142 + mutex_unlock(&mce_sysfs_mutex); 2143 + 2144 2144 return ret; 2145 2145 } 2146 2146