linux-mips
[Top] [All Lists]

Re: vmalloc bugs in 2.4.5???

To: Atsushi Nemoto <nemoto@toshiba-tops.co.jp>
Subject: Re: vmalloc bugs in 2.4.5???
From: Ralf Baechle <ralf@oss.sgi.com>
Date: Thu, 27 Dec 2001 01:12:22 -0200
Cc: dony.he@huawei.com, linux-mips@oss.sgi.com
In-reply-to: <20011227.105518.74756316.nemoto@toshiba-tops.co.jp>; from nemoto@toshiba-tops.co.jp on Thu, Dec 27, 2001 at 10:55:18AM +0900
References: <20011106130839.B30219@dea.linux-mips.net> <20011107.103947.74756322.nemoto@toshiba-tops.co.jp> <20011226013221.A737@dea.linux-mips.net> <20011227.105518.74756316.nemoto@toshiba-tops.co.jp>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mutt/1.2.5i
On Thu, Dec 27, 2001 at 10:55:18AM +0900, Atsushi Nemoto wrote:

> >> In somewhere between 2.4.6 and 2.4.9, the call to flush_cache_all()
> >> disappered from vmalloc_area_pages().  I have a data corruption
> >> problem in vmalloc()ed area without this call.  I think we still
> >> need this call.
> 
> ralf> Have you ever resolved this problem?  I've just doublechecked
> ralf> the vmalloc code and it seems as if it should be entirely safe
> ralf> without these two calls.  The tlb is flushed on vfree so no
> ralf> stale entries for a vmalloc address can ever be in the tlb at
> ralf> vmalloc time, so this flush_tlb_all() is just an expensive nop.
> ralf> And the same it true for flush_cache_all() no matter if caches
> ralf> are physically or virtually indexed.
> 
> I am still using the patch and have not tried without the two calls
> recently...
> 
> When I found this problem, I suppose that vmalloc called after
> free_pages causes the data corruption.  vmalloc can re-use pages freed
> by free_pages and it seems free_pages does not flush cache.  If
> vmalloc is to use a page which is associated with dirty cache and has
> different "color", virtual aliasing happens and data may be corrupt.
> Is this wrong?

Yes, you're right as for the cache.  But there is no reason for the
TLB flush, right?

  Ralf

<Prev in Thread] Current Thread [Next in Thread>