3 ms·
Why would you flush the cache on a system call?? The only case I can think of where a cache flush is needed at all is if you have a virtually-addressed (or -ind
by dhess 18y ago
Why would you flush the cache on a system call?? The only case I can think of where a cache flush is needed at all is if you have a virtually-addressed (or -indexed) cache and you're switching address spaces. Some ARM implementations may do this, if I recall correctly. But entering the kernel doesn't require an address space switch because the kernel is mapped into every process's address space, at the same virtual address.
Also, as I pointed out below, typically you don't even need to change any TLB entries on kernel entry, because the address space doesn't change and the kernel TLB mappings are usually pinned. In other words, any load from or store to a kernel page will always hit the TLB.
On most architectures, you probably don't even need to swap registers; not the general-purpose ones, anyway.
Sorry, but you're confusing switching processes with switching privilege, and greatly overestimating the cost of a system call.