From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by kanga.kvack.org (Postfix) with ESMTP id 935446B1BA2 for ; Mon, 20 Aug 2018 19:27:21 -0400 (EDT) Received: by mail-pg1-f198.google.com with SMTP id g5-v6so6916920pgq.5 for ; Mon, 20 Aug 2018 16:27:21 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com. [192.55.52.93]) by mx.google.com with ESMTPS id b82-v6si12266332pfb.18.2018.08.20.16.27.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 16:27:20 -0700 (PDT) Subject: Re: Redoing eXclusive Page Frame Ownership (XPFO) with isolated CPUs in mind (for KVM to isolate its guests per CPU) 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> From: Dave Hansen Message-ID: Date: Mon, 20 Aug 2018 16:26:32 -0700 MIME-Version: 1.0 In-Reply-To: <1534806880.10027.29.camel@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-ID: To: David Woodhouse , Tycho Andersen , Linus Torvalds Cc: 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 08/20/2018 04:14 PM, David Woodhouse wrote: > If you need the physmap, then rather than manually mapping with 4KiB > pages, you just switch. Having first ensured that no malicious guest or > userspace is running on a sibling, of course. The problem is determining when "you need the physmap". Tycho's patches, as I remember them basically classify pages between being "user" pages which are accessed only via kmap() and friends and "kernel" pages which need to be mapped all the time because they might have a 'task_struct' or a page table or a 'struct file'. 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.