LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Ghannam, Yazen" <Yazen.Ghannam@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"tony.luck@intel.com" <tony.luck@intel.com>,
"x86@kernel.org" <x86@kernel.org>
Subject: RE: [PATCH] x86/MCE, EDAC/mce_amd: Save all aux registers on SMCA systems
Date: Fri, 20 Apr 2018 13:05:17 +0000 [thread overview]
Message-ID: <CY4PR12MB155779EEC2894B501F30292EF8B40@CY4PR12MB1557.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20180418171347.GH4795@pd.tnic>
> -----Original Message-----
> From: Borislav Petkov <bp@alien8.de>
> Sent: Wednesday, April 18, 2018 1:14 PM
> To: Ghannam, Yazen <Yazen.Ghannam@amd.com>
> Cc: linux-edac@vger.kernel.org; linux-kernel@vger.kernel.org;
> tony.luck@intel.com; x86@kernel.org
> Subject: Re: [PATCH] x86/MCE, EDAC/mce_amd: Save all aux registers on
> SMCA systems
>
> On Tue, Apr 17, 2018 at 06:30:34PM +0000, Ghannam, Yazen wrote:
> > We could but it's an issue of documentation and testing the older systems.
> >
> > My first pass at this was to unconditionally read the registers because my
> > understanding was that registers that aren't accessible would be read-as-
> zero.
> > I thought this was a common MCA implementation. But Tony pointed out
> that
> > this isn't the case on Intel systems. This is the case on recent AMD systems.
> But
> > I don't know if it's the case on older systems which may or may not have
> > followed the Intel implementation more closely.
>
> So if our worry is the #GPs, we can always use the rdmsr*_safe()
> variants and look at the return value. And dump a invalid value like
> 0xdeadbeef or so, if the read failed.
>
> But if any bit of info we've gotten this way, helps us debug an MCE,
> we're already golden!
>
Okay, I can do that. What about using mce_rdmsrl()? The value gets set to
0 and a user gets a single warning. This may be more clear to the user. Also,
it shouldn't affect code that checks for non-zero values, like in __print_mce().
> > For example,
> >
> > Deferred error occurs:
> > - MCA_{STATUS,ADDR,DESTAT,DEADDR} all have valid data.
> >
> > MCE occurs
> > - MCA_{STATUS,ADDR} are overwritten with non-zero data.
> > - MCE handler clears MCA_STATUS. MCA_ADDR is non-zero.
> >
> > DFR handler finds MCA_STATUS[Deferred] is clear, so it saves
> > MCA_DESTAT and MCA_DEADDR which is 0.
> >
> > If !m->addr (which has MCA_DEADDR), then we read MCA_STATUS
> > which has the address from the MCE.
>
> The code could use a shorter version of this as a comment to state why
> we're doing it. Because it is not obvious.
>
Yes, will do.
Thanks,
Yazen
next prev parent reply other threads:[~2018-04-20 13:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-02 19:57 Yazen Ghannam
2018-04-17 17:21 ` Borislav Petkov
2018-04-17 18:30 ` Ghannam, Yazen
2018-04-18 17:13 ` Borislav Petkov
2018-04-20 13:05 ` Ghannam, Yazen [this message]
2018-04-20 18:03 ` Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CY4PR12MB155779EEC2894B501F30292EF8B40@CY4PR12MB1557.namprd12.prod.outlook.com \
--to=yazen.ghannam@amd.com \
--cc=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--subject='RE: [PATCH] x86/MCE, EDAC/mce_amd: Save all aux registers on SMCA systems' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).