How to deal with VIPT alias? – Page colour
为获得更好的阅读体验,请移步: http://tek-life.github.io/blog/how-to-deal-with-vipt-alias-page-color/ Agenda Introduction Cache aliases issue for VIPT How to solve alias Implement in Linux Introduction VIPT是Cache的一种Policy。如果 Cache_Size/numbers_of_way > Page_Size/Cache_Line_Size 就会产生alias问题。 Cache aliases issue for VIPT 何谓alias If the same PA is mapped into the different VAs, they could have different virtual indexes and certainly has the same physical tags, so multiple cacheline might have data for the single PA. Reference From: http://mail-index.netbsd.org/port-sh3/2006/09/07/0000.html alias会造成什么问题 由于相同的物理页在Cache中有多份拷贝,那么某一份拷贝更改而没有及时刷( clean )到Memory中,其他的Cache拷贝就不能获知其更改,而造成错误。 How to solve alias issue 解决alias问题的方法有以下三种 1. 存在多VA映射的物理页的PTE(page table entry)中的属性全部设置为 uncacheable. 2. flush cache 3. 多VA映射相同的物理页,如果能让VA在索引Cache的时候,都索引到相同的Cache sets中,那就不会产生alias问题了(因为在Cache set中识别Cache是否命中是用Physical Address Tag)。 第一种uncacheable的方法让memory不进Cache缓存的方式不可取,因为会导致系统的性能急剧下降。 ...