[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-86d2eac5a7045933a88c97f0453f22106bb90b54@git.kernel.org>
Date: Wed, 14 Jun 2017 02:19:09 -0700
From: tip-bot for Borislav Petkov <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
bp@...e.de, mingo@...nel.org, yazen.ghannam@....com,
tony.luck@...el.com, hpa@...or.com, bp@...en8.de,
tglx@...utronix.de, peterz@...radead.org
Subject: [tip:ras/core] x86/mce/mce-inject: Preset the MCE injection struct
Commit-ID: 86d2eac5a7045933a88c97f0453f22106bb90b54
Gitweb: http://git.kernel.org/tip/86d2eac5a7045933a88c97f0453f22106bb90b54
Author: Borislav Petkov <bp@...e.de>
AuthorDate: Tue, 13 Jun 2017 18:28:33 +0200
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Wed, 14 Jun 2017 07:32:09 +0200
x86/mce/mce-inject: Preset the MCE injection struct
Populate the MCE injection struct before doing initial injection so that
values which don't change have sane defaults.
Tested-by: Yazen Ghannam <yazen.ghannam@....com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Acked-by: Yazen Ghannam <yazen.ghannam@....com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Tony Luck <tony.luck@...el.com>
Link: http://lkml.kernel.org/r/20170613162835.30750-7-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/kernel/cpu/mcheck/mce-inject.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
index 00af8dd..231ad23 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
@@ -103,6 +103,13 @@ DEFINE_SIMPLE_ATTRIBUTE(misc_fops, inj_misc_get, inj_misc_set, "%llx\n");
DEFINE_SIMPLE_ATTRIBUTE(addr_fops, inj_addr_get, inj_addr_set, "%llx\n");
DEFINE_SIMPLE_ATTRIBUTE(synd_fops, inj_synd_get, inj_synd_set, "%llx\n");
+static void setup_inj_struct(struct mce *m)
+{
+ memset(m, 0, sizeof(struct mce));
+
+ m->cpuvendor = boot_cpu_data.x86_vendor;
+}
+
/* Update fake mce registers on current CPU. */
static void inject_mce(struct mce *m)
{
@@ -700,6 +707,8 @@ static int __init inject_init(void)
register_nmi_handler(NMI_LOCAL, mce_raise_notify, 0, "mce_notify");
mce_register_injector_chain(&inject_nb);
+ setup_inj_struct(&i_mce);
+
pr_info("Machine check injector initialized\n");
return 0;
Powered by blists - more mailing lists