From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f198.google.com (mail-io0-f198.google.com [209.85.223.198]) by kanga.kvack.org (Postfix) with ESMTP id BAD1E6B1BAF for ; Mon, 20 Aug 2018 19:38:43 -0400 (EDT) Received: by mail-io0-f198.google.com with SMTP id l24-v6so14508380iok.21 for ; Mon, 20 Aug 2018 16:38:43 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c1-v6sor412643itc.71.2018.08.20.16.38.42 for (Google Transport Security); Mon, 20 Aug 2018 16:38:42 -0700 (PDT) MIME-Version: 1.0 References: <20180820212556.GC2230@char.us.oracle.com> <1534801939.10027.24.camel@amazon.co.uk> <20180820223557.GC16961@cisco.cisco.com> <1534806880.10027.29.camel@infradead.org> In-Reply-To: From: Linus Torvalds Date: Mon, 20 Aug 2018 16:38:31 -0700 Message-ID: Subject: Re: Redoing eXclusive Page Frame Ownership (XPFO) with isolated CPUs in mind (for KVM to isolate its guests per CPU) Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Dave Hansen Cc: David Woodhouse , Tycho Andersen , Konrad Rzeszutek Wilk , juerg.haefliger@hpe.com, deepa.srinivasan@oracle.com, Jim Mattson , Andrew Cooper , Linux Kernel Mailing List , Boris Ostrovsky , linux-mm , Thomas Gleixner , joao.m.martins@oracle.com, pradeep.vincent@oracle.com, Andi Kleen , Khalid Aziz , kanth.ghatraju@oracle.com, Liran Alon , Kees Cook , jsteckli@os.inf.tu-dresden.de, Kernel Hardening , chris.hyser@oracle.com, Tyler Hicks , John Haxby , Jon Masters On Mon, Aug 20, 2018 at 4:27 PM Dave Hansen 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