init.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. /*
  2. * linux/arch/x86_64/mm/init.c
  3. *
  4. * Copyright (C) 1995 Linus Torvalds
  5. * Copyright (C) 2000 Pavel Machek <pavel@suse.cz>
  6. * Copyright (C) 2002,2003 Andi Kleen <ak@suse.de>
  7. */
  8. #include <linux/config.h>
  9. #include <linux/signal.h>
  10. #include <linux/sched.h>
  11. #include <linux/kernel.h>
  12. #include <linux/errno.h>
  13. #include <linux/string.h>
  14. #include <linux/types.h>
  15. #include <linux/ptrace.h>
  16. #include <linux/mman.h>
  17. #include <linux/mm.h>
  18. #include <linux/swap.h>
  19. #include <linux/smp.h>
  20. #include <linux/init.h>
  21. #include <linux/pagemap.h>
  22. #include <linux/bootmem.h>
  23. #include <linux/proc_fs.h>
  24. #include <linux/pci.h>
  25. #include <asm/processor.h>
  26. #include <asm/system.h>
  27. #include <asm/uaccess.h>
  28. #include <asm/pgtable.h>
  29. #include <asm/pgalloc.h>
  30. #include <asm/dma.h>
  31. #include <asm/fixmap.h>
  32. #include <asm/e820.h>
  33. #include <asm/apic.h>
  34. #include <asm/tlb.h>
  35. #include <asm/mmu_context.h>
  36. #include <asm/proto.h>
  37. #include <asm/smp.h>
  38. #include <asm/sections.h>
  39. #ifndef Dprintk
  40. #define Dprintk(x...)
  41. #endif
  42. static unsigned long dma_reserve __initdata;
  43. DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
  44. /*
  45. * NOTE: pagetable_init alloc all the fixmap pagetables contiguous on the
  46. * physical space so we can cache the place of the first one and move
  47. * around without checking the pgd every time.
  48. */
  49. void show_mem(void)
  50. {
  51. long i, total = 0, reserved = 0;
  52. long shared = 0, cached = 0;
  53. pg_data_t *pgdat;
  54. struct page *page;
  55. printk(KERN_INFO "Mem-info:\n");
  56. show_free_areas();
  57. printk(KERN_INFO "Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
  58. for_each_pgdat(pgdat) {
  59. for (i = 0; i < pgdat->node_spanned_pages; ++i) {
  60. page = pfn_to_page(pgdat->node_start_pfn + i);
  61. total++;
  62. if (PageReserved(page))
  63. reserved++;
  64. else if (PageSwapCache(page))
  65. cached++;
  66. else if (page_count(page))
  67. shared += page_count(page) - 1;
  68. }
  69. }
  70. printk(KERN_INFO "%lu pages of RAM\n", total);
  71. printk(KERN_INFO "%lu reserved pages\n",reserved);
  72. printk(KERN_INFO "%lu pages shared\n",shared);
  73. printk(KERN_INFO "%lu pages swap cached\n",cached);
  74. }
  75. /* References to section boundaries */
  76. int after_bootmem;
  77. static void *spp_getpage(void)
  78. {
  79. void *ptr;
  80. if (after_bootmem)
  81. ptr = (void *) get_zeroed_page(GFP_ATOMIC);
  82. else
  83. ptr = alloc_bootmem_pages(PAGE_SIZE);
  84. if (!ptr || ((unsigned long)ptr & ~PAGE_MASK))
  85. panic("set_pte_phys: cannot allocate page data %s\n", after_bootmem?"after bootmem":"");
  86. Dprintk("spp_getpage %p\n", ptr);
  87. return ptr;
  88. }
  89. static void set_pte_phys(unsigned long vaddr,
  90. unsigned long phys, pgprot_t prot)
  91. {
  92. pgd_t *pgd;
  93. pud_t *pud;
  94. pmd_t *pmd;
  95. pte_t *pte, new_pte;
  96. Dprintk("set_pte_phys %lx to %lx\n", vaddr, phys);
  97. pgd = pgd_offset_k(vaddr);
  98. if (pgd_none(*pgd)) {
  99. printk("PGD FIXMAP MISSING, it should be setup in head.S!\n");
  100. return;
  101. }
  102. pud = pud_offset(pgd, vaddr);
  103. if (pud_none(*pud)) {
  104. pmd = (pmd_t *) spp_getpage();
  105. set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER));
  106. if (pmd != pmd_offset(pud, 0)) {
  107. printk("PAGETABLE BUG #01! %p <-> %p\n", pmd, pmd_offset(pud,0));
  108. return;
  109. }
  110. }
  111. pmd = pmd_offset(pud, vaddr);
  112. if (pmd_none(*pmd)) {
  113. pte = (pte_t *) spp_getpage();
  114. set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE | _PAGE_USER));
  115. if (pte != pte_offset_kernel(pmd, 0)) {
  116. printk("PAGETABLE BUG #02!\n");
  117. return;
  118. }
  119. }
  120. new_pte = pfn_pte(phys >> PAGE_SHIFT, prot);
  121. pte = pte_offset_kernel(pmd, vaddr);
  122. if (!pte_none(*pte) &&
  123. pte_val(*pte) != (pte_val(new_pte) & __supported_pte_mask))
  124. pte_ERROR(*pte);
  125. set_pte(pte, new_pte);
  126. /*
  127. * It's enough to flush this one mapping.
  128. * (PGE mappings get flushed as well)
  129. */
  130. __flush_tlb_one(vaddr);
  131. }
  132. /* NOTE: this is meant to be run only at boot */
  133. void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
  134. {
  135. unsigned long address = __fix_to_virt(idx);
  136. if (idx >= __end_of_fixed_addresses) {
  137. printk("Invalid __set_fixmap\n");
  138. return;
  139. }
  140. set_pte_phys(address, phys, prot);
  141. }
  142. unsigned long __initdata table_start, table_end;
  143. extern pmd_t temp_boot_pmds[];
  144. static struct temp_map {
  145. pmd_t *pmd;
  146. void *address;
  147. int allocated;
  148. } temp_mappings[] __initdata = {
  149. { &temp_boot_pmds[0], (void *)(40UL * 1024 * 1024) },
  150. { &temp_boot_pmds[1], (void *)(42UL * 1024 * 1024) },
  151. {}
  152. };
  153. static __init void *alloc_low_page(int *index, unsigned long *phys)
  154. {
  155. struct temp_map *ti;
  156. int i;
  157. unsigned long pfn = table_end++, paddr;
  158. void *adr;
  159. if (pfn >= end_pfn)
  160. panic("alloc_low_page: ran out of memory");
  161. for (i = 0; temp_mappings[i].allocated; i++) {
  162. if (!temp_mappings[i].pmd)
  163. panic("alloc_low_page: ran out of temp mappings");
  164. }
  165. ti = &temp_mappings[i];
  166. paddr = (pfn << PAGE_SHIFT) & PMD_MASK;
  167. set_pmd(ti->pmd, __pmd(paddr | _KERNPG_TABLE | _PAGE_PSE));
  168. ti->allocated = 1;
  169. __flush_tlb();
  170. adr = ti->address + ((pfn << PAGE_SHIFT) & ~PMD_MASK);
  171. *index = i;
  172. *phys = pfn * PAGE_SIZE;
  173. return adr;
  174. }
  175. static __init void unmap_low_page(int i)
  176. {
  177. struct temp_map *ti = &temp_mappings[i];
  178. set_pmd(ti->pmd, __pmd(0));
  179. ti->allocated = 0;
  180. }
  181. static void __init phys_pud_init(pud_t *pud, unsigned long address, unsigned long end)
  182. {
  183. long i, j;
  184. i = pud_index(address);
  185. pud = pud + i;
  186. for (; i < PTRS_PER_PUD; pud++, i++) {
  187. int map;
  188. unsigned long paddr, pmd_phys;
  189. pmd_t *pmd;
  190. paddr = address + i*PUD_SIZE;
  191. if (paddr >= end) {
  192. for (; i < PTRS_PER_PUD; i++, pud++)
  193. set_pud(pud, __pud(0));
  194. break;
  195. }
  196. if (!e820_mapped(paddr, paddr+PUD_SIZE, 0)) {
  197. set_pud(pud, __pud(0));
  198. continue;
  199. }
  200. pmd = alloc_low_page(&map, &pmd_phys);
  201. set_pud(pud, __pud(pmd_phys | _KERNPG_TABLE));
  202. for (j = 0; j < PTRS_PER_PMD; pmd++, j++, paddr += PMD_SIZE) {
  203. unsigned long pe;
  204. if (paddr >= end) {
  205. for (; j < PTRS_PER_PMD; j++, pmd++)
  206. set_pmd(pmd, __pmd(0));
  207. break;
  208. }
  209. pe = _PAGE_NX|_PAGE_PSE | _KERNPG_TABLE | _PAGE_GLOBAL | paddr;
  210. pe &= __supported_pte_mask;
  211. set_pmd(pmd, __pmd(pe));
  212. }
  213. unmap_low_page(map);
  214. }
  215. __flush_tlb();
  216. }
  217. static void __init find_early_table_space(unsigned long end)
  218. {
  219. unsigned long puds, pmds, tables;
  220. puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
  221. pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
  222. tables = round_up(puds * sizeof(pud_t), PAGE_SIZE) +
  223. round_up(pmds * sizeof(pmd_t), PAGE_SIZE);
  224. table_start = find_e820_area(0x8000, __pa_symbol(&_text), tables);
  225. if (table_start == -1UL)
  226. panic("Cannot find space for the kernel page tables");
  227. table_start >>= PAGE_SHIFT;
  228. table_end = table_start;
  229. }
  230. /* Setup the direct mapping of the physical memory at PAGE_OFFSET.
  231. This runs before bootmem is initialized and gets pages directly from the
  232. physical memory. To access them they are temporarily mapped. */
  233. void __init init_memory_mapping(unsigned long start, unsigned long end)
  234. {
  235. unsigned long next;
  236. Dprintk("init_memory_mapping\n");
  237. /*
  238. * Find space for the kernel direct mapping tables.
  239. * Later we should allocate these tables in the local node of the memory
  240. * mapped. Unfortunately this is done currently before the nodes are
  241. * discovered.
  242. */
  243. find_early_table_space(end);
  244. start = (unsigned long)__va(start);
  245. end = (unsigned long)__va(end);
  246. for (; start < end; start = next) {
  247. int map;
  248. unsigned long pud_phys;
  249. pud_t *pud = alloc_low_page(&map, &pud_phys);
  250. next = start + PGDIR_SIZE;
  251. if (next > end)
  252. next = end;
  253. phys_pud_init(pud, __pa(start), __pa(next));
  254. set_pgd(pgd_offset_k(start), mk_kernel_pgd(pud_phys));
  255. unmap_low_page(map);
  256. }
  257. asm volatile("movq %%cr4,%0" : "=r" (mmu_cr4_features));
  258. __flush_tlb_all();
  259. early_printk("kernel direct mapping tables upto %lx @ %lx-%lx\n", end,
  260. table_start<<PAGE_SHIFT,
  261. table_end<<PAGE_SHIFT);
  262. }
  263. void __cpuinit zap_low_mappings(int cpu)
  264. {
  265. if (cpu == 0) {
  266. pgd_t *pgd = pgd_offset_k(0UL);
  267. pgd_clear(pgd);
  268. } else {
  269. /*
  270. * For AP's, zap the low identity mappings by changing the cr3
  271. * to init_level4_pgt and doing local flush tlb all
  272. */
  273. asm volatile("movq %0,%%cr3" :: "r" (__pa_symbol(&init_level4_pgt)));
  274. }
  275. __flush_tlb_all();
  276. }
  277. /* Compute zone sizes for the DMA and DMA32 zones in a node. */
  278. __init void
  279. size_zones(unsigned long *z, unsigned long *h,
  280. unsigned long start_pfn, unsigned long end_pfn)
  281. {
  282. int i;
  283. unsigned long w;
  284. for (i = 0; i < MAX_NR_ZONES; i++)
  285. z[i] = 0;
  286. if (start_pfn < MAX_DMA_PFN)
  287. z[ZONE_DMA] = MAX_DMA_PFN - start_pfn;
  288. if (start_pfn < MAX_DMA32_PFN) {
  289. unsigned long dma32_pfn = MAX_DMA32_PFN;
  290. if (dma32_pfn > end_pfn)
  291. dma32_pfn = end_pfn;
  292. z[ZONE_DMA32] = dma32_pfn - start_pfn;
  293. }
  294. z[ZONE_NORMAL] = end_pfn - start_pfn;
  295. /* Remove lower zones from higher ones. */
  296. w = 0;
  297. for (i = 0; i < MAX_NR_ZONES; i++) {
  298. if (z[i])
  299. z[i] -= w;
  300. w += z[i];
  301. }
  302. /* Compute holes */
  303. w = start_pfn;
  304. for (i = 0; i < MAX_NR_ZONES; i++) {
  305. unsigned long s = w;
  306. w += z[i];
  307. h[i] = e820_hole_size(s, w);
  308. }
  309. /* Add the space pace needed for mem_map to the holes too. */
  310. for (i = 0; i < MAX_NR_ZONES; i++)
  311. h[i] += (z[i] * sizeof(struct page)) / PAGE_SIZE;
  312. /* The 16MB DMA zone has the kernel and other misc mappings.
  313. Account them too */
  314. if (h[ZONE_DMA]) {
  315. h[ZONE_DMA] += dma_reserve;
  316. if (h[ZONE_DMA] >= z[ZONE_DMA]) {
  317. printk(KERN_WARNING
  318. "Kernel too large and filling up ZONE_DMA?\n");
  319. h[ZONE_DMA] = z[ZONE_DMA];
  320. }
  321. }
  322. }
  323. #ifndef CONFIG_NUMA
  324. void __init paging_init(void)
  325. {
  326. unsigned long zones[MAX_NR_ZONES], holes[MAX_NR_ZONES];
  327. size_zones(zones, holes, 0, end_pfn);
  328. free_area_init_node(0, NODE_DATA(0), zones,
  329. __pa(PAGE_OFFSET) >> PAGE_SHIFT, holes);
  330. }
  331. #endif
  332. /* Unmap a kernel mapping if it exists. This is useful to avoid prefetches
  333. from the CPU leading to inconsistent cache lines. address and size
  334. must be aligned to 2MB boundaries.
  335. Does nothing when the mapping doesn't exist. */
  336. void __init clear_kernel_mapping(unsigned long address, unsigned long size)
  337. {
  338. unsigned long end = address + size;
  339. BUG_ON(address & ~LARGE_PAGE_MASK);
  340. BUG_ON(size & ~LARGE_PAGE_MASK);
  341. for (; address < end; address += LARGE_PAGE_SIZE) {
  342. pgd_t *pgd = pgd_offset_k(address);
  343. pud_t *pud;
  344. pmd_t *pmd;
  345. if (pgd_none(*pgd))
  346. continue;
  347. pud = pud_offset(pgd, address);
  348. if (pud_none(*pud))
  349. continue;
  350. pmd = pmd_offset(pud, address);
  351. if (!pmd || pmd_none(*pmd))
  352. continue;
  353. if (0 == (pmd_val(*pmd) & _PAGE_PSE)) {
  354. /* Could handle this, but it should not happen currently. */
  355. printk(KERN_ERR
  356. "clear_kernel_mapping: mapping has been split. will leak memory\n");
  357. pmd_ERROR(*pmd);
  358. }
  359. set_pmd(pmd, __pmd(0));
  360. }
  361. __flush_tlb_all();
  362. }
  363. static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, kcore_modules,
  364. kcore_vsyscall;
  365. void __init mem_init(void)
  366. {
  367. long codesize, reservedpages, datasize, initsize;
  368. #ifdef CONFIG_SWIOTLB
  369. if (!iommu_aperture &&
  370. (end_pfn >= 0xffffffff>>PAGE_SHIFT || force_iommu))
  371. swiotlb = 1;
  372. if (swiotlb)
  373. swiotlb_init();
  374. #endif
  375. /* How many end-of-memory variables you have, grandma! */
  376. max_low_pfn = end_pfn;
  377. max_pfn = end_pfn;
  378. num_physpages = end_pfn;
  379. high_memory = (void *) __va(end_pfn * PAGE_SIZE);
  380. /* clear the zero-page */
  381. memset(empty_zero_page, 0, PAGE_SIZE);
  382. reservedpages = 0;
  383. /* this will put all low memory onto the freelists */
  384. #ifdef CONFIG_NUMA
  385. totalram_pages = numa_free_all_bootmem();
  386. #else
  387. totalram_pages = free_all_bootmem();
  388. #endif
  389. reservedpages = end_pfn - totalram_pages - e820_hole_size(0, end_pfn);
  390. after_bootmem = 1;
  391. codesize = (unsigned long) &_etext - (unsigned long) &_text;
  392. datasize = (unsigned long) &_edata - (unsigned long) &_etext;
  393. initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
  394. /* Register memory areas for /proc/kcore */
  395. kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);
  396. kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
  397. VMALLOC_END-VMALLOC_START);
  398. kclist_add(&kcore_kernel, &_stext, _end - _stext);
  399. kclist_add(&kcore_modules, (void *)MODULES_VADDR, MODULES_LEN);
  400. kclist_add(&kcore_vsyscall, (void *)VSYSCALL_START,
  401. VSYSCALL_END - VSYSCALL_START);
  402. printk("Memory: %luk/%luk available (%ldk kernel code, %ldk reserved, %ldk data, %ldk init)\n",
  403. (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
  404. end_pfn << (PAGE_SHIFT-10),
  405. codesize >> 10,
  406. reservedpages << (PAGE_SHIFT-10),
  407. datasize >> 10,
  408. initsize >> 10);
  409. #ifdef CONFIG_SMP
  410. /*
  411. * Sync boot_level4_pgt mappings with the init_level4_pgt
  412. * except for the low identity mappings which are already zapped
  413. * in init_level4_pgt. This sync-up is essential for AP's bringup
  414. */
  415. memcpy(boot_level4_pgt+1, init_level4_pgt+1, (PTRS_PER_PGD-1)*sizeof(pgd_t));
  416. #endif
  417. }
  418. void free_initmem(void)
  419. {
  420. unsigned long addr;
  421. addr = (unsigned long)(&__init_begin);
  422. for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
  423. ClearPageReserved(virt_to_page(addr));
  424. set_page_count(virt_to_page(addr), 1);
  425. memset((void *)(addr & ~(PAGE_SIZE-1)), 0xcc, PAGE_SIZE);
  426. free_page(addr);
  427. totalram_pages++;
  428. }
  429. memset(__initdata_begin, 0xba, __initdata_end - __initdata_begin);
  430. printk ("Freeing unused kernel memory: %luk freed\n", (__init_end - __init_begin) >> 10);
  431. }
  432. #ifdef CONFIG_BLK_DEV_INITRD
  433. void free_initrd_mem(unsigned long start, unsigned long end)
  434. {
  435. if (start < (unsigned long)&_end)
  436. return;
  437. printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
  438. for (; start < end; start += PAGE_SIZE) {
  439. ClearPageReserved(virt_to_page(start));
  440. set_page_count(virt_to_page(start), 1);
  441. free_page(start);
  442. totalram_pages++;
  443. }
  444. }
  445. #endif
  446. void __init reserve_bootmem_generic(unsigned long phys, unsigned len)
  447. {
  448. /* Should check here against the e820 map to avoid double free */
  449. #ifdef CONFIG_NUMA
  450. int nid = phys_to_nid(phys);
  451. reserve_bootmem_node(NODE_DATA(nid), phys, len);
  452. #else
  453. reserve_bootmem(phys, len);
  454. #endif
  455. if (phys+len <= MAX_DMA_PFN*PAGE_SIZE)
  456. dma_reserve += len / PAGE_SIZE;
  457. }
  458. int kern_addr_valid(unsigned long addr)
  459. {
  460. unsigned long above = ((long)addr) >> __VIRTUAL_MASK_SHIFT;
  461. pgd_t *pgd;
  462. pud_t *pud;
  463. pmd_t *pmd;
  464. pte_t *pte;
  465. if (above != 0 && above != -1UL)
  466. return 0;
  467. pgd = pgd_offset_k(addr);
  468. if (pgd_none(*pgd))
  469. return 0;
  470. pud = pud_offset(pgd, addr);
  471. if (pud_none(*pud))
  472. return 0;
  473. pmd = pmd_offset(pud, addr);
  474. if (pmd_none(*pmd))
  475. return 0;
  476. if (pmd_large(*pmd))
  477. return pfn_valid(pmd_pfn(*pmd));
  478. pte = pte_offset_kernel(pmd, addr);
  479. if (pte_none(*pte))
  480. return 0;
  481. return pfn_valid(pte_pfn(*pte));
  482. }
  483. #ifdef CONFIG_SYSCTL
  484. #include <linux/sysctl.h>
  485. extern int exception_trace, page_fault_trace;
  486. static ctl_table debug_table2[] = {
  487. { 99, "exception-trace", &exception_trace, sizeof(int), 0644, NULL,
  488. proc_dointvec },
  489. { 0, }
  490. };
  491. static ctl_table debug_root_table2[] = {
  492. { .ctl_name = CTL_DEBUG, .procname = "debug", .mode = 0555,
  493. .child = debug_table2 },
  494. { 0 },
  495. };
  496. static __init int x8664_sysctl_init(void)
  497. {
  498. register_sysctl_table(debug_root_table2, 1);
  499. return 0;
  500. }
  501. __initcall(x8664_sysctl_init);
  502. #endif
  503. /* A pseudo VMAs to allow ptrace access for the vsyscall page. This only
  504. covers the 64bit vsyscall page now. 32bit has a real VMA now and does
  505. not need special handling anymore. */
  506. static struct vm_area_struct gate_vma = {
  507. .vm_start = VSYSCALL_START,
  508. .vm_end = VSYSCALL_END,
  509. .vm_page_prot = PAGE_READONLY
  510. };
  511. struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
  512. {
  513. #ifdef CONFIG_IA32_EMULATION
  514. if (test_tsk_thread_flag(tsk, TIF_IA32))
  515. return NULL;
  516. #endif
  517. return &gate_vma;
  518. }
  519. int in_gate_area(struct task_struct *task, unsigned long addr)
  520. {
  521. struct vm_area_struct *vma = get_gate_vma(task);
  522. if (!vma)
  523. return 0;
  524. return (addr >= vma->vm_start) && (addr < vma->vm_end);
  525. }
  526. /* Use this when you have no reliable task/vma, typically from interrupt
  527. * context. It is less reliable than using the task's vma and may give
  528. * false positives.
  529. */
  530. int in_gate_area_no_task(unsigned long addr)
  531. {
  532. return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END);
  533. }