From: "Luck, Tony" <tony.luck@intel.com>
To: Borislav Petkov <bp@suse.de>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <andi.kleen@intel.com>
Subject: Re: [PATCH 1/2] x86/mce: Include the PPIN in machine check records when it is available
Date: Fri, 18 Nov 2016 08:42:04 -0800 [thread overview]
Message-ID: <20161118164204.GA10543@intel.com> (raw)
In-Reply-To: <20161118130022.vcnodxrslg6khycc@pd.tnic>
On Fri, Nov 18, 2016 at 02:00:22PM +0100, Borislav Petkov wrote:
> On Thu, Nov 17, 2016 at 04:35:48PM -0800, Luck, Tony wrote:
> > @@ -2134,8 +2140,37 @@ static int __init mcheck_enable(char *str)
> > }
> > __setup("mce", mcheck_enable);
> >
> > +static void mcheck_intel_ppin_init(void)
>
> So this functionality could all be moved to arch/x86/kernel/cpu/intel.c
> where you could set an artificial X86_FEATURE_PPIN and get rid of the
> have_ppin var.
Ok - will do.
> > + switch (boot_cpu_data.x86_model) {
> > + case INTEL_FAM6_IVYBRIDGE_X:
> > + case INTEL_FAM6_HASWELL_X:
> > + case INTEL_FAM6_BROADWELL_XEON_D:
> > + case INTEL_FAM6_BROADWELL_X:
> > + case INTEL_FAM6_SKYLAKE_X:
> > + if (rdmsrl_safe(MSR_PPIN_CTL, &msr_ppin_ctl))
> > + return;
>
> I don't think you need to check models - if the RDMSR fails, you're
> done.
Other models may use this MSR number for some other purpose. So the
read might succeed, but what I get might be something else entirely.
Technically with the model check I shouldn't have to use the _safe
versions ... but I'm paranoid that some SKUs might not implement this.
> > + if (msr_ppin_ctl == 1) {
>
> & BIT_ULL(0)
>
> for future robustness in case those other reserved bits get used.
Unlikely ... but paranoia is good (see above about using rdmsr_safe).
> > + pr_info("PPIN available but disabled\n");
>
> We don't care, do we?
Probably not ... there might be a BIOS setting, but the user that
finds they aren't getting PPIN in their logs could diagnose by making
their own rdmsr checks ... will delete this pr_info().
> > + return;
> > + }
> > + /* if PPIN is disabled, but not locked, try to enable */
> > + if (msr_ppin_ctl == 0) {
>
> Also, properly masked off. There are [63:2] reserved bits which might be
> assigned someday.
Ok.
> > + wrmsrl_safe(MSR_PPIN_CTL, 2);
> > + rdmsrl_safe(MSR_PPIN_CTL, &msr_ppin_ctl);
>
> Why aren't we programming a number here? Or are users supposed to do
> that?
>
> If so, please design a proper sysfs interface and not make them use
> msr-tools.
The PPIN is programmed at the fab. To the user it is just a handy
unique number. I think Intel can decode it back to which fab and
production run this chip came from (useful to us if there are many
chips reporting some error).
> > + }
> > + if (msr_ppin_ctl == 2)
> > + have_ppin = 1;
>
> set_cpu_cap(c, X86_FEATURE_PPIN);
Yes - that looks prettier.
Thanks
-Tony
next prev parent reply other threads:[~2016-11-18 16:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 0:35 [PATCH 2/2] mcelog: Print the PPIN in machine check records when it is available Luck, Tony
2016-11-18 0:35 ` [PATCH 1/2] x86/mce: Include " Luck, Tony
2016-11-18 13:00 ` Borislav Petkov
2016-11-18 16:42 ` Luck, Tony [this message]
2016-11-18 17:02 ` Andi Kleen
2016-11-18 17:45 ` Borislav Petkov
2016-11-18 17:48 ` [PATCH v2] " Luck, Tony
2016-11-23 11:48 ` Borislav Petkov
2016-11-23 13:29 ` Henrique de Moraes Holschuh
2016-11-23 13:37 ` Borislav Petkov
2016-11-23 14:05 ` Borislav Petkov
2016-11-23 16:42 ` Tony Luck
2016-11-23 16:55 ` Borislav Petkov
2016-11-23 17:29 ` Henrique de Moraes Holschuh
2016-11-23 20:56 ` Tony Luck
2016-11-24 11:20 ` Henrique de Moraes Holschuh
2016-11-23 15:58 ` [tip:ras/core] x86/mce: Include the PPIN in MCE records when available tip-bot for Tony Luck
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=20161118164204.GA10543@intel.com \
--to=tony.luck@intel.com \
--cc=andi.kleen@intel.com \
--cc=bp@suse.de \
--cc=linux-kernel@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).