Meltdown from a CPU architect's view

By: Linus Torvalds (torvalds.delete@this.linux-foundation.org),
Room: Moderated Discussions
Ricardo B (ricardo.b.delete@this.xxxxx.xx) on January 15, 2018 6:01 am wrote:
>
> In first approach, killing off a faulty load and any instructions which depend on it seems like a good idea.
> But Meltdown is real. And for some reason, several CPU designers have independently made it possible.

I can pretty much guarantee that Meltdown is easy to fix in hardware without lots of new gates.

Why? The TLB already contains other information that forces the CPU to serialize the load. The memory type - which turns a load into an uncached serialized load - is in the TLB already.

So on some other architectures, this might involve extra hardware and complexity, but not on x86. The complexity is already there. Guaranteed. There is no big new logic that needs to be done - all the pieces are there, all the information is there, it's just that Intel checked the protection (and raises the exception) separately, and didn't feed it into the logic that actually did the access, only into the retirement.

So Intel (and apparently Cortex A75) just tied the protection logic too closely to the exception handling and just made sure the instruction didn't retire. It's not an unreasonable implementation when you think of protections as just the exception that is raised.

But it should absolutely be trivial to just tie that protection check into the "does this load need to be serialized" logic in the memory unit too.

Similarly, the Spectre BTB filling attack should be trivial to just do right in hardware. Just make the BTB use the whole linear address, and preferably add the ASID too (or just flush it on context switch). There should be no software workarounds for that long-term. But unlike Meltdown, that will involve a bigger (wider) BTB array. So that's real extra hardware, although not really any extra complexity.

The bounds check attack we'll just have to live with in software, I suspect. That one is fairly fundamental to speculation.

The thing that annoyed me about Meltdown wasn't that it happened, it was literally that it should be so trivial to get right in hardware, and it is really painful to do in software. The only reason we had to do it in software was that we can modify software after-the-fact in ways hardware can't be.

And the other thing that really annoyed me about this whole thing was the insane and horrible Intel PR piece. Intel actually did a lot of things right, but then somebody decided that they need to put out misleading and horrible PR pieces about how their CPU's are "working as designed". Christ. I was personally so angry about that shit that I was ready to go "never Intel" for a while.

Somebody inside Intel needs to really take a damn hard look at their PR practices, and at their management engine crap. Because while I am annoyed by Meltdown, I understand why it happened and I think it was sad but understandable.

In contrast, their PR people are f*cking incompetent (and whoever ok'ed that weasel-wordy PR needs to have his head checked), and their management engine needs to just be scrapped entirely, and the new version documented and open sourced or something. They need to stop playing games around the constant security issues they have. That thing is pure shit.

Linus
< Previous Post in ThreadNext Post in Thread >
Thread (123 posts)
TopicPosted ByPosted
Meltdown from a CPU architect's viewDavid Kanter
  Meltdown from a CPU architect's viewYoav
    Meltdown from a CPU architect's viewanon
      Meltdown from a CPU architect's viewanon
        Meltdown from a CPU architect's viewanon
        Meltdown from a CPU architect's viewRonald Maas
  Meltdown from a CPU architect's viewRicardo B
    Meltdown from a CPU architect's viewMichael_S
    Meltdown from a CPU architect's viewanon
    Meltdown from a CPU architect's viewLinus Torvalds
      Meltdown from a CPU architect's viewEmil Briggs
        Meltdown from a CPU architect's viewLinus Torvalds
          Meltdown from a CPU architect's viewMichael S
            sky is fallingMichael S
              meltdown and public cloudRichardC
                meltdown and public cloudmpx
                  meltdown and public cloudRichardC
                meltdown and public cloudEmil Briggs
                  meltdown and public cloudRichardC
                  meltdown and public cloudAaron Spink
                    meltdown and public cloud-
                meltdown and public cloudLinus Torvalds
                  meltdown and public cloudanon
                    meltdown and public cloudEmil Briggs
                    meltdown and public cloudGabriele Svelto
                    meltdown and public cloudLinus Torvalds
                  meltdown and public cloudGabriele Svelto
                    meltdown and public cloudLinus Torvalds
                      meltdown and public cloudhobold
                        meltdown and public cloudgallier2
                      meltdown and public clouddmcq
                        meltdown and public cloudMichael_S
                          meltdown and public cloudGabriele Svelto
                          meltdown and public cloudTravis
                            meltdown and public cloudGabriele Svelto
                              meltdown and public cloudTravis
                                meltdown and public cloudGabriele Svelto
                                  meltdown and public cloudJeff S.
                                    meltdown and public cloudTravis
                                      meltdown and public cloudJeff S.
                                        meltdown and public cloudTravis
                                          meltdown and public cloudTravis
                                  meltdown and public cloudTravis
                                    meltdown and public cloudGabriele Svelto
                                      meltdown and public cloudTravis
                                        meltdown and public cloudGabriele Svelto
                                          meltdown and public cloudMaynard Handley
                                          meltdown and public cloudTravis
                                            meltdown and public cloudGabriele Svelto
                                          meltdown and public cloudBrendan
                                            meltdown and public cloudGabriele Svelto
                            meltdown and public cloudMichael_S
                              meltdown and public clouddmcq
                              meltdown and public cloudTravis
                            meltdown and public cloudalistair
                              meltdown and public cloudGabriele Svelto
                                meltdown and public clouddmcq
                                meltdown and public cloudRonald Maas
                                  meltdown and public cloudLinus Torvalds
                                    meltdown and public cloudTravis
                                      meltdown and public cloudLinus Torvalds
                                        meltdown and public cloudTravis
                                          meltdown and public cloudGabriele Svelto
                                            meltdown and public cloudTravis
                                              meltdown and public cloudGabriele Svelto
                                              meltdown and public cloudMaynard Handley
                                                meltdown and public cloudTravis
                                                  meltdown and public cloudGabriele Svelto
                                    meltdown and public cloudRonald Maas
                                    meltdown and public clouddmcq
                      meltdown and public cloudGabriele Svelto
                        meltdown and public cloudFoo_
                          meltdown and public cloudGabriele Svelto
                            Sure. That's not a reason to make things worse. (NT)Foo_
                  meltdown and public cloudRichardC
                    meltdown and public cloudMatt Sayler
                      EC2, not ECS above (NT)Matt Sayler
                      meltdown and public cloudRichardC
              sky is fallingmpx
              sky is falling - meet TLBleedMichael S
                sky is falling - meet TLBleedhobold
                  sky is falling - meet TLBleedanon
                sky is falling - meet TLBleedAndrew Clough
                  sky is falling - meet TLBleedNoSpammer
                sky is falling - meet TLBleedFoo_
                  sky is falling - meet TLBleedMichael S
                    sky is falling - meet TLBleedhobold
                      sky is falling - meet TLBleedMichael S
          Meltdown from a CPU architect's viewhobold
          RDCL_NO and IBRS_ALLanonymou5
            RDCL_NO and IBRS_ALLLinus Torvalds
              RDCL_NO and IBRS_ALLDariusz G. Jagielski
            RDCL_NO and IBRS_ALLTravis
          Meltdown from a CPU architect's viewIan Ameline
            Your "fix" is really, really bad and does not really fix anythingHeikki Kultala
            Meltdown from a CPU architect's viewMegol
              Meltdown from a CPU architect's viewIan Ameline
              Meltdown from a CPU architect's viewAaron Spink
                Meltdown from a CPU architect's viewanon
                  Meltdown from a CPU architect's viewRonald Maas
                    Meltdown from a CPU architect's viewRay Terry
                      Meltdown from a CPU architect's viewdmcq
                        Meltdown from a CPU architect's viewanon
                          Meltdown from a CPU architect's viewdmcq
                            Meltdown from a CPU architect's viewanon
                              Meltdown from a CPU architect's viewrwessel
                                Meltdown from a CPU architect's viewdmcq
          Cannonlake or icelakeDavid Kanter
            Cannonlake or icelakeanon
              Anyway, IMHO no more new server SKUs with Meltdown insideAlberto
                Anyway, IMHO no more new server SKUs with Meltdown insideMichael_S
                  Anyway, IMHO no more new server SKUs with Meltdown insideanon
                    Sounds like you agree about Skylake-D (NT)Michael_S
                      I agreed only about some quarters (or an year) in redAlberto
                        I agreed only about some quarters (or an year) in redMichael_S
          Meltdown from a CPU architect's viewKevin G
            Meltdown from a CPU architect's viewDoug S
          Meltdown from a CPU architect's viewjoema
            Meltdown from a CPU architect's viewdmcq
      Meltdown from a CPU architect's viewGabriele Svelto
        Meltdown from a CPU architect's viewRichardC
      Meltdown from a CPU architect's viewGroo
      Meltdown from a CPU architect's viewanon