Hello experts.
I making a security operating system using trustzone using ARMv8 big-little core.
I face some probleam of cache clean or invalidate.
I want to cache flush to used only secure-world memory based on virtual memory, no flush non-secure world cache line.
I know the ns bit in cache tags determine secure or non-secure.
and I found some coprocess register for cache flush based on virtual address like a ICIMVAU, DCIMVAC, DCCMVAC, DCCMVAU, DCCIMVAC.
but i didn't found the check secure cache or non-secure cache and operate to only secure world cache flush.
so how to flush to only secure area cache.
Is not supported operation?
thanks for read my question and please help me.
Thanks for your comment!
your comment make me a clearly understand!
Suddenly i have a one question about performance of cache flush.
If cache line size 64byte, iterate all the virtual address space is 4GB(4096 * 1024 * 1024 byte)/64byte = 67108864(loop count of all address space in 32bit)
but set/way is a less than all virtual address space. and virtual address translate to physical address before cache flush.
If using set/way cache flush (all cache line), must occure cache miss and get data from low level memory system.
but i guess set/way is more high performance, because set/way loop count is little (compare virtual address space)
how are you think the aspect of performance?
Something of a generalization, but you rarely want/need to clean and/or invalidate the entire address space. But rather a specific address range - for which the VA operations are best suited. For example, I have a buffer populated by an external master. It's only the address range of the buffer that needs maintenance operations. Flushing other lines is both unnecessary, and probably bad for performance (due then getting misses).
There also cases where you want to clean and/or invalidate the entire cache, regardless of addresses. Typically when the core or processor is being powered off. Then you use set/way operations.
Thanks for your comment!!.
In my case like linux address map! ( 0~3G User Space, 3~4G Kernel Space)
I know of this memory space very bad because don't need the 3GB space in secure world application. (later i will modify.)
I will flush all cache line used secure-world evenif interrupt forwarding to non-secure world, because this issue related security policy(non-secure world possible view to cache information in debugging).
so I will deside to cache flush set/way or virtual address. i don't know what is the make a high performance.
in my case no specific address range
Thanks.