提交 098e12f3 编写于 作者: B Borislav Petkov 提交者: Greg Kroah-Hartman

x86/mce-inject: Reset injection struct after injection

[ Upstream commit 7401a633c34adc7aefd3edfec60074cb0475a3e8 ]

Clear the MCE struct which is used for collecting the injection details
after injection.

Also, populate it with more details from the machine.
Signed-off-by: NBorislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20180905081954.10391-1-bp@alien8.deSigned-off-by: NSasha Levin <sashal@kernel.org>
上级 aa190837
......@@ -106,6 +106,9 @@ static void setup_inj_struct(struct mce *m)
memset(m, 0, sizeof(struct mce));
m->cpuvendor = boot_cpu_data.x86_vendor;
m->time = ktime_get_real_seconds();
m->cpuid = cpuid_eax(1);
m->microcode = boot_cpu_data.microcode;
}
/* Update fake mce registers on current CPU. */
......@@ -580,6 +583,9 @@ static int inj_bank_set(void *data, u64 val)
m->bank = val;
do_inject();
/* Reset injection struct */
setup_inj_struct(&i_mce);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册