Re: Current mainline git (24e700e291d52bd2) hangs when building e.g. perf

From: Rik van Riel
Date: Mon Sep 11 2017 - 11:08:25 EST


On Sun, 2017-09-10 at 18:46 -0700, Andy Lutomirski wrote:
>
> No, nothing stops the problematic speculative load.ÂÂHere's the
> issue.
> One CPU removes a reference to a page table from a higher-level page
> table, flushes, and then frees the page table.ÂÂThen it re-allocates
> it and writes something unrelated there.ÂÂAnother CPU that has CR3
> pointing to the page hierarchy in question could have a reference to
> the freed table in its paging structure cache.ÂÂEven if it's
> guaranteed to not try to access the addresses in question (because
> they're user addresses and the other CPU is in kernel mode, etc), but
> there is never a guarantee that the CPU doesn't randomly try to fill
> its TLB for the affected addresses.ÂÂThis results in invalid PTEs in
> the TLB, possible accesses using bogus memory types, and maybe even
> reads from IO space.

Good point, I had forgotten all about memory accesses
that do not originate with software behavior.