没有合适的资源?快使用搜索试试~ 我知道了~
virtio-v1.1.pdf
需积分: 5 30 下载量 77 浏览量
2022-08-23
10:26:53
上传
评论 1
收藏 698KB PDF 举报
温馨提示
试读
166页
半虚拟化virtio协议的官方文档
资源推荐
资源详情
资源评论
Virtual I/O Device (VIRTIO) Version 1.1
Committee Specification 01
11 April 2019
Specification URIs
This version:
https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/tex/ (Authoritative)
https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.pdf
https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.html
Previous version:
N/A
Latest version:
https://docs.oasis-open.org/virtio/virtio/v1.1/virtio-v1.1.pdf
https://docs.oasis-open.org/virtio/virtio/v1.1/virtio-v1.1.html
Technical Committee:
OASIS Virtual I/O Device (VIRTIO) TC
Chair:
Michael S. Tsirkin (mst@redhat.com), Red Hat
Editors:
Michael S. Tsirkin (mst@redhat.com), Red Hat
Cornelia Huck (cohuck@redhat.com), Red Hat
Additional artifacts:
This prose specification is one component of a Work Product that also includes:
• Example Driver Listing:
https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/listings/
Related work:
This specification replaces or supersedes:
• Virtual I/O Device (VIRTIO) Version 1.0. Edited by Rusty Russell, Michael S. Tsirkin,
Cornelia Huck, and Pawel Moll. Latest version:
https://docs.oasis-open.org/virtio/virtio/v1.0/virtio-v1.0.html http://ozlabs.org/~rusty/
virtio-spec/virtio-0.9.5.pdf
• Virtio PCI Card Specification Version 0.9.5:
http://ozlabs.org/~rusty/virtio-spec/virtio-0.9.5.pdf
virtio-v1.1-cs01
Standards Track Work Product Copyright © OASIS Open 2018. All Rights Reserved.
11 April 2019
Page 1 of 166
Abstract:
This document describes the specifications of the “virtio” family of devices. These devices are
found in virtual environments, yet by design they look like physical devices to the guest within
the virtual machine - and this document treats them as such. This similarity allows the guest to
use standard drivers and discovery mechanisms.
The purpose of virtio and this specification is that virtual environments and guests should have
a straightforward, efficient, standard and extensible mechanism for virtual devices, rather than
boutique per-environment or per-OS mechanisms.
Status:
This document was last revised or approved by the Virtual I/O Device (VIRTIO) TC on the above
date. The level of approval is also listed above. Check the “Latest version” location noted
above for possible later revisions of this document. Any other numbered Versions and other
technical work produced by the Technical Committee (TC) are listed at https://www.oasis-open.
org/committees/tc_home.php?wg_abbrev=virtio#technical.
Technical Committee members should send comments on this specification to the Technical
Committee’s email list. Others should send comments to the Technical Committee by using the
“Send A Comment” button on the Technical Committee’s web page at https://www.oasis-open.
org/committees/virtio/.
This specification is provided under the Non-Assertion Mode of the OASIS IPR Policy, the mode
chosen when the Technical Committee was established. For information on whether any patents
have been disclosed that may be essential to implementing this specification, and any offers of
patent licensing terms, please refer to the Intellectual Property Rights section of the TC’s web
page (https://github.com/oasis-tcs/virtio-admin/blob/master/IPR.md).
Note that any machine-readable content (Computer Language Definitions) declared Normative
for this Work Product is provided in separate plain text files. In the event of a discrepancy
between any such plain text file and display content in the Work Product’s prose narrative doc-
ument(s), the content in the separate plain text file prevails.
Citation format:
When referencing this specification the following citation format should be used:
[VIRTIO-v1.1]
Virtual I/O Device (VIRTIO) Version 1.1. Edited by Michael S. Tsirkin and Cornelia Huck. 11
April 2019. OASIS Committee Specification 01. https://docs.oasis-open.org/virtio/virtio/v1.1/
cs01/virtio-v1.1-cs01.html. Latest version: https://docs.oasis-open.org/virtio/virtio/v1.1/virtio-v1.
1.html.
virtio-v1.1-cs01
Standards Track Work Product Copyright © OASIS Open 2018. All Rights Reserved.
11 April 2019
Page 2 of 166
Notices
Copyright © OASIS Open 2018. All Rights Reserved.
All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual
Property Rights Policy (the ”OASIS IPR Policy”). The full Policy may be found at the OASIS website.
This document and translations of it may be copied and furnished to others, and derivative works that com-
ment on or otherwise explain it or assist in its implementation may be prepared, copied, published, and
distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and
this section are included on all such copies and derivative works. However, this document itself may not be
modified in any way, including by removing the copyright notice or references to OASIS, except as needed
for the purpose of developing any document or deliverable produced by an OASIS Technical Committee (in
which case the rules applicable to copyrights, as set forth in the OASIS IPR Policy, must be followed) or as
required to translate it into languages other than English.
This specification is provided under the Non-Assertion Mode of the OASIS IPR Policy, the mode chosen
when the Technical Committee was established. For information on whether any patents have been dis-
closed that may be essential to implementing this specification, and any offers of patent licensing terms,
please refer to the Intellectual Property Rights section of the TC’s web page (https://github.com/oasis-tcs/
virtio-admin/blob/master/IPR.md).
The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or
assigns.
This document and the information contained herein is provided on an ”AS IS” basis and OASIS DISCLAIMS
ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT
THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY
IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
OASIS requests that any OASIS Party or any other party that believes it has patent claims that would
necessarily be infringed by implementations of this OASIS Committee Specification or OASIS Standard, to
notify OASIS TC Administrator and provide an indication of its willingness to grant patent licenses to such
patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced
this specification.
OASIS invites any party to contact the OASIS TC Administrator if it is aware of a claim of ownership of any
patent claims that would necessarily be infringed by implementations of this specification by a patent holder
that is not willing to provide a license to such patent claims in a manner consistent with the IPR Mode of
the OASIS Technical Committee that produced this specification. OASIS may include such claims on its
website, but disclaims any obligation to do so.
OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might
be claimed to pertain to the implementation or use of the technology described in this document or the
extent to which any license under such rights might or might not be available; neither does it represent that
it has made any effort to identify any such rights. Information on OASIS’ procedures with respect to rights
in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS
website. Copies of claims of rights made available for publication and any assurances of licenses to be
made available, or the result of an attempt made to obtain a general license or permission for the use of
such proprietary rights by implementers or users of this OASIS Committee Specification or OASIS Standard,
can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information
or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact,
Essential Claims.
The name ”OASIS” is a trademark of OASIS, the owner and developer of this specification, and should be
used only to refer to the organization and its official outputs. OASIS welcomes reference to, and imple-
mentation and use of, specifications, while reserving the right to enforce its marks against misleading uses.
Please see https://www.oasis-open.org/policies-guidelines/trademark for above guidance.
virtio-v1.1-cs01
Standards Track Work Product Copyright © OASIS Open 2018. All Rights Reserved.
11 April 2019
Page 3 of 166
Table of Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.1 Normative References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.2 Non-Normative References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3.1 Legacy Interface: Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3.2 Transition from earlier specification drafts . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.4 Structure Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2 Basic Facilities of a Virtio Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1 Device Status Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.1 Driver Requirements: Device Status Field . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.2 Device Requirements: Device Status Field . . . . . . . . . . . . . . . . . . . . . . . . 16
2.2 Feature Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.2.1 Driver Requirements: Feature Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.2.2 Device Requirements: Feature Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.2.3 Legacy Interface: A Note on Feature Bits . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3 Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.4 Device Configuration Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.4.1 Driver Requirements: Device Configuration Space . . . . . . . . . . . . . . . . . . . . 17
2.4.2 Device Requirements: Device Configuration Space . . . . . . . . . . . . . . . . . . . 18
2.4.3 Legacy Interface: A Note on Device Configuration Space endian-ness . . . . . . . . . 18
2.4.4 Legacy Interface: Device Configuration Space . . . . . . . . . . . . . . . . . . . . . . 18
2.5 Virtqueues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.6 Split Virtqueues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.6.1 Driver Requirements: Virtqueues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.6.2 Legacy Interfaces: A Note on Virtqueue Layout . . . . . . . . . . . . . . . . . . . . . . 20
2.6.3 Legacy Interfaces: A Note on Virtqueue Endianness . . . . . . . . . . . . . . . . . . . 20
2.6.4 Message Framing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.6.4.1 Device Requirements: Message Framing . . . . . . . . . . . . . . . . . . . . 21
2.6.4.2 Driver Requirements: Message Framing . . . . . . . . . . . . . . . . . . . . 21
2.6.4.3 Legacy Interface: Message Framing . . . . . . . . . . . . . . . . . . . . . . . 21
2.6.5 The Virtqueue Descriptor Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.6.5.1 Device Requirements: The Virtqueue Descriptor Table . . . . . . . . . . . . 22
2.6.5.2 Driver Requirements: The Virtqueue Descriptor Table . . . . . . . . . . . . . 22
2.6.5.3 Indirect Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.6.5.3.1 Driver Requirements: Indirect Descriptors . . . . . . . . . . . . . . . 22
2.6.5.3.2 Device Requirements: Indirect Descriptors . . . . . . . . . . . . . . 22
2.6.6 The Virtqueue Available Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.6.6.1 Driver Requirements: The Virtqueue Available Ring . . . . . . . . . . . . . . 23
2.6.7 Used Buffer Notification Suppression . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.6.7.1 Driver Requirements: Used Buffer Notification Suppression . . . . . . . . . . 23
2.6.7.2 Device Requirements: Used Buffer Notification Suppression . . . . . . . . . 24
2.6.8 The Virtqueue Used Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.6.8.1 Legacy Interface: The Virtqueue Used Ring . . . . . . . . . . . . . . . . . . 25
2.6.8.2 Device Requirements: The Virtqueue Used Ring . . . . . . . . . . . . . . . . 25
2.6.8.3 Driver Requirements: The Virtqueue Used Ring . . . . . . . . . . . . . . . . 25
2.6.9 In-order use of descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.6.10 Available Buffer Notification Suppression . . . . . . . . . . . . . . . . . . . . . . . . . 25
virtio-v1.1-cs01
Standards Track Work Product Copyright © OASIS Open 2018. All Rights Reserved.
11 April 2019
Page 4 of 166
2.6.10.1 Driver Requirements: Available Buffer Notification Suppression . . . . . . . 26
2.6.10.2 Device Requirements: Available Buffer Notification Suppression . . . . . . . 26
2.6.11 Helpers for Operating Virtqueues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.6.12 Virtqueue Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.6.13 Supplying Buffers to The Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.6.13.1 Placing Buffers Into The Descriptor Table . . . . . . . . . . . . . . . . . . . . 27
2.6.13.2 Updating The Available Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.6.13.3 Updating idx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.6.13.3.1 Driver Requirements: Updating idx . . . . . . . . . . . . . . . . . . 28
2.6.13.4 Notifying The Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.6.13.4.1 Driver Requirements: Notifying The Device . . . . . . . . . . . . . . 28
2.6.14 Receiving Used Buffers From The Device . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.7 Packed Virtqueues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.7.1 Driver and Device Ring Wrap Counters . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.7.2 Polling of available and used descriptors . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.7.3 Write Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.7.4 Element Address and Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.7.5 Scatter-Gather Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.7.6 Next Flag: Descriptor Chaining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.7.7 Indirect Flag: Scatter-Gather Support . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.7.8 In-order use of descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.7.9 Multi-buffer requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.7.10 Driver and Device Event Suppression . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.7.10.1 Structure Size and Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.7.11 Driver Requirements: Virtqueues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.7.12 Device Requirements: Virtqueues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.7.13 The Virtqueue Descriptor Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.7.14 Event Suppression Structure Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.7.15 Device Requirements: The Virtqueue Descriptor Table . . . . . . . . . . . . . . . . . . 34
2.7.16 Driver Requirements: The Virtqueue Descriptor Table . . . . . . . . . . . . . . . . . . 34
2.7.17 Driver Requirements: Scatter-Gather Support . . . . . . . . . . . . . . . . . . . . . . . 34
2.7.18 Device Requirements: Scatter-Gather Support . . . . . . . . . . . . . . . . . . . . . . 35
2.7.19 Driver Requirements: Indirect Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.7.20 Virtqueue Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.7.21 Supplying Buffers to The Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.7.21.1 Placing Available Buffers Into The Descriptor Ring . . . . . . . . . . . . . . . 35
2.7.21.1.1 Driver Requirements: Updating flags . . . . . . . . . . . . . . . . . 36
2.7.21.2 Sending Available Buffer Notifications . . . . . . . . . . . . . . . . . . . . . . 36
2.7.21.3 Implementation Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.7.21.3.1 Driver Requirements: Sending Available Buffer Notifications . . . . 37
2.7.22 Receiving Used Buffers From The Device . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.7.23 Driver notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3 General Initialization And Device Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.1 Device Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.1.1 Driver Requirements: Device Initialization . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.1.2 Legacy Interface: Device Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.2 Device Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.2.1 Notification of Device Configuration Changes . . . . . . . . . . . . . . . . . . . . . . . 40
3.3 Device Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.3.1 Driver Requirements: Device Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4 Virtio Transport Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.1 Virtio Over PCI Bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.1.1 Device Requirements: Virtio Over PCI Bus . . . . . . . . . . . . . . . . . . . . . . . . 41
4.1.2 PCI Device Discovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.1.2.1 Device Requirements: PCI Device Discovery . . . . . . . . . . . . . . . . . . 41
virtio-v1.1-cs01
Standards Track Work Product Copyright © OASIS Open 2018. All Rights Reserved.
11 April 2019
Page 5 of 166
剩余165页未读,继续阅读
资源评论
田园诗人之园
- 粉丝: 2847
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功