[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150305072703.GB23951@gmail.com>
Date: Thu, 5 Mar 2015 08:27:03 +0100
From: Ingo Molnar <mingo@...nel.org>
To: "Luis R. Rodriguez" <mcgrof@...not-panic.com>
Cc: gregkh@...uxfoundation.org, akpm@...ux-foundation.org,
tony@...mide.com, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com, jgross@...e.com, luto@...capital.net,
toshi.kani@...com, dave.hansen@...ux.intel.com, JBeulich@...e.com,
pavel@....cz, qiuxishi@...wei.com, david.vrabel@...rix.com,
bp@...e.de, vbabka@...e.cz, iamjoonsoo.kim@....com,
decui@...rosoft.com, linux-kernel@...r.kernel.org, x86@...nel.org,
julia.lawall@...6.fr, "Luis R. Rodriguez" <mcgrof@...e.com>
Subject: [PATCH 6/4] x86/mm: Simplify probe_page_size_mask()
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 <mcgrof@...e.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Borislav Petkov <bp@...e.de>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: David Vrabel <david.vrabel@...rix.com>
Cc: Dexuan Cui <decui@...rosoft.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: JBeulich@...e.com
Cc: Jan Beulich <JBeulich@...e.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@....com>
Cc: Juergen Gross <jgross@...e.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Pavel Machek <pavel@....cz>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Tony Lindgren <tony@...mide.com>
Cc: Toshi Kani <toshi.kani@...com>
Cc: Vlastimil Babka <vbabka@...e.cz>
Cc: Xishi Qiu <qiuxishi@...wei.com>
Cc: julia.lawall@...6.fr
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
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");
+ 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists