diff --git a/arch/x86/kernel/cpu/mcheck/mce-internal.h b/arch/x86/kernel/cpu/mcheck/mce-internal.h index ea8b62264c14708cdcf123a6b8af3dbfa75ffe22..547720efd923f0f64c5ce30ef2dff9b6cccf7805 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-internal.h +++ b/arch/x86/kernel/cpu/mcheck/mce-internal.h @@ -79,3 +79,5 @@ static inline int apei_clear_mce(u64 record_id) return -EINVAL; } #endif + +void mce_inject_log(struct mce *m); diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index b979711452a557bc5b8d51c49a4a464b2d9e73c6..e4e6646cac4644116cf3b1875af5ab5e8c0766b6 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -199,6 +199,14 @@ void mce_log(struct mce *mce) set_bit(0, &mce_need_notify); } +void mce_inject_log(struct mce *m) +{ + mutex_lock(&mce_chrdev_read_mutex); + mce_log(m); + mutex_unlock(&mce_chrdev_read_mutex); +} +EXPORT_SYMBOL_GPL(mce_inject_log); + static struct notifier_block mce_srao_nb; void mce_register_decode_chain(struct notifier_block *nb)