aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2012-07-11 13:20:47 -0400
committerTony Luck <tony.luck@intel.com>2012-07-11 13:20:47 -0400
commit6751ed65dc6642af64f7b8a440a75563c8aab7ae (patch)
tree8736d4c2b3aa00c6a4f39d2e6cba4805720c2874 /arch/x86/kernel
parent6887a4131da3adaab011613776d865f4bcfb5678 (diff)
x86/mce: Fix siginfo_t->si_addr value for non-recoverable memory faults
In commit dad1743e5993f1 ("x86/mce: Only restart instruction after machine check recovery if it is safe") we fixed mce_notify_process() to force a signal to the current process if it was not restartable (RIPV bit not set in MCG_STATUS). But doing it here means that the process doesn't get told the virtual address of the fault via siginfo_t->si_addr. This would prevent application level recovery from the fault. Make a new MF_MUST_KILL flag bit for memory_failure() et al. to use so that we will provide the right information with the signal. Signed-off-by: Tony Luck <tony.luck@intel.com> Acked-by: Borislav Petkov <borislav.petkov@amd.com> Cc: stable@kernel.org # 3.4+
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index da27c5d2168..c46ed494f00 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1186,6 +1186,7 @@ void mce_notify_process(void)
1186{ 1186{
1187 unsigned long pfn; 1187 unsigned long pfn;
1188 struct mce_info *mi = mce_find_info(); 1188 struct mce_info *mi = mce_find_info();
1189 int flags = MF_ACTION_REQUIRED;
1189 1190
1190 if (!mi) 1191 if (!mi)
1191 mce_panic("Lost physical address for unconsumed uncorrectable error", NULL, NULL); 1192 mce_panic("Lost physical address for unconsumed uncorrectable error", NULL, NULL);
@@ -1200,8 +1201,9 @@ void mce_notify_process(void)
1200 * doomed. We still need to mark the page as poisoned and alert any 1201 * doomed. We still need to mark the page as poisoned and alert any
1201 * other users of the page. 1202 * other users of the page.
1202 */ 1203 */
1203 if (memory_failure(pfn, MCE_VECTOR, MF_ACTION_REQUIRED) < 0 || 1204 if (!mi->restartable)
1204 mi->restartable == 0) { 1205 flags |= MF_MUST_KILL;
1206 if (memory_failure(pfn, MCE_VECTOR, flags) < 0) {
1205 pr_err("Memory error not recovered"); 1207 pr_err("Memory error not recovered");
1206 force_sig(SIGBUS, current); 1208 force_sig(SIGBUS, current);
1207 } 1209 }