> ---
>
> MCE: Add an debugfs interface to force MCA recovery
>
> This is useful to run the MCA recovery test cases using
> error injection on a non MCA recovery capable system.
>
> On a system without MCA recovery this should be a nop.
>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
>
> ---
> arch/x86/kernel/cpu/mcheck/mce.c | 20 ++++++++++++++++++--
> 1 file changed, 18 insertions(+), 2 deletions(-)
>
> Index: linux/arch/x86/kernel/cpu/mcheck/mce.c
> ===================================================================
> --- linux.orig/arch/x86/kernel/cpu/mcheck/mce.c
> +++ linux/arch/x86/kernel/cpu/mcheck/mce.c
> @@ -2346,13 +2346,26 @@ static int fake_panic_set(void *data, u6
> fake_panic = val;
> return 0;
> }
> +static int mca_recovery_get(void *data, u64 *val)
> +{
> + *val = mce_ser;
> + return 0;
> +}
> +
> +static int mca_recovery_set(void *data, u64 val)
> +{
> + mce_ser = val;
> + return 0;
> +}
>
> DEFINE_SIMPLE_ATTRIBUTE(fake_panic_fops, fake_panic_get,
> fake_panic_set, "%llu\n");
> +DEFINE_SIMPLE_ATTRIBUTE(mca_recovery_fops, mca_recovery_get,
> + mca_recovery_set, "%llu\n");
>
> static int __init mcheck_debugfs_init(void)
> {
> - struct dentry *dmce, *ffake_panic;
> + struct dentry *dmce, *ffake_panic, *fmca_recovery;
>
> dmce = mce_get_debugfs_dir();
> if (!dmce)
> @@ -2361,7 +2374,10 @@ static int __init mcheck_debugfs_init(vo
> &fake_panic_fops);
> if (!ffake_panic)
> return -ENOMEM;
> -
> + fmca_recovery = debugfs_create_file("mca_recovery_force",0644,dmce,NULL,
> + &mca_recovery_fops);
> + if (!fmca_recovery)
> + return -ENOMEM;
> return 0;
> }
> late_initcall(mcheck_debugfs_init);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to
majordomo@vger.kernel.org
> More majordomo info at
http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at
http://www.tux.org/lkml/
>
>