Subject: Re: StrongARM performance tweaks cpufunc_asm.S
To: Ben Harris <bjh21@netbsd.org>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm32
Date: 03/09/2001 16:03:21
> In article <01030914514500.00460@pinky.paradox.demon.co.uk> you write:
> >On Thursday 08 March 2001 11:15 am, Richard Earnshaw wrote:
> >> Well the SA TRM definitely says that two banks aren't necessary iff the
> >> memory is unused for any other purpose. (maybe this was a hack to work
> >> around not draining the write buffers properly :-) I've been using this
> >> code for ~6 months in my own kernel and not seen any ill effects from it.
> >
> >just out of curiosity (and cos it's a mad idea :), would it be pheasible to
> >use any constant block of 16k? eg the first 16k of the kernel
>
> Have you looked at the code? It goes:
>
> _C_LABEL(sa110_cache_clean_addr):
> .word 0xf0000000
> .global _C_LABEL(sa110_cache_clean_size)
> _C_LABEL(sa110_cache_clean_size):
> .word 0x00008000
>
> That looks like the first 32k (since this is the old version) of the kernel
> to me. It might be a little better if it used a preprocessor constant
> there, though, since it won't behave quite as expected on (e.g.) hpcarm.
>
That address is only used very early on. Part of the bootstrap process
allocates a new block of clean ram. EG for the RPC:
rpc_sa110_cc_setup(void)
{
int loop;
paddr_t kaddr;
pt_entry_t *pte;
(void) pmap_extract(kernel_pmap, KERNEL_TEXT_BASE, &kaddr);
for (loop = 0; loop < CPU_SA110_CACHE_CLEAN_SIZE; loop += NBPG) {
pte = pmap_pte(kernel_pmap, (sa110_cc_base + loop));
*pte = L2_PTE(kaddr, AP_KR);
}
sa110_cache_clean_addr = sa110_cc_base;
sa110_cache_clean_size = CPU_SA110_CACHE_CLEAN_SIZE / 2;