• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

Protection Strategies for Direct Access to Virtualized I/O D

mysql 搞代码 4年前 (2022-01-09) 23次浏览 已收录 0个评论

Protection Strategies for Direct Access to Virtualized I/O Devices appeared in USENIX 2008. 该文比较了五种策略的保护程度和性能开销,遗憾的地方就是该文没有指出五种策略的使用场合,大部分不适用于全虚拟化,而适用于协同虚拟化。 The comparison o

Protection Strategies for Direct Access to Virtualized I/O Devices

appeared in USENIX 2008.

该文比较了五种策略的保护程度和性能开销,遗憾的地方就是该文没有指出五种策略的使用场合,大部分不适用于全虚拟化,而适用于协同虚拟化。

The comparison of these five strategiesyields several insights. First, all five strategies provide equivalent inter-guest(客户机之间) protection among OSinstances. However, the strategies support differing levels of protection withina particular guest (intra-guest客户机内部protection). For example, the direct-map strategy incursalmost no performance overhead but supports no intra-guest protection. Conversely,the single-use strategy provides the maximum possible intra-guest protection,but it imposes the largest performance penaltyThe traditional single-use strategy provides inter-guest protectionat the greatest cost, consuming from 6–26% of the CPU. Second, there is significant opportunityto reuse IOMMU mappings, which can reduce protection overheads. Multipleconcurrent I/O operations are able to share the same mappings often enough thatthere is a noticeable decrease in the overhead of providing protection. Sharingmappings only among concurrent I/O operations provides the same level ofintra-guest protection as the single-use strategy but with less overhead.Relaxing this intra-guest protection guarantee by allowing mappings to persistso that they can be reused in future I/O operations can significantly decreasethis overhead, allowing the guest to achieve performance levels very close tothat of the direct-map strategy while still maintaining some amount ofintraguest protection. Finally, the software-based protection strategy performscompetitively with several of the better-performing IOMMU-based strategieswhile maintaining strong inter-guest protection guarantees本文来源[email protected]搞@^&代*@码2网 and enabling

intra-guest protection capabilities.

五种策略

Single-use Mappings:每一次使用之前才映射,使用完毕解除映射

Shared Mappingsthe shared-mapping strategy detectswhen a valid IOMMU mapping to a memory page already exists and reuses thatmapping rather than generating a new one. In practical terms, this sharing canhappen when an application repeats the same I/O message or when an application sendsor receives small I/O messages that reside in the same memory page.

Persistent MappingsIOMMU mappings can further bereused by allowing them to persist even after all I/O transactions using the mappinghave completed. 即一次使用后就一直保留,不解除映射。

Direct MappingsTo allow maximum reuse of IOMMUmappings and to further reduce runtime overhead, it is possible to permanently mapthe entire physical address space of the guest operating system.

软件方案(很明显不支持完全虚拟化,而且要求VMM知道硬件细节):见WILLMANN,P., SHAFER, Concurrent direct network accessfor virtual machine monitors. In Proceedings of the 13th InternationalSymposium on High Performance Computer Architecture (Feb. 2007).

三种I/O访问错误

Three potential memory access violationscan occur on every I/O transfer initiated using this DMA architecture:

1. The device driver could create a DMAdescriptor with an incorrect address (a “bad-address” fault).

2. The operating system could repurpose thememory referenced by a DMA descriptor, or the device driver could later reuse avalid DMA descriptor without permission (an “invalid-use” fault).

3. The device itself could initiate a DMAtransfer to a memory address not referenced by the DMA descriptor (a“bad-device” fault). the last type of violation is only likely to occur as aresult of a device failure.

关于Intraguest的解释:其他四种方式都要在使用之前先映射(OS会检查),所以能避免badaddress。但是建立映射之后,Oncethe first request to create the IOMMU mapping has happened, however, none ofthe IOMMU-based strategies can prevent a driver from invalidly reusing thatsame mapping for a subsequent I/O transaction. In these strategies, the driveris responsible for informing the OS when it is done with an IOMMU mapping. Evenif the OS was modified to automatically revoke an IOMMU mapping when itdetected the completion of a corresponding I/O event, the driver could stillinvalidly reuse a mapping after the original I/O event finished, but before theOS could intervene to terminate the IOMMU mapping.

IOMMU的性能开销

Platform I/O PT Update IOTLB Update Update & Flush

IBM Calgary IOMMU 673 10207 10887

Intel VT-d IOMMU 991 1217 2213

AMD GART 27 486 579

Table 2: Microbenchmarks examining costs associated with moderntranslation hardware, in processor cycles.


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Protection Strategies for Direct Access to Virtualized I/O D
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址