From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933514AbdKAWOO (ORCPT ); Wed, 1 Nov 2017 18:14:14 -0400 Received: from mga02.intel.com ([134.134.136.20]:47689 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933333AbdKAWOM (ORCPT ); Wed, 1 Nov 2017 18:14:12 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,331,1505804400"; d="scan'208";a="144840025" Subject: Re: [PATCH 00/23] KAISER: unmap most of the kernel from userspace page tables To: Ingo Molnar References: <20171031223146.6B47C861@viggo.jf.intel.com> <20171101085424.cwvc4nrrdhvjc3su@gmail.com> Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andy Lutomirski , Linus Torvalds , Thomas Gleixner , Peter Zijlstra , "H. Peter Anvin" , borisBrian Gerst , Denys Vlasenko , Josh Poimboeuf , Thomas Garnier , Kees Cook From: Dave Hansen Message-ID: Date: Wed, 1 Nov 2017 15:14:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171101085424.cwvc4nrrdhvjc3su@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/01/2017 01:54 AM, Ingo Molnar wrote: > Beyond the inevitable cavalcade of (solvable) problems that will pop up during > review, one major item I'd like to see addressed is runtime configurability: it > should be possible to switch between a CR3-flushing and a regular syscall and page > table model on the admin level, without restarting the kernel and apps. Distros > really, really don't want to double the number of kernel variants they have. > > The 'Kaiser off' runtime switch doesn't have to be as efficient as > CONFIG_KAISER=n, at least initialloy, but at minimum it should avoid the most > expensive page table switching paths in the syscall entry codepaths. Due to popular demand, I went and implemented this today. It's not the prettiest code I ever wrote, but it's pretty small. Just in case anyone wants to play with it, I threw a snapshot of it up here: > https://git.kernel.org/pub/scm/linux/kernel/git/daveh/x86-kaiser.git/log/?h=kaiser-dynamic-414rc6-20171101 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.