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 tag 'linus-mce-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras

Pull a machine check recovery fix from Tony Luck.

I really don't like how the MCE code does some of the things it does,
but this does seem to be an improvement.

* tag 'linus-mce-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
x86/mce: Only restart instruction after machine check recovery if it is safe

+11 -3
+11 -3
arch/x86/kernel/cpu/mcheck/mce.c
··· 945 945 atomic_t inuse; 946 946 struct task_struct *t; 947 947 __u64 paddr; 948 + int restartable; 948 949 } mce_info[MCE_INFO_MAX]; 949 950 950 - static void mce_save_info(__u64 addr) 951 + static void mce_save_info(__u64 addr, int c) 951 952 { 952 953 struct mce_info *mi; 953 954 ··· 956 955 if (atomic_cmpxchg(&mi->inuse, 0, 1) == 0) { 957 956 mi->t = current; 958 957 mi->paddr = addr; 958 + mi->restartable = c; 959 959 return; 960 960 } 961 961 } ··· 1132 1130 mce_panic("Fatal machine check on current CPU", &m, msg); 1133 1131 if (worst == MCE_AR_SEVERITY) { 1134 1132 /* schedule action before return to userland */ 1135 - mce_save_info(m.addr); 1133 + mce_save_info(m.addr, m.mcgstatus & MCG_STATUS_RIPV); 1136 1134 set_thread_flag(TIF_MCE_NOTIFY); 1137 1135 } else if (kill_it) { 1138 1136 force_sig(SIGBUS, current); ··· 1181 1179 1182 1180 pr_err("Uncorrected hardware memory error in user-access at %llx", 1183 1181 mi->paddr); 1184 - if (memory_failure(pfn, MCE_VECTOR, MF_ACTION_REQUIRED) < 0) { 1182 + /* 1183 + * We must call memory_failure() here even if the current process is 1184 + * doomed. We still need to mark the page as poisoned and alert any 1185 + * other users of the page. 1186 + */ 1187 + if (memory_failure(pfn, MCE_VECTOR, MF_ACTION_REQUIRED) < 0 || 1188 + mi->restartable == 0) { 1185 1189 pr_err("Memory error not recovered"); 1186 1190 force_sig(SIGBUS, current); 1187 1191 }