tlbflush.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. /*
  2. * arch/arm/include/asm/tlbflush.h
  3. *
  4. * Copyright (C) 1999-2003 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef _ASMARM_TLBFLUSH_H
  11. #define _ASMARM_TLBFLUSH_H
  12. #ifndef CONFIG_MMU
  13. #define tlb_flush(tlb) ((void) tlb)
  14. #else /* CONFIG_MMU */
  15. #include <asm/glue.h>
  16. #define TLB_V3_PAGE (1 << 0)
  17. #define TLB_V4_U_PAGE (1 << 1)
  18. #define TLB_V4_D_PAGE (1 << 2)
  19. #define TLB_V4_I_PAGE (1 << 3)
  20. #define TLB_V6_U_PAGE (1 << 4)
  21. #define TLB_V6_D_PAGE (1 << 5)
  22. #define TLB_V6_I_PAGE (1 << 6)
  23. #define TLB_V3_FULL (1 << 8)
  24. #define TLB_V4_U_FULL (1 << 9)
  25. #define TLB_V4_D_FULL (1 << 10)
  26. #define TLB_V4_I_FULL (1 << 11)
  27. #define TLB_V6_U_FULL (1 << 12)
  28. #define TLB_V6_D_FULL (1 << 13)
  29. #define TLB_V6_I_FULL (1 << 14)
  30. #define TLB_V6_U_ASID (1 << 16)
  31. #define TLB_V6_D_ASID (1 << 17)
  32. #define TLB_V6_I_ASID (1 << 18)
  33. #define TLB_BTB (1 << 28)
  34. /* Unified Inner Shareable TLB operations (ARMv7 MP extensions) */
  35. #define TLB_V7_UIS_PAGE (1 << 19)
  36. #define TLB_V7_UIS_FULL (1 << 20)
  37. #define TLB_V7_UIS_ASID (1 << 21)
  38. /* Inner Shareable BTB operation (ARMv7 MP extensions) */
  39. #define TLB_V7_IS_BTB (1 << 22)
  40. #define TLB_L2CLEAN_FR (1 << 29) /* Feroceon */
  41. #define TLB_DCLEAN (1 << 30)
  42. #define TLB_WB (1 << 31)
  43. /*
  44. * MMU TLB Model
  45. * =============
  46. *
  47. * We have the following to choose from:
  48. * v3 - ARMv3
  49. * v4 - ARMv4 without write buffer
  50. * v4wb - ARMv4 with write buffer without I TLB flush entry instruction
  51. * v4wbi - ARMv4 with write buffer with I TLB flush entry instruction
  52. * fr - Feroceon (v4wbi with non-outer-cacheable page table walks)
  53. * fa - Faraday (v4 with write buffer with UTLB and branch target buffer (BTB))
  54. * v6wbi - ARMv6 with write buffer with I TLB flush entry instruction
  55. * v7wbi - identical to v6wbi
  56. */
  57. #undef _TLB
  58. #undef MULTI_TLB
  59. #define v3_tlb_flags (TLB_V3_FULL | TLB_V3_PAGE)
  60. #ifdef CONFIG_CPU_TLB_V3
  61. # define v3_possible_flags v3_tlb_flags
  62. # define v3_always_flags v3_tlb_flags
  63. # ifdef _TLB
  64. # define MULTI_TLB 1
  65. # else
  66. # define _TLB v3
  67. # endif
  68. #else
  69. # define v3_possible_flags 0
  70. # define v3_always_flags (-1UL)
  71. #endif
  72. #define v4_tlb_flags (TLB_V4_U_FULL | TLB_V4_U_PAGE)
  73. #ifdef CONFIG_CPU_TLB_V4WT
  74. # define v4_possible_flags v4_tlb_flags
  75. # define v4_always_flags v4_tlb_flags
  76. # ifdef _TLB
  77. # define MULTI_TLB 1
  78. # else
  79. # define _TLB v4
  80. # endif
  81. #else
  82. # define v4_possible_flags 0
  83. # define v4_always_flags (-1UL)
  84. #endif
  85. #define fa_tlb_flags (TLB_WB | TLB_BTB | TLB_DCLEAN | \
  86. TLB_V4_U_FULL | TLB_V4_U_PAGE)
  87. #ifdef CONFIG_CPU_TLB_FA
  88. # define fa_possible_flags fa_tlb_flags
  89. # define fa_always_flags fa_tlb_flags
  90. # ifdef _TLB
  91. # define MULTI_TLB 1
  92. # else
  93. # define _TLB fa
  94. # endif
  95. #else
  96. # define fa_possible_flags 0
  97. # define fa_always_flags (-1UL)
  98. #endif
  99. #define v4wbi_tlb_flags (TLB_WB | TLB_DCLEAN | \
  100. TLB_V4_I_FULL | TLB_V4_D_FULL | \
  101. TLB_V4_I_PAGE | TLB_V4_D_PAGE)
  102. #ifdef CONFIG_CPU_TLB_V4WBI
  103. # define v4wbi_possible_flags v4wbi_tlb_flags
  104. # define v4wbi_always_flags v4wbi_tlb_flags
  105. # ifdef _TLB
  106. # define MULTI_TLB 1
  107. # else
  108. # define _TLB v4wbi
  109. # endif
  110. #else
  111. # define v4wbi_possible_flags 0
  112. # define v4wbi_always_flags (-1UL)
  113. #endif
  114. #define fr_tlb_flags (TLB_WB | TLB_DCLEAN | TLB_L2CLEAN_FR | \
  115. TLB_V4_I_FULL | TLB_V4_D_FULL | \
  116. TLB_V4_I_PAGE | TLB_V4_D_PAGE)
  117. #ifdef CONFIG_CPU_TLB_FEROCEON
  118. # define fr_possible_flags fr_tlb_flags
  119. # define fr_always_flags fr_tlb_flags
  120. # ifdef _TLB
  121. # define MULTI_TLB 1
  122. # else
  123. # define _TLB v4wbi
  124. # endif
  125. #else
  126. # define fr_possible_flags 0
  127. # define fr_always_flags (-1UL)
  128. #endif
  129. #define v4wb_tlb_flags (TLB_WB | TLB_DCLEAN | \
  130. TLB_V4_I_FULL | TLB_V4_D_FULL | \
  131. TLB_V4_D_PAGE)
  132. #ifdef CONFIG_CPU_TLB_V4WB
  133. # define v4wb_possible_flags v4wb_tlb_flags
  134. # define v4wb_always_flags v4wb_tlb_flags
  135. # ifdef _TLB
  136. # define MULTI_TLB 1
  137. # else
  138. # define _TLB v4wb
  139. # endif
  140. #else
  141. # define v4wb_possible_flags 0
  142. # define v4wb_always_flags (-1UL)
  143. #endif
  144. #define v6wbi_tlb_flags (TLB_WB | TLB_DCLEAN | TLB_BTB | \
  145. TLB_V6_I_FULL | TLB_V6_D_FULL | \
  146. TLB_V6_I_PAGE | TLB_V6_D_PAGE | \
  147. TLB_V6_I_ASID | TLB_V6_D_ASID)
  148. #ifdef CONFIG_CPU_TLB_V6
  149. # define v6wbi_possible_flags v6wbi_tlb_flags
  150. # define v6wbi_always_flags v6wbi_tlb_flags
  151. # ifdef _TLB
  152. # define MULTI_TLB 1
  153. # else
  154. # define _TLB v6wbi
  155. # endif
  156. #else
  157. # define v6wbi_possible_flags 0
  158. # define v6wbi_always_flags (-1UL)
  159. #endif
  160. #ifdef CONFIG_SMP
  161. #define v7wbi_tlb_flags (TLB_WB | TLB_DCLEAN | TLB_V7_IS_BTB | \
  162. TLB_V7_UIS_FULL | TLB_V7_UIS_PAGE | TLB_V7_UIS_ASID)
  163. #else
  164. #define v7wbi_tlb_flags (TLB_WB | TLB_DCLEAN | TLB_BTB | \
  165. TLB_V6_U_FULL | TLB_V6_U_PAGE | TLB_V6_U_ASID)
  166. #endif
  167. #ifdef CONFIG_CPU_TLB_V7
  168. # define v7wbi_possible_flags v7wbi_tlb_flags
  169. # define v7wbi_always_flags v7wbi_tlb_flags
  170. # ifdef _TLB
  171. # define MULTI_TLB 1
  172. # else
  173. # define _TLB v7wbi
  174. # endif
  175. #else
  176. # define v7wbi_possible_flags 0
  177. # define v7wbi_always_flags (-1UL)
  178. #endif
  179. #ifndef _TLB
  180. #error Unknown TLB model
  181. #endif
  182. #ifndef __ASSEMBLY__
  183. #include <linux/sched.h>
  184. struct cpu_tlb_fns {
  185. void (*flush_user_range)(unsigned long, unsigned long, struct vm_area_struct *);
  186. void (*flush_kern_range)(unsigned long, unsigned long);
  187. unsigned long tlb_flags;
  188. };
  189. /*
  190. * Select the calling method
  191. */
  192. #ifdef MULTI_TLB
  193. #define __cpu_flush_user_tlb_range cpu_tlb.flush_user_range
  194. #define __cpu_flush_kern_tlb_range cpu_tlb.flush_kern_range
  195. #else
  196. #define __cpu_flush_user_tlb_range __glue(_TLB,_flush_user_tlb_range)
  197. #define __cpu_flush_kern_tlb_range __glue(_TLB,_flush_kern_tlb_range)
  198. extern void __cpu_flush_user_tlb_range(unsigned long, unsigned long, struct vm_area_struct *);
  199. extern void __cpu_flush_kern_tlb_range(unsigned long, unsigned long);
  200. #endif
  201. extern struct cpu_tlb_fns cpu_tlb;
  202. #define __cpu_tlb_flags cpu_tlb.tlb_flags
  203. /*
  204. * TLB Management
  205. * ==============
  206. *
  207. * The arch/arm/mm/tlb-*.S files implement these methods.
  208. *
  209. * The TLB specific code is expected to perform whatever tests it
  210. * needs to determine if it should invalidate the TLB for each
  211. * call. Start addresses are inclusive and end addresses are
  212. * exclusive; it is safe to round these addresses down.
  213. *
  214. * flush_tlb_all()
  215. *
  216. * Invalidate the entire TLB.
  217. *
  218. * flush_tlb_mm(mm)
  219. *
  220. * Invalidate all TLB entries in a particular address
  221. * space.
  222. * - mm - mm_struct describing address space
  223. *
  224. * flush_tlb_range(mm,start,end)
  225. *
  226. * Invalidate a range of TLB entries in the specified
  227. * address space.
  228. * - mm - mm_struct describing address space
  229. * - start - start address (may not be aligned)
  230. * - end - end address (exclusive, may not be aligned)
  231. *
  232. * flush_tlb_page(vaddr,vma)
  233. *
  234. * Invalidate the specified page in the specified address range.
  235. * - vaddr - virtual address (may not be aligned)
  236. * - vma - vma_struct describing address range
  237. *
  238. * flush_kern_tlb_page(kaddr)
  239. *
  240. * Invalidate the TLB entry for the specified page. The address
  241. * will be in the kernels virtual memory space. Current uses
  242. * only require the D-TLB to be invalidated.
  243. * - kaddr - Kernel virtual memory address
  244. */
  245. /*
  246. * We optimise the code below by:
  247. * - building a set of TLB flags that might be set in __cpu_tlb_flags
  248. * - building a set of TLB flags that will always be set in __cpu_tlb_flags
  249. * - if we're going to need __cpu_tlb_flags, access it once and only once
  250. *
  251. * This allows us to build optimal assembly for the single-CPU type case,
  252. * and as close to optimal given the compiler constrants for multi-CPU
  253. * case. We could do better for the multi-CPU case if the compiler
  254. * implemented the "%?" method, but this has been discontinued due to too
  255. * many people getting it wrong.
  256. */
  257. #define possible_tlb_flags (v3_possible_flags | \
  258. v4_possible_flags | \
  259. v4wbi_possible_flags | \
  260. fr_possible_flags | \
  261. v4wb_possible_flags | \
  262. fa_possible_flags | \
  263. v6wbi_possible_flags | \
  264. v7wbi_possible_flags)
  265. #define always_tlb_flags (v3_always_flags & \
  266. v4_always_flags & \
  267. v4wbi_always_flags & \
  268. fr_always_flags & \
  269. v4wb_always_flags & \
  270. fa_always_flags & \
  271. v6wbi_always_flags & \
  272. v7wbi_always_flags)
  273. #define tlb_flag(f) ((always_tlb_flags & (f)) || (__tlb_flag & possible_tlb_flags & (f)))
  274. static inline void local_flush_tlb_all(void)
  275. {
  276. const int zero = 0;
  277. const unsigned int __tlb_flag = __cpu_tlb_flags;
  278. if (tlb_flag(TLB_WB))
  279. dsb();
  280. if (tlb_flag(TLB_V3_FULL))
  281. asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc");
  282. if (tlb_flag(TLB_V4_U_FULL | TLB_V6_U_FULL))
  283. asm("mcr p15, 0, %0, c8, c7, 0" : : "r" (zero) : "cc");
  284. if (tlb_flag(TLB_V4_D_FULL | TLB_V6_D_FULL))
  285. asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc");
  286. if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL))
  287. asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
  288. if (tlb_flag(TLB_V7_UIS_FULL))
  289. asm("mcr p15, 0, %0, c8, c3, 0" : : "r" (zero) : "cc");
  290. if (tlb_flag(TLB_BTB)) {
  291. /* flush the branch target cache */
  292. asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
  293. dsb();
  294. isb();
  295. }
  296. if (tlb_flag(TLB_V7_IS_BTB)) {
  297. /* flush the branch target cache */
  298. asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero) : "cc");
  299. dsb();
  300. isb();
  301. }
  302. }
  303. static inline void local_flush_tlb_mm(struct mm_struct *mm)
  304. {
  305. const int zero = 0;
  306. const int asid = ASID(mm);
  307. const unsigned int __tlb_flag = __cpu_tlb_flags;
  308. if (tlb_flag(TLB_WB))
  309. dsb();
  310. if (cpumask_test_cpu(get_cpu(), mm_cpumask(mm))) {
  311. if (tlb_flag(TLB_V3_FULL))
  312. asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc");
  313. if (tlb_flag(TLB_V4_U_FULL))
  314. asm("mcr p15, 0, %0, c8, c7, 0" : : "r" (zero) : "cc");
  315. if (tlb_flag(TLB_V4_D_FULL))
  316. asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc");
  317. if (tlb_flag(TLB_V4_I_FULL))
  318. asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
  319. }
  320. put_cpu();
  321. if (tlb_flag(TLB_V6_U_ASID))
  322. asm("mcr p15, 0, %0, c8, c7, 2" : : "r" (asid) : "cc");
  323. if (tlb_flag(TLB_V6_D_ASID))
  324. asm("mcr p15, 0, %0, c8, c6, 2" : : "r" (asid) : "cc");
  325. if (tlb_flag(TLB_V6_I_ASID))
  326. asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc");
  327. if (tlb_flag(TLB_V7_UIS_ASID))
  328. asm("mcr p15, 0, %0, c8, c3, 2" : : "r" (asid) : "cc");
  329. if (tlb_flag(TLB_BTB)) {
  330. /* flush the branch target cache */
  331. asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
  332. dsb();
  333. }
  334. if (tlb_flag(TLB_V7_IS_BTB)) {
  335. /* flush the branch target cache */
  336. asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero) : "cc");
  337. dsb();
  338. isb();
  339. }
  340. }
  341. static inline void
  342. local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
  343. {
  344. const int zero = 0;
  345. const unsigned int __tlb_flag = __cpu_tlb_flags;
  346. uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm);
  347. if (tlb_flag(TLB_WB))
  348. dsb();
  349. if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) {
  350. if (tlb_flag(TLB_V3_PAGE))
  351. asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (uaddr) : "cc");
  352. if (tlb_flag(TLB_V4_U_PAGE))
  353. asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (uaddr) : "cc");
  354. if (tlb_flag(TLB_V4_D_PAGE))
  355. asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc");
  356. if (tlb_flag(TLB_V4_I_PAGE))
  357. asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc");
  358. if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL))
  359. asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
  360. }
  361. if (tlb_flag(TLB_V6_U_PAGE))
  362. asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (uaddr) : "cc");
  363. if (tlb_flag(TLB_V6_D_PAGE))
  364. asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc");
  365. if (tlb_flag(TLB_V6_I_PAGE))
  366. asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc");
  367. if (tlb_flag(TLB_V7_UIS_PAGE))
  368. asm("mcr p15, 0, %0, c8, c3, 1" : : "r" (uaddr) : "cc");
  369. if (tlb_flag(TLB_BTB)) {
  370. /* flush the branch target cache */
  371. asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
  372. dsb();
  373. }
  374. if (tlb_flag(TLB_V7_IS_BTB)) {
  375. /* flush the branch target cache */
  376. asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero) : "cc");
  377. dsb();
  378. isb();
  379. }
  380. }
  381. static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
  382. {
  383. const int zero = 0;
  384. const unsigned int __tlb_flag = __cpu_tlb_flags;
  385. kaddr &= PAGE_MASK;
  386. if (tlb_flag(TLB_WB))
  387. dsb();
  388. if (tlb_flag(TLB_V3_PAGE))
  389. asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (kaddr) : "cc");
  390. if (tlb_flag(TLB_V4_U_PAGE))
  391. asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (kaddr) : "cc");
  392. if (tlb_flag(TLB_V4_D_PAGE))
  393. asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (kaddr) : "cc");
  394. if (tlb_flag(TLB_V4_I_PAGE))
  395. asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc");
  396. if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL))
  397. asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
  398. if (tlb_flag(TLB_V6_U_PAGE))
  399. asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (kaddr) : "cc");
  400. if (tlb_flag(TLB_V6_D_PAGE))
  401. asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (kaddr) : "cc");
  402. if (tlb_flag(TLB_V6_I_PAGE))
  403. asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc");
  404. if (tlb_flag(TLB_V7_UIS_PAGE))
  405. asm("mcr p15, 0, %0, c8, c3, 1" : : "r" (kaddr) : "cc");
  406. if (tlb_flag(TLB_BTB)) {
  407. /* flush the branch target cache */
  408. asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
  409. dsb();
  410. isb();
  411. }
  412. if (tlb_flag(TLB_V7_IS_BTB)) {
  413. /* flush the branch target cache */
  414. asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero) : "cc");
  415. dsb();
  416. isb();
  417. }
  418. }
  419. /*
  420. * flush_pmd_entry
  421. *
  422. * Flush a PMD entry (word aligned, or double-word aligned) to
  423. * RAM if the TLB for the CPU we are running on requires this.
  424. * This is typically used when we are creating PMD entries.
  425. *
  426. * clean_pmd_entry
  427. *
  428. * Clean (but don't drain the write buffer) if the CPU requires
  429. * these operations. This is typically used when we are removing
  430. * PMD entries.
  431. */
  432. static inline void flush_pmd_entry(pmd_t *pmd)
  433. {
  434. const unsigned int __tlb_flag = __cpu_tlb_flags;
  435. if (tlb_flag(TLB_DCLEAN))
  436. asm("mcr p15, 0, %0, c7, c10, 1 @ flush_pmd"
  437. : : "r" (pmd) : "cc");
  438. if (tlb_flag(TLB_L2CLEAN_FR))
  439. asm("mcr p15, 1, %0, c15, c9, 1 @ L2 flush_pmd"
  440. : : "r" (pmd) : "cc");
  441. if (tlb_flag(TLB_WB))
  442. dsb();
  443. }
  444. static inline void clean_pmd_entry(pmd_t *pmd)
  445. {
  446. const unsigned int __tlb_flag = __cpu_tlb_flags;
  447. if (tlb_flag(TLB_DCLEAN))
  448. asm("mcr p15, 0, %0, c7, c10, 1 @ flush_pmd"
  449. : : "r" (pmd) : "cc");
  450. if (tlb_flag(TLB_L2CLEAN_FR))
  451. asm("mcr p15, 1, %0, c15, c9, 1 @ L2 flush_pmd"
  452. : : "r" (pmd) : "cc");
  453. }
  454. #undef tlb_flag
  455. #undef always_tlb_flags
  456. #undef possible_tlb_flags
  457. /*
  458. * Convert calls to our calling convention.
  459. */
  460. #define local_flush_tlb_range(vma,start,end) __cpu_flush_user_tlb_range(start,end,vma)
  461. #define local_flush_tlb_kernel_range(s,e) __cpu_flush_kern_tlb_range(s,e)
  462. #ifndef CONFIG_SMP
  463. #define flush_tlb_all local_flush_tlb_all
  464. #define flush_tlb_mm local_flush_tlb_mm
  465. #define flush_tlb_page local_flush_tlb_page
  466. #define flush_tlb_kernel_page local_flush_tlb_kernel_page
  467. #define flush_tlb_range local_flush_tlb_range
  468. #define flush_tlb_kernel_range local_flush_tlb_kernel_range
  469. #else
  470. extern void flush_tlb_all(void);
  471. extern void flush_tlb_mm(struct mm_struct *mm);
  472. extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr);
  473. extern void flush_tlb_kernel_page(unsigned long kaddr);
  474. extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
  475. extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
  476. #endif
  477. /*
  478. * if PG_dcache_dirty is set for the page, we need to ensure that any
  479. * cache entries for the kernels virtual memory range are written
  480. * back to the page.
  481. */
  482. extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
  483. pte_t *ptep);
  484. #endif
  485. #endif /* CONFIG_MMU */
  486. #endif