Linux MIPS Architecture development
 help / color / mirror / Atom feed
* bug in the latest cache code?
@ 2000-08-10  1:08 Jun Sun
  2000-08-10  2:30 ` Atsushi Nemoto
  2000-08-10 17:38 ` Ralf Baechle
  0 siblings, 2 replies; 4+ messages in thread
From: Jun Sun @ 2000-08-10  1:08 UTC (permalink / raw)
  To: linux, linux-mips


Ralf,

I spent the last a few days to track down a problem where /sbin/init
hangs forever.  It turns out, I believe, to be a bug introduced in the
recent cache code change.

A new function, r4k_flush_icache_page_i32(), was added recently.  It
calls blast_icache32_page(), which uses Hit cache operations to flush
cache.  Unfortunately, that will generate TLB fault if virtual address
is not present in TLB.  Under certain conditions,
r4k_flush_icache_page_i32() will be called in the middle of handling a
page fault, and it will then generate the same page fault again with
cache hit operation.  This causes a deadlock (on current->mm->mmap_sem).

I read the previous version of code.  The fix seems to be using the
indexed cache operation.  Here is the fix, and apparently it fixes the
problem on my board.

Jun

-----------

static void
r4k_flush_icache_page_i32(struct vm_area_struct *vma, struct page *page,
                      unsigned long address)
{
        if (!(vma->vm_flags & VM_EXEC))
                return;

-        blast_icache32_page(address);
+        address = KSEG0 + (address & PAGE_MASK & (dcache_size - 1));
+        blast_icache32_page_indexed(address);
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-08-10 17:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-08-10  1:08 bug in the latest cache code? Jun Sun
2000-08-10  2:30 ` Atsushi Nemoto
2000-08-10 17:38 ` Ralf Baechle
2000-08-10 17:50   ` Jun Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox