[Top] [All Lists]

Re: Syncing CPU caches from userland on MIPS

To: Florian Lohoff <>
Subject: Re: Syncing CPU caches from userland on MIPS
From: Arnaud Patard (Rtp) <>
Date: Wed, 25 Nov 2009 15:39:01 +0100
Cc: Aurelien Jarno <>,
In-reply-to: <> (Florian Lohoff's message of "Wed\, 25 Nov 2009 15\:01\:05 +0100")
Organization: RtpNet
Original-recipient: rfc822;
References: <> <>
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)
Florian Lohoff <> writes:

> On Tue, Nov 24, 2009 at 07:28:41PM +0100, Aurelien Jarno wrote:
>> Hi all,
>> This question is not really kernel related, but still MIPS related, I
>> hope you don't mind.
>> Arnaud Patard and myself are trying to get qemu working on MIPS [1],
>> which includes translating TCG code (internal representation) into MIPS
>> instructions, that are then executed. Most of the code works, but we 
>> have some strange behaviors that seems related to CPU caches.
>> The code is written to a buffer, which is then executed. Before the
>> execution, the caches are synced using the cacheflush syscall:
>> | #include <sys/cachectl.h>
>> |  
>> | 
>> | static inline void flush_icache_range(unsigned long start, unsigned long 
>> stop)
>> | {
>> |     cacheflush ((void *)start, stop-start, ICACHE);
>> | }
> Would this only evict stuff from the ICACHE? When trying to execute
> a just written buffer and with a writeback DCACHE you would need to 
> explicitly writeback the DCACHE to memory and invalidate the ICACHE.

we already though about using BCACHE instead of ICACHE only but it
didn't make any difference. the bug is still there.


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