From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967618AbdAED2e (ORCPT ); Wed, 4 Jan 2017 22:28:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53628 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967416AbdAED2c (ORCPT ); Wed, 4 Jan 2017 22:28:32 -0500 Date: Thu, 5 Jan 2017 11:28:00 +0800 From: Baoquan He To: Boris Petkov , keescook@chromium.org Cc: tglx@linutronix.de, hpa@zytor.com, mingo@redhat.com, linux-kernel@vger.kernel.org, x86@kernel.org, yinghai@kernel.org, thgarnie@google.com, kuleshovmail@gmail.com, luto@kernel.org, mcgrof@kernel.org, anderson@redhat.com, dyoung@redhat.com Subject: Re: [PATCH v3 1/3] x86/64: Make kernel text mapping always take one whole page table in early boot code Message-ID: <20170105032800.GE6937@x1> References: <1483519053-23402-1-git-send-email-bhe@redhat.com> <1483519053-23402-2-git-send-email-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 05 Jan 2017 03:28:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/04/17 at 03:00pm, Boris Petkov wrote: > On January 4, 2017 10:37:31 AM GMT+02:00, Baoquan He wrote: > >In early boot code level2_kernel_pgt is used to map kernel text. And > >its > >size varies with KERNEL_IMAGE_SIZE and fixed at compiling time. In fact > >we can make it always take 512 entries of one whole page table, because > >later function cleanup_highmap will clean up the unused entries. With > >the > >help of this change kernel text mapping size can be decided at runtime > >later, 512M if kaslr is disabled, 1G if kaslr is enabled. > Question: so why are we even having that distinction? Why aren't we making > text mapping size 1G by default and be done with it? Yes, good question, thanks! Possibly people worry more that no enough space left for kernel modules mapping whthin 1G, just a guess. I am fine with making text mapping size 1G by default. Kees must know more about the 1G only if kaslr enabled. Hi Kees, Could you help check if there is any risk making kernel mapping size 1G by default as Boris suggested? Thanks Baoquan