1 // SPDX-License-Identifier: GPL-2.0
3 * IA-32 Huge TLB Page Support for Kernel.
5 * Copyright (C) 2002, Rohit Seth <rohit.seth@intel.com>
8 #include <linux/init.h>
11 #include <linux/sched/mm.h>
12 #include <linux/hugetlb.h>
13 #include <linux/pagemap.h>
14 #include <linux/err.h>
15 #include <linux/sysctl.h>
16 #include <linux/compat.h>
19 #include <asm/tlbflush.h>
24 bool __init
arch_hugetlb_valid_size(unsigned long size
)
28 else if (size
== PUD_SIZE
&& boot_cpu_has(X86_FEATURE_GBPAGES
))
34 #ifdef CONFIG_CONTIG_ALLOC
35 static __init
int gigantic_pages_init(void)
37 /* With compaction or CMA we can allocate gigantic pages at runtime */
38 if (boot_cpu_has(X86_FEATURE_GBPAGES
))
39 hugetlb_add_hstate(PUD_SHIFT
- PAGE_SHIFT
);
42 arch_initcall(gigantic_pages_init
);