[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY8PR11MB71344BDC1A3AB4454FE9446A89412@CY8PR11MB7134.namprd11.prod.outlook.com>
Date: Sat, 19 Oct 2024 07:37:05 +0000
From: "Zhuo, Qiuxu" <qiuxu.zhuo@...el.com>
To: "Mehta, Sohil" <sohil.mehta@...el.com>, "Luck, Tony"
<tony.luck@...el.com>, "bp@...en8.de" <bp@...en8.de>
CC: "tglx@...utronix.de" <tglx@...utronix.de>, "dave.hansen@...ux.intel.com"
<dave.hansen@...ux.intel.com>, "mingo@...hat.com" <mingo@...hat.com>,
"hpa@...or.com" <hpa@...or.com>, "x86@...nel.org" <x86@...nel.org>,
"linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2 08/10] x86/mce: Remove the redundant zeroing
assignments
> From: Mehta, Sohil <sohil.mehta@...el.com>
> [...]
> > @@ -1284,8 +1282,6 @@ __mc_scan_banks(struct mce *m, struct pt_regs
> *regs, struct mce *final,
> > if (!mce_banks[i].ctl)
> > continue;
> >
> > - m->misc = 0;
> > - m->addr = 0;
> > m->bank = i;
> >
>
> However, in this case, I am not fully convinced if the misc and addr would
> already be 0 when we reach here.
>
> There are potentially a lot of things that happen in do_machine_check()
> between mce_gather_info() and __mc_scan_banks(). Especially,
> mce_no_way_out() which could theoretically call mce_read_aux() in some
> cases.
>
> Maybe it doesn't matter, misc and addr would be overwritten anyway. But I
> feel some more details in the commit message would be useful. It doesn't
> seem as simple as the brief description makes it sound (at least to me).
>
Your concern is reasonable. Thanks!
For both diffs, mce->misc and mce->addr can be guaranteed to be zeroed the first time
they reach here. However, I didn't notice that both diffs were in a for() loop where
mce->misc and mce->addr could retain the old values assigned by mce_read_aux() in
the previous iteration. So need to zero mce-misc and mce->addr in each iteration to
ensure they don't contain stale values.
I'll drop this patch in the next version.
-Qiuxu
Powered by blists - more mailing lists