Subject: Re: Problems flushing cache with KUSEG addresses
To: None <port-mips@netbsd.org>
From: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
List: port-mips
Date: 07/27/2000 15:13:44
> /*
> * Make sure sigreturn trampoline is coherent.
> */
> #ifdef MIPS3
> if (CPUISMIPS3)
> MachFlushDCache((vaddr_t)p->p_sigacts->ps_sigcode, szsigcode);
> #endif
> MachFlushICache((vaddr_t)p->p_sigacts->ps_sigcode, szsigcode);
I think the intent of the above can be digested as;
IF (cache is write-back) {
make sure to drain the data cache to the target address range
make sure Icache not to have (now possibly obsoluted)
insns from target address range.
}
else {
/* no need to drain data cache because cache is write-thru */
make sure Icache not to have (now possibly obsoluted)
insns from target address range.
}
I think the Icache op is necessary in theory but it's likely noop
because insns on user stack has been never executed at the moment.
I guess that's the reason why various NetBSD/mips ports worked without
the Icache flush so far.
Tohru Nishimura