From: Borislav Petkov <bp@alien8.de>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: "Raj, Ashok" <ashok.raj@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
Subject: Re: [Patch V0] x86, mce: Ensure offline CPU's don't participate in mce rendezvous process.
Date: Fri, 4 Dec 2015 18:36:33 +0100 [thread overview]
Message-ID: <20151204173633.GK21177@pd.tnic> (raw)
In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F39F78AD9@ORSMSX114.amr.corp.intel.com>
On Fri, Dec 04, 2015 at 05:23:18PM +0000, Luck, Tony wrote:
> > Franky, I'm not sure at all and very very wary of adding *any* code
> > which runs on an offlined CPU. Because *no one* does that and it hasn't
> > been tested at all. So who knows what happens.
> >
> > What we should be doing is execute the *minimal* amount of code possible
> > and get out. No counting, no per-cpu variables. No nothing.
>
> The minimal code requires we use:
>
> smp_processor_id() [to get our cpu number]
> cpu_is_offline() [to find out the cpu is offline]
>
> The first of those looks more dangerous in that it accesses a per-cpu variable.
>
> I don't think we need to be totally paranoid here. We know that the offline cpus
> were once online and went through normal kernel initialization code (if they didn't,
> then we can't possibly be executing this code ... their CR4.MCE bit would be zero so their
> response to a machine check would have been to reset the system).
I don't mean that - I mean the stuff we do before we call
cpu_is_offline() like ist_enter, this_cpu_inc(mce_exception_count),
etc. Then we do a whole another bunch of stuff at the "out:" label like
printk and whatnot which shouldn't run on an offlined CPU.
I.e., the check whether a CPU is offline should be the first thing we do
in do_machine_check and get the hell out if so.
> Agreed. It would be more pleasant if we had some way to *really* offline a cpu,
> including telling the rest of the system not to send it any more broadcast events
> like MCE, SMI. But the h/w guys like to give the s/w guys job security by making
> these corner cases that we have to work around in s/w :-)
Mind you, this is unintentional from the hw guys. But ha(!), I know
*exactly* what you mean.
:-)
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
next prev parent reply other threads:[~2015-12-04 17:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-04 0:16 [Patch V0] x86, mce: Ensure offline CPU's don't participate in mce rendezvous process Ashok Raj
2015-12-03 23:34 ` Greg KH
2015-12-04 14:34 ` Borislav Petkov
2015-12-04 17:14 ` Raj, Ashok
2015-12-04 16:51 ` Borislav Petkov
2015-12-04 17:23 ` Luck, Tony
2015-12-04 17:36 ` Borislav Petkov [this message]
2015-12-04 17:53 ` Luck, Tony
2015-12-04 18:00 ` Borislav Petkov
2015-12-04 18:30 ` Luck, Tony
2015-12-04 19:38 ` Borislav Petkov
2015-12-04 22:34 ` Andy Lutomirski
2015-12-05 0:08 ` Raj, Ashok
2015-12-04 23:14 ` Andy Lutomirski
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=20151204173633.GK21177@pd.tnic \
--to=bp@alien8.de \
--cc=ashok.raj@intel.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
/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