From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f200.google.com (mail-io0-f200.google.com [209.85.223.200]) by kanga.kvack.org (Postfix) with ESMTP id 5EBFB6B026F for ; Wed, 1 Nov 2017 18:28:50 -0400 (EDT) Received: by mail-io0-f200.google.com with SMTP id m81so11347604ioi.3 for ; Wed, 01 Nov 2017 15:28:50 -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 c6sor888731iob.42.2017.11.01.15.28.49 for (Google Transport Security); Wed, 01 Nov 2017 15:28:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20171031223146.6B47C861@viggo.jf.intel.com> <20171101085424.cwvc4nrrdhvjc3su@gmail.com> From: Linus Torvalds Date: Wed, 1 Nov 2017 15:28:48 -0700 Message-ID: Subject: Re: [PATCH 00/23] KAISER: unmap most of the kernel from userspace page tables Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Dave Hansen Cc: Ingo Molnar , Linux Kernel Mailing List , linux-mm , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , "H. Peter Anvin" , borisBrian Gerst , Denys Vlasenko , Josh Poimboeuf , Thomas Garnier , Kees Cook On Wed, Nov 1, 2017 at 3:14 PM, Dave Hansen wrote: > > I ran some quick tests. When CONFIG_KAISER=y, but "echo 0 > > kaiser-enabled", the tests that I ran were within the noise vs. a > vanilla kernel, and that's with *zero* optimization. I guess the optimal version just ends up switching between two different entrypoints for the on/off case. And the not-quite-as-aggressive, but almost-optimal version would just be a two-byte asm alternative with an unconditional branch to the movcr3 code and back, and is turned into a noop when it's off. But since 99%+ of the cost is going to be that cr3 write, even the stupid "just load value and branch over the cr3 conditionally" is going to make things hard to measure. Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org