[mmu/cache]-ARMV8的cache的维护指令介绍
生活随笔
收集整理的這篇文章主要介紹了
[mmu/cache]-ARMV8的cache的维护指令介绍
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
★★★ 個人博客導(dǎo)讀首頁—點擊此處 ★★★
Armv8里定義的Cache的管理的操作有三種:
- 無效(Invalidate) 整個高速緩存或者某個高速緩存行。高速緩存上的數(shù)據(jù)會被丟棄。
- 清除(Clean) 整個高速緩存或者某個高速緩存行。相應(yīng)的高速緩存行會被標(biāo)記為臟,數(shù)據(jù)會寫回到下一級高速緩存中或者主存儲器中。
- 清零(Zero) 在某些情況下,對高速緩存進行清零操作起到一個預(yù)取和加速的功效,比如當(dāng)程序需要使用一大塊臨時內(nèi)存,在初始化階段對這個內(nèi)存進行清零操作,這時高速緩存控制器會主動把這些零數(shù)據(jù)寫入高速緩存行中。若程序主動使用高速緩存的清零操作,那么將大大減少系統(tǒng)內(nèi)部總線的帶寬。
對高速緩存的操作可以指定不同的范圍。
- 整塊高速緩存。
- 某個虛擬地址。
- 特定的高速緩存行或者組和路。
另外在ARMv8架構(gòu)中最多可以支持7級的高速緩存,L1~L7高速緩存。當(dāng)對一個高速緩存行進行操作時,我們需要知道高速緩存操作的范圍。ARMv8架構(gòu)中從處理器到所有內(nèi)存的角度分成如下幾個視角。
- PoC(Point of Coherency,全局緩存一致性角度)
- PoU(Point of Unification,處理器緩存一致性角度
有了上面的這些概念,然后我們再看下cache的指令格式:
function中的G和D一般和其它function組合使用的,例如
DC IGDVAC :操作d-cache,根據(jù)虛擬地址無效掉data和Allocation Tags,操作范圍到PoC
Invalidate data and Allocation Tags in data cache by address to Point of Coherency.
DC IGVAC :操作d-cache,根據(jù)虛擬地址無效掉Allocation Tags,操作范圍到PoC
Invalidate Allocation Tags in data cache by address to Point of Coherency
最后,我們再看armv8文檔中定義的cache指令集:
DC CISW, Data or unified Cache line Clean and Invalidate by Set/Way DC CSW, Data or unified Cache line Clean by Set/Way DC CVAU, Data or unified Cache line Clean by VA to PoU DC ZVA, Data Cache Zero by VAIC IALLU, Instruction Cache Invalidate All to PoU IC IALLU{, <Xt>} IC IALLUIS, Instruction Cache Invalidate All to PoU, Inner Shareable IC IALLUIS{, <Xt>} IC IVAU, Instruction Cache line Invalidate by VA to PoU IC IVAU{, <Xt>}DC CIVAC, Data or unified Cache line Clean and Invalidate by VA to PoC DC CVAC, Data or unified Cache line Clean by VA to PoC DC CVAP, Data or unified Cache line Clean by VA to PoP DC GVA, Data Cache set Allocation Tag by VA DC GZVA, Data Cache set Allocation Tags and Zero by VA DC IGDSW, Data, Allocation Tag or unified Cache line Invalidate of Data and Allocation Tags by Set/Way DC IGDVAC, Data, Allocation Tag or unified Cache line Invalidate of Allocation Tags by VA to PoC DC IGSW, Data, Allocation Tag or unified Cache line Invalidate of Allocation Tags by Set/Way DC IGVAC, Data, Allocation Tag or unified Cache line Invalidate of Allocation Tags by VA to PoC DC ISW, Data or unified Cache line Invalidate by Set/Way DC IVAC, Data or unified Cache line Invalidate by VA to PoC DC CVADP, Data or unified Cache line Clean by VA to PoDPARMv8.5-MemTag: DC CGDSW, Data, Allocation Tag or unified Cache line Clean of Data and Allocation Tags by Set/Way DC CGDVAC, Data, Allocation Tag or unified Cache line Clean of Allocation Tags by VA to PoC DC CGDVADP, Data, Allocation Tag or unified Cache line Clean of Allocation Tags by VA to PoDP DC CGDVAP, Data, Allocation Tag or unified Cache line Clean of Data and Allocation Tags by VA to PoP DC CGSW, Data, Allocation Tag or unified Cache line Clean of Allocation Tags by Set/Way DC CGVAC, Data, Allocation Tag or unified Cache line Clean of Allocation Tags by VA to PoC DC CGVADP, Data, Allocation Tag or unified Cache line Clean of Data and Allocation Tags by VA to PoDP DC CGVAP, Data, Allocation Tag or unified Cache line Clean of Allocation Tags by VA to PoP DC CIGDSW, Data, Allocation Tag or unified Cache line Clean and Invalidate of Data and Allocation Tags by Set/Way DC CIGDVAC, Data, Allocation Tag or unified Cache line Clean and Invalidate of Data and Allocation Tags by VA to PoC DC CIGSW, Data, Allocation Tag or unified Cache line Clean and Invalidate of Allocation Tags by Set/Way DC CIGVAC, Data, Allocation Tag or unified Cache line Clean and Invalidate of Allocation Tags by VA to PoCcache操作的使用示例:
總結(jié)
以上是生活随笔為你收集整理的[mmu/cache]-ARMV8的cache的维护指令介绍的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: LockSettingsService的
- 下一篇: [mmu/cache]-MMU的地址翻译