- 论坛徽章:
- 1
|
本帖最后由 arm-linux-gcc 于 2014-09-15 19:57 编辑
回复 26# wLiu2007
vipt的tag是从物理地址中取出来的,[31:x]
x = way_size > page_size ? log2(page_size) : log2(way_size)
vipt的tag需要扩展,在http://en.wikipedia.org/wiki/CPU_cache有原话:
Virtually indexed, physically tagged (VIPT) caches use the virtual address for the index and the physical address in the tag. The advantage over PIPT is lower latency, as the cache line can be looked up in parallel with the TLB translation, however the tag cannot be compared until the physical address is available. The advantage over VIVT is that since the tag has the physical address, the cache can detect homonyms. VIPT requires more tag bits, as the index bits no longer represent the same address.
这个是由硬件做的,不需要os的支持
扩展tag是为了解决“不同va映射到不同pa,并且va的index都相同,并且两个pa间隔不超过way_size”的问题
page color则是为了解决“不同va映射到同一个pa的”
|
|