日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

[architecture]-ARM SMMU学习概念总结一篇就够了

發(fā)布時間:2025/3/21 编程问答 16 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [architecture]-ARM SMMU学习概念总结一篇就够了 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

引流關(guān)鍵詞: SMMU,mmu500,mmu600,mmu700,system mmu,Non-cacheable,Cacheable, non-shareable,inner-shareable,outer-shareable, optee、ATF、TF-A、Trustzone、optee3.14、MMU、VMSA、cache、TLB、arm、armv8、armv9、TEE、安全、內(nèi)存管理、頁表…


目錄

        • 前言
        • 1、SMMU總結(jié)
          • 1.1、SMMU的timeline
          • 1.2、SMMU的簡介
          • 1.3、為什么要使用SMMU?
        • 2、MMU IP總結(jié)
          • 2.1、CoreLink MMU-700 features
          • 2.12、CoreLink MMU-600AE features
          • 2.3、CoreLink MMU-600 features
          • 2.4、CoreLink MMU-500 Features
          • 2.5、CoreLink MMU-401 Features
        • 3、總結(jié)
        • 4、參考

前言

最近朋友圈、微信群(ARM-Trustzone-TEE-AT)掀起一陣學習SMMU的熱潮,作為一名安全領(lǐng)域的渣渣 ,勢必要蹭一蹭這個“熱點”,也學習一下吧,反正早晚都要學,因為它和安全的關(guān)系還是比較大的。學習是一件長期的過程,本文就先簡單理一下概念吧。

1、SMMU總結(jié)

1.1、SMMU的timeline

1.2、SMMU的簡介

SMMU的全稱是System Memory Management Units, 它屬于Arm的System IP, 主要給其他Master來使用,其連頁表格式和Core MMU是一樣的,理論上可以讓Core的MMU和SMMU使用同一套頁表.

那么SMMU都是用在哪些地方呢?*以下展示了一個usecase,來自arm官方博客(February 17, 2014),也是比較早期的一個Sample case

1.3、為什么要使用SMMU?
  • 訪問非連續(xù)的地址
    現(xiàn)在系統(tǒng)中很少再預留連續(xù)的memory,如果Master需要很多memory,可以通過SMMU把一些非連續(xù)的PA映射到連續(xù)的VA,例如給DMA,VPU,DPU使用。

  • 32位轉(zhuǎn)換成64位
    現(xiàn)在很多系統(tǒng)是64位的,但是有些Master還是32位的,只能訪問低4GB空間,如果訪問更大的地址空間需要軟硬件參與交換memory,實現(xiàn)起來比較復雜,也可以通過SMMU來解決,Master發(fā)出來的32位的地址,通過SMMU轉(zhuǎn)換成64位,就很容易訪問高地址空間。

  • 限制Master的訪問空間
    Master理論上可以訪問所有的地址空間,可以通過SMMU來對Master的訪問進行過濾,只讓Master訪問受限的區(qū)域,那這個區(qū)域也可以通過CPU對SMMU建立頁表時動態(tài)控制。

  • 用戶態(tài)驅(qū)動
    現(xiàn)在我們也看到很多系統(tǒng)把設(shè)備驅(qū)動做在用戶態(tài),調(diào)用驅(qū)動時不需要在切換到內(nèi)核態(tài),但是存在一些安全隱患,就是用戶態(tài)直接控制驅(qū)動,有可能訪問到內(nèi)核空間,這種情況下也可以用SMMU來實現(xiàn)限制設(shè)備的訪問空間

  • 設(shè)備虛擬化
    例如設(shè)備虛擬化有多種方式,Emulate,Para-virtualized,以及Pass-through,用SMMU可以實現(xiàn)Pass though,這樣無論是性能,還是軟件的改動都是比較小的。

  • 一些不支持TrustZone的Master,可以利用SMMU支持Trustzone

2、MMU IP總結(jié)

2.1、CoreLink MMU-700 features
  • SMMUv3.2 compliant IO-MMU compatible with Arm v8.4 and Arm v9 based CPUs.
  • Key Arm architecture features enabled: Secure-EL2, range invalidate, MPAM.
  • Support for advanced PCIe and CXL ATS functionality.
  • Built to support PCIe Gen5 bandwidth for wide range of I/O applications.
  • Introduces AMBA-LTI for translations as a look-aside function.
  • Enables the PCIe-PRI feature for on-die accelerators without the need for ATS flow.
2.12、CoreLink MMU-600AE features
  • Meets automotive safety requirements for building high-performance ASIL B to ASIL D systems.
  • Software compatible with MMU-600 with Arm v8.2 compliant RAS reporting interface.
  • Efficient functional logic duplication, ECC and address protection for SRAM.
  • AMBA extensions for interface protection.
  • Fault management unit to simplify error reporting, testing and integration.
2.3、CoreLink MMU-600 features
  • Enhances CoreLink MMU-500 feature set by incorporating SMMUv3.1 specification to support Armv8.2 CPUs.
  • Expands the number of contexts supported to millions.
  • Implements AMBA-DTI to interface TBU and TCU to improve scalability.
  • Multi-level TLB and Walk Cache improves system address translation hit rates.
  • Improved write buffer depth and parallel translations.
2.4、CoreLink MMU-500 Features
  • Builds on top of MMU-400 features by implementing SMMUv2 architecture adding support for Armv8 CPUs.
  • Supports Stage 1, Stage 2, and Stage1 followed by Stage 2 address translation for up to 128 active device contexts.
  • Implements a distributed Translation Buffer Unit (TBU) micro-architecture with direct point-to-point connections between each TBU and the centralized Translation Control Unit (TCU) for Page Table Walks (PTWs).
  • Supports up to 128 entries per TLB which is further backed by TCU cache up to 2K entries.
2.5、CoreLink MMU-401 Features
  • Supports SMMUv1 architecture for Armv7 CPUs and Arm v8 for 64KB page sizes.
  • Performs stage2 translation only for hypervisor support.
  • Implements a single TBU micro-architecture with connection to a single TCU for page table walks.

3、總結(jié)

啥是mmu500,啥是smmu?
mmu500和smmu v3.2的關(guān)系,就如同gic500和gicv3的關(guān)系。一個是具體的IP,一個是架構(gòu)。

4、參考

ARM system-memory-management-unit
SMMU跟TrustZone啥關(guān)系?

總結(jié)

以上是生活随笔為你收集整理的[architecture]-ARM SMMU学习概念总结一篇就够了的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。