tlbflush.h 15 KB

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