kernel linux页表生成,linux-kernel – Linux IOMMU页表

Does the IOMMU uses the CPU MMU page tables for storing VA->PA mapping?

不是.操作系统中有许多进程,每个进程都有自己的VA-> PA映射(它们都在不同的虚拟地址空间中运行).

有物理内存,由内存控制器控制.还有一些设备需要访问物理内存:CPU和外部总线控制器. CPU有自己的翻译和总线控制器有自己的.

If not i.e. the virtual addresses are different then are the mappings created per device or per IOMMU unit?

映射是根据IOMMU的功能创建的.一些简单的IOMMU可能具有一个用于设备总线根控制器的全局映射(PCI-express根comples).像英特尔VT-d这样复杂的IOMMU可能有几个映射或嵌套转换,根据一些每个端口规则选择. (但桥后面的两个设备通常会有相同的翻译.)

https://www.kernel.org/doc/Documentation/Intel-IOMMU.txt

The Intel IOMMU driver allocates a virtual address per domain. Each PCIE

device has its own domain (hence protection). Devices under p2p bridges

share the virtual address with all devices under the p2p bridge due to

transaction id aliasing for p2p bridges.

https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt

In some systems,bus addresses are identical to CPU physical addresses,but in

general they are not. IOMMUs and host bridges can produce arbitrary

mappings between physical and bus addresses.

(另请参阅附近的图片“这是一张图片和一些例子:”在https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt中)

virtual address (X)… The virtual memory system maps X to a physical address (Y) in system RAM. The driver can use virtual address X to access the buffer,but the device itself cannot because DMA doesn’t go through the CPU virtual memory system.

In some simple systems,the device can do DMA directly to physical address

Y. But in many others,there is IOMMU hardware that translates DMA

addresses to physical addresses,e.g.,it translates Z to Y.

另请查看https://events.linuxfoundation.org/sites/events/files/slides/20140429-dma.pdf(2014)和http://www.linuxplumbersconf.org/2014/wp-content/uploads/2014/10/LPC2014_IOMMU.txt

和http://developer.amd.com/wordpress/media/2012/10/IOMMU-ben-yehuda.pdf论文(2012年)有关设备内存重映射和IOMMU虚拟化使用历史的文章.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值