From: tip-bot for Borislav Petkov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, hpa@zytor.com, bp@suse.de,
linux-kernel@vger.kernel.org, mingo@kernel.org
Subject: [tip:ras/core] x86/mce-inject: Reset injection struct after injection
Date: Fri, 21 Sep 2018 05:33:50 -0700 [thread overview]
Message-ID: <tip-7401a633c34adc7aefd3edfec60074cb0475a3e8@git.kernel.org> (raw)
In-Reply-To: <20180905081954.10391-1-bp@alien8.de>
Commit-ID: 7401a633c34adc7aefd3edfec60074cb0475a3e8
Gitweb: https://git.kernel.org/tip/7401a633c34adc7aefd3edfec60074cb0475a3e8
Author: Borislav Petkov <bp@suse.de>
AuthorDate: Tue, 4 Sep 2018 11:22:12 +0200
Committer: Borislav Petkov <bp@suse.de>
CommitDate: Fri, 21 Sep 2018 14:28:37 +0200
x86/mce-inject: Reset injection struct after injection
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: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20180905081954.10391-1-bp@alien8.de
---
arch/x86/kernel/cpu/mcheck/mce-inject.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
index c805a06e14c3..1fc424c40a31 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
@@ -108,6 +108,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. */
@@ -576,6 +579,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;
}
prev parent reply other threads:[~2018-09-21 12:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-05 8:19 [PATCH] x86/mce-inject: Reset struct after injection Borislav Petkov
2018-09-21 12:33 ` tip-bot for Borislav Petkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-7401a633c34adc7aefd3edfec60074cb0475a3e8@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@suse.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).