Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14c0abf1 authored by Huang Ying's avatar Huang Ying Committed by Ingo Molnar
Browse files

x86: mce, inject: Use real inject-msg in raise_local



Current raise_local() uses a struct mce that comes from mce_write()
as a parameter instead of the real inject-msg, so when we set
mce.finished = 0 to clear injected MCE, the real inject stays
valid.

This will cause the remaining inject-msg affect the next injection,
which is not desired.

To fix this, real inject-msg is used in raise_local instead of the
one on the stack.

This patch is based on the diagnosis and the fixes by Dean Nelson.

Reported-by: default avatarDean Nelson <dnelson@redhat.com>
Signed-off-by: default avatarHuang Ying <ying.huang@intel.com>
Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <1253601357.15717.757.camel@yhuang-dev.sh.intel.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b417c9fd
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -98,8 +98,9 @@ static struct notifier_block mce_raise_nb = {
};
};


/* Inject mce on current CPU */
/* Inject mce on current CPU */
static int raise_local(struct mce *m)
static int raise_local(void)
{
{
	struct mce *m = &__get_cpu_var(injectm);
	int context = MCJ_CTX(m->inject_flags);
	int context = MCJ_CTX(m->inject_flags);
	int ret = 0;
	int ret = 0;
	int cpu = m->extcpu;
	int cpu = m->extcpu;
@@ -167,12 +168,12 @@ static void raise_mce(struct mce *m)
			}
			}
			cpu_relax();
			cpu_relax();
		}
		}
		raise_local(m);
		raise_local();
		put_cpu();
		put_cpu();
		put_online_cpus();
		put_online_cpus();
	} else
	} else
#endif
#endif
		raise_local(m);
		raise_local();
}
}


/* Error injection interface */
/* Error injection interface */