> From: Avadhut Naik <avadhut.n...@amd.com>
> [...]
> diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index
> 3b9970117a0f..3c86b838b541 100644
> --- a/arch/x86/include/asm/mce.h
> +++ b/arch/x86/include/asm/mce.h
> @@ -187,6 +187,14 @@ enum mce_notifier_prios {
>       MCE_PRIO_HIGHEST = MCE_PRIO_CEC
>  };
> 
> +/**
> + * struct mce_hw_err - Hardware Error Record.
> + * @m:               Machine Check record.
> + */
> +struct mce_hw_err {
> +     struct mce m;

The word 'mce' isn't too long. IMHO using 'mce' instead of 'm' as
a variable name is more meaningful :-).

    struct mce mce;
 
> [...]
> diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
> index 2a938f429c4d..d9d1af7227ce 100644
> --- a/arch/x86/kernel/cpu/mce/core.c
> +++ b/arch/x86/kernel/cpu/mce/core.c
> [...]
> 
>  /* Do initial initialization of a struct mce */

s/mce/mce_hw_err/

> -void mce_prep_record(struct mce *m)
> +void mce_prep_record(struct mce_hw_err *err)
>  {
> +     struct mce *m = &err->m;
> +
> +     memset(err, 0, sizeof(struct mce_hw_err));
>       mce_prep_record_common(m);
>       mce_prep_record_per_cpu(smp_processor_id(), m);  } @@ -148,9
> +149,9 @@ void mce_prep_record(struct mce *m)  DEFINE_PER_CPU(struct
> mce, injectm);  EXPORT_PER_CPU_SYMBOL_GPL(injectm);
> [...]
>  static __always_inline int
> -__mc_scan_banks(struct mce *m, struct pt_regs *regs, struct mce *final,
> +__mc_scan_banks(struct mce_hw_err *err, struct pt_regs *regs, struct mce 
> *final,

The 'final' parameter should also be a pointer to this_cpu_ptr(&hw_errs_seen).
So, it's the final value with an entire 'mce_hw_err' structure stored to 
' hw_errs_seen ',  not just a 'mce' structure got stored in 'hw_errs_seen'.

So,
   __mc_scan_banks(struct mce_hw_err *err, struct pt_regs *regs, struct 
mce_hw_err *final, ...

>               unsigned long *toclear, unsigned long *valid_banks, int 
> no_way_out,
>               int *worst)
> [...]

Reply via email to