Re: Redoing eXclusive Page Frame Ownership (XPFO) with isolated CPUs in mind (for KVM to isolate its guests per CPU)

From: Linus Torvalds
Date: Mon Aug 20 2018 - 19:38:46 EST


On Mon, Aug 20, 2018 at 4:27 PM Dave Hansen <dave.hansen@xxxxxxxxx> wrote:
>
> You're right that we could have a full physmap that we switch to for
> kmap()-like access to user pages. But, the real problem is
> transitioning pages from kernel to user usage since it requires shooting
> down the old kernel mappings for those pages in some way.

You might decide that you simply don't care enough, and are willing to
leave possible stale TLB entries rather than shoot things down.

Then you'd still possibly see user pages in the kernel map, but only
for a fairly limited time, and only until the TLB entry gets re-used
for other reasons.

Even with kernel page table entries being marked global, their
lifetime in the TLB is likely not very long, and definitely not long
enough for some user that tries to scan for pages.

Linus