From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932189AbbCEIiR (ORCPT ); Thu, 5 Mar 2015 03:38:17 -0500 Received: from cantor2.suse.de ([195.135.220.15]:48558 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932083AbbCEIiQ (ORCPT ); Thu, 5 Mar 2015 03:38:16 -0500 Message-ID: <54F815F1.5080800@suse.com> Date: Thu, 05 Mar 2015 09:38:09 +0100 From: Juergen Gross User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ingo Molnar , "Luis R. Rodriguez" CC: gregkh@linuxfoundation.org, akpm@linux-foundation.org, tony@atomide.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, luto@amacapital.net, toshi.kani@hp.com, dave.hansen@linux.intel.com, JBeulich@suse.com, pavel@ucw.cz, qiuxishi@huawei.com, david.vrabel@citrix.com, bp@suse.de, vbabka@suse.cz, iamjoonsoo.kim@lge.com, decui@microsoft.com, linux-kernel@vger.kernel.org, x86@kernel.org, julia.lawall@lip6.fr, "Luis R. Rodriguez" Subject: Re: [PATCH 6/4] x86/mm: Simplify probe_page_size_mask() References: <1425518654-3403-1-git-send-email-mcgrof@do-not-panic.com> <20150305072703.GB23951@gmail.com> In-Reply-To: <20150305072703.GB23951@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/05/2015 08:27 AM, Ingo Molnar wrote: > > Now that we've simplified the gbpages config space, move the > 'page_size_mask' initialization into probe_page_size_mask(), right > next to the PSE and PGE enablement lines. > > Cc: Luis R. Rodriguez > Cc: Andrew Morton > Cc: Andy Lutomirski > Cc: Borislav Petkov > Cc: Borislav Petkov > Cc: Dave Hansen > Cc: David Vrabel > Cc: Dexuan Cui > Cc: Greg Kroah-Hartman > Cc: H. Peter Anvin > Cc: JBeulich@suse.com > Cc: Jan Beulich > Cc: Joonsoo Kim > Cc: Juergen Gross > Cc: Linus Torvalds > Cc: Pavel Machek > Cc: Thomas Gleixner > Cc: Tony Lindgren > Cc: Toshi Kani > Cc: Vlastimil Babka > Cc: Xishi Qiu > Cc: julia.lawall@lip6.fr > Signed-off-by: Ingo Molnar > --- > arch/x86/mm/init.c | 23 ++++++++++------------- > 1 file changed, 10 insertions(+), 13 deletions(-) > > diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c > index 8704153f2675..6dc85d51cd98 100644 > --- a/arch/x86/mm/init.c > +++ b/arch/x86/mm/init.c > @@ -131,29 +131,18 @@ void __init early_alloc_pgt_buf(void) > > int after_bootmem; > > -static int page_size_mask; > - > early_param_on_off("gbpages", "nogbpages", direct_gbpages, CONFIG_X86_DIRECT_GBPAGES); > > -static void __init init_gbpages(void) > -{ > - if (direct_gbpages && cpu_has_gbpages) { > - printk(KERN_INFO "Using GB pages for direct mapping\n"); > - page_size_mask |= 1 << PG_LEVEL_1G; > - } else > - direct_gbpages = 0; > -} > - > struct map_range { > unsigned long start; > unsigned long end; > unsigned page_size_mask; > }; > > +static int page_size_mask; > + > static void __init probe_page_size_mask(void) > { > - init_gbpages(); > - > #if !defined(CONFIG_DEBUG_PAGEALLOC) && !defined(CONFIG_KMEMCHECK) > /* > * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages. > @@ -173,6 +162,14 @@ static void __init probe_page_size_mask(void) > cr4_set_bits_and_update_boot(X86_CR4_PGE); > __supported_pte_mask |= _PAGE_GLOBAL; > } > + > + /* Enable 1 GB linear kernel mappings if available: */ > + if (direct_gbpages && cpu_has_gbpages) { > + printk(KERN_INFO "Using GB pages for direct mapping\n"); pr_info()? > + page_size_mask |= 1 << PG_LEVEL_1G; > + } else { > + direct_gbpages = 0; > + } > } > > #ifdef CONFIG_X86_32 > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ >