From: Stuart M. <stu...@st...> - 2003-02-14 14:55:04
|
Hi Paul This looks like a problem I hit a short while ago when using ssh. Turns out to be a problem in the generic kernel code, which is using a clear_highpage() to zero the page, which doesn't have the necessary extra cache alias prevention code. Ideally it should be replaced by clear_user_page(), but the virtual address where the page is going to be mapped isn't available at that point in the code. At this point I had a look in Marcello's tree in BK, and it turns out somebody else has already fixed this problem by simply adding a call to flush_dcache_page(). IIRC this is a post 2.4.20 change. I'm running with the attached patch to a 2.4.18 tree, and your test code appears to work for me on an SH4, I've not tried anything else. Hope this helps Stuart On Fri, 14 Feb 2003 08:47:07 -0500 pau...@ti... wrote: > I've hit what looks to be another cache bug (looks like its an alias > issue), and so far it seems to hit both SH-3 and 4. (I haven't tested > SH-2 or 5 yet). > > The problem pops up when doing an mmap() of /dev/zero and then reading > from it, the read is sometimes 0, but most of the time ends up getting > back garbage and promptly segfaulting. > > I've attached my testcode for this as well. The fault happens right on > the read. > > I've managed to fix this on SH-4 (patch attached) by doing an all out > flush_cache_all() after the activate_context() in switch_mm() .. not a > very optimal solution, but seems to do the right thing for now. > > Unfortunately this same fix doesn't help SH-3 any (after implicitly > wrapping flush_cache_all() to cache_wback_all()). > > Anyone seen this before? > > Regards, > > -- > Paul Mundt <pau...@ti...> > TimeSys Corporation > |