From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f197.google.com (mail-qt0-f197.google.com [209.85.216.197]) by kanga.kvack.org (Postfix) with ESMTP id 3A9196B55AF for ; Fri, 31 Aug 2018 03:45:48 -0400 (EDT) Received: by mail-qt0-f197.google.com with SMTP id y54-v6so12466834qta.8 for ; Fri, 31 Aug 2018 00:45:48 -0700 (PDT) Received: from smtp-fw-6002.amazon.com (smtp-fw-6002.amazon.com. [52.95.49.90]) by mx.google.com with ESMTPS id u2-v6si244759qvu.284.2018.08.31.00.45.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 00:45:46 -0700 (PDT) From: Julian Stecklina Subject: Re: Redoing eXclusive Page Frame Ownership (XPFO) with isolated CPUs in mind (for KVM to isolate its guests per CPU) In-Reply-To: Date: Thu, 30 Aug 2018 18:00:51 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: Linus Torvalds Cc: David Woodhouse , 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 , Kernel Hardening , chris.hyser@oracle.com, Tyler Hicks , John Haxby , Jon Masters Hey everyone, On Mon, 20 Aug 2018 15:27 Linus Torvalds wrote: > On Mon, Aug 20, 2018 at 3:02 PM Woodhouse, David wrote: >> >> It's the *kernel* we don't want being able to access those pages, >> because of the multitude of unfixable cache load gadgets. > > Ahh. > > I guess the proof is in the pudding. Did somebody try to forward-port > that patch set and see what the performance is like? I've been spending some cycles on the XPFO patch set this week. For the patch set as it was posted for v4.13, the performance overhead of compiling a Linux kernel is ~40% on x86_64[1]. The overhead comes almost completely from TLB flushing. If we can live with stale TLB entries allowing temporary access (which I think is reasonable), we can remove all TLB flushing (on x86). This reduces the overhead to 2-3% for kernel compile. There were no problems in forward-porting the patch set to master. You can find the result here, including a patch makes the TLB flushing configurable: http://git.infradead.org/users/jsteckli/linux-xpfo.git/shortlog/refs/heads/xpfo-master It survived some casual stress-ng runs. I can rerun the benchmarks on this version, but I doubt there is any change. > It used to be just 500 LOC. Was that because they took horrible > shortcuts? The patch is still fairly small. As for the horrible shortcuts, I let others comment on that. HTH, Julian [1] Measured on my quad-core (8 hyperthreads) Kaby Lake desktop building Linux 4.18 with the Phoronix Test Suite. -- Amazon Development Center Germany GmbH Berlin - Dresden - Aachen main office: Krausenstr. 38, 10117 Berlin Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger Ust-ID: DE289237879 Eingetragen am Amtsgericht Charlottenburg HRB 149173 B