Subject: Re: R5000 cache code fixes...
To: Rafal Boni <rafal@attbi.com>
From: Nigel Stephens <nigel@mips.com>
List: port-mips
Date: 04/27/2003 14:04:26
Rafal Boni wrote:

> void
>-r5k_sdcache_wbinv_rangeall(vaddr_t va, vsize_t size)
>+r5k_sdcache_wbinv_range_index(vaddr_t va, vsize_t size)
> {
>-	r5k_sdcache_wbinv_all();
>+	/*
>+	 * Since we're doing Index ops, we expect to not be able
>+	 * to access the address we've been given.  So, get the
>+	 * bits that determine the cache index, and make a KSEG0
>+	 * address out of them.
>+	 */
>+	va = MIPS_PHYS_TO_KSEG0(va & (mips_sdcache_size - 1));
>+	r5k_sdcache_wbinv_range(va, size);
> }
>
>  
>

Rafal

Excuse me if I'm getting confused here, as I don't know my way around 
the NetBSD cache maintenance code, but unlike the primaries the r5k 
secondary cache is physically indexed. Surely you can't simply use the 
low-order virtual address bits as an index without first translating 
them to a physical address, or else wbinv'ing all possible aliases?

Regards

Nigel

-- 
                         Nigel Stephens         Mailto:nigel@mips.com
    _    _ ____  ___     MIPS Technologies (UK) Phone.: +44 1223 706200
    |\  /|||___)(___     The Fruit Farm         Direct: +44 1223 706207
    | \/ |||    ____)    Ely Road, Chittering   Fax...: +44 1223 706250
     TECHNOLOGIES UK     Cambridge CB5 9PH      Cell..: +44 7976 686470
                         England                http://www.mips.com