aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/x86_64/boot-options.txt5
-rw-r--r--arch/x86/Kconfig.debug12
-rw-r--r--arch/x86/mm/init_64.c20
-rw-r--r--include/asm-x86/pgtable_64.h2
4 files changed, 39 insertions, 0 deletions
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt
index 34abae4e9442..b0c7b6c4abda 100644
--- a/Documentation/x86_64/boot-options.txt
+++ b/Documentation/x86_64/boot-options.txt
@@ -307,3 +307,8 @@ Debugging
307 stuck (default) 307 stuck (default)
308 308
309Miscellaneous 309Miscellaneous
310
311 nogbpages
312 Do not use GB pages for kernel direct mappings.
313 gbpages
314 Use GB pages for kernel direct mappings.
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index 7ce8e7025661..f4413c04e687 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -76,6 +76,18 @@ config DEBUG_RODATA
76 data. This is recommended so that we can catch kernel bugs sooner. 76 data. This is recommended so that we can catch kernel bugs sooner.
77 If in doubt, say "Y". 77 If in doubt, say "Y".
78 78
79config DIRECT_GBPAGES
80 bool "Enable gbpages-mapped kernel pagetables"
81 depends on DEBUG_KERNEL && EXPERIMENTAL && X86_64
82 help
83 Enable gigabyte pages support (if the CPU supports it). This can
84 improve the kernel's performance a tiny bit by reducing TLB
85 pressure.
86
87 This is experimental code.
88
89 If in doubt, say "N".
90
79config DEBUG_RODATA_TEST 91config DEBUG_RODATA_TEST
80 bool "Testcase for the DEBUG_RODATA feature" 92 bool "Testcase for the DEBUG_RODATA feature"
81 depends on DEBUG_RODATA 93 depends on DEBUG_RODATA
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index a02a14f0f324..6e7d5a42a09a 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -54,6 +54,26 @@ static unsigned long dma_reserve __initdata;
54 54
55DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 55DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
56 56
57int direct_gbpages __meminitdata
58#ifdef CONFIG_DIRECT_GBPAGES
59 = 1
60#endif
61;
62
63static int __init parse_direct_gbpages_off(char *arg)
64{
65 direct_gbpages = 0;
66 return 0;
67}
68early_param("nogbpages", parse_direct_gbpages_off);
69
70static int __init parse_direct_gbpages_on(char *arg)
71{
72 direct_gbpages = 1;
73 return 0;
74}
75early_param("gbpages", parse_direct_gbpages_on);
76
57/* 77/*
58 * NOTE: pagetable_init alloc all the fixmap pagetables contiguous on the 78 * NOTE: pagetable_init alloc all the fixmap pagetables contiguous on the
59 * physical space so we can cache the place of the first one and move 79 * physical space so we can cache the place of the first one and move
diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h
index 01d2359e7a34..6ef09914acbe 100644
--- a/include/asm-x86/pgtable_64.h
+++ b/include/asm-x86/pgtable_64.h
@@ -239,6 +239,8 @@ static inline int pud_large(pud_t pte)
239 239
240#define update_mmu_cache(vma,address,pte) do { } while (0) 240#define update_mmu_cache(vma,address,pte) do { } while (0)
241 241
242extern int direct_gbpages;
243
242/* Encode and de-code a swap entry */ 244/* Encode and de-code a swap entry */
243#define __swp_type(x) (((x).val >> 1) & 0x3f) 245#define __swp_type(x) (((x).val >> 1) & 0x3f)
244#define __swp_offset(x) ((x).val >> 8) 246#define __swp_offset(x) ((x).val >> 8)