pgtable.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. #include <linux/mm.h>
  2. #include <linux/gfp.h>
  3. #include <asm/pgalloc.h>
  4. #include <asm/pgtable.h>
  5. #include <asm/tlb.h>
  6. #include <asm/fixmap.h>
  7. #include <asm/mtrr.h>
  8. #define PGALLOC_GFP (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK | __GFP_ZERO)
  9. #ifdef CONFIG_HIGHPTE
  10. #define PGALLOC_USER_GFP __GFP_HIGHMEM
  11. #else
  12. #define PGALLOC_USER_GFP 0
  13. #endif
  14. gfp_t __userpte_alloc_gfp = PGALLOC_GFP | PGALLOC_USER_GFP;
  15. pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
  16. {
  17. return (pte_t *)__get_free_page(PGALLOC_GFP & ~__GFP_ACCOUNT);
  18. }
  19. pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
  20. {
  21. struct page *pte;
  22. pte = alloc_pages(__userpte_alloc_gfp, 0);
  23. if (!pte)
  24. return NULL;
  25. if (!pgtable_page_ctor(pte)) {
  26. __free_page(pte);
  27. return NULL;
  28. }
  29. return pte;
  30. }
  31. static int __init setup_userpte(char *arg)
  32. {
  33. if (!arg)
  34. return -EINVAL;
  35. /*
  36. * "userpte=nohigh" disables allocation of user pagetables in
  37. * high memory.
  38. */
  39. if (strcmp(arg, "nohigh") == 0)
  40. __userpte_alloc_gfp &= ~__GFP_HIGHMEM;
  41. else
  42. return -EINVAL;
  43. return 0;
  44. }
  45. early_param("userpte", setup_userpte);
  46. void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
  47. {
  48. pgtable_page_dtor(pte);
  49. paravirt_release_pte(page_to_pfn(pte));
  50. tlb_remove_page(tlb, pte);
  51. }
  52. #if CONFIG_PGTABLE_LEVELS > 2
  53. void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
  54. {
  55. struct page *page = virt_to_page(pmd);
  56. paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT);
  57. /*
  58. * NOTE! For PAE, any changes to the top page-directory-pointer-table
  59. * entries need a full cr3 reload to flush.
  60. */
  61. #ifdef CONFIG_X86_PAE
  62. tlb->need_flush_all = 1;
  63. #endif
  64. pgtable_pmd_page_dtor(page);
  65. tlb_remove_page(tlb, page);
  66. }
  67. #if CONFIG_PGTABLE_LEVELS > 3
  68. void ___pud_free_tlb(struct mmu_gather *tlb, pud_t *pud)
  69. {
  70. paravirt_release_pud(__pa(pud) >> PAGE_SHIFT);
  71. tlb_remove_page(tlb, virt_to_page(pud));
  72. }
  73. #endif /* CONFIG_PGTABLE_LEVELS > 3 */
  74. #endif /* CONFIG_PGTABLE_LEVELS > 2 */
  75. static inline void pgd_list_add(pgd_t *pgd)
  76. {
  77. struct page *page = virt_to_page(pgd);
  78. list_add(&page->lru, &pgd_list);
  79. }
  80. static inline void pgd_list_del(pgd_t *pgd)
  81. {
  82. struct page *page = virt_to_page(pgd);
  83. list_del(&page->lru);
  84. }
  85. #define UNSHARED_PTRS_PER_PGD \
  86. (SHARED_KERNEL_PMD ? KERNEL_PGD_BOUNDARY : PTRS_PER_PGD)
  87. static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm)
  88. {
  89. BUILD_BUG_ON(sizeof(virt_to_page(pgd)->index) < sizeof(mm));
  90. virt_to_page(pgd)->index = (pgoff_t)mm;
  91. }
  92. struct mm_struct *pgd_page_get_mm(struct page *page)
  93. {
  94. return (struct mm_struct *)page->index;
  95. }
  96. static void pgd_ctor(struct mm_struct *mm, pgd_t *pgd)
  97. {
  98. /* If the pgd points to a shared pagetable level (either the
  99. ptes in non-PAE, or shared PMD in PAE), then just copy the
  100. references from swapper_pg_dir. */
  101. if (CONFIG_PGTABLE_LEVELS == 2 ||
  102. (CONFIG_PGTABLE_LEVELS == 3 && SHARED_KERNEL_PMD) ||
  103. CONFIG_PGTABLE_LEVELS == 4) {
  104. clone_pgd_range(pgd + KERNEL_PGD_BOUNDARY,
  105. swapper_pg_dir + KERNEL_PGD_BOUNDARY,
  106. KERNEL_PGD_PTRS);
  107. }
  108. /* list required to sync kernel mapping updates */
  109. if (!SHARED_KERNEL_PMD) {
  110. pgd_set_mm(pgd, mm);
  111. pgd_list_add(pgd);
  112. }
  113. }
  114. static void pgd_dtor(pgd_t *pgd)
  115. {
  116. if (SHARED_KERNEL_PMD)
  117. return;
  118. spin_lock(&pgd_lock);
  119. pgd_list_del(pgd);
  120. spin_unlock(&pgd_lock);
  121. }
  122. /*
  123. * List of all pgd's needed for non-PAE so it can invalidate entries
  124. * in both cached and uncached pgd's; not needed for PAE since the
  125. * kernel pmd is shared. If PAE were not to share the pmd a similar
  126. * tactic would be needed. This is essentially codepath-based locking
  127. * against pageattr.c; it is the unique case in which a valid change
  128. * of kernel pagetables can't be lazily synchronized by vmalloc faults.
  129. * vmalloc faults work because attached pagetables are never freed.
  130. * -- nyc
  131. */
  132. #ifdef CONFIG_X86_PAE
  133. /*
  134. * In PAE mode, we need to do a cr3 reload (=tlb flush) when
  135. * updating the top-level pagetable entries to guarantee the
  136. * processor notices the update. Since this is expensive, and
  137. * all 4 top-level entries are used almost immediately in a
  138. * new process's life, we just pre-populate them here.
  139. *
  140. * Also, if we're in a paravirt environment where the kernel pmd is
  141. * not shared between pagetables (!SHARED_KERNEL_PMDS), we allocate
  142. * and initialize the kernel pmds here.
  143. */
  144. #define PREALLOCATED_PMDS UNSHARED_PTRS_PER_PGD
  145. void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd)
  146. {
  147. paravirt_alloc_pmd(mm, __pa(pmd) >> PAGE_SHIFT);
  148. /* Note: almost everything apart from _PAGE_PRESENT is
  149. reserved at the pmd (PDPT) level. */
  150. set_pud(pudp, __pud(__pa(pmd) | _PAGE_PRESENT));
  151. /*
  152. * According to Intel App note "TLBs, Paging-Structure Caches,
  153. * and Their Invalidation", April 2007, document 317080-001,
  154. * section 8.1: in PAE mode we explicitly have to flush the
  155. * TLB via cr3 if the top-level pgd is changed...
  156. */
  157. flush_tlb_mm(mm);
  158. }
  159. #else /* !CONFIG_X86_PAE */
  160. /* No need to prepopulate any pagetable entries in non-PAE modes. */
  161. #define PREALLOCATED_PMDS 0
  162. #endif /* CONFIG_X86_PAE */
  163. static void free_pmds(struct mm_struct *mm, pmd_t *pmds[])
  164. {
  165. int i;
  166. for(i = 0; i < PREALLOCATED_PMDS; i++)
  167. if (pmds[i]) {
  168. pgtable_pmd_page_dtor(virt_to_page(pmds[i]));
  169. free_page((unsigned long)pmds[i]);
  170. mm_dec_nr_pmds(mm);
  171. }
  172. }
  173. static int preallocate_pmds(struct mm_struct *mm, pmd_t *pmds[])
  174. {
  175. int i;
  176. bool failed = false;
  177. gfp_t gfp = PGALLOC_GFP;
  178. if (mm == &init_mm)
  179. gfp &= ~__GFP_ACCOUNT;
  180. for(i = 0; i < PREALLOCATED_PMDS; i++) {
  181. pmd_t *pmd = (pmd_t *)__get_free_page(gfp);
  182. if (!pmd)
  183. failed = true;
  184. if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) {
  185. free_page((unsigned long)pmd);
  186. pmd = NULL;
  187. failed = true;
  188. }
  189. if (pmd)
  190. mm_inc_nr_pmds(mm);
  191. pmds[i] = pmd;
  192. }
  193. if (failed) {
  194. free_pmds(mm, pmds);
  195. return -ENOMEM;
  196. }
  197. return 0;
  198. }
  199. /*
  200. * Mop up any pmd pages which may still be attached to the pgd.
  201. * Normally they will be freed by munmap/exit_mmap, but any pmd we
  202. * preallocate which never got a corresponding vma will need to be
  203. * freed manually.
  204. */
  205. static void pgd_mop_up_pmds(struct mm_struct *mm, pgd_t *pgdp)
  206. {
  207. int i;
  208. for(i = 0; i < PREALLOCATED_PMDS; i++) {
  209. pgd_t pgd = pgdp[i];
  210. if (pgd_val(pgd) != 0) {
  211. pmd_t *pmd = (pmd_t *)pgd_page_vaddr(pgd);
  212. pgdp[i] = native_make_pgd(0);
  213. paravirt_release_pmd(pgd_val(pgd) >> PAGE_SHIFT);
  214. pmd_free(mm, pmd);
  215. mm_dec_nr_pmds(mm);
  216. }
  217. }
  218. }
  219. static void pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmds[])
  220. {
  221. pud_t *pud;
  222. int i;
  223. if (PREALLOCATED_PMDS == 0) /* Work around gcc-3.4.x bug */
  224. return;
  225. pud = pud_offset(pgd, 0);
  226. for (i = 0; i < PREALLOCATED_PMDS; i++, pud++) {
  227. pmd_t *pmd = pmds[i];
  228. if (i >= KERNEL_PGD_BOUNDARY)
  229. memcpy(pmd, (pmd_t *)pgd_page_vaddr(swapper_pg_dir[i]),
  230. sizeof(pmd_t) * PTRS_PER_PMD);
  231. pud_populate(mm, pud, pmd);
  232. }
  233. }
  234. /*
  235. * Xen paravirt assumes pgd table should be in one page. 64 bit kernel also
  236. * assumes that pgd should be in one page.
  237. *
  238. * But kernel with PAE paging that is not running as a Xen domain
  239. * only needs to allocate 32 bytes for pgd instead of one page.
  240. */
  241. #ifdef CONFIG_X86_PAE
  242. #include <linux/slab.h>
  243. #define PGD_SIZE (PTRS_PER_PGD * sizeof(pgd_t))
  244. #define PGD_ALIGN 32
  245. static struct kmem_cache *pgd_cache;
  246. static int __init pgd_cache_init(void)
  247. {
  248. /*
  249. * When PAE kernel is running as a Xen domain, it does not use
  250. * shared kernel pmd. And this requires a whole page for pgd.
  251. */
  252. if (!SHARED_KERNEL_PMD)
  253. return 0;
  254. /*
  255. * when PAE kernel is not running as a Xen domain, it uses
  256. * shared kernel pmd. Shared kernel pmd does not require a whole
  257. * page for pgd. We are able to just allocate a 32-byte for pgd.
  258. * During boot time, we create a 32-byte slab for pgd table allocation.
  259. */
  260. pgd_cache = kmem_cache_create("pgd_cache", PGD_SIZE, PGD_ALIGN,
  261. SLAB_PANIC, NULL);
  262. if (!pgd_cache)
  263. return -ENOMEM;
  264. return 0;
  265. }
  266. core_initcall(pgd_cache_init);
  267. static inline pgd_t *_pgd_alloc(void)
  268. {
  269. /*
  270. * If no SHARED_KERNEL_PMD, PAE kernel is running as a Xen domain.
  271. * We allocate one page for pgd.
  272. */
  273. if (!SHARED_KERNEL_PMD)
  274. return (pgd_t *)__get_free_page(PGALLOC_GFP);
  275. /*
  276. * Now PAE kernel is not running as a Xen domain. We can allocate
  277. * a 32-byte slab for pgd to save memory space.
  278. */
  279. return kmem_cache_alloc(pgd_cache, PGALLOC_GFP);
  280. }
  281. static inline void _pgd_free(pgd_t *pgd)
  282. {
  283. if (!SHARED_KERNEL_PMD)
  284. free_page((unsigned long)pgd);
  285. else
  286. kmem_cache_free(pgd_cache, pgd);
  287. }
  288. #else
  289. static inline pgd_t *_pgd_alloc(void)
  290. {
  291. return (pgd_t *)__get_free_page(PGALLOC_GFP);
  292. }
  293. static inline void _pgd_free(pgd_t *pgd)
  294. {
  295. free_page((unsigned long)pgd);
  296. }
  297. #endif /* CONFIG_X86_PAE */
  298. pgd_t *pgd_alloc(struct mm_struct *mm)
  299. {
  300. pgd_t *pgd;
  301. pmd_t *pmds[PREALLOCATED_PMDS];
  302. pgd = _pgd_alloc();
  303. if (pgd == NULL)
  304. goto out;
  305. mm->pgd = pgd;
  306. if (preallocate_pmds(mm, pmds) != 0)
  307. goto out_free_pgd;
  308. if (paravirt_pgd_alloc(mm) != 0)
  309. goto out_free_pmds;
  310. /*
  311. * Make sure that pre-populating the pmds is atomic with
  312. * respect to anything walking the pgd_list, so that they
  313. * never see a partially populated pgd.
  314. */
  315. spin_lock(&pgd_lock);
  316. pgd_ctor(mm, pgd);
  317. pgd_prepopulate_pmd(mm, pgd, pmds);
  318. spin_unlock(&pgd_lock);
  319. return pgd;
  320. out_free_pmds:
  321. free_pmds(mm, pmds);
  322. out_free_pgd:
  323. _pgd_free(pgd);
  324. out:
  325. return NULL;
  326. }
  327. void pgd_free(struct mm_struct *mm, pgd_t *pgd)
  328. {
  329. pgd_mop_up_pmds(mm, pgd);
  330. pgd_dtor(pgd);
  331. paravirt_pgd_free(mm, pgd);
  332. _pgd_free(pgd);
  333. }
  334. /*
  335. * Used to set accessed or dirty bits in the page table entries
  336. * on other architectures. On x86, the accessed and dirty bits
  337. * are tracked by hardware. However, do_wp_page calls this function
  338. * to also make the pte writeable at the same time the dirty bit is
  339. * set. In that case we do actually need to write the PTE.
  340. */
  341. int ptep_set_access_flags(struct vm_area_struct *vma,
  342. unsigned long address, pte_t *ptep,
  343. pte_t entry, int dirty)
  344. {
  345. int changed = !pte_same(*ptep, entry);
  346. if (changed && dirty) {
  347. *ptep = entry;
  348. pte_update(vma->vm_mm, address, ptep);
  349. }
  350. return changed;
  351. }
  352. #ifdef CONFIG_TRANSPARENT_HUGEPAGE
  353. int pmdp_set_access_flags(struct vm_area_struct *vma,
  354. unsigned long address, pmd_t *pmdp,
  355. pmd_t entry, int dirty)
  356. {
  357. int changed = !pmd_same(*pmdp, entry);
  358. VM_BUG_ON(address & ~HPAGE_PMD_MASK);
  359. if (changed && dirty) {
  360. *pmdp = entry;
  361. /*
  362. * We had a write-protection fault here and changed the pmd
  363. * to to more permissive. No need to flush the TLB for that,
  364. * #PF is architecturally guaranteed to do that and in the
  365. * worst-case we'll generate a spurious fault.
  366. */
  367. }
  368. return changed;
  369. }
  370. #endif
  371. int ptep_test_and_clear_young(struct vm_area_struct *vma,
  372. unsigned long addr, pte_t *ptep)
  373. {
  374. int ret = 0;
  375. if (pte_young(*ptep))
  376. ret = test_and_clear_bit(_PAGE_BIT_ACCESSED,
  377. (unsigned long *) &ptep->pte);
  378. if (ret)
  379. pte_update(vma->vm_mm, addr, ptep);
  380. return ret;
  381. }
  382. #ifdef CONFIG_TRANSPARENT_HUGEPAGE
  383. int pmdp_test_and_clear_young(struct vm_area_struct *vma,
  384. unsigned long addr, pmd_t *pmdp)
  385. {
  386. int ret = 0;
  387. if (pmd_young(*pmdp))
  388. ret = test_and_clear_bit(_PAGE_BIT_ACCESSED,
  389. (unsigned long *)pmdp);
  390. return ret;
  391. }
  392. #endif
  393. int ptep_clear_flush_young(struct vm_area_struct *vma,
  394. unsigned long address, pte_t *ptep)
  395. {
  396. /*
  397. * On x86 CPUs, clearing the accessed bit without a TLB flush
  398. * doesn't cause data corruption. [ It could cause incorrect
  399. * page aging and the (mistaken) reclaim of hot pages, but the
  400. * chance of that should be relatively low. ]
  401. *
  402. * So as a performance optimization don't flush the TLB when
  403. * clearing the accessed bit, it will eventually be flushed by
  404. * a context switch or a VM operation anyway. [ In the rare
  405. * event of it not getting flushed for a long time the delay
  406. * shouldn't really matter because there's no real memory
  407. * pressure for swapout to react to. ]
  408. */
  409. return ptep_test_and_clear_young(vma, address, ptep);
  410. }
  411. #ifdef CONFIG_TRANSPARENT_HUGEPAGE
  412. int pmdp_clear_flush_young(struct vm_area_struct *vma,
  413. unsigned long address, pmd_t *pmdp)
  414. {
  415. int young;
  416. VM_BUG_ON(address & ~HPAGE_PMD_MASK);
  417. young = pmdp_test_and_clear_young(vma, address, pmdp);
  418. if (young)
  419. flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
  420. return young;
  421. }
  422. #endif
  423. /**
  424. * reserve_top_address - reserves a hole in the top of kernel address space
  425. * @reserve - size of hole to reserve
  426. *
  427. * Can be used to relocate the fixmap area and poke a hole in the top
  428. * of kernel address space to make room for a hypervisor.
  429. */
  430. void __init reserve_top_address(unsigned long reserve)
  431. {
  432. #ifdef CONFIG_X86_32
  433. BUG_ON(fixmaps_set > 0);
  434. __FIXADDR_TOP = round_down(-reserve, 1 << PMD_SHIFT) - PAGE_SIZE;
  435. printk(KERN_INFO "Reserving virtual address space above 0x%08lx (rounded to 0x%08lx)\n",
  436. -reserve, __FIXADDR_TOP + PAGE_SIZE);
  437. #endif
  438. }
  439. int fixmaps_set;
  440. void __native_set_fixmap(enum fixed_addresses idx, pte_t pte)
  441. {
  442. unsigned long address = __fix_to_virt(idx);
  443. if (idx >= __end_of_fixed_addresses) {
  444. BUG();
  445. return;
  446. }
  447. set_pte_vaddr(address, pte);
  448. fixmaps_set++;
  449. }
  450. void native_set_fixmap(enum fixed_addresses idx, phys_addr_t phys,
  451. pgprot_t flags)
  452. {
  453. __native_set_fixmap(idx, pfn_pte(phys >> PAGE_SHIFT, flags));
  454. }
  455. #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
  456. /**
  457. * pud_set_huge - setup kernel PUD mapping
  458. *
  459. * MTRRs can override PAT memory types with 4KiB granularity. Therefore, this
  460. * function sets up a huge page only if any of the following conditions are met:
  461. *
  462. * - MTRRs are disabled, or
  463. *
  464. * - MTRRs are enabled and the range is completely covered by a single MTRR, or
  465. *
  466. * - MTRRs are enabled and the corresponding MTRR memory type is WB, which
  467. * has no effect on the requested PAT memory type.
  468. *
  469. * Callers should try to decrease page size (1GB -> 2MB -> 4K) if the bigger
  470. * page mapping attempt fails.
  471. *
  472. * Returns 1 on success and 0 on failure.
  473. */
  474. int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
  475. {
  476. u8 mtrr, uniform;
  477. mtrr = mtrr_type_lookup(addr, addr + PUD_SIZE, &uniform);
  478. if ((mtrr != MTRR_TYPE_INVALID) && (!uniform) &&
  479. (mtrr != MTRR_TYPE_WRBACK))
  480. return 0;
  481. prot = pgprot_4k_2_large(prot);
  482. set_pte((pte_t *)pud, pfn_pte(
  483. (u64)addr >> PAGE_SHIFT,
  484. __pgprot(pgprot_val(prot) | _PAGE_PSE)));
  485. return 1;
  486. }
  487. /**
  488. * pmd_set_huge - setup kernel PMD mapping
  489. *
  490. * See text over pud_set_huge() above.
  491. *
  492. * Returns 1 on success and 0 on failure.
  493. */
  494. int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot)
  495. {
  496. u8 mtrr, uniform;
  497. mtrr = mtrr_type_lookup(addr, addr + PMD_SIZE, &uniform);
  498. if ((mtrr != MTRR_TYPE_INVALID) && (!uniform) &&
  499. (mtrr != MTRR_TYPE_WRBACK)) {
  500. pr_warn_once("%s: Cannot satisfy [mem %#010llx-%#010llx] with a huge-page mapping due to MTRR override.\n",
  501. __func__, addr, addr + PMD_SIZE);
  502. return 0;
  503. }
  504. prot = pgprot_4k_2_large(prot);
  505. set_pte((pte_t *)pmd, pfn_pte(
  506. (u64)addr >> PAGE_SHIFT,
  507. __pgprot(pgprot_val(prot) | _PAGE_PSE)));
  508. return 1;
  509. }
  510. /**
  511. * pud_clear_huge - clear kernel PUD mapping when it is set
  512. *
  513. * Returns 1 on success and 0 on failure (no PUD map is found).
  514. */
  515. int pud_clear_huge(pud_t *pud)
  516. {
  517. if (pud_large(*pud)) {
  518. pud_clear(pud);
  519. return 1;
  520. }
  521. return 0;
  522. }
  523. /**
  524. * pmd_clear_huge - clear kernel PMD mapping when it is set
  525. *
  526. * Returns 1 on success and 0 on failure (no PMD map is found).
  527. */
  528. int pmd_clear_huge(pmd_t *pmd)
  529. {
  530. if (pmd_large(*pmd)) {
  531. pmd_clear(pmd);
  532. return 1;
  533. }
  534. return 0;
  535. }
  536. #endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */