summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2012-07-11 10:20:47 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-09 08:31:29 -0700
commit7b689c5d930f281e417597af9f817ba03dc9d898 (patch)
tree75bb26f8fc89a58f25377e60cf2af6879fb795b0 /arch
parent2830f9a08c084bcf40819942f04d0ca500faf4b8 (diff)
downloadlinux-3.10-7b689c5d930f281e417597af9f817ba03dc9d898.tar.gz
linux-3.10-7b689c5d930f281e417597af9f817ba03dc9d898.tar.bz2
linux-3.10-7b689c5d930f281e417597af9f817ba03dc9d898.zip
x86/mce: Fix siginfo_t->si_addr value for non-recoverable memory faults
commit 6751ed65dc6642af64f7b8a440a75563c8aab7ae upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-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 61604aefc40..0d2db0e7caf 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1180,6 +1180,7 @@ void mce_notify_process(void)
{
unsigned long pfn;
struct mce_info *mi = mce_find_info();
+ int flags = MF_ACTION_REQUIRED;
if (!mi)
mce_panic("Lost physical address for unconsumed uncorrectable error", NULL, NULL);
@@ -1194,8 +1195,9 @@ void mce_notify_process(void)
* doomed. We still need to mark the page as poisoned and alert any
* other users of the page.
*/
- if (memory_failure(pfn, MCE_VECTOR, MF_ACTION_REQUIRED) < 0 ||
- mi->restartable == 0) {
+ if (!mi->restartable)
+ flags |= MF_MUST_KILL;
+ if (memory_failure(pfn, MCE_VECTOR, flags) < 0) {
pr_err("Memory error not recovered");
force_sig(SIGBUS, current);
}