flush_dcache_page()/flush_icache_page() for larger page sizes
I'm trying to figure out how to implement analogues of flush_icache_page() and flush_dcache_page() for larger pagesizes (or otherwise determine if I need to at all) on UltraSPARC, and am having trouble tracking down the relevant documentation. If someone could name some relevant document(s), I'd be much obliged.
Thanks.
-- wli
P.S.: I'm also looking for similar information about Super-H and its 64-bit analogue, but I'm not even sure what mailing list to look for.
Quoted 5 lines · On Fri, 29 Oct 2004 16:03:47 -0700 William Lee Irwin III <[email protected]>…
I'm trying to figure out how to implement analogues of
flush_icache_page()andflush_dcache_page()for larger pagesizes (or otherwise determine if I need to at all) on UltraSPARC, and am having trouble tracking down the relevant documentation. If someone could name some relevant document(s), I'd be much obliged.
If you use a 16K or larger page size (which means anything other than the current 8K) flush_dcache_page() is totally unnecessary as D-cache aliases become impossible with 16K and larger page sizes. See the L1DCACHE_SIZE > PAGE_SIZE checks in routines such as arch/sparc64/mm/init.c:fluah_dcache_page_impl() and friends.
flush_icache_page() is really easy to cons up. Just do a loop of "flushi %0" for the first address in each 32-byte block of the page. Use virtual addresses. Ie:
#include <asm/system.h>
for (addr = page_vaddr; addr < page_vaddr + PAGE_SIZE; addr += 32) flushi(addr);
There is a lot of code in the sparc64 port which is there explicitly to handle multiple page sizes.
Actually, __flush_dcache_page() as written will handle any page size. It searches the entire 16K D-cache for the matching physical addresses.
Everywhere I look there is code handling the various page sizes appropriately. If you're asking for how to implement these flushes you must see some case which isn't handled, what might that be?
Quoted 6 lines · David S. Miller
Actually,
__flush_dcache_page()as written will handle any page size. It searches the entire 16K D-cache for the matching physical addresses. Everywhere I look there is code handling the various page sizes appropriately. If you're asking for how to implement these flushes you must see some case which isn't handled, what might that be?
No, I presumed aliases could occur when they could not. The "totally unnecessary" part for >= 16K page sizes part handles the whole of my concerns.
-- wli