Re: [RFC PATCH 06/16] x86/split_lock: Save #AC setting for split lock in firmware in boot time and restore the setting in reboot
From: Thomas Gleixner
Date: Tue Jun 26 2018 - 05:41:05 EST
On Tue, 26 Jun 2018, Peter Zijlstra wrote:
> On Fri, Jun 22, 2018 at 04:11:07PM +0100, Alan Cox wrote:
> > On Thu, 2018-06-21 at 21:58 +0200, Peter Zijlstra wrote:
> > > On Sun, May 27, 2018 at 08:45:55AM -0700, Fenghua Yu wrote:
> > > > Firmware may contain split locked instructions.
> > >
> > > I think that's the wrong attitude. You should mandate in your BIOS
> > > development guide that Firmware _MUST_NOT_ contain unaligned LOCK
> > > prefixed instructions.
> > >
> >
> > In the longer term I would agree entirely with that sentiment.
>
> But then how do we deal with SMIs ? The firmware people will at least
> need to know about this, and the quick fix is to make the SMI handler
> save/restore the MSR, but since they're aware and already changing their
> code, they might as well fix the actual problem -- which is likely
> trivial.
>
> So no, I don't buy it. Just fix the firmware instead of allowing them to
> fester and grow layers of ducttape.
>
> Because even for SMM WRMSR is 100s of cycles, and why would they want to
> make every single SMI more expensive.
>
> Also, as mentioned earlier, what are we going to do about SMIs in
> general? They're a _far_ _FAR_ bigger problem for RT workloads than a
> sporadic split atomic. Esp. with some vendors thinking they can run
> bitcoin miners in SMI (or whatever else it is that is taking miliseconds
> of compute time).
>
> Split atomics are an insignificant problem compared to the nightmare
> trainwreck that is SMM.
Aside of that, the split lock detection is only available for not yet
released silicon. So there is absolutely _ZERO_ reason to force the kernel
to deal with broken BIOSes. This would be a different story if the feature
would break gazillion of shipped systems.
So there is no 'In the longer term'. It's still enough time to fix the BIOS
hackery _before_ any of this hits a production line.
Ergo. This is not going to go anywhere near the x86 kernel code ever. We
are not fostering completely avoidable engineering trainwrecks.
To be honest, this part of the patch set should have never seen the light
of LKML and we neither should have that discussion in the first place.
Thanks,
tglx