[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY8PR11MB713406B2C492D55428397AFA89452@CY8PR11MB7134.namprd11.prod.outlook.com>
Date: Tue, 15 Oct 2024 06:53:41 +0000
From: "Zhuo, Qiuxu" <qiuxu.zhuo@...el.com>
To: Avadhut Naik <avadhut.naik@....com>, "x86@...nel.org" <x86@...nel.org>,
"linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
"linux-trace-kernel@...r.kernel.org" <linux-trace-kernel@...r.kernel.org>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"bp@...en8.de" <bp@...en8.de>, "Luck, Tony" <tony.luck@...el.com>,
"rafael@...nel.org" <rafael@...nel.org>, "tglx@...utronix.de"
<tglx@...utronix.de>, "mingo@...hat.com" <mingo@...hat.com>,
"rostedt@...dmis.org" <rostedt@...dmis.org>, "lenb@...nel.org"
<lenb@...nel.org>, "mchehab@...nel.org" <mchehab@...nel.org>,
"james.morse@....com" <james.morse@....com>, "airlied@...il.com"
<airlied@...il.com>, "yazen.ghannam@....com" <yazen.ghannam@....com>,
"john.allen@....com" <john.allen@....com>, "avadnaik@....com"
<avadnaik@....com>
Subject: RE: [PATCH v5 1/5] x86/mce: Add wrapper for struct mce to export
vendor specific info
> From: Avadhut Naik <avadhut.naik@....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)
> [...]
Powered by blists - more mailing lists