diff options
Diffstat (limited to 'arch/sparc/mm')
-rw-r--r-- | arch/sparc/mm/init_64.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 6ea73da29312..6ffc7e911d50 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -258,21 +258,16 @@ static inline void tsb_insert(struct tsb *ent, unsigned long tag, unsigned long | |||
258 | unsigned long _PAGE_ALL_SZ_BITS __read_mostly; | 258 | unsigned long _PAGE_ALL_SZ_BITS __read_mostly; |
259 | unsigned long _PAGE_SZBITS __read_mostly; | 259 | unsigned long _PAGE_SZBITS __read_mostly; |
260 | 260 | ||
261 | void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) | 261 | static void flush_dcache(unsigned long pfn) |
262 | { | 262 | { |
263 | struct mm_struct *mm; | 263 | struct page *page; |
264 | struct tsb *tsb; | ||
265 | unsigned long tag, flags; | ||
266 | unsigned long tsb_index, tsb_hash_shift; | ||
267 | 264 | ||
268 | if (tlb_type != hypervisor) { | 265 | page = pfn_to_page(pfn); |
269 | unsigned long pfn = pte_pfn(pte); | 266 | if (page && page_mapping(page)) { |
270 | unsigned long pg_flags; | 267 | unsigned long pg_flags; |
271 | struct page *page; | ||
272 | 268 | ||
273 | if (pfn_valid(pfn) && | 269 | pg_flags = page->flags; |
274 | (page = pfn_to_page(pfn), page_mapping(page)) && | 270 | if (pg_flags & (1UL << PG_dcache_dirty)) { |
275 | ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) { | ||
276 | int cpu = ((pg_flags >> PG_dcache_cpu_shift) & | 271 | int cpu = ((pg_flags >> PG_dcache_cpu_shift) & |
277 | PG_dcache_cpu_mask); | 272 | PG_dcache_cpu_mask); |
278 | int this_cpu = get_cpu(); | 273 | int this_cpu = get_cpu(); |
@@ -290,6 +285,21 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t p | |||
290 | put_cpu(); | 285 | put_cpu(); |
291 | } | 286 | } |
292 | } | 287 | } |
288 | } | ||
289 | |||
290 | void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) | ||
291 | { | ||
292 | struct mm_struct *mm; | ||
293 | struct tsb *tsb; | ||
294 | unsigned long tag, flags; | ||
295 | unsigned long tsb_index, tsb_hash_shift; | ||
296 | |||
297 | if (tlb_type != hypervisor) { | ||
298 | unsigned long pfn = pte_pfn(pte); | ||
299 | |||
300 | if (pfn_valid(pfn)) | ||
301 | flush_dcache(pfn); | ||
302 | } | ||
293 | 303 | ||
294 | mm = vma->vm_mm; | 304 | mm = vma->vm_mm; |
295 | 305 | ||