[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0c903e3b-093e-461a-aa70-c2d58fc6d82d@amd.com>
Date: Mon, 8 Apr 2024 14:47:52 -0500
From: "Naik, Avadhut" <avadnaik@....com>
To: "Luck, Tony" <tony.luck@...el.com>, Yazen Ghannam <yazen.ghannam@....com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"Avadhut.Naik@....com" <Avadhut.Naik@....com>,
"John.Allen@....com" <John.Allen@....com>,
"linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>
Subject: Re: [PATCH v2 16/16] EDAC/mce_amd: Add support for FRU Text in MCA
On 4/5/2024 11:06, Luck, Tony wrote:
>> diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
>> index aa27729f7899..a4d09dda5fae 100644
>> --- a/arch/x86/kernel/cpu/mce/core.c
>> +++ b/arch/x86/kernel/cpu/mce/core.c
>> @@ -207,6 +207,8 @@ static void __print_mce(struct mce_hw_err *err)
>> pr_cont("SYND2 %llx ", err->vi.amd.synd2);
>> if (m->ipid)
>> pr_cont("IPID %llx ", m->ipid);
>> + if (err->vi.amd.config)
>
> This is in common code. If other vendors start adding their own stuff to the
> "vi" union you might incorrectly print this. Add a vendor check before looking
> at values inside "m->vi".
>
Do we really need an explicit vendor check in this particular instance?
Below is a snippet from __print_mce() after applying this series:
if (mce_flags.smca) {
if (m->synd)
pr_cont("SYND %llx ", m->synd);
if (err->vi.amd.synd1)
pr_cont("SYND1 %llx ", err->vi.amd.synd1);
if (err->vi.amd.synd2)
pr_cont("SYND2 %llx ", err->vi.amd.synd2);
if (m->ipid)
pr_cont("IPID %llx ", m->ipid);
if (err->vi.amd.config)
pr_cont("CONFIG %llx ", err->vi.amd.config);
}
pr_cont("\n");
All of the above registers including the newly added config MSR will only
be logged if the smca flag is set in mce_flags.
Doesn't that already serve as a vendor check of sorts?
Something that I am missing here?
--
Thanks,
Avadhut Naik
Powered by blists - more mailing lists