[Patch V1 2/3] x86, mce: Refactor parts of mce_log() to reuse when logging from offline CPUs
From: Ashok Raj
Date: Thu Sep 24 2015 - 00:50:11 EST
Simply refactoring part of mce_log() to facilitate logging from offline
CPUs.
Signed-off-by: Ashok Raj <ashok.raj@xxxxxxxxx>
Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx>
---
arch/x86/kernel/cpu/mcheck/mce.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 48bd244..2df073d 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -152,16 +152,10 @@ static struct mce_log mcelog = {
.recordlen = sizeof(struct mce),
};
-void mce_log(struct mce *mce)
+static void mce_log_add(struct mce *mce)
{
unsigned next, entry;
- /* Emit the trace record: */
- trace_mce_record(mce);
-
- if (!mce_gen_pool_add(mce))
- irq_work_queue(&mce_irq_work);
-
mce->finished = 0;
wmb();
for (;;) {
@@ -199,6 +193,19 @@ void mce_log(struct mce *mce)
set_bit(0, &mce_need_notify);
}
+void mce_log(struct mce *mce)
+{
+ unsigned next, entry;
+
+ /* Emit the trace record: */
+ trace_mce_record(mce);
+
+ if (!mce_gen_pool_add(mce))
+ irq_work_queue(&mce_irq_work);
+
+ mce_log_add(mce);
+}
+
void mce_inject_log(struct mce *m)
{
mutex_lock(&mce_chrdev_read_mutex);
--
2.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/