@@ -375,13 +375,15 @@ static void r4k_flush_cache_mm(struct mm_struct *mm)
375375struct flush_cache_page_args {
376376 struct vm_area_struct * vma ;
377377 unsigned long addr ;
378+ unsigned long pfn ;
378379};
379380
380381static inline void local_r4k_flush_cache_page (void * args )
381382{
382383 struct flush_cache_page_args * fcp_args = args ;
383384 struct vm_area_struct * vma = fcp_args -> vma ;
384385 unsigned long addr = fcp_args -> addr ;
386+ unsigned long paddr = fcp_args -> pfn << PAGE_SHIFT ;
385387 int exec = vma -> vm_flags & VM_EXEC ;
386388 struct mm_struct * mm = vma -> vm_mm ;
387389 pgd_t * pgdp ;
@@ -431,11 +433,12 @@ static inline void local_r4k_flush_cache_page(void *args)
431433 * Do indexed flush, too much work to get the (possible) TLB refills
432434 * to work correctly.
433435 */
434- addr = INDEX_BASE + (addr & (dcache_size - 1 ));
435436 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc )) {
436- r4k_blast_dcache_page_indexed (addr );
437- if (exec && !cpu_icache_snoops_remote_store )
438- r4k_blast_scache_page_indexed (addr );
437+ r4k_blast_dcache_page_indexed (cpu_has_pindexed_dcache ?
438+ paddr : addr );
439+ if (exec && !cpu_icache_snoops_remote_store ) {
440+ r4k_blast_scache_page_indexed (paddr );
441+ }
439442 }
440443 if (exec ) {
441444 if (cpu_has_vtag_icache ) {
@@ -455,6 +458,7 @@ static void r4k_flush_cache_page(struct vm_area_struct *vma,
455458
456459 args .vma = vma ;
457460 args .addr = addr ;
461+ args .pfn = pfn ;
458462
459463 on_each_cpu (local_r4k_flush_cache_page , & args , 1 , 1 );
460464}
@@ -956,6 +960,7 @@ static void __init probe_pcache(void)
956960 switch (c -> cputype ) {
957961 case CPU_20KC :
958962 case CPU_25KF :
963+ c -> dcache .flags |= MIPS_CACHE_PINDEX ;
959964 case CPU_R10000 :
960965 case CPU_R12000 :
961966 case CPU_SB1 :
0 commit comments