* [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-08 21:40 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-08 21:40 UTC (permalink / raw)
To: Rusty Russell
Cc: Sasha Levin, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi
Here's a spec change documenting what my C patch does
(almost - I tweaked the layout a bit, but the idea is the same).
Some more cleanups are needed but I thought I'd send it
for early flames/comments.
The idea is simple: we split functionally unrelated
register groups to independent structures, and let
the device place is anywhere using a capability
in PCI configuration space.
It can then go into MMIO space which is cheaper than PIO.
A legacy portion of the configuration is mirrored
in the first BAR, to keep legacy drivers working.
Any new fields can be added in existing structures
at the end, so they won't affect legacy.
Alternatively we can add new structures with new
structure IDs, pointed to from PCI configuration space.
As we don't yet have devices or drivers with 64 bit features,
I decided we don't need high feature bits in legacy space.
This also frees up feature bit 31 as we don't need it
to enable high feature bits anymore.
As this solves the dynamic placement of MSIX vectors
and high feature bits,
I thought it's easier to just reserve space for that
programming than give it a separate structure. This
can be changed by a patch on top.
Note that data path is split from configuration.
PDF will follow.
----
diff --git a/virtio-spec.lyx b/virtio-spec.lyx
index 6426f8f..5aec38c 100644
--- a/virtio-spec.lyx
+++ b/virtio-spec.lyx
@@ -56,6 +56,7 @@
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
+\author 1986246365 "Michael S. Tsirkin"
\end_header
\begin_body
@@ -570,7 +571,34 @@ Device Configuration
\end_layout
\begin_layout Standard
-To configure the device, we use the first I/O region of the PCI device.
+To configure the device, we
+\change_inserted 1986246365 1320783354
+use I/O and/or memory regions of the PCI device.
+ These contain the virtio header registers, the notification register, the
+ ISR status register and device specific registers, as specified by Virtio
+ Structure PCI Capabilities
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320787659
+For backwards compatibility, devices should present part of these configuration
+ registers in a legacy configuration structure in the first I/O region of
+ the PCI device
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+
+\change_deleted 1986246365 1320766512
+use the first I/O region of the PCI device.
This contains a
\emph on
virtio header
@@ -578,6 +606,8 @@ virtio header
followed by a
\emph on
device-specific region.
+\change_unchanged
+
\end_layout
\begin_layout Standard
@@ -595,9 +625,23 @@ natural
\end_layout
\begin_layout Standard
-Note that this is possible because while the virtio header is PCI (i.e.
- little) endian, the device-specific region is encoded in the native endian
- of the guest (where such distinction is applicable).
+Note that this is possible because while the virtio header
+\change_inserted 1986246365 1320767249
+, notification and ISR status are
+\change_deleted 1986246365 1320767251
+ is
+\change_unchanged
+ PCI (i.e.
+ little) endian, the device-specific
+\change_deleted 1986246365 1320767335
+ region is
+\change_inserted 1986246365 1320767337
+registers are
+\change_unchanged
+ encoded in the native endian of the guest (where such distinction is applicable
+).
+\change_inserted 1986246365 1320767660
+
\end_layout
\begin_layout Subsection
@@ -635,51 +679,2954 @@ Device-specific setup, including reading the Device Feature Bits, discovery
writing the virtio configuration space.
\end_layout
-\begin_layout Enumerate
-The subset of Device Feature Bits understood by the driver is written to
- the device.
+\begin_layout Enumerate
+The subset of Device Feature Bits understood by the driver is written to
+ the device.
+\end_layout
+
+\begin_layout Enumerate
+The DRIVER_OK status bit is set.
+\end_layout
+
+\begin_layout Enumerate
+The device can now be used (ie.
+ buffers added to the virtqueues)
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+Historically, drivers have used the device before steps 5 and 6.
+ This is only allowed if the driver does not use any features which would
+ alter this early use of the device.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+If any of these steps go irrecoverably wrong, the guest should set the FAILED
+ status bit to indicate that it has given up on the device (it can reset
+ the device later to restart if desired).
+\end_layout
+
+\begin_layout Standard
+We now cover the fields required for general setup in detail.
+\change_inserted 1986246365 1320766663
+
+\end_layout
+
+\begin_layout Subsection
+
+\change_inserted 1986246365 1320781584
+Virtio Structure PCI Capability
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320781061
+Virtio configuration layout includes virtio configuration header, notification
+ and ISR status and device configuration structures.
+ Each structure is mapped by a Base Address register (BAR) belonging to
+ the function, located beginning at 10h in Configuration Space.
+
+\emph on
+Structure ID
+\emph default
+indentifies the structure
+\emph on
+, Size
+\emph default
+ indicates the structure size, in bytes, a
+\emph on
+BAR Indicator register (BIR)
+\emph default
+ indicates which BAR, and
+\emph on
+Offset
+\emph default
+ indicates where the structure begins relative to the base address associated
+ with the BAR.
+ The BAR is permitted to be either 32-bit or 64-bit, it can map Memory Space
+ or I/O Space.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320781133
+These registers are specified using vendor-specific PCI capability located
+ on capability list in PCI configuration space of the device.
+ This virtio structure capability uses little-endian format; all bits are
+ read-only:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320772579
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="34">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0pt">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0pt">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771774
+Bit
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771777
+31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771779
+30
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771781
+29
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771783
+28
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771786
+27
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771810
+26
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771813
+25
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771815
+24
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771817
+23
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771819
+22
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771821
+21
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771823
+20
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771825
+19
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771829
+18
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771831
+17
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771833
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771835
+15
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771840
+14
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771841
+13
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771843
+12
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771845
+11
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771847
+10
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771850
+9
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771852
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771854
+7
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771856
+6
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771858
+5
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771859
+4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771861
+3
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771862
+2
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771864
+1
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771888
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771997
+Offset
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320781029
+Structure ID
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772123
+Capability Length = 12
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772095
+Next Capability Pointer
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772055
+Capability ID = 9
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772004
+0
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772549
+Size
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320779698
+BAR Indicator Register
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772007
+4
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772540
+Offset
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772011
+8
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320779667
+Purpose:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320780912
+
+\emph on
+Capability ID
+\emph default
+,
+\emph on
+Next Capability Pointer
+\emph default
+,
+\emph on
+Capability Length
+\emph default
+ - these fields are specified by PCI local bus specification, Rev 3.0
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320785073
+
+\emph on
+Structure ID
+\emph default
+ - identifies the structure mapped.
+ If an ID representing a specific structure is absent, the structure is
+ located in the legacy virtio configuration in the first PCI BAR.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320782689
+
+\emph on
+Size
+\emph default
+ - size of the structure mapped.
+ This size might include padding, or fields unused by the driver.
+ Drivers are also recommended to only map part of configuration structure
+ large enough for device operation.
+ For example, a future device might present a large structure size of several
+ MBytes.
+ As current devices never utilize structures larger than 4KBytes in size,
+ driver can limit the mapped structure size to e.g.
+ 4KBytes to allow forward compatibility with such devices without loss of
+ functionality and without wasting resources.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320781965
+
+\emph on
+BAR Indicator Register
+\emph default
+ - Indicates which one of the BAR registers, located beginning at 10h in
+ Configuration Space, is used to map the structure into Memory or I/O Space.
+ Legal values are 0 - 5.
+ BAR offset is calculated as
+\emph on
+BAR
+\emph default
+ = 10h + 4 *
+\emph on
+BIR.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320781002
+
+\emph on
+Offset
+\emph default
+ - Used as an offset from the address contained by one of the function’s
+ Base Address registers to point to the base of the structure.
+ Depending on the structure, the lower bits are masked off (set to zero)
+ by software to form an aligned offset.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320785098
+A single device has multiple virtio capabilities on the PCI capability linked-li
+st.
+ To locate a specific register, driver scans the PCI capability list looking
+ for capabilities using the vendor specific
+\emph on
+Capability ID
+\emph default
+, that is
+\emph on
+Capability ID
+\emph default
+ value
+\emph on
+9
+\emph default
+, according to the PCI spec.
+ For each capability, it verifies that the
+\emph on
+Capability Length
+\emph default
+ field matches the expected value (12) - if it doesn't, this indicates a
+ layout change, which causes driver to ignore the specific PCI capability
+ and proceed to the next PCI capability in the list.
+ Next,
+\emph on
+ Structure ID
+\emph default
+ single-byte field is read at offset 3.
+ Unrecognized
+\emph on
+Structure ID
+\emph default
+ values are ignored.
+ Low bits in the
+\emph on
+Offset
+\emph default
+ register are masked to match alignment requirements, if any.
+ Device drivers are recommended to sanity check
+\emph on
+BIR
+\emph default
+,
+\emph on
+Offset
+\emph default
+, and
+\emph on
+Size
+\emph default
+ fields, ignoring the capability or failing gracefully on error.
+ Drivers are also recommended to only map part of configuration structure
+ large enough for device operation.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786035
+For backwards compatibility, devices should also present legacy configuration
+ space in the first I/O region of the PCI device, mirroring virtio configuration
+ structures in this space.
+ Drivers should fall back on this legacy structure if a specific Virtio
+ Structure capability is missing in the PCI capability list.
+ However, devices are not required to map the whole configuration structure
+ in legacy space - only the initial segment expected by legacy drivers needs
+ to be mapped.
+ The minimal size of such legacy segment size, for each structure, is listed
+ below.
+ Drivers are discouraged from using legacy space if a specific Structure
+ ID is present; this is to allow deprecating the legacy space in the future.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786428
+Below is the list of supported Virtio structures, including Structure ID,
+ offset alignment, and where it can be located in the legacy configuration
+ space.
+ Note that legacy space layout changes as the MSI-X capability is enabled
+ and disabled
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786428
+ie.
+ once you enable MSI-X on the device, the other fields move.
+ If you turn it off again, they move back!
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786868
+\begin_inset Tabular
+<lyxtabular version="3" rows="5" columns="6">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Structure
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+ID
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Alignment
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786921
+Minimal Size
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785821
+Offset in legacy space
+\change_deleted 1986246365 1320785817
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786926
+Minimal Size in legacy space
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785855
+Virtio Header
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785860
+0x1
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786157
+4 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786225
+28 bytes
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786145
+0
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786236
+24 bytes if MSI-X is enabled, 20 if disabled
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786188
+Queue Notify
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786191
+0x2
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786267
+2 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786228
+2 bytes
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786505
+16 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786303
+2 bytes
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786878
+ISR Status
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786260
+0x3
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786270
+1 byte
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786273
+1 byte
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786534
+19 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786306
+1 byte
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786847
+Device Header
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786474
+0x4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786477
+1 byte
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786487
+Device specific
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786513
+24 bytes if MSI-X is enabled, 20 if disabled
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786492
+Device specific
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786973
+Drivers should assume that each structure size can be extended in the future.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320787003
+Queue Notify and ISR status are single-field registers.
+ Device Header has device specific structure.
+ Virtio Header structure is documented below.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Subsection
+Virtio Header
+\end_layout
+
+\begin_layout Standard
+The virtio header looks as follows:
+\end_layout
+
+\begin_layout Standard
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="9">
+<features tabularvalignment="middle">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Bits
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+32
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+32
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+32
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+16
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+16
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+16
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+8
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+8
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Read/Write
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+R
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+R+W
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+R+W
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+R
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+R+W
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+R+W
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+R+W
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+R
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Purpose
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Device
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Guest
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Queue
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Queue
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Queue
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786386
+
+\size footnotesize
+Reserved
+\change_deleted 1986246365 1320786378
+Queue
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Device
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786393
+
+\size footnotesize
+Reserved
+\change_deleted 1986246365 1320786390
+ISR
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Features bits 0:31
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Features bits 0:31
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Address
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Size
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Select
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_deleted 1986246365 1320786378
+
+\size footnotesize
+Notify
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Status
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_deleted 1986246365 1320786388
+
+\size footnotesize
+Status
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\change_deleted 1986246365 1320786398
+If MSI-X is enabled for the device, two additional fields immediately follow
+ this header:
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+ie.
+ once you enable MSI-X on the device, the other fields move.
+ If you turn it off again, they move back!
+\end_layout
+
+\end_inset
+
+
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="3">
+<features tabularvalignment="middle">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Bits
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+16
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+16
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Read/Write
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+R+W
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+R+W
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Purpose
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Configuration
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Queue
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+(MSI-X)
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Vector
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Vector
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\change_deleted 1986246365 1320786816
+Finally, if feature bits (VIRTIO_F_FEATURES_HI)
+\change_unchanged
+ this is immediately followed by two additional fields:
+\end_layout
+
+\begin_layout Standard
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="3">
+<features tabularvalignment="middle">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Bits
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+32
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+32
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Read/Write
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+R
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+R+W
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Purpose
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Device
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Guest
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Features bits 32:63
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Features bits 32:63
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\change_deleted 1986246365 1320786783
+Immediately following these general headers, there may be device-specific
+ headers:
+\end_layout
+
+\begin_layout Standard
+
+\change_deleted 1986246365 1320786783
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="2">
+<features tabularvalignment="middle">
+<column alignment="left" valignment="top" width="0">
+<column alignment="left" valignment="top" width="0">
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Bits
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Device Specific
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Read/Write
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Device Specific
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Purpose
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\size footnotesize
+Device Specific...
\end_layout
-\begin_layout Enumerate
-The DRIVER_OK status bit is set.
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
\end_layout
-\begin_layout Enumerate
-The device can now be used (ie.
- buffers added to the virtqueues)
-\begin_inset Foot
-status open
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
\begin_layout Plain Layout
-Historically, drivers have used the device before steps 5 and 6.
- This is only allowed if the driver does not use any features which would
- alter this early use of the device.
+
\end_layout
\end_inset
+</cell>
+</row>
+</lyxtabular>
+\end_inset
-\end_layout
-\begin_layout Standard
-If any of these steps go irrecoverably wrong, the guest should set the FAILED
- status bit to indicate that it has given up on the device (it can reset
- the device later to restart if desired).
-\end_layout
+\change_inserted 1986246365 1320784618
-\begin_layout Standard
-We now cover the fields required for general setup in detail.
\end_layout
\begin_layout Subsection
-Virtio Header
+
+\change_inserted 1986246365 1320786351
+Legacy Virtio Header
\end_layout
\begin_layout Standard
-The virtio header looks as follows:
+
+\change_inserted 1986246365 1320786351
+For reference, the legacy virtio header looks as follows; one observes that
+ most register offsets match the new virtio header, to make compatibility
+ easier:
\end_layout
\begin_layout Standard
+
+\change_inserted 1986246365 1320786351
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="9">
<features tabularvalignment="middle">
@@ -697,6 +3644,8 @@ The virtio header looks as follows:
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
Bits
\end_layout
@@ -706,6 +3655,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
32
\end_layout
@@ -715,6 +3666,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
32
\end_layout
@@ -724,6 +3677,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
32
\end_layout
@@ -733,6 +3688,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
16
\end_layout
@@ -742,6 +3699,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
16
\end_layout
@@ -751,6 +3710,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
16
\end_layout
@@ -760,6 +3721,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
8
\end_layout
@@ -769,6 +3732,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
8
\end_layout
@@ -780,6 +3745,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
Read/Write
\end_layout
@@ -789,6 +3756,8 @@ Read/Write
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
R
\end_layout
@@ -798,6 +3767,8 @@ R
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
R+W
\end_layout
@@ -807,6 +3778,8 @@ R+W
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
R+W
\end_layout
@@ -816,6 +3789,8 @@ R+W
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
R
\end_layout
@@ -825,6 +3800,8 @@ R
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
R+W
\end_layout
@@ -834,6 +3811,8 @@ R+W
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
R+W
\end_layout
@@ -843,6 +3822,8 @@ R+W
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
R+W
\end_layout
@@ -852,6 +3833,8 @@ R+W
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
R
\end_layout
@@ -863,6 +3846,8 @@ R
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
Purpose
\end_layout
@@ -873,6 +3858,8 @@ Purpose
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Device
\end_layout
@@ -884,6 +3871,8 @@ Device
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Guest
\end_layout
@@ -895,6 +3884,8 @@ Guest
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Queue
\end_layout
@@ -906,6 +3897,8 @@ Queue
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Queue
\end_layout
@@ -917,6 +3910,8 @@ Queue
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Queue
\end_layout
@@ -928,6 +3923,8 @@ Queue
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Queue
\end_layout
@@ -939,6 +3936,8 @@ Queue
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Device
\end_layout
@@ -950,6 +3949,8 @@ Device
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
ISR
\end_layout
@@ -963,6 +3964,8 @@ ISR
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\end_layout
\end_inset
@@ -972,6 +3975,8 @@ ISR
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Features bits 0:31
\end_layout
@@ -983,6 +3988,8 @@ Features bits 0:31
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Features bits 0:31
\end_layout
@@ -994,6 +4001,8 @@ Features bits 0:31
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Address
\end_layout
@@ -1005,6 +4014,8 @@ Address
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Size
\end_layout
@@ -1016,6 +4027,8 @@ Size
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Select
\end_layout
@@ -1027,6 +4040,8 @@ Select
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Notify
\end_layout
@@ -1038,6 +4053,8 @@ Notify
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Status
\end_layout
@@ -1049,6 +4066,8 @@ Status
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Status
\end_layout
@@ -1064,12 +4083,16 @@ Status
\end_layout
\begin_layout Standard
+
+\change_inserted 1986246365 1320786351
If MSI-X is enabled for the device, two additional fields immediately follow
this header:
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
ie.
once you enable MSI-X on the device, the other fields move.
If you turn it off again, they move back!
@@ -1081,6 +4104,8 @@ ie.
\end_layout
\begin_layout Standard
+
+\change_inserted 1986246365 1320786351
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features tabularvalignment="middle">
@@ -1092,6 +4117,8 @@ ie.
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
Bits
\end_layout
@@ -1101,6 +4128,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
16
\end_layout
@@ -1110,6 +4139,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
16
\end_layout
@@ -1121,6 +4152,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
Read/Write
\end_layout
@@ -1130,6 +4163,8 @@ Read/Write
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
R+W
\end_layout
@@ -1139,6 +4174,8 @@ R+W
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
R+W
\end_layout
@@ -1150,6 +4187,8 @@ R+W
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
Purpose
\end_layout
@@ -1160,6 +4199,8 @@ Purpose
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Configuration
\end_layout
@@ -1171,6 +4212,8 @@ Configuration
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Queue
\end_layout
@@ -1183,6 +4226,8 @@ Queue
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
(MSI-X)
\end_layout
@@ -1193,16 +4238,7 @@ Queue
\begin_layout Plain Layout
-\size footnotesize
-Vector
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
\size footnotesize
Vector
@@ -1210,145 +4246,15 @@ Vector
\end_inset
</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Finally, if feature bits (VIRTIO_F_FEATURES_HI) this is immediately followed
- by two additional fields:
-\end_layout
-
-\begin_layout Standard
-\begin_inset Tabular
-<lyxtabular version="3" rows="4" columns="3">
-<features tabularvalignment="middle">
-<column alignment="left" valignment="top" width="0">
-<column alignment="left" valignment="top" width="0">
-<column alignment="left" valignment="top" width="0">
-<row>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-Bits
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-32
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-32
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-Read/Write
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-R
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-R+W
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-Purpose
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-
-\size footnotesize
-Device
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-
-\size footnotesize
-Guest
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row>
<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
-
-\size footnotesize
-Features bits 32:63
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
\size footnotesize
-Features bits 32:63
+Vector
\end_layout
\end_inset
@@ -1362,11 +4268,15 @@ Features bits 32:63
\end_layout
\begin_layout Standard
-Immediately following these general headers, there may be device-specific
+
+\change_inserted 1986246365 1320786351
+Immediately following these general headers, there may be legacy device-specific
headers:
\end_layout
\begin_layout Standard
+
+\change_inserted 1986246365 1320786351
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="2">
<features tabularvalignment="middle">
@@ -1377,6 +4287,8 @@ Immediately following these general headers, there may be device-specific
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
Bits
\end_layout
@@ -1386,6 +4298,8 @@ Bits
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
Device Specific
\end_layout
@@ -1397,6 +4311,8 @@ Device Specific
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
Read/Write
\end_layout
@@ -1406,6 +4322,8 @@ Read/Write
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
Device Specific
\end_layout
@@ -1417,6 +4335,8 @@ Device Specific
\begin_inset Text
\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786351
Purpose
\end_layout
@@ -1427,6 +4347,8 @@ Purpose
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\size footnotesize
Device Specific...
\end_layout
@@ -1440,6 +4362,8 @@ Device Specific...
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\end_layout
\end_inset
@@ -1449,6 +4373,8 @@ Device Specific...
\begin_layout Plain Layout
+\change_inserted 1986246365 1320786351
+
\end_layout
\end_inset
@@ -1461,6 +4387,15 @@ Device Specific...
\end_layout
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786619
+Legacy device-specific headers are supported for backwards compatibility.
+ As such, they are not required to map the whole device configuration structure
+ - only the initial segment expected by legacy drivers needs to be mapped.
+ The size of such legacy segment size is device specific.
+\end_layout
+
\begin_layout Subsubsection
Device Status
\end_layout
@@ -1531,8 +4466,10 @@ name "sub:Feature-Bits"
The least significant 31 bits of the first configuration field indicates
the features that the device supports (the high bit is reserved, and will
be used to indicate the presence of future feature bits elsewhere).
- If more than 31 feature bits are supported, the device indicates so by
- setting feature bit 31 (see
+
+\change_deleted 1986246365 1320784929
+If more than 31 feature bits are supported, the device indicates so by setting
+ feature bit 31 (see
\begin_inset CommandInset ref
LatexCommand ref
reference "cha:Reserved-Feature-Bits"
@@ -1540,7 +4477,9 @@ reference "cha:Reserved-Feature-Bits"
\end_inset
).
- The bits are allocated as follows:
+
+\change_unchanged
+The bits are allocated as follows:
\end_layout
\begin_layout Description
@@ -1615,10 +4554,14 @@ This allows for forwards and backwards compatibility: if the device is enhanced
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320784940
Access to feature bits 32 to 63 is enabled by Guest by setting feature bit
31.
If this bit is unset, Device must assume that all feature bits > 31 are
unset.
+\change_unchanged
+
\end_layout
\begin_layout Subsubsection
@@ -1629,10 +4572,14 @@ Configuration/Queue Vectors
When MSI-X capability is present and enabled in the device (through standard
PCI configuration space) 4 bytes at byte offset 20 are used to map configuratio
n change and queue interrupts to MSI-X vectors.
- In this case, the ISR Status field is unused, and device specific configuration
- starts at byte offset 24 in virtio header structure.
+ In this case, the ISR Status field is unused
+\change_deleted 1986246365 1320784981
+, and device specific configuration starts at byte offset 24 in virtio header
+ structure.
When MSI-X capability is not enabled, device specific configuration starts
- at byte offset 20 in virtio header.
+ at byte offset 20 in virtio header
+\change_unchanged
+.
\end_layout
\begin_layout Standard
^ permalink raw reply related [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-08 21:40 ` Michael S. Tsirkin
(?)
@ 2011-11-08 21:41 ` Michael S. Tsirkin
2011-11-09 10:21 ` Avi Kivity
-1 siblings, 1 reply; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-08 21:41 UTC (permalink / raw)
To: Rusty Russell
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, virtualization, Christian Borntraeger,
Sasha Levin, Amit Shah, avi
[-- Attachment #1: Type: text/plain, Size: 65 bytes --]
> PDF will follow.
Attached for the lyx challenged :)
--
MST
[-- Attachment #2: virtio-spec.pdf --]
[-- Type: application/pdf, Size: 316465 bytes --]
[-- Attachment #3: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-08 21:41 ` Michael S. Tsirkin
@ 2011-11-09 10:21 ` Avi Kivity
0 siblings, 0 replies; 134+ messages in thread
From: Avi Kivity @ 2011-11-09 10:21 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, virtualization, Christian Borntraeger,
Sasha Levin, Amit Shah
On 11/08/2011 11:41 PM, Michael S. Tsirkin wrote:
> > PDF will follow.
>
> Attached for the lyx challenged :)
>
>
The diagrams are truncated.
Otherwise looks reasonable.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-08 21:40 ` Michael S. Tsirkin
(?)
(?)
@ 2011-11-09 8:46 ` Sasha Levin
2011-11-09 10:13 ` Michael S. Tsirkin
2011-11-09 12:38 ` Avi Kivity
-1 siblings, 2 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 8:46 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi
On Tue, 2011-11-08 at 23:40 +0200, Michael S. Tsirkin wrote:
> Here's a spec change documenting what my C patch does
> (almost - I tweaked the layout a bit, but the idea is the same).
> Some more cleanups are needed but I thought I'd send it
> for early flames/comments.
>
> The idea is simple: we split functionally unrelated
> register groups to independent structures, and let
> the device place is anywhere using a capability
> in PCI configuration space.
>
> It can then go into MMIO space which is cheaper than PIO.
>
> A legacy portion of the configuration is mirrored
> in the first BAR, to keep legacy drivers working.
> Any new fields can be added in existing structures
> at the end, so they won't affect legacy.
If newer specs add more structures at the end of the config space, and
use the same config space for legacy, that space now becomes device
specific config space and not new-shiny-feature space, so we must
remember to handle those cases.
> Alternatively we can add new structures with new
> structure IDs, pointed to from PCI configuration space.
>
> As we don't yet have devices or drivers with 64 bit features,
> I decided we don't need high feature bits in legacy space.
> This also frees up feature bit 31 as we don't need it
> to enable high feature bits anymore.
KVM tool actually has support for 64bit features, we can probably remove
that when Pekka isn't looking :)
>
> As this solves the dynamic placement of MSIX vectors
> and high feature bits,
> I thought it's easier to just reserve space for that
> programming than give it a separate structure. This
> can be changed by a patch on top.
>
> Note that data path is split from configuration.
>
> PDF will follow.
> ----
>
The device initialization sequence might use an update as well. Maybe
also a description of how device handles missing structure IDs.
[snip]
> +
> +\begin_layout Standard
> +
> +\change_inserted 1986246365 1320781133
> +These registers are specified using vendor-specific PCI capability located
> + on capability list in PCI configuration space of the device.
> + This virtio structure capability uses little-endian format; all bits are
> + read-only:
> +\end_layout
> +
> +\begin_layout Standard
> +
> +\change_inserted 1986246365 1320772579
> +\begin_inset Tabular
Just a note, these tables are way too wide to work properly in PDFs :)
> +<lyxtabular version="3" rows="4" columns="34">
> +<features tabularvalignment="middle">
> +<column alignment="center" valignment="top" width="0pt">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0pt">
> +<row>
[snip]
> +
> +\begin_layout Standard
> +
> +\change_inserted 1986246365 1320779667
> +Purpose:
> +\end_layout
> +
> +\begin_layout Standard
> +
> +\change_inserted 1986246365 1320780912
> +
> +\emph on
> +Capability ID
> +\emph default
> +,
> +\emph on
> +Next Capability Pointer
> +\emph default
> +,
> +\emph on
> +Capability Length
> +\emph default
> + - these fields are specified by PCI local bus specification, Rev 3.0
I'm not sure what capability length is, can't find it in the spec
either.
[snip]
> +\begin_layout Plain Layout
> +ie.
> + once you enable MSI-X on the device, the other fields move.
> + If you turn it off again, they move back!
Is it still true? We're talking about the new layout here (there are
several of this footnote, this one is located right *before* the section
which talks about legacy config space.
[snip]
> +
> +\change_deleted 1986246365 1320784929
> +If more than 31 feature bits are supported, the device indicates so by setting
> + feature bit 31 (see
The bit numbers below this text should be corrected as well.
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 8:46 ` Sasha Levin
@ 2011-11-09 10:13 ` Michael S. Tsirkin
2011-11-09 12:38 ` Avi Kivity
1 sibling, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 10:13 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, penberg, avi, Amit Shah
On Wed, Nov 09, 2011 at 10:46:06AM +0200, Sasha Levin wrote:
> On Tue, 2011-11-08 at 23:40 +0200, Michael S. Tsirkin wrote:
> > Here's a spec change documenting what my C patch does
> > (almost - I tweaked the layout a bit, but the idea is the same).
> > Some more cleanups are needed but I thought I'd send it
> > for early flames/comments.
> >
> > The idea is simple: we split functionally unrelated
> > register groups to independent structures, and let
> > the device place is anywhere using a capability
> > in PCI configuration space.
> >
> > It can then go into MMIO space which is cheaper than PIO.
> >
> > A legacy portion of the configuration is mirrored
> > in the first BAR, to keep legacy drivers working.
> > Any new fields can be added in existing structures
> > at the end, so they won't affect legacy.
>
> If newer specs add more structures at the end of the config space, and
> use the same config space for legacy, that space now becomes device
> specific config space and not new-shiny-feature space, so we must
> remember to handle those cases.
Yes. Devices should mirror virtio header and device structures
in MMIO and point Structures there. It seems unavoidable for
device structures (because legacy layout is dynamic
and we don't want to keep doing that), so I thought it's not worth the
trouble for virtio header either.
Notification and ISR Structures can point into PIO.
I'll add some more text to clarify that.
> > Alternatively we can add new structures with new
> > structure IDs, pointed to from PCI configuration space.
> >
> > As we don't yet have devices or drivers with 64 bit features,
> > I decided we don't need high feature bits in legacy space.
> > This also frees up feature bit 31 as we don't need it
> > to enable high feature bits anymore.
>
> KVM tool actually has support for 64bit features, we can probably remove
> that when Pekka isn't looking :)
It's not yet released so maybe it's not an issue yet.
If it's too late I can re-add them to legacy too.
Pekka, 64 features aren't yet used and we are discussing
changing the layout for that field. Mind taking it out
of kvm tool for now?
> >
> > As this solves the dynamic placement of MSIX vectors
> > and high feature bits,
> > I thought it's easier to just reserve space for that
> > programming than give it a separate structure. This
> > can be changed by a patch on top.
> >
> > Note that data path is split from configuration.
> >
> > PDF will follow.
> > ----
> >
>
> The device initialization sequence might use an update as well.
What is needed? Add an item where the driver scans the PCI capability
list to detect the layout?
> Maybe
> also a description of how device handles missing structure IDs.
>
> [snip]
Hmm. I just have
'Drivers should fall back on this legacy structure if a
Virtio Structure capability is missing in the PCI capability
list'.
What else would be helpful? An example?
> > +
> > +\begin_layout Standard
> > +
> > +\change_inserted 1986246365 1320781133
> > +These registers are specified using vendor-specific PCI capability located
> > + on capability list in PCI configuration space of the device.
> > + This virtio structure capability uses little-endian format; all bits are
> > + read-only:
> > +\end_layout
> > +
> > +\begin_layout Standard
> > +
> > +\change_inserted 1986246365 1320772579
> > +\begin_inset Tabular
>
> Just a note, these tables are way too wide to work properly in PDFs :)
True, looks like I need to abbreviate
> > +<lyxtabular version="3" rows="4" columns="34">
> > +<features tabularvalignment="middle">
> > +<column alignment="center" valignment="top" width="0pt">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0pt">
> > +<row>
>
> [snip]
>
> > +
> > +\begin_layout Standard
> > +
> > +\change_inserted 1986246365 1320779667
> > +Purpose:
> > +\end_layout
> > +
> > +\begin_layout Standard
> > +
> > +\change_inserted 1986246365 1320780912
> > +
> > +\emph on
> > +Capability ID
> > +\emph default
> > +,
> > +\emph on
> > +Next Capability Pointer
> > +\emph default
> > +,
> > +\emph on
> > +Capability Length
> > +\emph default
> > + - these fields are specified by PCI local bus specification, Rev 3.0
>
> I'm not sure what capability length is, can't find it in the spec
> either.
>
> [snip]
It's the legth of the vendor specific capability structure in bytes.
'the byte immediately following the “Next”
pointer in the capability structure is defined to be a length field'
It's on page 330 in my copy.
> > +\begin_layout Plain Layout
> > +ie.
> > + once you enable MSI-X on the device, the other fields move.
> > + If you turn it off again, they move back!
>
> Is it still true? We're talking about the new layout here (there are
> several of this footnote, this one is located right *before* the section
> which talks about legacy config space.
>
> [snip]
Of course not. I'll move the footnote, this only applies to the
legacy naturally.
> > +
> > +\change_deleted 1986246365 1320784929
> > +If more than 31 feature bits are supported, the device indicates so by setting
> > + feature bit 31 (see
>
> The bit numbers below this text should be corrected as well.
Will fix. Thanks!
> --
>
> Sasha.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 10:13 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 10:13 UTC (permalink / raw)
To: Sasha Levin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, Nov 09, 2011 at 10:46:06AM +0200, Sasha Levin wrote:
> On Tue, 2011-11-08 at 23:40 +0200, Michael S. Tsirkin wrote:
> > Here's a spec change documenting what my C patch does
> > (almost - I tweaked the layout a bit, but the idea is the same).
> > Some more cleanups are needed but I thought I'd send it
> > for early flames/comments.
> >
> > The idea is simple: we split functionally unrelated
> > register groups to independent structures, and let
> > the device place is anywhere using a capability
> > in PCI configuration space.
> >
> > It can then go into MMIO space which is cheaper than PIO.
> >
> > A legacy portion of the configuration is mirrored
> > in the first BAR, to keep legacy drivers working.
> > Any new fields can be added in existing structures
> > at the end, so they won't affect legacy.
>
> If newer specs add more structures at the end of the config space, and
> use the same config space for legacy, that space now becomes device
> specific config space and not new-shiny-feature space, so we must
> remember to handle those cases.
Yes. Devices should mirror virtio header and device structures
in MMIO and point Structures there. It seems unavoidable for
device structures (because legacy layout is dynamic
and we don't want to keep doing that), so I thought it's not worth the
trouble for virtio header either.
Notification and ISR Structures can point into PIO.
I'll add some more text to clarify that.
> > Alternatively we can add new structures with new
> > structure IDs, pointed to from PCI configuration space.
> >
> > As we don't yet have devices or drivers with 64 bit features,
> > I decided we don't need high feature bits in legacy space.
> > This also frees up feature bit 31 as we don't need it
> > to enable high feature bits anymore.
>
> KVM tool actually has support for 64bit features, we can probably remove
> that when Pekka isn't looking :)
It's not yet released so maybe it's not an issue yet.
If it's too late I can re-add them to legacy too.
Pekka, 64 features aren't yet used and we are discussing
changing the layout for that field. Mind taking it out
of kvm tool for now?
> >
> > As this solves the dynamic placement of MSIX vectors
> > and high feature bits,
> > I thought it's easier to just reserve space for that
> > programming than give it a separate structure. This
> > can be changed by a patch on top.
> >
> > Note that data path is split from configuration.
> >
> > PDF will follow.
> > ----
> >
>
> The device initialization sequence might use an update as well.
What is needed? Add an item where the driver scans the PCI capability
list to detect the layout?
> Maybe
> also a description of how device handles missing structure IDs.
>
> [snip]
Hmm. I just have
'Drivers should fall back on this legacy structure if a
Virtio Structure capability is missing in the PCI capability
list'.
What else would be helpful? An example?
> > +
> > +\begin_layout Standard
> > +
> > +\change_inserted 1986246365 1320781133
> > +These registers are specified using vendor-specific PCI capability located
> > + on capability list in PCI configuration space of the device.
> > + This virtio structure capability uses little-endian format; all bits are
> > + read-only:
> > +\end_layout
> > +
> > +\begin_layout Standard
> > +
> > +\change_inserted 1986246365 1320772579
> > +\begin_inset Tabular
>
> Just a note, these tables are way too wide to work properly in PDFs :)
True, looks like I need to abbreviate
> > +<lyxtabular version="3" rows="4" columns="34">
> > +<features tabularvalignment="middle">
> > +<column alignment="center" valignment="top" width="0pt">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0">
> > +<column alignment="center" valignment="top" width="0pt">
> > +<row>
>
> [snip]
>
> > +
> > +\begin_layout Standard
> > +
> > +\change_inserted 1986246365 1320779667
> > +Purpose:
> > +\end_layout
> > +
> > +\begin_layout Standard
> > +
> > +\change_inserted 1986246365 1320780912
> > +
> > +\emph on
> > +Capability ID
> > +\emph default
> > +,
> > +\emph on
> > +Next Capability Pointer
> > +\emph default
> > +,
> > +\emph on
> > +Capability Length
> > +\emph default
> > + - these fields are specified by PCI local bus specification, Rev 3.0
>
> I'm not sure what capability length is, can't find it in the spec
> either.
>
> [snip]
It's the legth of the vendor specific capability structure in bytes.
'the byte immediately following the “Next”
pointer in the capability structure is defined to be a length field'
It's on page 330 in my copy.
> > +\begin_layout Plain Layout
> > +ie.
> > + once you enable MSI-X on the device, the other fields move.
> > + If you turn it off again, they move back!
>
> Is it still true? We're talking about the new layout here (there are
> several of this footnote, this one is located right *before* the section
> which talks about legacy config space.
>
> [snip]
Of course not. I'll move the footnote, this only applies to the
legacy naturally.
> > +
> > +\change_deleted 1986246365 1320784929
> > +If more than 31 feature bits are supported, the device indicates so by setting
> > + feature bit 31 (see
>
> The bit numbers below this text should be corrected as well.
Will fix. Thanks!
> --
>
> Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 10:13 ` Michael S. Tsirkin
@ 2011-11-09 10:26 ` Sasha Levin
-1 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 10:26 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, penberg, avi, Amit Shah
On Wed, 2011-11-09 at 12:13 +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 10:46:06AM +0200, Sasha Levin wrote:
> > The device initialization sequence might use an update as well.
>
> What is needed? Add an item where the driver scans the PCI capability
> list to detect the layout?
Yup, something similar like that - just to make it obvious.
> > Maybe
> > also a description of how device handles missing structure IDs.
> >
> > [snip]
>
> Hmm. I just have
> 'Drivers should fall back on this legacy structure if a
> Virtio Structure capability is missing in the PCI capability
> list'.
>
> What else would be helpful? An example?
I just remembered from your patch that you could define some structure
IDs, but not necessarily all of them, if it's not longer the case then
ignore me. If it is, then the scenario of a missing structure should be
specified (For example, if the ISR structure wasn't defined, fall back
to...).
> > I'm not sure what capability length is, can't find it in the spec
> > either.
> >
> > [snip]
>
> It's the legth of the vendor specific capability structure in bytes.
> 'the byte immediately following the “Next”
> pointer in the capability structure is defined to be a length field'
> It's on page 330 in my copy.
Right, I was looking only at the regular cap definition.
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 10:26 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 10:26 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, 2011-11-09 at 12:13 +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 10:46:06AM +0200, Sasha Levin wrote:
> > The device initialization sequence might use an update as well.
>
> What is needed? Add an item where the driver scans the PCI capability
> list to detect the layout?
Yup, something similar like that - just to make it obvious.
> > Maybe
> > also a description of how device handles missing structure IDs.
> >
> > [snip]
>
> Hmm. I just have
> 'Drivers should fall back on this legacy structure if a
> Virtio Structure capability is missing in the PCI capability
> list'.
>
> What else would be helpful? An example?
I just remembered from your patch that you could define some structure
IDs, but not necessarily all of them, if it's not longer the case then
ignore me. If it is, then the scenario of a missing structure should be
specified (For example, if the ISR structure wasn't defined, fall back
to...).
> > I'm not sure what capability length is, can't find it in the spec
> > either.
> >
> > [snip]
>
> It's the legth of the vendor specific capability structure in bytes.
> 'the byte immediately following the “Next”
> pointer in the capability structure is defined to be a length field'
> It's on page 330 in my copy.
Right, I was looking only at the regular cap definition.
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 10:26 ` Sasha Levin
@ 2011-11-09 10:49 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 10:49 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, penberg, avi, Amit Shah
On Wed, Nov 09, 2011 at 12:26:08PM +0200, Sasha Levin wrote:
> On Wed, 2011-11-09 at 12:13 +0200, Michael S. Tsirkin wrote:
> > On Wed, Nov 09, 2011 at 10:46:06AM +0200, Sasha Levin wrote:
> > > The device initialization sequence might use an update as well.
> >
> > What is needed? Add an item where the driver scans the PCI capability
> > list to detect the layout?
>
> Yup, something similar like that - just to make it obvious.
>
> > > Maybe
> > > also a description of how device handles missing structure IDs.
> > >
> > > [snip]
> >
> > Hmm. I just have
> > 'Drivers should fall back on this legacy structure if a
> > Virtio Structure capability is missing in the PCI capability
> > list'.
> >
> > What else would be helpful? An example?
>
> I just remembered from your patch that you could define some structure
> IDs, but not necessarily all of them, if it's not longer the case then
> ignore me. If it is, then the scenario of a missing structure should be
> specified (For example, if the ISR structure wasn't defined, fall back
> to...).
Yes, this was the intent of the text above. I'll make that explicit.
> > > I'm not sure what capability length is, can't find it in the spec
> > > either.
> > >
> > > [snip]
> >
> > It's the legth of the vendor specific capability structure in bytes.
> > 'the byte immediately following the “Next”
> > pointer in the capability structure is defined to be a length field'
> > It's on page 330 in my copy.
>
> Right, I was looking only at the regular cap definition.
>
> --
>
> Sasha.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 10:49 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 10:49 UTC (permalink / raw)
To: Sasha Levin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, Nov 09, 2011 at 12:26:08PM +0200, Sasha Levin wrote:
> On Wed, 2011-11-09 at 12:13 +0200, Michael S. Tsirkin wrote:
> > On Wed, Nov 09, 2011 at 10:46:06AM +0200, Sasha Levin wrote:
> > > The device initialization sequence might use an update as well.
> >
> > What is needed? Add an item where the driver scans the PCI capability
> > list to detect the layout?
>
> Yup, something similar like that - just to make it obvious.
>
> > > Maybe
> > > also a description of how device handles missing structure IDs.
> > >
> > > [snip]
> >
> > Hmm. I just have
> > 'Drivers should fall back on this legacy structure if a
> > Virtio Structure capability is missing in the PCI capability
> > list'.
> >
> > What else would be helpful? An example?
>
> I just remembered from your patch that you could define some structure
> IDs, but not necessarily all of them, if it's not longer the case then
> ignore me. If it is, then the scenario of a missing structure should be
> specified (For example, if the ISR structure wasn't defined, fall back
> to...).
Yes, this was the intent of the text above. I'll make that explicit.
> > > I'm not sure what capability length is, can't find it in the spec
> > > either.
> > >
> > > [snip]
> >
> > It's the legth of the vendor specific capability structure in bytes.
> > 'the byte immediately following the “Next”
> > pointer in the capability structure is defined to be a length field'
> > It's on page 330 in my copy.
>
> Right, I was looking only at the regular cap definition.
>
> --
>
> Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 10:13 ` Michael S. Tsirkin
(?)
(?)
@ 2011-11-09 12:25 ` Pekka Enberg
2011-11-09 12:28 ` Sasha Levin
-1 siblings, 1 reply; 134+ messages in thread
From: Pekka Enberg @ 2011-11-09 12:25 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Sasha Levin, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm,
avi, penberg
On Wed, 9 Nov 2011, Michael S. Tsirkin wrote:
>> KVM tool actually has support for 64bit features, we can probably remove
>> that when Pekka isn't looking :)
>
> It's not yet released so maybe it's not an issue yet.
> If it's too late I can re-add them to legacy too.
>
> Pekka, 64 features aren't yet used and we are discussing
> changing the layout for that field. Mind taking it out
> of kvm tool for now?
Sasha, why did we add 64-bit features to the KVM tool? Wasn't it part of
the virtio spec? Does QEMU not use them? How badly will older versions of
the KVM tool break if you drop 64-bit features?
Pekka
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 12:25 ` Pekka Enberg
@ 2011-11-09 12:28 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 12:28 UTC (permalink / raw)
To: Pekka Enberg
Cc: Krishna Kumar, Wang Sheng-Hui, kvm, Pawel Moll,
Michael S. Tsirkin, Alexey Kardashevskiy,
lkml - Kernel Mailing List, virtualization, Christian Borntraeger,
penberg, avi, Amit Shah
On Wed, 2011-11-09 at 14:25 +0200, Pekka Enberg wrote:
> On Wed, 9 Nov 2011, Michael S. Tsirkin wrote:
> >> KVM tool actually has support for 64bit features, we can probably remove
> >> that when Pekka isn't looking :)
> >
> > It's not yet released so maybe it's not an issue yet.
> > If it's too late I can re-add them to legacy too.
> >
> > Pekka, 64 features aren't yet used and we are discussing
> > changing the layout for that field. Mind taking it out
> > of kvm tool for now?
>
> Sasha, why did we add 64-bit features to the KVM tool? Wasn't it part of
> the virtio spec? Does QEMU not use them? How badly will older versions of
> the KVM tool break if you drop 64-bit features?
We added 64-bit features to the tool because it just got into the spec
when we rewrote our virtio-pci handling - so we just implemented the
updated spec.
QEMU doesn't use them since while it did get into the spec, it was
intended to future-proof the limited feature bits, so no one really
needed them yet.
They don't exist in kernel code either, for same reason as above.
Nothing will break if we remove it since no one really used it, we were
probably the first and only implementation of the spec which considered
them :)
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 12:28 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 12:28 UTC (permalink / raw)
To: Pekka Enberg
Cc: Michael S. Tsirkin, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm,
avi, penberg
On Wed, 2011-11-09 at 14:25 +0200, Pekka Enberg wrote:
> On Wed, 9 Nov 2011, Michael S. Tsirkin wrote:
> >> KVM tool actually has support for 64bit features, we can probably remove
> >> that when Pekka isn't looking :)
> >
> > It's not yet released so maybe it's not an issue yet.
> > If it's too late I can re-add them to legacy too.
> >
> > Pekka, 64 features aren't yet used and we are discussing
> > changing the layout for that field. Mind taking it out
> > of kvm tool for now?
>
> Sasha, why did we add 64-bit features to the KVM tool? Wasn't it part of
> the virtio spec? Does QEMU not use them? How badly will older versions of
> the KVM tool break if you drop 64-bit features?
We added 64-bit features to the tool because it just got into the spec
when we rewrote our virtio-pci handling - so we just implemented the
updated spec.
QEMU doesn't use them since while it did get into the spec, it was
intended to future-proof the limited feature bits, so no one really
needed them yet.
They don't exist in kernel code either, for same reason as above.
Nothing will break if we remove it since no one really used it, we were
probably the first and only implementation of the spec which considered
them :)
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 12:28 ` Sasha Levin
(?)
@ 2011-11-09 12:36 ` Pekka Enberg
2011-11-09 15:33 ` Michael S. Tsirkin
` (2 more replies)
-1 siblings, 3 replies; 134+ messages in thread
From: Pekka Enberg @ 2011-11-09 12:36 UTC (permalink / raw)
To: Sasha Levin
Cc: Michael S. Tsirkin, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm,
avi, penberg
On Wed, 9 Nov 2011, Sasha Levin wrote:
> They don't exist in kernel code either, for same reason as above.
>
> Nothing will break if we remove it since no one really used it, we were
> probably the first and only implementation of the spec which considered
> them :)
As long as we are able to run older versions of the KVM tool with newer
kernels and vice versa, I see no reason why we can't drop 64-bit features
from the KVM tool.
Pekka
^ permalink raw reply [flat|nested] 134+ messages in thread* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 12:36 ` Pekka Enberg
@ 2011-11-09 15:33 ` Michael S. Tsirkin
2011-11-09 15:33 ` Michael S. Tsirkin
2012-06-18 11:54 ` Michael S. Tsirkin
2 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 15:33 UTC (permalink / raw)
To: Pekka Enberg
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, penberg, Sasha Levin, Amit Shah, avi
On Wed, Nov 09, 2011 at 02:36:43PM +0200, Pekka Enberg wrote:
> On Wed, 9 Nov 2011, Sasha Levin wrote:
> >They don't exist in kernel code either, for same reason as above.
> >
> >Nothing will break if we remove it since no one really used it, we were
> >probably the first and only implementation of the spec which considered
> >them :)
>
> As long as we are able to run older versions of the KVM tool with
> newer kernels and vice versa, I see no reason why we can't drop 64-bit
> features from the KVM tool.
>
> Pekka
What do these older versions do? Do they *set* bit 31 in the
features register?
--
MST
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 12:36 ` Pekka Enberg
2011-11-09 15:33 ` Michael S. Tsirkin
@ 2011-11-09 15:33 ` Michael S. Tsirkin
2012-06-18 11:54 ` Michael S. Tsirkin
2 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 15:33 UTC (permalink / raw)
To: Pekka Enberg
Cc: Sasha Levin, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm,
avi, penberg
On Wed, Nov 09, 2011 at 02:36:43PM +0200, Pekka Enberg wrote:
> On Wed, 9 Nov 2011, Sasha Levin wrote:
> >They don't exist in kernel code either, for same reason as above.
> >
> >Nothing will break if we remove it since no one really used it, we were
> >probably the first and only implementation of the spec which considered
> >them :)
>
> As long as we are able to run older versions of the KVM tool with
> newer kernels and vice versa, I see no reason why we can't drop 64-bit
> features from the KVM tool.
>
> Pekka
What do these older versions do? Do they *set* bit 31 in the
features register?
--
MST
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 12:36 ` Pekka Enberg
@ 2012-06-18 11:54 ` Michael S. Tsirkin
2011-11-09 15:33 ` Michael S. Tsirkin
2012-06-18 11:54 ` Michael S. Tsirkin
2 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2012-06-18 11:54 UTC (permalink / raw)
To: Pekka Enberg
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, penberg, Sasha Levin, Amit Shah, avi
On Wed, Nov 09, 2011 at 02:36:43PM +0200, Pekka Enberg wrote:
> On Wed, 9 Nov 2011, Sasha Levin wrote:
> >They don't exist in kernel code either, for same reason as above.
> >
> >Nothing will break if we remove it since no one really used it, we were
> >probably the first and only implementation of the spec which considered
> >them :)
>
> As long as we are able to run older versions of the KVM tool with
> newer kernels and vice versa, I see no reason why we can't drop
> 64-bit features from the KVM tool.
>
> Pekka
So what happened? Did you guys do this? Need to know what to do to make
progress. IIUC Rusty removed the new fields in 0.9.3.
Does your tool still use them? Did any version of the tool released by
distros do so?
--
MST
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2012-06-18 11:54 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2012-06-18 11:54 UTC (permalink / raw)
To: Pekka Enberg
Cc: Sasha Levin, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm,
avi, penberg
On Wed, Nov 09, 2011 at 02:36:43PM +0200, Pekka Enberg wrote:
> On Wed, 9 Nov 2011, Sasha Levin wrote:
> >They don't exist in kernel code either, for same reason as above.
> >
> >Nothing will break if we remove it since no one really used it, we were
> >probably the first and only implementation of the spec which considered
> >them :)
>
> As long as we are able to run older versions of the KVM tool with
> newer kernels and vice versa, I see no reason why we can't drop
> 64-bit features from the KVM tool.
>
> Pekka
So what happened? Did you guys do this? Need to know what to do to make
progress. IIUC Rusty removed the new fields in 0.9.3.
Does your tool still use them? Did any version of the tool released by
distros do so?
--
MST
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2012-06-18 11:54 ` Michael S. Tsirkin
(?)
@ 2012-06-18 12:05 ` Sasha Levin
-1 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2012-06-18 12:05 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Pekka Enberg, Christian Borntraeger, penberg, avi, Amit Shah
On Mon, 2012-06-18 at 14:54 +0300, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 02:36:43PM +0200, Pekka Enberg wrote:
> > On Wed, 9 Nov 2011, Sasha Levin wrote:
> > >They don't exist in kernel code either, for same reason as above.
> > >
> > >Nothing will break if we remove it since no one really used it, we were
> > >probably the first and only implementation of the spec which considered
> > >them :)
> >
> > As long as we are able to run older versions of the KVM tool with
> > newer kernels and vice versa, I see no reason why we can't drop
> > 64-bit features from the KVM tool.
> >
> > Pekka
>
> So what happened? Did you guys do this? Need to know what to do to make
> progress. IIUC Rusty removed the new fields in 0.9.3.
> Does your tool still use them? Did any version of the tool released by
> distros do so?
Yup, they were removed quite a while ago.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2012-06-18 11:54 ` Michael S. Tsirkin
(?)
(?)
@ 2012-06-18 12:05 ` Sasha Levin
2012-06-18 12:07 ` Michael S. Tsirkin
-1 siblings, 1 reply; 134+ messages in thread
From: Sasha Levin @ 2012-06-18 12:05 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Pekka Enberg, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm,
avi, penberg
On Mon, 2012-06-18 at 14:54 +0300, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 02:36:43PM +0200, Pekka Enberg wrote:
> > On Wed, 9 Nov 2011, Sasha Levin wrote:
> > >They don't exist in kernel code either, for same reason as above.
> > >
> > >Nothing will break if we remove it since no one really used it, we were
> > >probably the first and only implementation of the spec which considered
> > >them :)
> >
> > As long as we are able to run older versions of the KVM tool with
> > newer kernels and vice versa, I see no reason why we can't drop
> > 64-bit features from the KVM tool.
> >
> > Pekka
>
> So what happened? Did you guys do this? Need to know what to do to make
> progress. IIUC Rusty removed the new fields in 0.9.3.
> Does your tool still use them? Did any version of the tool released by
> distros do so?
Yup, they were removed quite a while ago.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2012-06-18 12:05 ` Sasha Levin
@ 2012-06-18 12:07 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2012-06-18 12:07 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Pekka Enberg, Christian Borntraeger, penberg, avi, Amit Shah
On Mon, Jun 18, 2012 at 02:05:17PM +0200, Sasha Levin wrote:
> On Mon, 2012-06-18 at 14:54 +0300, Michael S. Tsirkin wrote:
> > On Wed, Nov 09, 2011 at 02:36:43PM +0200, Pekka Enberg wrote:
> > > On Wed, 9 Nov 2011, Sasha Levin wrote:
> > > >They don't exist in kernel code either, for same reason as above.
> > > >
> > > >Nothing will break if we remove it since no one really used it, we were
> > > >probably the first and only implementation of the spec which considered
> > > >them :)
> > >
> > > As long as we are able to run older versions of the KVM tool with
> > > newer kernels and vice versa, I see no reason why we can't drop
> > > 64-bit features from the KVM tool.
> > >
> > > Pekka
> >
> > So what happened? Did you guys do this? Need to know what to do to make
> > progress. IIUC Rusty removed the new fields in 0.9.3.
> > Does your tool still use them? Did any version of the tool released by
> > distros do so?
>
> Yup, they were removed quite a while ago.
Thanks, that's nice. So we can reuse that bit if we need it
and it won't break your code.
--
MST
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2012-06-18 12:07 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2012-06-18 12:07 UTC (permalink / raw)
To: Sasha Levin
Cc: Pekka Enberg, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm,
avi, penberg
On Mon, Jun 18, 2012 at 02:05:17PM +0200, Sasha Levin wrote:
> On Mon, 2012-06-18 at 14:54 +0300, Michael S. Tsirkin wrote:
> > On Wed, Nov 09, 2011 at 02:36:43PM +0200, Pekka Enberg wrote:
> > > On Wed, 9 Nov 2011, Sasha Levin wrote:
> > > >They don't exist in kernel code either, for same reason as above.
> > > >
> > > >Nothing will break if we remove it since no one really used it, we were
> > > >probably the first and only implementation of the spec which considered
> > > >them :)
> > >
> > > As long as we are able to run older versions of the KVM tool with
> > > newer kernels and vice versa, I see no reason why we can't drop
> > > 64-bit features from the KVM tool.
> > >
> > > Pekka
> >
> > So what happened? Did you guys do this? Need to know what to do to make
> > progress. IIUC Rusty removed the new fields in 0.9.3.
> > Does your tool still use them? Did any version of the tool released by
> > distros do so?
>
> Yup, they were removed quite a while ago.
Thanks, that's nice. So we can reuse that bit if we need it
and it won't break your code.
--
MST
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 12:28 ` Sasha Levin
(?)
(?)
@ 2011-11-09 12:36 ` Pekka Enberg
-1 siblings, 0 replies; 134+ messages in thread
From: Pekka Enberg @ 2011-11-09 12:36 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, Wang Sheng-Hui, kvm, Pawel Moll,
Michael S. Tsirkin, Alexey Kardashevskiy,
lkml - Kernel Mailing List, virtualization, Christian Borntraeger,
penberg, avi, Amit Shah
On Wed, 9 Nov 2011, Sasha Levin wrote:
> They don't exist in kernel code either, for same reason as above.
>
> Nothing will break if we remove it since no one really used it, we were
> probably the first and only implementation of the spec which considered
> them :)
As long as we are able to run older versions of the KVM tool with newer
kernels and vice versa, I see no reason why we can't drop 64-bit features
from the KVM tool.
Pekka
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 10:13 ` Michael S. Tsirkin
` (2 preceding siblings ...)
(?)
@ 2011-11-09 12:25 ` Pekka Enberg
-1 siblings, 0 replies; 134+ messages in thread
From: Pekka Enberg @ 2011-11-09 12:25 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, penberg, Sasha Levin, Amit Shah, avi
On Wed, 9 Nov 2011, Michael S. Tsirkin wrote:
>> KVM tool actually has support for 64bit features, we can probably remove
>> that when Pekka isn't looking :)
>
> It's not yet released so maybe it's not an issue yet.
> If it's too late I can re-add them to legacy too.
>
> Pekka, 64 features aren't yet used and we are discussing
> changing the layout for that field. Mind taking it out
> of kvm tool for now?
Sasha, why did we add 64-bit features to the KVM tool? Wasn't it part of
the virtio spec? Does QEMU not use them? How badly will older versions of
the KVM tool break if you drop 64-bit features?
Pekka
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 8:46 ` Sasha Levin
@ 2011-11-09 12:38 ` Avi Kivity
2011-11-09 12:38 ` Avi Kivity
1 sibling, 0 replies; 134+ messages in thread
From: Avi Kivity @ 2011-11-09 12:38 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, Wang Sheng-Hui, kvm, Pawel Moll,
Michael S. Tsirkin, Alexey Kardashevskiy,
lkml - Kernel Mailing List, virtualization, Christian Borntraeger,
Amit Shah
On 11/09/2011 10:46 AM, Sasha Levin wrote:
> > Alternatively we can add new structures with new
> > structure IDs, pointed to from PCI configuration space.
> >
> > As we don't yet have devices or drivers with 64 bit features,
> > I decided we don't need high feature bits in legacy space.
> > This also frees up feature bit 31 as we don't need it
> > to enable high feature bits anymore.
>
> KVM tool actually has support for 64bit features, we can probably remove
> that when Pekka isn't looking :)
>
What about the Windows drivers?
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 12:38 ` Avi Kivity
0 siblings, 0 replies; 134+ messages in thread
From: Avi Kivity @ 2011-11-09 12:38 UTC (permalink / raw)
To: Sasha Levin
Cc: Michael S. Tsirkin, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm
On 11/09/2011 10:46 AM, Sasha Levin wrote:
> > Alternatively we can add new structures with new
> > structure IDs, pointed to from PCI configuration space.
> >
> > As we don't yet have devices or drivers with 64 bit features,
> > I decided we don't need high feature bits in legacy space.
> > This also frees up feature bit 31 as we don't need it
> > to enable high feature bits anymore.
>
> KVM tool actually has support for 64bit features, we can probably remove
> that when Pekka isn't looking :)
>
What about the Windows drivers?
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 12:38 ` Avi Kivity
@ 2011-11-09 12:48 ` Sasha Levin
-1 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 12:48 UTC (permalink / raw)
To: Avi Kivity
Cc: Krishna Kumar, Wang Sheng-Hui, kvm, Pawel Moll,
Michael S. Tsirkin, Alexey Kardashevskiy,
lkml - Kernel Mailing List, virtualization, Christian Borntraeger,
Amit Shah
On Wed, 2011-11-09 at 14:38 +0200, Avi Kivity wrote:
> On 11/09/2011 10:46 AM, Sasha Levin wrote:
> > > Alternatively we can add new structures with new
> > > structure IDs, pointed to from PCI configuration space.
> > >
> > > As we don't yet have devices or drivers with 64 bit features,
> > > I decided we don't need high feature bits in legacy space.
> > > This also frees up feature bit 31 as we don't need it
> > > to enable high feature bits anymore.
> >
> > KVM tool actually has support for 64bit features, we can probably remove
> > that when Pekka isn't looking :)
> >
>
> What about the Windows drivers?
While 64-bit features were defined, there was no actual devices to use
them.
So even if Windows drivers had the ability to support 64-bit features,
no device ever needed it therefore no device ever activated it.
A potential issue might arise when we remap feature bit 31 to do
something else, and when activated it would fool Windows drivers to
think that 64-bit features are now activated, while they're not - but
thats not something that should happen since legacy layout shouldn't
have that field enabled as per the spec (no new features in legacy
code).
I was unable to check if it was actually implemented in the drivers
because
http://git.kernel.org/?p=virt/kvm/kvm-guest-drivers-windows.git;a=summary is not quite there (*cough*).
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 12:48 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 12:48 UTC (permalink / raw)
To: Avi Kivity
Cc: Michael S. Tsirkin, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm
On Wed, 2011-11-09 at 14:38 +0200, Avi Kivity wrote:
> On 11/09/2011 10:46 AM, Sasha Levin wrote:
> > > Alternatively we can add new structures with new
> > > structure IDs, pointed to from PCI configuration space.
> > >
> > > As we don't yet have devices or drivers with 64 bit features,
> > > I decided we don't need high feature bits in legacy space.
> > > This also frees up feature bit 31 as we don't need it
> > > to enable high feature bits anymore.
> >
> > KVM tool actually has support for 64bit features, we can probably remove
> > that when Pekka isn't looking :)
> >
>
> What about the Windows drivers?
While 64-bit features were defined, there was no actual devices to use
them.
So even if Windows drivers had the ability to support 64-bit features,
no device ever needed it therefore no device ever activated it.
A potential issue might arise when we remap feature bit 31 to do
something else, and when activated it would fool Windows drivers to
think that 64-bit features are now activated, while they're not - but
thats not something that should happen since legacy layout shouldn't
have that field enabled as per the spec (no new features in legacy
code).
I was unable to check if it was actually implemented in the drivers
because
http://git.kernel.org/?p=virt/kvm/kvm-guest-drivers-windows.git;a=summary is not quite there (*cough*).
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 12:48 ` Sasha Levin
(?)
@ 2011-11-09 15:19 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 15:19 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, Avi Kivity, Amit Shah
On Wed, Nov 09, 2011 at 02:48:58PM +0200, Sasha Levin wrote:
> On Wed, 2011-11-09 at 14:38 +0200, Avi Kivity wrote:
> > On 11/09/2011 10:46 AM, Sasha Levin wrote:
> > > > Alternatively we can add new structures with new
> > > > structure IDs, pointed to from PCI configuration space.
> > > >
> > > > As we don't yet have devices or drivers with 64 bit features,
> > > > I decided we don't need high feature bits in legacy space.
> > > > This also frees up feature bit 31 as we don't need it
> > > > to enable high feature bits anymore.
> > >
> > > KVM tool actually has support for 64bit features, we can probably remove
> > > that when Pekka isn't looking :)
> > >
> >
> > What about the Windows drivers?
>
> While 64-bit features were defined, there was no actual devices to use
> them.
>
> So even if Windows drivers had the ability to support 64-bit features,
> no device ever needed it therefore no device ever activated it.
>
> A potential issue might arise when we remap feature bit 31 to do
> something else, and when activated it would fool Windows drivers to
> think that 64-bit features are now activated, while they're not - but
> thats not something that should happen since legacy layout shouldn't
> have that field enabled as per the spec (no new features in legacy
> code).
>
> I was unable to check if it was actually implemented in the drivers
> because
> http://git.kernel.org/?p=virt/kvm/kvm-guest-drivers-windows.git;a=summary is not quite there (*cough*).
I'm pretty sure windows drivers didn't yet get to it.
This was out for a very short time.
> --
>
> Sasha.
>
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 12:48 ` Sasha Levin
(?)
(?)
@ 2011-11-09 15:19 ` Michael S. Tsirkin
2011-11-13 14:07 ` Ronen Hod
-1 siblings, 1 reply; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 15:19 UTC (permalink / raw)
To: Sasha Levin
Cc: Avi Kivity, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm
On Wed, Nov 09, 2011 at 02:48:58PM +0200, Sasha Levin wrote:
> On Wed, 2011-11-09 at 14:38 +0200, Avi Kivity wrote:
> > On 11/09/2011 10:46 AM, Sasha Levin wrote:
> > > > Alternatively we can add new structures with new
> > > > structure IDs, pointed to from PCI configuration space.
> > > >
> > > > As we don't yet have devices or drivers with 64 bit features,
> > > > I decided we don't need high feature bits in legacy space.
> > > > This also frees up feature bit 31 as we don't need it
> > > > to enable high feature bits anymore.
> > >
> > > KVM tool actually has support for 64bit features, we can probably remove
> > > that when Pekka isn't looking :)
> > >
> >
> > What about the Windows drivers?
>
> While 64-bit features were defined, there was no actual devices to use
> them.
>
> So even if Windows drivers had the ability to support 64-bit features,
> no device ever needed it therefore no device ever activated it.
>
> A potential issue might arise when we remap feature bit 31 to do
> something else, and when activated it would fool Windows drivers to
> think that 64-bit features are now activated, while they're not - but
> thats not something that should happen since legacy layout shouldn't
> have that field enabled as per the spec (no new features in legacy
> code).
>
> I was unable to check if it was actually implemented in the drivers
> because
> http://git.kernel.org/?p=virt/kvm/kvm-guest-drivers-windows.git;a=summary is not quite there (*cough*).
I'm pretty sure windows drivers didn't yet get to it.
This was out for a very short time.
> --
>
> Sasha.
>
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 15:19 ` Michael S. Tsirkin
@ 2011-11-13 14:07 ` Ronen Hod
0 siblings, 0 replies; 134+ messages in thread
From: Ronen Hod @ 2011-11-13 14:07 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, Sasha Levin, Amit Shah, Avi Kivity
On 11/09/2011 05:19 PM, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 02:48:58PM +0200, Sasha Levin wrote:
>> On Wed, 2011-11-09 at 14:38 +0200, Avi Kivity wrote:
>>> On 11/09/2011 10:46 AM, Sasha Levin wrote:
>>>>> Alternatively we can add new structures with new
>>>>> structure IDs, pointed to from PCI configuration space.
>>>>>
>>>>> As we don't yet have devices or drivers with 64 bit features,
>>>>> I decided we don't need high feature bits in legacy space.
>>>>> This also frees up feature bit 31 as we don't need it
>>>>> to enable high feature bits anymore.
>>>> KVM tool actually has support for 64bit features, we can probably remove
>>>> that when Pekka isn't looking :)
>>>>
>>> What about the Windows drivers?
>> While 64-bit features were defined, there was no actual devices to use
>> them.
>>
>> So even if Windows drivers had the ability to support 64-bit features,
>> no device ever needed it therefore no device ever activated it.
>>
>> A potential issue might arise when we remap feature bit 31 to do
>> something else, and when activated it would fool Windows drivers to
>> think that 64-bit features are now activated, while they're not - but
>> thats not something that should happen since legacy layout shouldn't
>> have that field enabled as per the spec (no new features in legacy
>> code).
>>
>> I was unable to check if it was actually implemented in the drivers
>> because
>> http://git.kernel.org/?p=virt/kvm/kvm-guest-drivers-windows.git;a=summary is not quite there (*cough*).
https://github.com/YanVugenfirer/kvm-guest-drivers-windows
> I'm pretty sure windows drivers didn't yet get to it.
> This was out for a very short time.
>
>> --
>>
>> Sasha.
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-13 14:07 ` Ronen Hod
0 siblings, 0 replies; 134+ messages in thread
From: Ronen Hod @ 2011-11-13 14:07 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Sasha Levin, Avi Kivity, Rusty Russell,
lkml - Kernel Mailing List, Alexey Kardashevskiy, Amit Shah,
Christian Borntraeger, Krishna Kumar, Pawel Moll, Wang Sheng-Hui,
virtualization, kvm
On 11/09/2011 05:19 PM, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 02:48:58PM +0200, Sasha Levin wrote:
>> On Wed, 2011-11-09 at 14:38 +0200, Avi Kivity wrote:
>>> On 11/09/2011 10:46 AM, Sasha Levin wrote:
>>>>> Alternatively we can add new structures with new
>>>>> structure IDs, pointed to from PCI configuration space.
>>>>>
>>>>> As we don't yet have devices or drivers with 64 bit features,
>>>>> I decided we don't need high feature bits in legacy space.
>>>>> This also frees up feature bit 31 as we don't need it
>>>>> to enable high feature bits anymore.
>>>> KVM tool actually has support for 64bit features, we can probably remove
>>>> that when Pekka isn't looking :)
>>>>
>>> What about the Windows drivers?
>> While 64-bit features were defined, there was no actual devices to use
>> them.
>>
>> So even if Windows drivers had the ability to support 64-bit features,
>> no device ever needed it therefore no device ever activated it.
>>
>> A potential issue might arise when we remap feature bit 31 to do
>> something else, and when activated it would fool Windows drivers to
>> think that 64-bit features are now activated, while they're not - but
>> thats not something that should happen since legacy layout shouldn't
>> have that field enabled as per the spec (no new features in legacy
>> code).
>>
>> I was unable to check if it was actually implemented in the drivers
>> because
>> http://git.kernel.org/?p=virt/kvm/kvm-guest-drivers-windows.git;a=summary is not quite there (*cough*).
https://github.com/YanVugenfirer/kvm-guest-drivers-windows
> I'm pretty sure windows drivers didn't yet get to it.
> This was out for a very short time.
>
>> --
>>
>> Sasha.
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 12:48 ` Sasha Levin
` (2 preceding siblings ...)
(?)
@ 2011-11-09 15:51 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 15:51 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, Avi Kivity, Amit Shah
On Wed, Nov 09, 2011 at 02:48:58PM +0200, Sasha Levin wrote:
> I was unable to check if it was actually implemented in the drivers
> because
> http://git.kernel.org/?p=virt/kvm/kvm-guest-drivers-windows.git;a=summary is not quite there (*cough*).
I found a mirror:
http://mirror.nexcess.net/kernel.org/scm/virt/kvm/kvm-guest-drivers-windows.git/
don't know how fresh it is.
> --
>
> Sasha.
>
^ permalink raw reply [flat|nested] 134+ messages in thread* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 12:48 ` Sasha Levin
` (3 preceding siblings ...)
(?)
@ 2011-11-09 15:51 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 15:51 UTC (permalink / raw)
To: Sasha Levin
Cc: Avi Kivity, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm
On Wed, Nov 09, 2011 at 02:48:58PM +0200, Sasha Levin wrote:
> I was unable to check if it was actually implemented in the drivers
> because
> http://git.kernel.org/?p=virt/kvm/kvm-guest-drivers-windows.git;a=summary is not quite there (*cough*).
I found a mirror:
http://mirror.nexcess.net/kernel.org/scm/virt/kvm/kvm-guest-drivers-windows.git/
don't know how fresh it is.
> --
>
> Sasha.
>
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 12:38 ` Avi Kivity
@ 2011-11-13 20:40 ` Vadim Rozenfeld
-1 siblings, 0 replies; 134+ messages in thread
From: Vadim Rozenfeld @ 2011-11-13 20:40 UTC (permalink / raw)
To: Avi Kivity
Cc: Krishna Kumar, kvm, Pawel Moll, Michael S. Tsirkin,
Alexey Kardashevskiy, Wang Sheng-Hui, lkml - Kernel Mailing List,
virtualization, Christian Borntraeger, Sasha Levin, Amit Shah
On Wed, 2011-11-09 at 14:38 +0200, Avi Kivity wrote:
> On 11/09/2011 10:46 AM, Sasha Levin wrote:
> > > Alternatively we can add new structures with new
> > > structure IDs, pointed to from PCI configuration space.
> > >
> > > As we don't yet have devices or drivers with 64 bit features,
> > > I decided we don't need high feature bits in legacy space.
> > > This also frees up feature bit 31 as we don't need it
> > > to enable high feature bits anymore.
> >
> > KVM tool actually has support for 64bit features, we can probably remove
> > that when Pekka isn't looking :)
> >
>
> What about the Windows drivers?
>
Probably some small adjustments will be required,
but I don't see any major problem here.
Vadim.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-13 20:40 ` Vadim Rozenfeld
0 siblings, 0 replies; 134+ messages in thread
From: Vadim Rozenfeld @ 2011-11-13 20:40 UTC (permalink / raw)
To: Avi Kivity
Cc: Sasha Levin, Krishna Kumar, Wang Sheng-Hui, kvm, Pawel Moll,
Michael S. Tsirkin, Alexey Kardashevskiy,
lkml - Kernel Mailing List, virtualization, Christian Borntraeger,
Amit Shah
On Wed, 2011-11-09 at 14:38 +0200, Avi Kivity wrote:
> On 11/09/2011 10:46 AM, Sasha Levin wrote:
> > > Alternatively we can add new structures with new
> > > structure IDs, pointed to from PCI configuration space.
> > >
> > > As we don't yet have devices or drivers with 64 bit features,
> > > I decided we don't need high feature bits in legacy space.
> > > This also frees up feature bit 31 as we don't need it
> > > to enable high feature bits anymore.
> >
> > KVM tool actually has support for 64bit features, we can probably remove
> > that when Pekka isn't looking :)
> >
>
> What about the Windows drivers?
>
Probably some small adjustments will be required,
but I don't see any major problem here.
Vadim.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-08 21:40 ` Michael S. Tsirkin
` (2 preceding siblings ...)
(?)
@ 2011-11-09 8:46 ` Sasha Levin
-1 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 8:46 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, avi, Amit Shah
On Tue, 2011-11-08 at 23:40 +0200, Michael S. Tsirkin wrote:
> Here's a spec change documenting what my C patch does
> (almost - I tweaked the layout a bit, but the idea is the same).
> Some more cleanups are needed but I thought I'd send it
> for early flames/comments.
>
> The idea is simple: we split functionally unrelated
> register groups to independent structures, and let
> the device place is anywhere using a capability
> in PCI configuration space.
>
> It can then go into MMIO space which is cheaper than PIO.
>
> A legacy portion of the configuration is mirrored
> in the first BAR, to keep legacy drivers working.
> Any new fields can be added in existing structures
> at the end, so they won't affect legacy.
If newer specs add more structures at the end of the config space, and
use the same config space for legacy, that space now becomes device
specific config space and not new-shiny-feature space, so we must
remember to handle those cases.
> Alternatively we can add new structures with new
> structure IDs, pointed to from PCI configuration space.
>
> As we don't yet have devices or drivers with 64 bit features,
> I decided we don't need high feature bits in legacy space.
> This also frees up feature bit 31 as we don't need it
> to enable high feature bits anymore.
KVM tool actually has support for 64bit features, we can probably remove
that when Pekka isn't looking :)
>
> As this solves the dynamic placement of MSIX vectors
> and high feature bits,
> I thought it's easier to just reserve space for that
> programming than give it a separate structure. This
> can be changed by a patch on top.
>
> Note that data path is split from configuration.
>
> PDF will follow.
> ----
>
The device initialization sequence might use an update as well. Maybe
also a description of how device handles missing structure IDs.
[snip]
> +
> +\begin_layout Standard
> +
> +\change_inserted 1986246365 1320781133
> +These registers are specified using vendor-specific PCI capability located
> + on capability list in PCI configuration space of the device.
> + This virtio structure capability uses little-endian format; all bits are
> + read-only:
> +\end_layout
> +
> +\begin_layout Standard
> +
> +\change_inserted 1986246365 1320772579
> +\begin_inset Tabular
Just a note, these tables are way too wide to work properly in PDFs :)
> +<lyxtabular version="3" rows="4" columns="34">
> +<features tabularvalignment="middle">
> +<column alignment="center" valignment="top" width="0pt">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0">
> +<column alignment="center" valignment="top" width="0pt">
> +<row>
[snip]
> +
> +\begin_layout Standard
> +
> +\change_inserted 1986246365 1320779667
> +Purpose:
> +\end_layout
> +
> +\begin_layout Standard
> +
> +\change_inserted 1986246365 1320780912
> +
> +\emph on
> +Capability ID
> +\emph default
> +,
> +\emph on
> +Next Capability Pointer
> +\emph default
> +,
> +\emph on
> +Capability Length
> +\emph default
> + - these fields are specified by PCI local bus specification, Rev 3.0
I'm not sure what capability length is, can't find it in the spec
either.
[snip]
> +\begin_layout Plain Layout
> +ie.
> + once you enable MSI-X on the device, the other fields move.
> + If you turn it off again, they move back!
Is it still true? We're talking about the new layout here (there are
several of this footnote, this one is located right *before* the section
which talks about legacy config space.
[snip]
> +
> +\change_deleted 1986246365 1320784929
> +If more than 31 feature bits are supported, the device indicates so by setting
> + feature bit 31 (see
The bit numbers below this text should be corrected as well.
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-08 21:40 ` Michael S. Tsirkin
` (3 preceding siblings ...)
(?)
@ 2011-11-09 9:55 ` Sasha Levin
2011-11-09 10:18 ` Michael S. Tsirkin
-1 siblings, 1 reply; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 9:55 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi
On Tue, 2011-11-08 at 23:40 +0200, Michael S. Tsirkin wrote:
> Here's a spec change documenting what my C patch does
> (almost - I tweaked the layout a bit, but the idea is the same).
> Some more cleanups are needed but I thought I'd send it
> for early flames/comments.
>
> The idea is simple: we split functionally unrelated
> register groups to independent structures, and let
> the device place is anywhere using a capability
> in PCI configuration space.
I'm also wondering it it's ok to move virtio configuration out of virtio
space and into PCI space for archs that don't have PCI (such as ARM).
Would it mean they get stuck with legacy configuration (and no new
features)? Or is there an alternative for them?
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 9:55 ` Sasha Levin
@ 2011-11-09 10:18 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 10:18 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, avi, Amit Shah
On Wed, Nov 09, 2011 at 11:55:02AM +0200, Sasha Levin wrote:
> On Tue, 2011-11-08 at 23:40 +0200, Michael S. Tsirkin wrote:
> > Here's a spec change documenting what my C patch does
> > (almost - I tweaked the layout a bit, but the idea is the same).
> > Some more cleanups are needed but I thought I'd send it
> > for early flames/comments.
> >
> > The idea is simple: we split functionally unrelated
> > register groups to independent structures, and let
> > the device place is anywhere using a capability
> > in PCI configuration space.
>
> I'm also wondering it it's ok to move virtio configuration out of virtio
> space and into PCI space for archs that don't have PCI (such as ARM).
A bit of confusion here: no register is moved from memory into
configuration space. Configuration space only gains a list of
pointers into memory/pio space.
> Would it mean they get stuck with legacy configuration (and no new
> features)? Or is there an alternative for them?
The change only affects the layout of virtio PCI. Arches that don't
have PCI don't use virtio PCI, presumably?
BTW, the spec only covers x86 ATM, this needs to be fixed.
>
> --
>
> Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 10:18 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 10:18 UTC (permalink / raw)
To: Sasha Levin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi
On Wed, Nov 09, 2011 at 11:55:02AM +0200, Sasha Levin wrote:
> On Tue, 2011-11-08 at 23:40 +0200, Michael S. Tsirkin wrote:
> > Here's a spec change documenting what my C patch does
> > (almost - I tweaked the layout a bit, but the idea is the same).
> > Some more cleanups are needed but I thought I'd send it
> > for early flames/comments.
> >
> > The idea is simple: we split functionally unrelated
> > register groups to independent structures, and let
> > the device place is anywhere using a capability
> > in PCI configuration space.
>
> I'm also wondering it it's ok to move virtio configuration out of virtio
> space and into PCI space for archs that don't have PCI (such as ARM).
A bit of confusion here: no register is moved from memory into
configuration space. Configuration space only gains a list of
pointers into memory/pio space.
> Would it mean they get stuck with legacy configuration (and no new
> features)? Or is there an alternative for them?
The change only affects the layout of virtio PCI. Arches that don't
have PCI don't use virtio PCI, presumably?
BTW, the spec only covers x86 ATM, this needs to be fixed.
>
> --
>
> Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 10:18 ` Michael S. Tsirkin
(?)
@ 2011-11-09 10:20 ` Sasha Levin
-1 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 10:20 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, avi, Amit Shah
On Wed, 2011-11-09 at 12:18 +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 11:55:02AM +0200, Sasha Levin wrote:
> > On Tue, 2011-11-08 at 23:40 +0200, Michael S. Tsirkin wrote:
> > > Here's a spec change documenting what my C patch does
> > > (almost - I tweaked the layout a bit, but the idea is the same).
> > > Some more cleanups are needed but I thought I'd send it
> > > for early flames/comments.
> > >
> > > The idea is simple: we split functionally unrelated
> > > register groups to independent structures, and let
> > > the device place is anywhere using a capability
> > > in PCI configuration space.
> >
> > I'm also wondering it it's ok to move virtio configuration out of virtio
> > space and into PCI space for archs that don't have PCI (such as ARM).
>
> A bit of confusion here: no register is moved from memory into
> configuration space. Configuration space only gains a list of
> pointers into memory/pio space.
The definition of the way the virtio configuration space looks is moved
into PCI configuration space, it was constant before.
> > Would it mean they get stuck with legacy configuration (and no new
> > features)? Or is there an alternative for them?
>
> The change only affects the layout of virtio PCI. Arches that don't
> have PCI don't use virtio PCI, presumably?
>
> BTW, the spec only covers x86 ATM, this needs to be fixed.
From what I see there is a WIP by Pawel Moll <pawel.moll@arm.com> to add
virtio platform drivers which get virtio working on ARM for example, and
by Peter Maydell <peter.maydell@linaro.org> to modify the spec to
support MMIO access (besides PCI).
Maybe worth seeing if it works for them...
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 10:20 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 10:20 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, avi, Amit Shah
On Wed, 2011-11-09 at 12:18 +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 11:55:02AM +0200, Sasha Levin wrote:
> > On Tue, 2011-11-08 at 23:40 +0200, Michael S. Tsirkin wrote:
> > > Here's a spec change documenting what my C patch does
> > > (almost - I tweaked the layout a bit, but the idea is the same).
> > > Some more cleanups are needed but I thought I'd send it
> > > for early flames/comments.
> > >
> > > The idea is simple: we split functionally unrelated
> > > register groups to independent structures, and let
> > > the device place is anywhere using a capability
> > > in PCI configuration space.
> >
> > I'm also wondering it it's ok to move virtio configuration out of virtio
> > space and into PCI space for archs that don't have PCI (such as ARM).
>
> A bit of confusion here: no register is moved from memory into
> configuration space. Configuration space only gains a list of
> pointers into memory/pio space.
The definition of the way the virtio configuration space looks is moved
into PCI configuration space, it was constant before.
> > Would it mean they get stuck with legacy configuration (and no new
> > features)? Or is there an alternative for them?
>
> The change only affects the layout of virtio PCI. Arches that don't
> have PCI don't use virtio PCI, presumably?
>
> BTW, the spec only covers x86 ATM, this needs to be fixed.
>From what I see there is a WIP by Pawel Moll <pawel.moll@arm.com> to add
virtio platform drivers which get virtio working on ARM for example, and
by Peter Maydell <peter.maydell@linaro.org> to modify the spec to
support MMIO access (besides PCI).
Maybe worth seeing if it works for them...
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 10:20 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 10:20 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi
On Wed, 2011-11-09 at 12:18 +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 11:55:02AM +0200, Sasha Levin wrote:
> > On Tue, 2011-11-08 at 23:40 +0200, Michael S. Tsirkin wrote:
> > > Here's a spec change documenting what my C patch does
> > > (almost - I tweaked the layout a bit, but the idea is the same).
> > > Some more cleanups are needed but I thought I'd send it
> > > for early flames/comments.
> > >
> > > The idea is simple: we split functionally unrelated
> > > register groups to independent structures, and let
> > > the device place is anywhere using a capability
> > > in PCI configuration space.
> >
> > I'm also wondering it it's ok to move virtio configuration out of virtio
> > space and into PCI space for archs that don't have PCI (such as ARM).
>
> A bit of confusion here: no register is moved from memory into
> configuration space. Configuration space only gains a list of
> pointers into memory/pio space.
The definition of the way the virtio configuration space looks is moved
into PCI configuration space, it was constant before.
> > Would it mean they get stuck with legacy configuration (and no new
> > features)? Or is there an alternative for them?
>
> The change only affects the layout of virtio PCI. Arches that don't
> have PCI don't use virtio PCI, presumably?
>
> BTW, the spec only covers x86 ATM, this needs to be fixed.
>From what I see there is a WIP by Pawel Moll <pawel.moll@arm.com> to add
virtio platform drivers which get virtio working on ARM for example, and
by Peter Maydell <peter.maydell@linaro.org> to modify the spec to
support MMIO access (besides PCI).
Maybe worth seeing if it works for them...
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 10:20 ` Sasha Levin
(?)
(?)
@ 2011-11-09 10:47 ` Pawel Moll
2011-11-09 10:55 ` Sasha Levin
-1 siblings, 1 reply; 134+ messages in thread
From: Pawel Moll @ 2011-11-09 10:47 UTC (permalink / raw)
To: Sasha Levin
Cc: Michael S. Tsirkin, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Wang Sheng-Hui,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
avi@redhat.com
On Wed, 2011-11-09 at 10:20 +0000, Sasha Levin wrote:
> > > I'm also wondering it it's ok to move virtio configuration out of virtio
> > > space and into PCI space for archs that don't have PCI (such as ARM).
Just a note - ARM-based chips can by all means have PCI (grep -r PCI
arch/arm/ ;-). The fact is that most of the SOCs available on the market
don't have it, but this is slowly changing.
The main architectural difference is that ARM doesn't provide separate
I/O space so the PCI I/O space is usually remapped somewhere into normal
address space (grep -r "#define __io_address" arch/arm/)
> > > Would it mean they get stuck with legacy configuration (and no new
> > > features)? Or is there an alternative for them?
> >
> > The change only affects the layout of virtio PCI. Arches that don't
> > have PCI don't use virtio PCI, presumably?
> >
> > BTW, the spec only covers x86 ATM, this needs to be fixed.
>
> From what I see there is a WIP by Pawel Moll <pawel.moll@arm.com> to add
> virtio platform drivers which get virtio working on ARM for example, and
> by Peter Maydell <peter.maydell@linaro.org> to modify the spec to
> support MMIO access (besides PCI).
Yep, it's actually already in 3.2-rc1 (drivers/virtio/virtio_mmio.c) and
in the spec (see Appendix X). And actually the control registers layout
I used was originally based on the PCI "legacy" headers (slightly
simplified), but evolved a bit since. My understanding is that the
changes Michael is proposing affect the PCI device interface only so
they shouldn't affect "my" interface.
By the way, I vaguely remember Peter mentioning that he got the PCI
device "experimentally" running some time ago on one of the PCI-enabled
ARM platform models (realview or versatile)...
Cheers!
Pawel
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 10:47 ` Pawel Moll
@ 2011-11-09 10:55 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 10:55 UTC (permalink / raw)
To: Pawel Moll
Cc: Krishna Kumar, Wang Sheng-Hui, kvm@vger.kernel.org,
Michael S. Tsirkin, Alexey Kardashevskiy,
lkml - Kernel Mailing List,
virtualization@lists.linux-foundation.org, Christian Borntraeger,
avi@redhat.com, Amit Shah
On Wed, 2011-11-09 at 10:47 +0000, Pawel Moll wrote:
> On Wed, 2011-11-09 at 10:20 +0000, Sasha Levin wrote:
> > > > I'm also wondering it it's ok to move virtio configuration out of virtio
> > > > space and into PCI space for archs that don't have PCI (such as ARM).
>
> Just a note - ARM-based chips can by all means have PCI (grep -r PCI
> arch/arm/ ;-). The fact is that most of the SOCs available on the market
> don't have it, but this is slowly changing.
>
> The main architectural difference is that ARM doesn't provide separate
> I/O space so the PCI I/O space is usually remapped somewhere into normal
> address space (grep -r "#define __io_address" arch/arm/)
>
> > > > Would it mean they get stuck with legacy configuration (and no new
> > > > features)? Or is there an alternative for them?
> > >
> > > The change only affects the layout of virtio PCI. Arches that don't
> > > have PCI don't use virtio PCI, presumably?
> > >
> > > BTW, the spec only covers x86 ATM, this needs to be fixed.
> >
> > From what I see there is a WIP by Pawel Moll <pawel.moll@arm.com> to add
> > virtio platform drivers which get virtio working on ARM for example, and
> > by Peter Maydell <peter.maydell@linaro.org> to modify the spec to
> > support MMIO access (besides PCI).
>
> Yep, it's actually already in 3.2-rc1 (drivers/virtio/virtio_mmio.c) and
> in the spec (see Appendix X). And actually the control registers layout
> I used was originally based on the PCI "legacy" headers (slightly
> simplified), but evolved a bit since. My understanding is that the
> changes Michael is proposing affect the PCI device interface only so
> they shouldn't affect "my" interface.
I didn't know it's in already, might be interesting adding support to it
to x86 userspace tools.
I thought you used the 'legacy' layout, which is why I was worried that
these changed might cause problems for you - but from what I see you
have a different layout there, so as you said, it shouldn't cause any
issues there.
>
> By the way, I vaguely remember Peter mentioning that he got the PCI
> device "experimentally" running some time ago on one of the PCI-enabled
> ARM platform models (realview or versatile)...
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 10:55 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 10:55 UTC (permalink / raw)
To: Pawel Moll
Cc: Michael S. Tsirkin, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Wang Sheng-Hui,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
avi@redhat.com
On Wed, 2011-11-09 at 10:47 +0000, Pawel Moll wrote:
> On Wed, 2011-11-09 at 10:20 +0000, Sasha Levin wrote:
> > > > I'm also wondering it it's ok to move virtio configuration out of virtio
> > > > space and into PCI space for archs that don't have PCI (such as ARM).
>
> Just a note - ARM-based chips can by all means have PCI (grep -r PCI
> arch/arm/ ;-). The fact is that most of the SOCs available on the market
> don't have it, but this is slowly changing.
>
> The main architectural difference is that ARM doesn't provide separate
> I/O space so the PCI I/O space is usually remapped somewhere into normal
> address space (grep -r "#define __io_address" arch/arm/)
>
> > > > Would it mean they get stuck with legacy configuration (and no new
> > > > features)? Or is there an alternative for them?
> > >
> > > The change only affects the layout of virtio PCI. Arches that don't
> > > have PCI don't use virtio PCI, presumably?
> > >
> > > BTW, the spec only covers x86 ATM, this needs to be fixed.
> >
> > From what I see there is a WIP by Pawel Moll <pawel.moll@arm.com> to add
> > virtio platform drivers which get virtio working on ARM for example, and
> > by Peter Maydell <peter.maydell@linaro.org> to modify the spec to
> > support MMIO access (besides PCI).
>
> Yep, it's actually already in 3.2-rc1 (drivers/virtio/virtio_mmio.c) and
> in the spec (see Appendix X). And actually the control registers layout
> I used was originally based on the PCI "legacy" headers (slightly
> simplified), but evolved a bit since. My understanding is that the
> changes Michael is proposing affect the PCI device interface only so
> they shouldn't affect "my" interface.
I didn't know it's in already, might be interesting adding support to it
to x86 userspace tools.
I thought you used the 'legacy' layout, which is why I was worried that
these changed might cause problems for you - but from what I see you
have a different layout there, so as you said, it shouldn't cause any
issues there.
>
> By the way, I vaguely remember Peter mentioning that he got the PCI
> device "experimentally" running some time ago on one of the PCI-enabled
> ARM platform models (realview or versatile)...
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 10:55 ` Sasha Levin
(?)
@ 2011-11-09 11:06 ` Pawel Moll
-1 siblings, 0 replies; 134+ messages in thread
From: Pawel Moll @ 2011-11-09 11:06 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, Peter Maydell, Wang Sheng-Hui, kvm@vger.kernel.org,
Michael S. Tsirkin, Alexey Kardashevskiy,
lkml - Kernel Mailing List,
virtualization@lists.linux-foundation.org, Christian Borntraeger,
avi@redhat.com, Amit Shah
On Wed, 2011-11-09 at 10:55 +0000, Sasha Levin wrote:
> On Wed, 2011-11-09 at 10:47 +0000, Pawel Moll wrote:
> > Yep, it's actually already in 3.2-rc1 (drivers/virtio/virtio_mmio.c) and
> > in the spec (see Appendix X). And actually the control registers layout
> > I used was originally based on the PCI "legacy" headers (slightly
> > simplified), but evolved a bit since. My understanding is that the
> > changes Michael is proposing affect the PCI device interface only so
> > they shouldn't affect "my" interface.
>
> I didn't know it's in already, might be interesting adding support to it
> to x86 userspace tools.
Do you mean the qemu or the (non-qemu) KVM tools I know nothing
about? ;-)
If qemu, Peter got it already running with virtio_mmio on ARM models
(not upstream yet as far as I know), but I presume the code would we
mostly non-ARM specific.
Cheers!
Pawel
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 10:55 ` Sasha Levin
(?)
(?)
@ 2011-11-09 11:06 ` Pawel Moll
2011-11-09 11:39 ` Peter Maydell
` (2 more replies)
-1 siblings, 3 replies; 134+ messages in thread
From: Pawel Moll @ 2011-11-09 11:06 UTC (permalink / raw)
To: Sasha Levin
Cc: Michael S. Tsirkin, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Wang Sheng-Hui,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
avi@redhat.com, Peter Maydell
On Wed, 2011-11-09 at 10:55 +0000, Sasha Levin wrote:
> On Wed, 2011-11-09 at 10:47 +0000, Pawel Moll wrote:
> > Yep, it's actually already in 3.2-rc1 (drivers/virtio/virtio_mmio.c) and
> > in the spec (see Appendix X). And actually the control registers layout
> > I used was originally based on the PCI "legacy" headers (slightly
> > simplified), but evolved a bit since. My understanding is that the
> > changes Michael is proposing affect the PCI device interface only so
> > they shouldn't affect "my" interface.
>
> I didn't know it's in already, might be interesting adding support to it
> to x86 userspace tools.
Do you mean the qemu or the (non-qemu) KVM tools I know nothing
about? ;-)
If qemu, Peter got it already running with virtio_mmio on ARM models
(not upstream yet as far as I know), but I presume the code would we
mostly non-ARM specific.
Cheers!
Pawel
^ permalink raw reply [flat|nested] 134+ messages in thread* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 11:06 ` Pawel Moll
@ 2011-11-09 11:39 ` Peter Maydell
2011-11-09 11:39 ` Peter Maydell
2011-11-09 12:07 ` Sasha Levin
2 siblings, 0 replies; 134+ messages in thread
From: Peter Maydell @ 2011-11-09 11:39 UTC (permalink / raw)
To: Pawel Moll
Cc: Krishna Kumar, Wang Sheng-Hui, kvm@vger.kernel.org,
Michael S. Tsirkin, Alexey Kardashevskiy,
lkml - Kernel Mailing List,
virtualization@lists.linux-foundation.org, Christian Borntraeger,
Sasha Levin, Amit Shah, avi@redhat.com
On 9 November 2011 11:06, Pawel Moll <pawel.moll@arm.com> wrote:
> On Wed, 2011-11-09 at 10:55 +0000, Sasha Levin wrote:
>> On Wed, 2011-11-09 at 10:47 +0000, Pawel Moll wrote:
>> > Yep, it's actually already in 3.2-rc1 (drivers/virtio/virtio_mmio.c) and
>> > in the spec (see Appendix X). And actually the control registers layout
>> > I used was originally based on the PCI "legacy" headers (slightly
>> > simplified), but evolved a bit since. My understanding is that the
>> > changes Michael is proposing affect the PCI device interface only so
>> > they shouldn't affect "my" interface.
>>
>> I didn't know it's in already, might be interesting adding support to it
>> to x86 userspace tools.
>
> Do you mean the qemu or the (non-qemu) KVM tools I know nothing
> about? ;-)
>
> If qemu, Peter got it already running with virtio_mmio on ARM models
> (not upstream yet as far as I know), but I presume the code would we
> mostly non-ARM specific.
The QEMU code is completely non-ARM-specific (apart from the line
in the relevant ARM board models where we instantiate the devices).
I haven't submitted it upstream yet though because really the
virtio transport layer in QEMU needs to be refactored as a qdev
bus first.
-- PMM
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 11:06 ` Pawel Moll
2011-11-09 11:39 ` Peter Maydell
@ 2011-11-09 11:39 ` Peter Maydell
2011-11-09 12:07 ` Sasha Levin
2 siblings, 0 replies; 134+ messages in thread
From: Peter Maydell @ 2011-11-09 11:39 UTC (permalink / raw)
To: Pawel Moll
Cc: Sasha Levin, Michael S. Tsirkin, Rusty Russell,
lkml - Kernel Mailing List, Alexey Kardashevskiy, Amit Shah,
Christian Borntraeger, Krishna Kumar, Wang Sheng-Hui,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
avi@redhat.com
On 9 November 2011 11:06, Pawel Moll <pawel.moll@arm.com> wrote:
> On Wed, 2011-11-09 at 10:55 +0000, Sasha Levin wrote:
>> On Wed, 2011-11-09 at 10:47 +0000, Pawel Moll wrote:
>> > Yep, it's actually already in 3.2-rc1 (drivers/virtio/virtio_mmio.c) and
>> > in the spec (see Appendix X). And actually the control registers layout
>> > I used was originally based on the PCI "legacy" headers (slightly
>> > simplified), but evolved a bit since. My understanding is that the
>> > changes Michael is proposing affect the PCI device interface only so
>> > they shouldn't affect "my" interface.
>>
>> I didn't know it's in already, might be interesting adding support to it
>> to x86 userspace tools.
>
> Do you mean the qemu or the (non-qemu) KVM tools I know nothing
> about? ;-)
>
> If qemu, Peter got it already running with virtio_mmio on ARM models
> (not upstream yet as far as I know), but I presume the code would we
> mostly non-ARM specific.
The QEMU code is completely non-ARM-specific (apart from the line
in the relevant ARM board models where we instantiate the devices).
I haven't submitted it upstream yet though because really the
virtio transport layer in QEMU needs to be refactored as a qdev
bus first.
-- PMM
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 11:06 ` Pawel Moll
@ 2011-11-09 12:07 ` Sasha Levin
2011-11-09 11:39 ` Peter Maydell
2011-11-09 12:07 ` Sasha Levin
2 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 12:07 UTC (permalink / raw)
To: Pawel Moll
Cc: Krishna Kumar, Peter Maydell, Wang Sheng-Hui, kvm@vger.kernel.org,
Michael S. Tsirkin, Alexey Kardashevskiy,
lkml - Kernel Mailing List,
virtualization@lists.linux-foundation.org, Christian Borntraeger,
avi@redhat.com, Amit Shah
On Wed, 2011-11-09 at 11:06 +0000, Pawel Moll wrote:
> On Wed, 2011-11-09 at 10:55 +0000, Sasha Levin wrote:
> > On Wed, 2011-11-09 at 10:47 +0000, Pawel Moll wrote:
> > > Yep, it's actually already in 3.2-rc1 (drivers/virtio/virtio_mmio.c) and
> > > in the spec (see Appendix X). And actually the control registers layout
> > > I used was originally based on the PCI "legacy" headers (slightly
> > > simplified), but evolved a bit since. My understanding is that the
> > > changes Michael is proposing affect the PCI device interface only so
> > > they shouldn't affect "my" interface.
> >
> > I didn't know it's in already, might be interesting adding support to it
> > to x86 userspace tools.
>
> Do you mean the qemu or the (non-qemu) KVM tools I know nothing
> about? ;-)
I'll get you in the loop when we add virtio-mmio :)
>
> If qemu, Peter got it already running with virtio_mmio on ARM models
> (not upstream yet as far as I know), but I presume the code would we
> mostly non-ARM specific.
>
> Cheers!
>
> Pawel
>
>
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 12:07 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 12:07 UTC (permalink / raw)
To: Pawel Moll
Cc: Michael S. Tsirkin, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Wang Sheng-Hui,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
avi@redhat.com, Peter Maydell
On Wed, 2011-11-09 at 11:06 +0000, Pawel Moll wrote:
> On Wed, 2011-11-09 at 10:55 +0000, Sasha Levin wrote:
> > On Wed, 2011-11-09 at 10:47 +0000, Pawel Moll wrote:
> > > Yep, it's actually already in 3.2-rc1 (drivers/virtio/virtio_mmio.c) and
> > > in the spec (see Appendix X). And actually the control registers layout
> > > I used was originally based on the PCI "legacy" headers (slightly
> > > simplified), but evolved a bit since. My understanding is that the
> > > changes Michael is proposing affect the PCI device interface only so
> > > they shouldn't affect "my" interface.
> >
> > I didn't know it's in already, might be interesting adding support to it
> > to x86 userspace tools.
>
> Do you mean the qemu or the (non-qemu) KVM tools I know nothing
> about? ;-)
I'll get you in the loop when we add virtio-mmio :)
>
> If qemu, Peter got it already running with virtio_mmio on ARM models
> (not upstream yet as far as I know), but I presume the code would we
> mostly non-ARM specific.
>
> Cheers!
>
> Pawel
>
>
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-09 10:20 ` Sasha Levin
` (2 preceding siblings ...)
(?)
@ 2011-11-09 10:47 ` Pawel Moll
-1 siblings, 0 replies; 134+ messages in thread
From: Pawel Moll @ 2011-11-09 10:47 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, Wang Sheng-Hui, kvm@vger.kernel.org,
Michael S. Tsirkin, Alexey Kardashevskiy,
lkml - Kernel Mailing List,
virtualization@lists.linux-foundation.org, Christian Borntraeger,
avi@redhat.com, Amit Shah
On Wed, 2011-11-09 at 10:20 +0000, Sasha Levin wrote:
> > > I'm also wondering it it's ok to move virtio configuration out of virtio
> > > space and into PCI space for archs that don't have PCI (such as ARM).
Just a note - ARM-based chips can by all means have PCI (grep -r PCI
arch/arm/ ;-). The fact is that most of the SOCs available on the market
don't have it, but this is slowly changing.
The main architectural difference is that ARM doesn't provide separate
I/O space so the PCI I/O space is usually remapped somewhere into normal
address space (grep -r "#define __io_address" arch/arm/)
> > > Would it mean they get stuck with legacy configuration (and no new
> > > features)? Or is there an alternative for them?
> >
> > The change only affects the layout of virtio PCI. Arches that don't
> > have PCI don't use virtio PCI, presumably?
> >
> > BTW, the spec only covers x86 ATM, this needs to be fixed.
>
> From what I see there is a WIP by Pawel Moll <pawel.moll@arm.com> to add
> virtio platform drivers which get virtio working on ARM for example, and
> by Peter Maydell <peter.maydell@linaro.org> to modify the spec to
> support MMIO access (besides PCI).
Yep, it's actually already in 3.2-rc1 (drivers/virtio/virtio_mmio.c) and
in the spec (see Appendix X). And actually the control registers layout
I used was originally based on the PCI "legacy" headers (slightly
simplified), but evolved a bit since. My understanding is that the
changes Michael is proposing affect the PCI device interface only so
they shouldn't affect "my" interface.
By the way, I vaguely remember Peter mentioning that he got the PCI
device "experimentally" running some time ago on one of the PCI-enabled
ARM platform models (realview or versatile)...
Cheers!
Pawel
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH RFC] virtio-spec: flexible configuration layout
2011-11-08 21:40 ` Michael S. Tsirkin
` (4 preceding siblings ...)
(?)
@ 2011-11-09 9:55 ` Sasha Levin
-1 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 9:55 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
Christian Borntraeger, avi, Amit Shah
On Tue, 2011-11-08 at 23:40 +0200, Michael S. Tsirkin wrote:
> Here's a spec change documenting what my C patch does
> (almost - I tweaked the layout a bit, but the idea is the same).
> Some more cleanups are needed but I thought I'd send it
> for early flames/comments.
>
> The idea is simple: we split functionally unrelated
> register groups to independent structures, and let
> the device place is anywhere using a capability
> in PCI configuration space.
I'm also wondering it it's ok to move virtio configuration out of virtio
space and into PCI space for archs that don't have PCI (such as ARM).
Would it mean they get stuck with legacy configuration (and no new
features)? Or is there an alternative for them?
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread* [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-08 21:40 ` Michael S. Tsirkin
@ 2011-11-09 19:59 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 19:59 UTC (permalink / raw)
To: Rusty Russell
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, Sasha Levin, Amit Shah, avi
Here's an updated spec patch. Changes from v1:
- add an example configuration
- scale tables so they fit within page
- clean up some remaining items mentioning feature bit 31
Description from v1:
Here's a spec change documenting what my C patch does
(almost - I tweaked the layout a bit, but the idea is the same).
Some more cleanups are needed but I thought I'd send it
for early flames/comments.
The idea is simple: we split functionally unrelated
register groups to independent structures, and let
the device place is anywhere using a capability
in PCI configuration space.
It can then go into MMIO space which is cheaper than PIO.
A legacy portion of the configuration is mirrored
in the first BAR, to keep legacy drivers working.
Any new fields can be added in existing structures
at the end, so they won't affect legacy.
Alternatively we can add new structures with new
structure IDs, pointed to from PCI configuration space.
As we don't yet have devices or drivers with 64 bit features,
I decided we don't need high feature bits in legacy space.
This also frees up feature bit 31 as we don't need it
to enable high feature bits anymore.
I don't think any released software actually uses it
(the kvm tool HEAD apparently does,
but I think it's not too late to fix it).
As this solves the dynamic placement of MSIX vectors
and high feature bits,
I thought it's easier to just reserve space for that
programming than give it a separate structure. This
can be changed by a patch on top.
Note that data path is split from configuration.
PDF will follow.
Please comment.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
diff --git a/virtio-spec.lyx b/virtio-spec.lyx
index 6426f8f..2ce2553 100644
--- a/virtio-spec.lyx
+++ b/virtio-spec.lyx
@@ -3,6 +3,9 @@
\begin_document
\begin_header
\textclass report
+\begin_preamble
+\usepackage{graphicx}
+\end_preamble
\use_default_options false
\maintain_unincluded_children false
\language english
@@ -56,6 +59,7 @@
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
+\author 1986246365 "Michael S. Tsirkin"
\end_header
\begin_body
@@ -570,7 +574,34 @@ Device Configuration
\end_layout
\begin_layout Standard
-To configure the device, we use the first I/O region of the PCI device.
+To configure the device, we
+\change_inserted 1986246365 1320783354
+use I/O and/or memory regions of the PCI device.
+ These contain the virtio header registers, the notification register, the
+ ISR status register and device specific registers, as specified by Virtio
+ Structure PCI Capabilities
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320787659
+For backwards compatibility, devices should present part of these configuration
+ registers in a legacy configuration structure in the first I/O region of
+ the PCI device
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+
+\change_deleted 1986246365 1320766512
+use the first I/O region of the PCI device.
This contains a
\emph on
virtio header
@@ -578,105 +609,3115 @@ virtio header
followed by a
\emph on
device-specific region.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+There may be different widths of accesses to the I/O region; the
+\begin_inset Quotes eld
+\end_inset
+
+natural
+\begin_inset Quotes erd
+\end_inset
+
+ access method for each field in the virtio header must be used (i.e.
+ 32-bit accesses for 32-bit fields, etc), but the device-specific region
+ can be accessed using any width accesses, and should obtain the same results.
+\end_layout
+
+\begin_layout Standard
+Note that this is possible because while the virtio header
+\change_inserted 1986246365 1320767249
+, notification and ISR status are
+\change_deleted 1986246365 1320767251
+ is
+\change_unchanged
+ PCI (i.e.
+ little) endian, the device-specific
+\change_deleted 1986246365 1320767335
+ region is
+\change_inserted 1986246365 1320767337
+registers are
+\change_unchanged
+ encoded in the native endian of the guest (where such distinction is applicable
+).
+\change_inserted 1986246365 1320767660
+
+\end_layout
+
+\begin_layout Subsection
+Device Initialization Sequence
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:Device-Initialization-Sequence"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+We start with an overview of device initialization, then expand on the details
+ of the device and how each step is preformed.
+\end_layout
+
+\begin_layout Enumerate
+Reset the device.
+ This is not required on initial start up.
+\end_layout
+
+\begin_layout Enumerate
+The ACKNOWLEDGE status bit is set: we have noticed the device.
+\end_layout
+
+\begin_layout Enumerate
+The DRIVER status bit is set: we know how to drive the device.
+\end_layout
+
+\begin_layout Enumerate
+
+\change_inserted 1986246365 1320838089
+PCI capability list scan, detecting virtio configuration layout using Virtio
+ Structure PCI capabilities.
+
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320838121
+Historically drivers skipped this step, using legacy configuration space
+ unconditionally.
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Device-specific setup, including reading the Device Feature Bits, discovery
+ of virtqueues for the device, optional MSI-X setup, and reading and possibly
+ writing the virtio configuration space.
+\end_layout
+
+\begin_layout Enumerate
+The subset of Device Feature Bits understood by the driver is written to
+ the device.
+\end_layout
+
+\begin_layout Enumerate
+The DRIVER_OK status bit is set.
+\end_layout
+
+\begin_layout Enumerate
+The device can now be used (ie.
+ buffers added to the virtqueues)
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+Historically, drivers have used the device before steps 5 and 6.
+ This is only allowed if the driver does not use any features which would
+ alter this early use of the device.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+If any of these steps go irrecoverably wrong, the guest should set the FAILED
+ status bit to indicate that it has given up on the device (it can reset
+ the device later to restart if desired).
+\end_layout
+
+\begin_layout Standard
+We now cover the fields required for general setup in detail.
+\change_inserted 1986246365 1320766663
+
+\end_layout
+
+\begin_layout Subsection
+
+\change_inserted 1986246365 1320781584
+Virtio Structure PCI Capability
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320781061
+Virtio configuration layout includes virtio configuration header, notification
+ and ISR status and device configuration structures.
+ Each structure is mapped by a Base Address register (BAR) belonging to
+ the function, located beginning at 10h in Configuration Space.
+
+\emph on
+Structure ID
+\emph default
+indentifies the structure
+\emph on
+, Size
+\emph default
+ indicates the structure size, in bytes, a
+\emph on
+BAR Indicator register (BIR)
+\emph default
+ indicates which BAR, and
+\emph on
+Offset
+\emph default
+ indicates where the structure begins relative to the base address associated
+ with the BAR.
+ The BAR is permitted to be either 32-bit or 64-bit, it can map Memory Space
+ or I/O Space.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320838522
+These registers are specified using vendor-specific PCI capability located
+ on capability list in PCI configuration space of the device.
+ This virtio structure capability uses little-endian format; all bits are
+ read-only:
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+resizebox{
+\backslash
+textwidth}{!}{%
+\end_layout
+
+\end_inset
+
+
+\change_inserted 1986246365 1320839073
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="34">
+<features tabularvalignment="bottom">
+<column alignment="center" valignment="top" width="0pt">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0pt">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771774
+
+\size tiny
+Bit
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771777
+
+\size tiny
+31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771779
+
+\size tiny
+30
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771781
+
+\size tiny
+29
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771783
+
+\size tiny
+28
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771786
+
+\size tiny
+27
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771810
+
+\size tiny
+26
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771813
+
+\size tiny
+25
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771815
+
+\size tiny
+24
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771817
+
+\size tiny
+23
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771819
+
+\size tiny
+22
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771821
+
+\size tiny
+21
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771823
+
+\size tiny
+20
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771825
+
+\size tiny
+19
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771829
+
+\size tiny
+18
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771831
+
+\size tiny
+17
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771833
+
+\size tiny
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771835
+
+\size tiny
+15
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771840
+
+\size tiny
+14
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771841
+
+\size tiny
+13
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771843
+
+\size tiny
+12
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771845
+
+\size tiny
+11
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771847
+
+\size tiny
+10
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771850
+
+\size tiny
+9
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771852
+
+\size tiny
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771854
+
+\size tiny
+7
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771856
+
+\size tiny
+6
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771858
+
+\size tiny
+5
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771859
+
+\size tiny
+4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771861
+
+\size tiny
+3
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771862
+
+\size tiny
+2
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771864
+
+\size tiny
+1
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771888
+
+\size tiny
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771997
+
+\size tiny
+Offset
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320781029
+
+\size larger
+Structure ID
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850302
+
+\size larger
+CapLength = 12
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850298
+
+\size larger
+NextCapPtr
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850289
+
+\size larger
+CapID = 9
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772004
+0
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772549
+
+\size larger
+Size
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850408
+
+\size larger
+BIR
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772007
+4
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772540
+
+\size larger
+Offset
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772011
+8
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\change_unchanged
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+
+\change_inserted 1986246365 1320839073
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320838992
+Purpose:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320780912
+
+\emph on
+Capability ID
+\emph default
+,
+\emph on
+Next Capability Pointer
+\emph default
+,
+\emph on
+Capability Length
+\emph default
+ - these fields are specified by PCI local bus specification, Rev 3.0
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320785073
+
+\emph on
+Structure ID
+\emph default
+ - identifies the structure mapped.
+ If an ID representing a specific structure is absent, the structure is
+ located in the legacy virtio configuration in the first PCI BAR.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320782689
+
+\emph on
+Size
+\emph default
+ - size of the structure mapped.
+ This size might include padding, or fields unused by the driver.
+ Drivers are also recommended to only map part of configuration structure
+ large enough for device operation.
+ For example, a future device might present a large structure size of several
+ MBytes.
+ As current devices never utilize structures larger than 4KBytes in size,
+ driver can limit the mapped structure size to e.g.
+ 4KBytes to allow forward compatibility with such devices without loss of
+ functionality and without wasting resources.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320839833
+
+\emph on
+BIR - BAR Indicator Register
+\emph default
+ - Indicates which one of the BAR registers, located beginning at 10h in
+ Configuration Space, is used to map the structure into Memory or I/O Space.
+ Legal values are 0 - 5.
+ BAR offset is calculated as
+\emph on
+BAR
+\emph default
+ = 10h + 4 *
+\emph on
+BIR.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320781002
+
+\emph on
+Offset
+\emph default
+ - Used as an offset from the address contained by one of the function’s
+ Base Address registers to point to the base of the structure.
+ Depending on the structure, the lower bits are masked off (set to zero)
+ by software to form an aligned offset.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320785098
+A single device has multiple virtio capabilities on the PCI capability linked-li
+st.
+ To locate a specific register, driver scans the PCI capability list looking
+ for capabilities using the vendor specific
+\emph on
+Capability ID
+\emph default
+, that is
+\emph on
+Capability ID
+\emph default
+ value
+\emph on
+9
+\emph default
+, according to the PCI spec.
+ For each capability, it verifies that the
+\emph on
+Capability Length
+\emph default
+ field matches the expected value (12) - if it doesn't, this indicates a
+ layout change, which causes driver to ignore the specific PCI capability
+ and proceed to the next PCI capability in the list.
+ Next,
+\emph on
+ Structure ID
+\emph default
+ single-byte field is read at offset 3.
+ Unrecognized
+\emph on
+Structure ID
+\emph default
+ values are ignored.
+ Low bits in the
+\emph on
+Offset
+\emph default
+ register are masked to match alignment requirements, if any.
+ Device drivers are recommended to sanity check
+\emph on
+BIR
+\emph default
+,
+\emph on
+Offset
+\emph default
+, and
+\emph on
+Size
+\emph default
+ fields, ignoring the capability or failing gracefully on error.
+ Drivers are also recommended to only map part of configuration structure
+ large enough for device operation.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786035
+For backwards compatibility, devices should also present legacy configuration
+ space in the first I/O region of the PCI device, mirroring virtio configuration
+ structures in this space.
+ Drivers should fall back on this legacy structure if a specific Virtio
+ Structure capability is missing in the PCI capability list.
+ However, devices are not required to map the whole configuration structure
+ in legacy space - only the initial segment expected by legacy drivers needs
+ to be mapped.
+ The minimal size of such legacy segment size, for each structure, is listed
+ below.
+ Drivers are discouraged from using legacy space if a specific Structure
+ ID is present; this is to allow deprecating the legacy space in the future.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320850770
+Below is the list of supported Virtio structures, including Structure ID,
+ offset alignment, and where it can be located in the legacy configuration
+ space.
+ Note that legacy space layout changes as the MSI-X capability is enabled
+ and disabled
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320856794
+ie.
+ once you enable MSI-X on the device, some legacy fields move.
+ If you turn it off again, they move back! this does not affect the new
+ configuration
+\end_layout
+
+\end_inset
+
+.
+ Alignment, offset and all sizes are in bytes.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786868
+\begin_inset Tabular
+<lyxtabular version="3" rows="6" columns="6">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<row>
+<cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Structure
+\change_inserted 1986246365 1320855560
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+ID
+\change_inserted 1986246365 1320855560
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Align-
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855560
+MinSize
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785821
+Offset in
+\change_deleted 1986246365 1320785817
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850780
+MinSize in
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell multirow="4" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="4" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855625
+ment
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="4" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855593
+legacy space
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855610
+ legacy space
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785855
+Virtio Header
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785860
+0x1
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786157
+4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786225
+28 bytes
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786145
+0
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855180
+24 or 20
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855511
+\begin_inset CommandInset label
+LatexCommand label
+name "fn:24-or-20"
+
+\end_inset
+
+24 bytes if MSI-X is enabled, 20 bytes if it is disabled
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786188
+Queue Notify
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786191
+0x2
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786267
+2 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786228
+2 bytes
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786505
+16 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786303
+2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786878
+ISR Status
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786260
+0x3
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786270
+1 byte
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786273
+1 byte
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786534
+19 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786306
+1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786847
+Device Header
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786474
+0x4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786477
+1 byte
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855405
+?
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855417
+\begin_inset CommandInset label
+LatexCommand label
+name "fn:Device-specific"
+
+\end_inset
+
+Device specific
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855534
+24 or 20
+\begin_inset Formula $^{\text{\ref{fn:24-or-20}}}$
+\end_inset
+
+
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855432
+?
+\begin_inset Formula $^{\text{\ref{fn:Device-specific}}}$
+\end_inset
+
+
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786973
+Drivers should assume that each structure size can be extended in the future.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320859762
+Queue Notify and ISR status are single-field registers.
+ Device Header has device specific structure.
+ Virtio Header structure is documented below.
+\end_layout
+
+\begin_layout Subsubsection
+
+\change_inserted 1986246365 1320867253
+Example Virtio Structure Layout
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320865758
+Let's assume that a virtio block device presents two Virtio Structure capabiliti
+es in PCI capability list:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863392
+Structure ID 0x1; BIR 1; Offset 0x1000; Size 0x100
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863399
+Structure ID 0x4; BIR 1; Offset 0x1100; Size 0x200
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863479
+Let's further assume that MSI-X is disabled.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863498
+In this case, the driver should use:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863543
+Virtio Header at offset 0x1000 in BAR 1
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863568
+Device Header at offset 0x1100 in BAR1
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320868074
+Queue Notify at offset 0x10 in BAR0 (legacy configuration space is used
+ since Structure ID is not present)
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320868077
+ISR status at offset 0x13 in BAR0 (legacy configuration space is used since
+ Structure ID is not present)
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320867162
+For use by legacy drivers, the first 20 bytes in BAR0 mirror bytes 0x1000
+ to 0x1013 in BAR1, and the following 32 bytes in BAR0 should mirror bytes
+ 0x1100 to 111F in BAR1.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320867231
+Enabling MSI-X only affects the legacy drivers: with MSI-X enabled, the
+ first 24 bytes in BAR0 mirror bytes 0x1000 to 0x1017 in BAR1, and the following
+ 32 bytes in BAR0 should mirror bytes 0x1100 to 111F in BAR1.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Subsection
+
+\change_inserted 1986246365 1320855988
+Virtio Header
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320858571
+The virtio header looks as follows:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320858597
+\begin_inset Tabular
+<lyxtabular version="3" rows="13" columns="3">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858603
+Bits
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858614
+R/W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858619
+Purpose
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858841
+32
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858858
+R
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858870
+Device Features bits 0:31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858873
+32
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858876
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858885
+Guest Features bits 0:31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858889
+32
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858891
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858907
+Queue Address
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859001
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859006
+R
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858953
+Queue Size
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859012
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859008
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858957
+Queue Select
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859015
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858964
+Reserved
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859029
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859032
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858972
+Device Status
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859052
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858989
+Reserved
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859063
+16
+\change_unchanged
+
\end_layout
-\begin_layout Standard
-There may be different widths of accesses to the I/O region; the
-\begin_inset Quotes eld
\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
-natural
-\begin_inset Quotes erd
-\end_inset
+\begin_layout Plain Layout
- access method for each field in the virtio header must be used (i.e.
- 32-bit accesses for 32-bit fields, etc), but the device-specific region
- can be accessed using any width accesses, and should obtain the same results.
-\end_layout
+\change_inserted 1986246365 1320859065
+R+W
+\change_unchanged
-\begin_layout Standard
-Note that this is possible because while the virtio header is PCI (i.e.
- little) endian, the device-specific region is encoded in the native endian
- of the guest (where such distinction is applicable).
\end_layout
-\begin_layout Subsection
-Device Initialization Sequence
-\begin_inset CommandInset label
-LatexCommand label
-name "sub:Device-Initialization-Sequence"
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859081
+MSI-X Configuration Vector
+\change_unchanged
+
+\end_layout
\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859083
+16
+\change_unchanged
\end_layout
-\begin_layout Standard
-We start with an overview of device initialization, then expand on the details
- of the device and how each step is preformed.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859088
+R+W
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-Reset the device.
- This is not required on initial start up.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859095
+MSI-X Queue Vector
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The ACKNOWLEDGE status bit is set: we have noticed the device.
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859102
+32
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The DRIVER status bit is set: we know how to drive the device.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859106
+R
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-Device-specific setup, including reading the Device Feature Bits, discovery
- of virtqueues for the device, optional MSI-X setup, and reading and possibly
- writing the virtio configuration space.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859116
+Device Features bits 32:63
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The subset of Device Feature Bits understood by the driver is written to
- the device.
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859122
+32
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The DRIVER_OK status bit is set.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859119
+R+W
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The device can now be used (ie.
- buffers added to the virtqueues)
-\begin_inset Foot
-status open
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
\begin_layout Plain Layout
-Historically, drivers have used the device before steps 5 and 6.
- This is only allowed if the driver does not use any features which would
- alter this early use of the device.
+
+\change_inserted 1986246365 1320859130
+Guest Features bits 32:63
+\change_unchanged
+
\end_layout
\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
\end_layout
-\begin_layout Standard
-If any of these steps go irrecoverably wrong, the guest should set the FAILED
- status bit to indicate that it has given up on the device (it can reset
- the device later to restart if desired).
+\begin_layout Subsubsection
+
+\change_inserted 1986246365 1320856004
+Legacy
+\change_unchanged
+Virtio Header
\end_layout
\begin_layout Standard
-We now cover the fields required for general setup in detail.
-\end_layout
-\begin_layout Subsection
-Virtio Header
+\change_inserted 1986246365 1320867482
+For backwards compatibility, devices should mirror the initial part of virtio
+ header and device header structures, Queue Notify and ISR Status registers
+ in legacy configuration space in the first I/O region of the PCI device.
+ Drivers should fall back on this legacy structure if a specific Virtio
+ Structure capability is missing in the PCI capability list.
+ Drivers are discouraged from using legacy space if a specific Structure
+ ID is present; this is to allow deprecating the legacy space in the future.
\end_layout
\begin_layout Standard
-The virtio header looks as follows:
+
+\change_inserted 1986246365 1320859848
+For reference, the
+\change_deleted 1986246365 1320856044
+The
+\change_unchanged
+
+\change_inserted 1986246365 1320859848
+legacy
+\change_unchanged
+virtio header looks as follows
+\change_inserted 1986246365 1320859848
+; one observes that most register offsets match the new virtio header, to
+ make compatibility easier
+\change_unchanged
+:
\end_layout
\begin_layout Standard
@@ -1067,11 +4108,15 @@ Status
If MSI-X is enabled for the device, two additional fields immediately follow
this header:
\begin_inset Foot
-status collapsed
+status open
\begin_layout Plain Layout
ie.
- once you enable MSI-X on the device, the other fields move.
+ once you enable MSI-X on the device, the other fields
+\change_inserted 1986246365 1320867540
+in legacy configuration
+\change_unchanged
+move.
If you turn it off again, they move back!
\end_layout
@@ -1219,11 +4264,15 @@ Vector
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320867563
Finally, if feature bits (VIRTIO_F_FEATURES_HI) this is immediately followed
by two additional fields:
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320867563
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features tabularvalignment="middle">
@@ -1359,11 +4408,16 @@ Features bits 32:63
\end_inset
+\change_unchanged
+
\end_layout
\begin_layout Standard
-Immediately following these general headers, there may be device-specific
- headers:
+Immediately following these general headers, there may be
+\change_inserted 1986246365 1320856347
+legacy
+\change_unchanged
+device-specific headers:
\end_layout
\begin_layout Standard
@@ -1459,6 +4513,17 @@ Device Specific...
\end_inset
+\change_inserted 1986246365 1320856108
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320856109
+Legacy device-specific headers are supported for backwards compatibility.
+ As such, they are not required to map the whole device configuration structure
+ - only the initial segment expected by legacy drivers needs to be mapped.
+ The size of such legacy segment size is device specific.
\end_layout
\begin_layout Subsubsection
@@ -1531,8 +4596,10 @@ name "sub:Feature-Bits"
The least significant 31 bits of the first configuration field indicates
the features that the device supports (the high bit is reserved, and will
be used to indicate the presence of future feature bits elsewhere).
- If more than 31 feature bits are supported, the device indicates so by
- setting feature bit 31 (see
+
+\change_deleted 1986246365 1320784929
+If more than 31 feature bits are supported, the device indicates so by setting
+ feature bit 31 (see
\begin_inset CommandInset ref
LatexCommand ref
reference "cha:Reserved-Feature-Bits"
@@ -1540,7 +4607,9 @@ reference "cha:Reserved-Feature-Bits"
\end_inset
).
- The bits are allocated as follows:
+
+\change_unchanged
+The bits are allocated as follows:
\end_layout
\begin_layout Description
@@ -1615,10 +4684,14 @@ This allows for forwards and backwards compatibility: if the device is enhanced
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320784940
Access to feature bits 32 to 63 is enabled by Guest by setting feature bit
31.
If this bit is unset, Device must assume that all feature bits > 31 are
unset.
+\change_unchanged
+
\end_layout
\begin_layout Subsubsection
@@ -1629,10 +4702,14 @@ Configuration/Queue Vectors
When MSI-X capability is present and enabled in the device (through standard
PCI configuration space) 4 bytes at byte offset 20 are used to map configuratio
n change and queue interrupts to MSI-X vectors.
- In this case, the ISR Status field is unused, and device specific configuration
- starts at byte offset 24 in virtio header structure.
+ In this case, the ISR Status field is unused
+\change_deleted 1986246365 1320784981
+, and device specific configuration starts at byte offset 24 in virtio header
+ structure.
When MSI-X capability is not enabled, device specific configuration starts
- at byte offset 20 in virtio header.
+ at byte offset 20 in virtio header
+\change_unchanged
+.
\end_layout
\begin_layout Standard
@@ -3829,7 +6906,13 @@ Appendix B: Reserved Feature Bits
\end_layout
\begin_layout Standard
-Currently there are five device-independent feature bits defined:
+Currently there are
+\change_deleted 1986246365 1320867366
+five
+\change_inserted 1986246365 1320867367
+four
+\change_unchanged
+ device-independent feature bits defined:
\end_layout
\begin_layout Description
@@ -3926,9 +7009,13 @@ An experimental virtio PCI driver contained in Linux version 2.6.25 had this
\end_layout
\begin_layout Description
+
+\change_deleted 1986246365 1320867370
VIRTIO_F_FEATURES_HIGH(31) This feature indicates that the device supports
feature bits 32:63.
If unset, feature bits 32:63 are unset.
+\change_unchanged
+
\end_layout
\begin_layout Chapter*
@@ -4186,6 +7273,24 @@ struct virtio_net_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867743
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 8 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
@@ -5226,6 +8331,24 @@ struct virtio_blk_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867779
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 32 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
@@ -5780,6 +8903,24 @@ struct virtio_console_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867806
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 8 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
@@ -5994,6 +9135,28 @@ configuration
\end_inset
layout None currently defined.
+\change_inserted 1986246365 1320867840
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1986246365 1320867845
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 0 bytes.
+\change_unchanged
+
\end_layout
\begin_layout Section*
@@ -6127,6 +9290,24 @@ struct virtio_balloon_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867865
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 4 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 19:59 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 19:59 UTC (permalink / raw)
To: Rusty Russell
Cc: Sasha Levin, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
Here's an updated spec patch. Changes from v1:
- add an example configuration
- scale tables so they fit within page
- clean up some remaining items mentioning feature bit 31
Description from v1:
Here's a spec change documenting what my C patch does
(almost - I tweaked the layout a bit, but the idea is the same).
Some more cleanups are needed but I thought I'd send it
for early flames/comments.
The idea is simple: we split functionally unrelated
register groups to independent structures, and let
the device place is anywhere using a capability
in PCI configuration space.
It can then go into MMIO space which is cheaper than PIO.
A legacy portion of the configuration is mirrored
in the first BAR, to keep legacy drivers working.
Any new fields can be added in existing structures
at the end, so they won't affect legacy.
Alternatively we can add new structures with new
structure IDs, pointed to from PCI configuration space.
As we don't yet have devices or drivers with 64 bit features,
I decided we don't need high feature bits in legacy space.
This also frees up feature bit 31 as we don't need it
to enable high feature bits anymore.
I don't think any released software actually uses it
(the kvm tool HEAD apparently does,
but I think it's not too late to fix it).
As this solves the dynamic placement of MSIX vectors
and high feature bits,
I thought it's easier to just reserve space for that
programming than give it a separate structure. This
can be changed by a patch on top.
Note that data path is split from configuration.
PDF will follow.
Please comment.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
diff --git a/virtio-spec.lyx b/virtio-spec.lyx
index 6426f8f..2ce2553 100644
--- a/virtio-spec.lyx
+++ b/virtio-spec.lyx
@@ -3,6 +3,9 @@
\begin_document
\begin_header
\textclass report
+\begin_preamble
+\usepackage{graphicx}
+\end_preamble
\use_default_options false
\maintain_unincluded_children false
\language english
@@ -56,6 +59,7 @@
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
+\author 1986246365 "Michael S. Tsirkin"
\end_header
\begin_body
@@ -570,7 +574,34 @@ Device Configuration
\end_layout
\begin_layout Standard
-To configure the device, we use the first I/O region of the PCI device.
+To configure the device, we
+\change_inserted 1986246365 1320783354
+use I/O and/or memory regions of the PCI device.
+ These contain the virtio header registers, the notification register, the
+ ISR status register and device specific registers, as specified by Virtio
+ Structure PCI Capabilities
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320787659
+For backwards compatibility, devices should present part of these configuration
+ registers in a legacy configuration structure in the first I/O region of
+ the PCI device
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+
+\change_deleted 1986246365 1320766512
+use the first I/O region of the PCI device.
This contains a
\emph on
virtio header
@@ -578,105 +609,3115 @@ virtio header
followed by a
\emph on
device-specific region.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+There may be different widths of accesses to the I/O region; the
+\begin_inset Quotes eld
+\end_inset
+
+natural
+\begin_inset Quotes erd
+\end_inset
+
+ access method for each field in the virtio header must be used (i.e.
+ 32-bit accesses for 32-bit fields, etc), but the device-specific region
+ can be accessed using any width accesses, and should obtain the same results.
+\end_layout
+
+\begin_layout Standard
+Note that this is possible because while the virtio header
+\change_inserted 1986246365 1320767249
+, notification and ISR status are
+\change_deleted 1986246365 1320767251
+ is
+\change_unchanged
+ PCI (i.e.
+ little) endian, the device-specific
+\change_deleted 1986246365 1320767335
+ region is
+\change_inserted 1986246365 1320767337
+registers are
+\change_unchanged
+ encoded in the native endian of the guest (where such distinction is applicable
+).
+\change_inserted 1986246365 1320767660
+
+\end_layout
+
+\begin_layout Subsection
+Device Initialization Sequence
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:Device-Initialization-Sequence"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+We start with an overview of device initialization, then expand on the details
+ of the device and how each step is preformed.
+\end_layout
+
+\begin_layout Enumerate
+Reset the device.
+ This is not required on initial start up.
+\end_layout
+
+\begin_layout Enumerate
+The ACKNOWLEDGE status bit is set: we have noticed the device.
+\end_layout
+
+\begin_layout Enumerate
+The DRIVER status bit is set: we know how to drive the device.
+\end_layout
+
+\begin_layout Enumerate
+
+\change_inserted 1986246365 1320838089
+PCI capability list scan, detecting virtio configuration layout using Virtio
+ Structure PCI capabilities.
+
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320838121
+Historically drivers skipped this step, using legacy configuration space
+ unconditionally.
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Device-specific setup, including reading the Device Feature Bits, discovery
+ of virtqueues for the device, optional MSI-X setup, and reading and possibly
+ writing the virtio configuration space.
+\end_layout
+
+\begin_layout Enumerate
+The subset of Device Feature Bits understood by the driver is written to
+ the device.
+\end_layout
+
+\begin_layout Enumerate
+The DRIVER_OK status bit is set.
+\end_layout
+
+\begin_layout Enumerate
+The device can now be used (ie.
+ buffers added to the virtqueues)
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+Historically, drivers have used the device before steps 5 and 6.
+ This is only allowed if the driver does not use any features which would
+ alter this early use of the device.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+If any of these steps go irrecoverably wrong, the guest should set the FAILED
+ status bit to indicate that it has given up on the device (it can reset
+ the device later to restart if desired).
+\end_layout
+
+\begin_layout Standard
+We now cover the fields required for general setup in detail.
+\change_inserted 1986246365 1320766663
+
+\end_layout
+
+\begin_layout Subsection
+
+\change_inserted 1986246365 1320781584
+Virtio Structure PCI Capability
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320781061
+Virtio configuration layout includes virtio configuration header, notification
+ and ISR status and device configuration structures.
+ Each structure is mapped by a Base Address register (BAR) belonging to
+ the function, located beginning at 10h in Configuration Space.
+
+\emph on
+Structure ID
+\emph default
+indentifies the structure
+\emph on
+, Size
+\emph default
+ indicates the structure size, in bytes, a
+\emph on
+BAR Indicator register (BIR)
+\emph default
+ indicates which BAR, and
+\emph on
+Offset
+\emph default
+ indicates where the structure begins relative to the base address associated
+ with the BAR.
+ The BAR is permitted to be either 32-bit or 64-bit, it can map Memory Space
+ or I/O Space.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320838522
+These registers are specified using vendor-specific PCI capability located
+ on capability list in PCI configuration space of the device.
+ This virtio structure capability uses little-endian format; all bits are
+ read-only:
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+resizebox{
+\backslash
+textwidth}{!}{%
+\end_layout
+
+\end_inset
+
+
+\change_inserted 1986246365 1320839073
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="34">
+<features tabularvalignment="bottom">
+<column alignment="center" valignment="top" width="0pt">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0pt">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771774
+
+\size tiny
+Bit
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771777
+
+\size tiny
+31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771779
+
+\size tiny
+30
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771781
+
+\size tiny
+29
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771783
+
+\size tiny
+28
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771786
+
+\size tiny
+27
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771810
+
+\size tiny
+26
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771813
+
+\size tiny
+25
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771815
+
+\size tiny
+24
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771817
+
+\size tiny
+23
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771819
+
+\size tiny
+22
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771821
+
+\size tiny
+21
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771823
+
+\size tiny
+20
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771825
+
+\size tiny
+19
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771829
+
+\size tiny
+18
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771831
+
+\size tiny
+17
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771833
+
+\size tiny
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771835
+
+\size tiny
+15
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771840
+
+\size tiny
+14
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771841
+
+\size tiny
+13
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771843
+
+\size tiny
+12
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771845
+
+\size tiny
+11
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771847
+
+\size tiny
+10
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771850
+
+\size tiny
+9
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771852
+
+\size tiny
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771854
+
+\size tiny
+7
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771856
+
+\size tiny
+6
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771858
+
+\size tiny
+5
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771859
+
+\size tiny
+4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771861
+
+\size tiny
+3
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771862
+
+\size tiny
+2
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771864
+
+\size tiny
+1
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771888
+
+\size tiny
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771997
+
+\size tiny
+Offset
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320781029
+
+\size larger
+Structure ID
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850302
+
+\size larger
+CapLength = 12
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850298
+
+\size larger
+NextCapPtr
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850289
+
+\size larger
+CapID = 9
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772004
+0
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772549
+
+\size larger
+Size
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850408
+
+\size larger
+BIR
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772007
+4
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772540
+
+\size larger
+Offset
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772011
+8
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\change_unchanged
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+
+\change_inserted 1986246365 1320839073
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320838992
+Purpose:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320780912
+
+\emph on
+Capability ID
+\emph default
+,
+\emph on
+Next Capability Pointer
+\emph default
+,
+\emph on
+Capability Length
+\emph default
+ - these fields are specified by PCI local bus specification, Rev 3.0
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320785073
+
+\emph on
+Structure ID
+\emph default
+ - identifies the structure mapped.
+ If an ID representing a specific structure is absent, the structure is
+ located in the legacy virtio configuration in the first PCI BAR.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320782689
+
+\emph on
+Size
+\emph default
+ - size of the structure mapped.
+ This size might include padding, or fields unused by the driver.
+ Drivers are also recommended to only map part of configuration structure
+ large enough for device operation.
+ For example, a future device might present a large structure size of several
+ MBytes.
+ As current devices never utilize structures larger than 4KBytes in size,
+ driver can limit the mapped structure size to e.g.
+ 4KBytes to allow forward compatibility with such devices without loss of
+ functionality and without wasting resources.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320839833
+
+\emph on
+BIR - BAR Indicator Register
+\emph default
+ - Indicates which one of the BAR registers, located beginning at 10h in
+ Configuration Space, is used to map the structure into Memory or I/O Space.
+ Legal values are 0 - 5.
+ BAR offset is calculated as
+\emph on
+BAR
+\emph default
+ = 10h + 4 *
+\emph on
+BIR.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320781002
+
+\emph on
+Offset
+\emph default
+ - Used as an offset from the address contained by one of the function’s
+ Base Address registers to point to the base of the structure.
+ Depending on the structure, the lower bits are masked off (set to zero)
+ by software to form an aligned offset.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320785098
+A single device has multiple virtio capabilities on the PCI capability linked-li
+st.
+ To locate a specific register, driver scans the PCI capability list looking
+ for capabilities using the vendor specific
+\emph on
+Capability ID
+\emph default
+, that is
+\emph on
+Capability ID
+\emph default
+ value
+\emph on
+9
+\emph default
+, according to the PCI spec.
+ For each capability, it verifies that the
+\emph on
+Capability Length
+\emph default
+ field matches the expected value (12) - if it doesn't, this indicates a
+ layout change, which causes driver to ignore the specific PCI capability
+ and proceed to the next PCI capability in the list.
+ Next,
+\emph on
+ Structure ID
+\emph default
+ single-byte field is read at offset 3.
+ Unrecognized
+\emph on
+Structure ID
+\emph default
+ values are ignored.
+ Low bits in the
+\emph on
+Offset
+\emph default
+ register are masked to match alignment requirements, if any.
+ Device drivers are recommended to sanity check
+\emph on
+BIR
+\emph default
+,
+\emph on
+Offset
+\emph default
+, and
+\emph on
+Size
+\emph default
+ fields, ignoring the capability or failing gracefully on error.
+ Drivers are also recommended to only map part of configuration structure
+ large enough for device operation.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786035
+For backwards compatibility, devices should also present legacy configuration
+ space in the first I/O region of the PCI device, mirroring virtio configuration
+ structures in this space.
+ Drivers should fall back on this legacy structure if a specific Virtio
+ Structure capability is missing in the PCI capability list.
+ However, devices are not required to map the whole configuration structure
+ in legacy space - only the initial segment expected by legacy drivers needs
+ to be mapped.
+ The minimal size of such legacy segment size, for each structure, is listed
+ below.
+ Drivers are discouraged from using legacy space if a specific Structure
+ ID is present; this is to allow deprecating the legacy space in the future.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320850770
+Below is the list of supported Virtio structures, including Structure ID,
+ offset alignment, and where it can be located in the legacy configuration
+ space.
+ Note that legacy space layout changes as the MSI-X capability is enabled
+ and disabled
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320856794
+ie.
+ once you enable MSI-X on the device, some legacy fields move.
+ If you turn it off again, they move back! this does not affect the new
+ configuration
+\end_layout
+
+\end_inset
+
+.
+ Alignment, offset and all sizes are in bytes.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786868
+\begin_inset Tabular
+<lyxtabular version="3" rows="6" columns="6">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<row>
+<cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Structure
+\change_inserted 1986246365 1320855560
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+ID
+\change_inserted 1986246365 1320855560
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Align-
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855560
+MinSize
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785821
+Offset in
+\change_deleted 1986246365 1320785817
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850780
+MinSize in
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell multirow="4" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="4" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855625
+ment
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="4" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855593
+legacy space
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855610
+ legacy space
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785855
+Virtio Header
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785860
+0x1
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786157
+4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786225
+28 bytes
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786145
+0
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855180
+24 or 20
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855511
+\begin_inset CommandInset label
+LatexCommand label
+name "fn:24-or-20"
+
+\end_inset
+
+24 bytes if MSI-X is enabled, 20 bytes if it is disabled
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786188
+Queue Notify
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786191
+0x2
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786267
+2 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786228
+2 bytes
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786505
+16 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786303
+2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786878
+ISR Status
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786260
+0x3
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786270
+1 byte
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786273
+1 byte
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786534
+19 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786306
+1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786847
+Device Header
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786474
+0x4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786477
+1 byte
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855405
+?
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855417
+\begin_inset CommandInset label
+LatexCommand label
+name "fn:Device-specific"
+
+\end_inset
+
+Device specific
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855534
+24 or 20
+\begin_inset Formula $^{\text{\ref{fn:24-or-20}}}$
+\end_inset
+
+
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855432
+?
+\begin_inset Formula $^{\text{\ref{fn:Device-specific}}}$
+\end_inset
+
+
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786973
+Drivers should assume that each structure size can be extended in the future.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320859762
+Queue Notify and ISR status are single-field registers.
+ Device Header has device specific structure.
+ Virtio Header structure is documented below.
+\end_layout
+
+\begin_layout Subsubsection
+
+\change_inserted 1986246365 1320867253
+Example Virtio Structure Layout
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320865758
+Let's assume that a virtio block device presents two Virtio Structure capabiliti
+es in PCI capability list:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863392
+Structure ID 0x1; BIR 1; Offset 0x1000; Size 0x100
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863399
+Structure ID 0x4; BIR 1; Offset 0x1100; Size 0x200
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863479
+Let's further assume that MSI-X is disabled.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863498
+In this case, the driver should use:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863543
+Virtio Header at offset 0x1000 in BAR 1
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863568
+Device Header at offset 0x1100 in BAR1
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320868074
+Queue Notify at offset 0x10 in BAR0 (legacy configuration space is used
+ since Structure ID is not present)
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320868077
+ISR status at offset 0x13 in BAR0 (legacy configuration space is used since
+ Structure ID is not present)
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320867162
+For use by legacy drivers, the first 20 bytes in BAR0 mirror bytes 0x1000
+ to 0x1013 in BAR1, and the following 32 bytes in BAR0 should mirror bytes
+ 0x1100 to 111F in BAR1.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320867231
+Enabling MSI-X only affects the legacy drivers: with MSI-X enabled, the
+ first 24 bytes in BAR0 mirror bytes 0x1000 to 0x1017 in BAR1, and the following
+ 32 bytes in BAR0 should mirror bytes 0x1100 to 111F in BAR1.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Subsection
+
+\change_inserted 1986246365 1320855988
+Virtio Header
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320858571
+The virtio header looks as follows:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320858597
+\begin_inset Tabular
+<lyxtabular version="3" rows="13" columns="3">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858603
+Bits
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858614
+R/W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858619
+Purpose
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858841
+32
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858858
+R
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858870
+Device Features bits 0:31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858873
+32
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858876
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858885
+Guest Features bits 0:31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858889
+32
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858891
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858907
+Queue Address
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859001
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859006
+R
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858953
+Queue Size
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859012
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859008
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858957
+Queue Select
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859015
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858964
+Reserved
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859029
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859032
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858972
+Device Status
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859052
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858989
+Reserved
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859063
+16
+\change_unchanged
+
\end_layout
-\begin_layout Standard
-There may be different widths of accesses to the I/O region; the
-\begin_inset Quotes eld
\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
-natural
-\begin_inset Quotes erd
-\end_inset
+\begin_layout Plain Layout
- access method for each field in the virtio header must be used (i.e.
- 32-bit accesses for 32-bit fields, etc), but the device-specific region
- can be accessed using any width accesses, and should obtain the same results.
-\end_layout
+\change_inserted 1986246365 1320859065
+R+W
+\change_unchanged
-\begin_layout Standard
-Note that this is possible because while the virtio header is PCI (i.e.
- little) endian, the device-specific region is encoded in the native endian
- of the guest (where such distinction is applicable).
\end_layout
-\begin_layout Subsection
-Device Initialization Sequence
-\begin_inset CommandInset label
-LatexCommand label
-name "sub:Device-Initialization-Sequence"
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859081
+MSI-X Configuration Vector
+\change_unchanged
+
+\end_layout
\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859083
+16
+\change_unchanged
\end_layout
-\begin_layout Standard
-We start with an overview of device initialization, then expand on the details
- of the device and how each step is preformed.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859088
+R+W
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-Reset the device.
- This is not required on initial start up.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859095
+MSI-X Queue Vector
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The ACKNOWLEDGE status bit is set: we have noticed the device.
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859102
+32
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The DRIVER status bit is set: we know how to drive the device.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859106
+R
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-Device-specific setup, including reading the Device Feature Bits, discovery
- of virtqueues for the device, optional MSI-X setup, and reading and possibly
- writing the virtio configuration space.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859116
+Device Features bits 32:63
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The subset of Device Feature Bits understood by the driver is written to
- the device.
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859122
+32
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The DRIVER_OK status bit is set.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859119
+R+W
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The device can now be used (ie.
- buffers added to the virtqueues)
-\begin_inset Foot
-status open
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
\begin_layout Plain Layout
-Historically, drivers have used the device before steps 5 and 6.
- This is only allowed if the driver does not use any features which would
- alter this early use of the device.
+
+\change_inserted 1986246365 1320859130
+Guest Features bits 32:63
+\change_unchanged
+
\end_layout
\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
\end_layout
-\begin_layout Standard
-If any of these steps go irrecoverably wrong, the guest should set the FAILED
- status bit to indicate that it has given up on the device (it can reset
- the device later to restart if desired).
+\begin_layout Subsubsection
+
+\change_inserted 1986246365 1320856004
+Legacy
+\change_unchanged
+Virtio Header
\end_layout
\begin_layout Standard
-We now cover the fields required for general setup in detail.
-\end_layout
-\begin_layout Subsection
-Virtio Header
+\change_inserted 1986246365 1320867482
+For backwards compatibility, devices should mirror the initial part of virtio
+ header and device header structures, Queue Notify and ISR Status registers
+ in legacy configuration space in the first I/O region of the PCI device.
+ Drivers should fall back on this legacy structure if a specific Virtio
+ Structure capability is missing in the PCI capability list.
+ Drivers are discouraged from using legacy space if a specific Structure
+ ID is present; this is to allow deprecating the legacy space in the future.
\end_layout
\begin_layout Standard
-The virtio header looks as follows:
+
+\change_inserted 1986246365 1320859848
+For reference, the
+\change_deleted 1986246365 1320856044
+The
+\change_unchanged
+
+\change_inserted 1986246365 1320859848
+legacy
+\change_unchanged
+virtio header looks as follows
+\change_inserted 1986246365 1320859848
+; one observes that most register offsets match the new virtio header, to
+ make compatibility easier
+\change_unchanged
+:
\end_layout
\begin_layout Standard
@@ -1067,11 +4108,15 @@ Status
If MSI-X is enabled for the device, two additional fields immediately follow
this header:
\begin_inset Foot
-status collapsed
+status open
\begin_layout Plain Layout
ie.
- once you enable MSI-X on the device, the other fields move.
+ once you enable MSI-X on the device, the other fields
+\change_inserted 1986246365 1320867540
+in legacy configuration
+\change_unchanged
+move.
If you turn it off again, they move back!
\end_layout
@@ -1219,11 +4264,15 @@ Vector
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320867563
Finally, if feature bits (VIRTIO_F_FEATURES_HI) this is immediately followed
by two additional fields:
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320867563
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features tabularvalignment="middle">
@@ -1359,11 +4408,16 @@ Features bits 32:63
\end_inset
+\change_unchanged
+
\end_layout
\begin_layout Standard
-Immediately following these general headers, there may be device-specific
- headers:
+Immediately following these general headers, there may be
+\change_inserted 1986246365 1320856347
+legacy
+\change_unchanged
+device-specific headers:
\end_layout
\begin_layout Standard
@@ -1459,6 +4513,17 @@ Device Specific...
\end_inset
+\change_inserted 1986246365 1320856108
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320856109
+Legacy device-specific headers are supported for backwards compatibility.
+ As such, they are not required to map the whole device configuration structure
+ - only the initial segment expected by legacy drivers needs to be mapped.
+ The size of such legacy segment size is device specific.
\end_layout
\begin_layout Subsubsection
@@ -1531,8 +4596,10 @@ name "sub:Feature-Bits"
The least significant 31 bits of the first configuration field indicates
the features that the device supports (the high bit is reserved, and will
be used to indicate the presence of future feature bits elsewhere).
- If more than 31 feature bits are supported, the device indicates so by
- setting feature bit 31 (see
+
+\change_deleted 1986246365 1320784929
+If more than 31 feature bits are supported, the device indicates so by setting
+ feature bit 31 (see
\begin_inset CommandInset ref
LatexCommand ref
reference "cha:Reserved-Feature-Bits"
@@ -1540,7 +4607,9 @@ reference "cha:Reserved-Feature-Bits"
\end_inset
).
- The bits are allocated as follows:
+
+\change_unchanged
+The bits are allocated as follows:
\end_layout
\begin_layout Description
@@ -1615,10 +4684,14 @@ This allows for forwards and backwards compatibility: if the device is enhanced
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320784940
Access to feature bits 32 to 63 is enabled by Guest by setting feature bit
31.
If this bit is unset, Device must assume that all feature bits > 31 are
unset.
+\change_unchanged
+
\end_layout
\begin_layout Subsubsection
@@ -1629,10 +4702,14 @@ Configuration/Queue Vectors
When MSI-X capability is present and enabled in the device (through standard
PCI configuration space) 4 bytes at byte offset 20 are used to map configuratio
n change and queue interrupts to MSI-X vectors.
- In this case, the ISR Status field is unused, and device specific configuration
- starts at byte offset 24 in virtio header structure.
+ In this case, the ISR Status field is unused
+\change_deleted 1986246365 1320784981
+, and device specific configuration starts at byte offset 24 in virtio header
+ structure.
When MSI-X capability is not enabled, device specific configuration starts
- at byte offset 20 in virtio header.
+ at byte offset 20 in virtio header
+\change_unchanged
+.
\end_layout
\begin_layout Standard
@@ -3829,7 +6906,13 @@ Appendix B: Reserved Feature Bits
\end_layout
\begin_layout Standard
-Currently there are five device-independent feature bits defined:
+Currently there are
+\change_deleted 1986246365 1320867366
+five
+\change_inserted 1986246365 1320867367
+four
+\change_unchanged
+ device-independent feature bits defined:
\end_layout
\begin_layout Description
@@ -3926,9 +7009,13 @@ An experimental virtio PCI driver contained in Linux version 2.6.25 had this
\end_layout
\begin_layout Description
+
+\change_deleted 1986246365 1320867370
VIRTIO_F_FEATURES_HIGH(31) This feature indicates that the device supports
feature bits 32:63.
If unset, feature bits 32:63 are unset.
+\change_unchanged
+
\end_layout
\begin_layout Chapter*
@@ -4186,6 +7273,24 @@ struct virtio_net_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867743
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 8 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
@@ -5226,6 +8331,24 @@ struct virtio_blk_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867779
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 32 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
@@ -5780,6 +8903,24 @@ struct virtio_console_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867806
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 8 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
@@ -5994,6 +9135,28 @@ configuration
\end_inset
layout None currently defined.
+\change_inserted 1986246365 1320867840
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1986246365 1320867845
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 0 bytes.
+\change_unchanged
+
\end_layout
\begin_layout Section*
@@ -6127,6 +9290,24 @@ struct virtio_balloon_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867865
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 4 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
^ permalink raw reply related [flat|nested] 134+ messages in thread* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-09 19:59 ` Michael S. Tsirkin
(?)
@ 2011-11-09 20:00 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 20:00 UTC (permalink / raw)
To: Rusty Russell
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, virtualization, penberg,
Christian Borntraeger, Sasha Levin, Amit Shah, avi
[-- Attachment #1: Type: text/plain, Size: 81 bytes --]
> PDF will follow.
Attached a compiled version for the Lyx-challenged.
--
MST
[-- Attachment #2: virtio-spec.pdf --]
[-- Type: application/pdf, Size: 335445 bytes --]
[-- Attachment #3: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-09 19:59 ` Michael S. Tsirkin
@ 2011-11-09 20:24 ` Sasha Levin
-1 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 20:24 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, avi, Amit Shah
On Wed, 2011-11-09 at 21:59 +0200, Michael S. Tsirkin wrote:
[snip]
> +\begin_layout Enumerate
> +Reset the device.
> + This is not required on initial start up.
> +\end_layout
> +
> +\begin_layout Enumerate
> +The ACKNOWLEDGE status bit is set: we have noticed the device.
> +\end_layout
> +
> +\begin_layout Enumerate
> +The DRIVER status bit is set: we know how to drive the device.
> +\end_layout
> +
> +\begin_layout Enumerate
> +
> +\change_inserted 1986246365 1320838089
> +PCI capability list scan, detecting virtio configuration layout using Virtio
> + Structure PCI capabilities.
Does the legacy space always gets mapped from BAR0?
If yes, It'll be a bit harder deprecating it in the future.
If not, this should actually be #1. Previous 3 bullets here were already
setting the status byte in the device config.
[snip]
> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
> +\begin_inset Text
> +
> +\begin_layout Plain Layout
> +
> +\change_inserted 1986246365 1320786225
> +28 bytes
This is the new virtio header min size, shouldn't it be 32? (20 + 4
(msi-x) + 4 (guest feature) + 4 (device features)).
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 20:24 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 20:24 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, 2011-11-09 at 21:59 +0200, Michael S. Tsirkin wrote:
[snip]
> +\begin_layout Enumerate
> +Reset the device.
> + This is not required on initial start up.
> +\end_layout
> +
> +\begin_layout Enumerate
> +The ACKNOWLEDGE status bit is set: we have noticed the device.
> +\end_layout
> +
> +\begin_layout Enumerate
> +The DRIVER status bit is set: we know how to drive the device.
> +\end_layout
> +
> +\begin_layout Enumerate
> +
> +\change_inserted 1986246365 1320838089
> +PCI capability list scan, detecting virtio configuration layout using Virtio
> + Structure PCI capabilities.
Does the legacy space always gets mapped from BAR0?
If yes, It'll be a bit harder deprecating it in the future.
If not, this should actually be #1. Previous 3 bullets here were already
setting the status byte in the device config.
[snip]
> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
> +\begin_inset Text
> +
> +\begin_layout Plain Layout
> +
> +\change_inserted 1986246365 1320786225
> +28 bytes
This is the new virtio header min size, shouldn't it be 32? (20 + 4
(msi-x) + 4 (guest feature) + 4 (device features)).
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-09 20:24 ` Sasha Levin
@ 2011-11-09 20:52 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 20:52 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, avi, Amit Shah
On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> On Wed, 2011-11-09 at 21:59 +0200, Michael S. Tsirkin wrote:
>
> [snip]
>
> > +\begin_layout Enumerate
> > +Reset the device.
> > + This is not required on initial start up.
> > +\end_layout
> > +
> > +\begin_layout Enumerate
> > +The ACKNOWLEDGE status bit is set: we have noticed the device.
> > +\end_layout
> > +
> > +\begin_layout Enumerate
> > +The DRIVER status bit is set: we know how to drive the device.
> > +\end_layout
> > +
> > +\begin_layout Enumerate
> > +
> > +\change_inserted 1986246365 1320838089
> > +PCI capability list scan, detecting virtio configuration layout using Virtio
> > + Structure PCI capabilities.
>
> Does the legacy space always gets mapped from BAR0?
>
> If yes,
Yes and this is repeated in several places. Not clear? How can this
be made clearer?
> It'll be a bit harder deprecating it in the future.
Harder than ... what ?
IMO there's no way to put legacy anywhere except the first BAR
without breaking existing guests.
> If not, this should actually be #1. Previous 3 bullets here were already
> setting the status byte in the device config.
>
> [snip]
>
> > +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
> > +\begin_inset Text
> > +
> > +\begin_layout Plain Layout
> > +
> > +\change_inserted 1986246365 1320786225
> > +28 bytes
>
> This is the new virtio header min size, shouldn't it be 32? (20 + 4
> (msi-x) + 4 (guest feature) + 4 (device features)).
Good catch, I'll correct this.
> --
>
> Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 20:52 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 20:52 UTC (permalink / raw)
To: Sasha Levin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> On Wed, 2011-11-09 at 21:59 +0200, Michael S. Tsirkin wrote:
>
> [snip]
>
> > +\begin_layout Enumerate
> > +Reset the device.
> > + This is not required on initial start up.
> > +\end_layout
> > +
> > +\begin_layout Enumerate
> > +The ACKNOWLEDGE status bit is set: we have noticed the device.
> > +\end_layout
> > +
> > +\begin_layout Enumerate
> > +The DRIVER status bit is set: we know how to drive the device.
> > +\end_layout
> > +
> > +\begin_layout Enumerate
> > +
> > +\change_inserted 1986246365 1320838089
> > +PCI capability list scan, detecting virtio configuration layout using Virtio
> > + Structure PCI capabilities.
>
> Does the legacy space always gets mapped from BAR0?
>
> If yes,
Yes and this is repeated in several places. Not clear? How can this
be made clearer?
> It'll be a bit harder deprecating it in the future.
Harder than ... what ?
IMO there's no way to put legacy anywhere except the first BAR
without breaking existing guests.
> If not, this should actually be #1. Previous 3 bullets here were already
> setting the status byte in the device config.
>
> [snip]
>
> > +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
> > +\begin_inset Text
> > +
> > +\begin_layout Plain Layout
> > +
> > +\change_inserted 1986246365 1320786225
> > +28 bytes
>
> This is the new virtio header min size, shouldn't it be 32? (20 + 4
> (msi-x) + 4 (guest feature) + 4 (device features)).
Good catch, I'll correct this.
> --
>
> Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-09 20:52 ` Michael S. Tsirkin
@ 2011-11-09 20:57 ` Sasha Levin
-1 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 20:57 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, avi, Amit Shah
On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > On Wed, 2011-11-09 at 21:59 +0200, Michael S. Tsirkin wrote:
> >
> > [snip]
> >
> > > +\begin_layout Enumerate
> > > +Reset the device.
> > > + This is not required on initial start up.
> > > +\end_layout
> > > +
> > > +\begin_layout Enumerate
> > > +The ACKNOWLEDGE status bit is set: we have noticed the device.
> > > +\end_layout
> > > +
> > > +\begin_layout Enumerate
> > > +The DRIVER status bit is set: we know how to drive the device.
> > > +\end_layout
> > > +
> > > +\begin_layout Enumerate
> > > +
> > > +\change_inserted 1986246365 1320838089
> > > +PCI capability list scan, detecting virtio configuration layout using Virtio
> > > + Structure PCI capabilities.
> >
> > Does the legacy space always gets mapped from BAR0?
> >
> > If yes,
>
> Yes and this is repeated in several places. Not clear? How can this
> be made clearer?
Do you mean comments such as "For backwards compatibility, devices
should also present legacy configuration space in the first I/O region
of the PCI device"? What I understood from it is that the device should
have a legacy config in case it's used with an older guest, but I didn't
understand from it that the legacy config will be used even if new
layout is present.
> > It'll be a bit harder deprecating it in the future.
>
> Harder than ... what ?
Harder than allowing devices not to present it at all if new layout
config is used. Right now the simple implementation is to use MMIO for
config and device specific, and let it fallback to legacy for ISR and
notifications (and therefore, this is probably how everybody will
implement it), which means that when you do want to deprecate legacy,
there will be extra work to be done then, instead of doing it now.
> IMO there's no way to put legacy anywhere except the first BAR
> without breaking existing guests.
It's not about where we put legacy, it's about how easy it is to drop
legacy entirely.
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 20:57 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 20:57 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > On Wed, 2011-11-09 at 21:59 +0200, Michael S. Tsirkin wrote:
> >
> > [snip]
> >
> > > +\begin_layout Enumerate
> > > +Reset the device.
> > > + This is not required on initial start up.
> > > +\end_layout
> > > +
> > > +\begin_layout Enumerate
> > > +The ACKNOWLEDGE status bit is set: we have noticed the device.
> > > +\end_layout
> > > +
> > > +\begin_layout Enumerate
> > > +The DRIVER status bit is set: we know how to drive the device.
> > > +\end_layout
> > > +
> > > +\begin_layout Enumerate
> > > +
> > > +\change_inserted 1986246365 1320838089
> > > +PCI capability list scan, detecting virtio configuration layout using Virtio
> > > + Structure PCI capabilities.
> >
> > Does the legacy space always gets mapped from BAR0?
> >
> > If yes,
>
> Yes and this is repeated in several places. Not clear? How can this
> be made clearer?
Do you mean comments such as "For backwards compatibility, devices
should also present legacy configuration space in the first I/O region
of the PCI device"? What I understood from it is that the device should
have a legacy config in case it's used with an older guest, but I didn't
understand from it that the legacy config will be used even if new
layout is present.
> > It'll be a bit harder deprecating it in the future.
>
> Harder than ... what ?
Harder than allowing devices not to present it at all if new layout
config is used. Right now the simple implementation is to use MMIO for
config and device specific, and let it fallback to legacy for ISR and
notifications (and therefore, this is probably how everybody will
implement it), which means that when you do want to deprecate legacy,
there will be extra work to be done then, instead of doing it now.
> IMO there's no way to put legacy anywhere except the first BAR
> without breaking existing guests.
It's not about where we put legacy, it's about how easy it is to drop
legacy entirely.
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-09 20:57 ` Sasha Levin
@ 2011-11-09 21:14 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 21:14 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, avi, Amit Shah
On Wed, Nov 09, 2011 at 10:57:28PM +0200, Sasha Levin wrote:
> On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > On Wed, 2011-11-09 at 21:59 +0200, Michael S. Tsirkin wrote:
> > >
> > > [snip]
> > >
> > > > +\begin_layout Enumerate
> > > > +Reset the device.
> > > > + This is not required on initial start up.
> > > > +\end_layout
> > > > +
> > > > +\begin_layout Enumerate
> > > > +The ACKNOWLEDGE status bit is set: we have noticed the device.
> > > > +\end_layout
> > > > +
> > > > +\begin_layout Enumerate
> > > > +The DRIVER status bit is set: we know how to drive the device.
> > > > +\end_layout
> > > > +
> > > > +\begin_layout Enumerate
> > > > +
> > > > +\change_inserted 1986246365 1320838089
> > > > +PCI capability list scan, detecting virtio configuration layout using Virtio
> > > > + Structure PCI capabilities.
> > >
> > > Does the legacy space always gets mapped from BAR0?
> > >
> > > If yes,
> >
> > Yes and this is repeated in several places. Not clear? How can this
> > be made clearer?
>
> Do you mean comments such as "For backwards compatibility, devices
> should also present legacy configuration space in the first I/O region
> of the PCI device"? What I understood from it is that the device should
> have a legacy config in case it's used with an older guest, but I didn't
> understand from it that the legacy config will be used even if new
> layout is present.
Yes, this is what I meant. New guest is required to use the new space
and not the legacy one. So you dont need a legacy space for the at all.
But practically, we'll need to support old guests for a long while.
> > > It'll be a bit harder deprecating it in the future.
> >
> > Harder than ... what ?
>
> Harder than allowing devices not to present it at all if new layout
> config is used.
Yes, it's allowed if you know you have a new guest. It says
explicitly that drivers are required to use new capabilities
is they are there.
> Right now the simple implementation is to use MMIO for
> config and device specific, and let it fallback to legacy for ISR and
> notifications (and therefore, this is probably how everybody will
> implement it), which means that when you do want to deprecate legacy,
> there will be extra work to be done then, instead of doing it now.
If hypervisors don't implement the new layout then drivers will
have to keep supporting the old one. I don't think we can do
much about that.
> > IMO there's no way to put legacy anywhere except the first BAR
> > without breaking existing guests.
>
> It's not about where we put legacy, it's about how easy it is to drop
> legacy entirely.
We can only do this after all guests and hypervisors are updated. When
they are, we can drop legacy from drivers and hypervisors, and
I don't see a way to make it easier.
> --
>
> Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 21:14 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-09 21:14 UTC (permalink / raw)
To: Sasha Levin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, Nov 09, 2011 at 10:57:28PM +0200, Sasha Levin wrote:
> On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > On Wed, 2011-11-09 at 21:59 +0200, Michael S. Tsirkin wrote:
> > >
> > > [snip]
> > >
> > > > +\begin_layout Enumerate
> > > > +Reset the device.
> > > > + This is not required on initial start up.
> > > > +\end_layout
> > > > +
> > > > +\begin_layout Enumerate
> > > > +The ACKNOWLEDGE status bit is set: we have noticed the device.
> > > > +\end_layout
> > > > +
> > > > +\begin_layout Enumerate
> > > > +The DRIVER status bit is set: we know how to drive the device.
> > > > +\end_layout
> > > > +
> > > > +\begin_layout Enumerate
> > > > +
> > > > +\change_inserted 1986246365 1320838089
> > > > +PCI capability list scan, detecting virtio configuration layout using Virtio
> > > > + Structure PCI capabilities.
> > >
> > > Does the legacy space always gets mapped from BAR0?
> > >
> > > If yes,
> >
> > Yes and this is repeated in several places. Not clear? How can this
> > be made clearer?
>
> Do you mean comments such as "For backwards compatibility, devices
> should also present legacy configuration space in the first I/O region
> of the PCI device"? What I understood from it is that the device should
> have a legacy config in case it's used with an older guest, but I didn't
> understand from it that the legacy config will be used even if new
> layout is present.
Yes, this is what I meant. New guest is required to use the new space
and not the legacy one. So you dont need a legacy space for the at all.
But practically, we'll need to support old guests for a long while.
> > > It'll be a bit harder deprecating it in the future.
> >
> > Harder than ... what ?
>
> Harder than allowing devices not to present it at all if new layout
> config is used.
Yes, it's allowed if you know you have a new guest. It says
explicitly that drivers are required to use new capabilities
is they are there.
> Right now the simple implementation is to use MMIO for
> config and device specific, and let it fallback to legacy for ISR and
> notifications (and therefore, this is probably how everybody will
> implement it), which means that when you do want to deprecate legacy,
> there will be extra work to be done then, instead of doing it now.
If hypervisors don't implement the new layout then drivers will
have to keep supporting the old one. I don't think we can do
much about that.
> > IMO there's no way to put legacy anywhere except the first BAR
> > without breaking existing guests.
>
> It's not about where we put legacy, it's about how easy it is to drop
> legacy entirely.
We can only do this after all guests and hypervisors are updated. When
they are, we can drop legacy from drivers and hypervisors, and
I don't see a way to make it easier.
> --
>
> Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-09 21:14 ` Michael S. Tsirkin
@ 2011-11-09 21:13 ` Sasha Levin
-1 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 21:13 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, avi, Amit Shah
On Wed, 2011-11-09 at 23:14 +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 10:57:28PM +0200, Sasha Levin wrote:
> > On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > > On Wed, 2011-11-09 at 21:59 +0200, Michael S. Tsirkin wrote:
> > > >
> > > > [snip]
> > > >
> > > > > +\begin_layout Enumerate
> > > > > +Reset the device.
> > > > > + This is not required on initial start up.
> > > > > +\end_layout
> > > > > +
> > > > > +\begin_layout Enumerate
> > > > > +The ACKNOWLEDGE status bit is set: we have noticed the device.
> > > > > +\end_layout
> > > > > +
> > > > > +\begin_layout Enumerate
> > > > > +The DRIVER status bit is set: we know how to drive the device.
> > > > > +\end_layout
> > > > > +
> > > > > +\begin_layout Enumerate
> > > > > +
> > > > > +\change_inserted 1986246365 1320838089
> > > > > +PCI capability list scan, detecting virtio configuration layout using Virtio
> > > > > + Structure PCI capabilities.
> > > >
> > > > Does the legacy space always gets mapped from BAR0?
> > > >
> > > > If yes,
> > >
> > > Yes and this is repeated in several places. Not clear? How can this
> > > be made clearer?
> >
> > Do you mean comments such as "For backwards compatibility, devices
> > should also present legacy configuration space in the first I/O region
> > of the PCI device"? What I understood from it is that the device should
> > have a legacy config in case it's used with an older guest, but I didn't
> > understand from it that the legacy config will be used even if new
> > layout is present.
>
> Yes, this is what I meant. New guest is required to use the new space
> and not the legacy one. So you dont need a legacy space for the at all.
> But practically, we'll need to support old guests for a long while.
>
> > > > It'll be a bit harder deprecating it in the future.
> > >
> > > Harder than ... what ?
> >
> > Harder than allowing devices not to present it at all if new layout
> > config is used.
>
> Yes, it's allowed if you know you have a new guest. It says
> explicitly that drivers are required to use new capabilities
> is they are there.
>
> > Right now the simple implementation is to use MMIO for
> > config and device specific, and let it fallback to legacy for ISR and
> > notifications (and therefore, this is probably how everybody will
> > implement it), which means that when you do want to deprecate legacy,
> > there will be extra work to be done then, instead of doing it now.
>
> If hypervisors don't implement the new layout then drivers will
> have to keep supporting the old one. I don't think we can do
> much about that.
>
> > > IMO there's no way to put legacy anywhere except the first BAR
> > > without breaking existing guests.
> >
> > It's not about where we put legacy, it's about how easy it is to drop
> > legacy entirely.
>
> We can only do this after all guests and hypervisors are updated. When
> they are, we can drop legacy from drivers and hypervisors, and
> I don't see a way to make it easier.
Well, in that case, why does the PCI cap probing is #4 in the device
init list? Shouldn't we getting the layout and mapping it before we
write to the status byte?
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-09 21:13 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-09 21:13 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, 2011-11-09 at 23:14 +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 09, 2011 at 10:57:28PM +0200, Sasha Levin wrote:
> > On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > > On Wed, 2011-11-09 at 21:59 +0200, Michael S. Tsirkin wrote:
> > > >
> > > > [snip]
> > > >
> > > > > +\begin_layout Enumerate
> > > > > +Reset the device.
> > > > > + This is not required on initial start up.
> > > > > +\end_layout
> > > > > +
> > > > > +\begin_layout Enumerate
> > > > > +The ACKNOWLEDGE status bit is set: we have noticed the device.
> > > > > +\end_layout
> > > > > +
> > > > > +\begin_layout Enumerate
> > > > > +The DRIVER status bit is set: we know how to drive the device.
> > > > > +\end_layout
> > > > > +
> > > > > +\begin_layout Enumerate
> > > > > +
> > > > > +\change_inserted 1986246365 1320838089
> > > > > +PCI capability list scan, detecting virtio configuration layout using Virtio
> > > > > + Structure PCI capabilities.
> > > >
> > > > Does the legacy space always gets mapped from BAR0?
> > > >
> > > > If yes,
> > >
> > > Yes and this is repeated in several places. Not clear? How can this
> > > be made clearer?
> >
> > Do you mean comments such as "For backwards compatibility, devices
> > should also present legacy configuration space in the first I/O region
> > of the PCI device"? What I understood from it is that the device should
> > have a legacy config in case it's used with an older guest, but I didn't
> > understand from it that the legacy config will be used even if new
> > layout is present.
>
> Yes, this is what I meant. New guest is required to use the new space
> and not the legacy one. So you dont need a legacy space for the at all.
> But practically, we'll need to support old guests for a long while.
>
> > > > It'll be a bit harder deprecating it in the future.
> > >
> > > Harder than ... what ?
> >
> > Harder than allowing devices not to present it at all if new layout
> > config is used.
>
> Yes, it's allowed if you know you have a new guest. It says
> explicitly that drivers are required to use new capabilities
> is they are there.
>
> > Right now the simple implementation is to use MMIO for
> > config and device specific, and let it fallback to legacy for ISR and
> > notifications (and therefore, this is probably how everybody will
> > implement it), which means that when you do want to deprecate legacy,
> > there will be extra work to be done then, instead of doing it now.
>
> If hypervisors don't implement the new layout then drivers will
> have to keep supporting the old one. I don't think we can do
> much about that.
>
> > > IMO there's no way to put legacy anywhere except the first BAR
> > > without breaking existing guests.
> >
> > It's not about where we put legacy, it's about how easy it is to drop
> > legacy entirely.
>
> We can only do this after all guests and hypervisors are updated. When
> they are, we can drop legacy from drivers and hypervisors, and
> I don't see a way to make it easier.
Well, in that case, why does the PCI cap probing is #4 in the device
init list? Shouldn't we getting the layout and mapping it before we
write to the status byte?
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-09 21:13 ` Sasha Levin
@ 2011-11-10 8:55 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-10 8:55 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, avi, Amit Shah
On Wed, Nov 09, 2011 at 11:13:56PM +0200, Sasha Levin wrote:
> On Wed, 2011-11-09 at 23:14 +0200, Michael S. Tsirkin wrote:
> > On Wed, Nov 09, 2011 at 10:57:28PM +0200, Sasha Levin wrote:
> > > On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > > > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > > > On Wed, 2011-11-09 at 21:59 +0200, Michael S. Tsirkin wrote:
> > > > >
> > > > > [snip]
> > > > >
> > > > > > +\begin_layout Enumerate
> > > > > > +Reset the device.
> > > > > > + This is not required on initial start up.
> > > > > > +\end_layout
> > > > > > +
> > > > > > +\begin_layout Enumerate
> > > > > > +The ACKNOWLEDGE status bit is set: we have noticed the device.
> > > > > > +\end_layout
> > > > > > +
> > > > > > +\begin_layout Enumerate
> > > > > > +The DRIVER status bit is set: we know how to drive the device.
> > > > > > +\end_layout
> > > > > > +
> > > > > > +\begin_layout Enumerate
> > > > > > +
> > > > > > +\change_inserted 1986246365 1320838089
> > > > > > +PCI capability list scan, detecting virtio configuration layout using Virtio
> > > > > > + Structure PCI capabilities.
> > > > >
> > > > > Does the legacy space always gets mapped from BAR0?
> > > > >
> > > > > If yes,
> > > >
> > > > Yes and this is repeated in several places. Not clear? How can this
> > > > be made clearer?
> > >
> > > Do you mean comments such as "For backwards compatibility, devices
> > > should also present legacy configuration space in the first I/O region
> > > of the PCI device"? What I understood from it is that the device should
> > > have a legacy config in case it's used with an older guest, but I didn't
> > > understand from it that the legacy config will be used even if new
> > > layout is present.
> >
> > Yes, this is what I meant. New guest is required to use the new space
> > and not the legacy one. So you dont need a legacy space for the at all.
> > But practically, we'll need to support old guests for a long while.
> >
> > > > > It'll be a bit harder deprecating it in the future.
> > > >
> > > > Harder than ... what ?
> > >
> > > Harder than allowing devices not to present it at all if new layout
> > > config is used.
> >
> > Yes, it's allowed if you know you have a new guest. It says
> > explicitly that drivers are required to use new capabilities
> > is they are there.
> >
> > > Right now the simple implementation is to use MMIO for
> > > config and device specific, and let it fallback to legacy for ISR and
> > > notifications (and therefore, this is probably how everybody will
> > > implement it), which means that when you do want to deprecate legacy,
> > > there will be extra work to be done then, instead of doing it now.
> >
> > If hypervisors don't implement the new layout then drivers will
> > have to keep supporting the old one. I don't think we can do
> > much about that.
> >
> > > > IMO there's no way to put legacy anywhere except the first BAR
> > > > without breaking existing guests.
> > >
> > > It's not about where we put legacy, it's about how easy it is to drop
> > > legacy entirely.
> >
> > We can only do this after all guests and hypervisors are updated. When
> > they are, we can drop legacy from drivers and hypervisors, and
> > I don't see a way to make it easier.
>
> Well, in that case, why does the PCI cap probing is #4 in the device
> init list? Shouldn't we getting the layout and mapping it before we
> write to the status byte?
True, this is actually how it's done in the driver.
Good catch, I'll correct the text, thanks.
> --
>
> Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-10 8:55 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-10 8:55 UTC (permalink / raw)
To: Sasha Levin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, Nov 09, 2011 at 11:13:56PM +0200, Sasha Levin wrote:
> On Wed, 2011-11-09 at 23:14 +0200, Michael S. Tsirkin wrote:
> > On Wed, Nov 09, 2011 at 10:57:28PM +0200, Sasha Levin wrote:
> > > On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > > > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > > > On Wed, 2011-11-09 at 21:59 +0200, Michael S. Tsirkin wrote:
> > > > >
> > > > > [snip]
> > > > >
> > > > > > +\begin_layout Enumerate
> > > > > > +Reset the device.
> > > > > > + This is not required on initial start up.
> > > > > > +\end_layout
> > > > > > +
> > > > > > +\begin_layout Enumerate
> > > > > > +The ACKNOWLEDGE status bit is set: we have noticed the device.
> > > > > > +\end_layout
> > > > > > +
> > > > > > +\begin_layout Enumerate
> > > > > > +The DRIVER status bit is set: we know how to drive the device.
> > > > > > +\end_layout
> > > > > > +
> > > > > > +\begin_layout Enumerate
> > > > > > +
> > > > > > +\change_inserted 1986246365 1320838089
> > > > > > +PCI capability list scan, detecting virtio configuration layout using Virtio
> > > > > > + Structure PCI capabilities.
> > > > >
> > > > > Does the legacy space always gets mapped from BAR0?
> > > > >
> > > > > If yes,
> > > >
> > > > Yes and this is repeated in several places. Not clear? How can this
> > > > be made clearer?
> > >
> > > Do you mean comments such as "For backwards compatibility, devices
> > > should also present legacy configuration space in the first I/O region
> > > of the PCI device"? What I understood from it is that the device should
> > > have a legacy config in case it's used with an older guest, but I didn't
> > > understand from it that the legacy config will be used even if new
> > > layout is present.
> >
> > Yes, this is what I meant. New guest is required to use the new space
> > and not the legacy one. So you dont need a legacy space for the at all.
> > But practically, we'll need to support old guests for a long while.
> >
> > > > > It'll be a bit harder deprecating it in the future.
> > > >
> > > > Harder than ... what ?
> > >
> > > Harder than allowing devices not to present it at all if new layout
> > > config is used.
> >
> > Yes, it's allowed if you know you have a new guest. It says
> > explicitly that drivers are required to use new capabilities
> > is they are there.
> >
> > > Right now the simple implementation is to use MMIO for
> > > config and device specific, and let it fallback to legacy for ISR and
> > > notifications (and therefore, this is probably how everybody will
> > > implement it), which means that when you do want to deprecate legacy,
> > > there will be extra work to be done then, instead of doing it now.
> >
> > If hypervisors don't implement the new layout then drivers will
> > have to keep supporting the old one. I don't think we can do
> > much about that.
> >
> > > > IMO there's no way to put legacy anywhere except the first BAR
> > > > without breaking existing guests.
> > >
> > > It's not about where we put legacy, it's about how easy it is to drop
> > > legacy entirely.
> >
> > We can only do this after all guests and hypervisors are updated. When
> > they are, we can drop legacy from drivers and hypervisors, and
> > I don't see a way to make it easier.
>
> Well, in that case, why does the PCI cap probing is #4 in the device
> init list? Shouldn't we getting the layout and mapping it before we
> write to the status byte?
True, this is actually how it's done in the driver.
Good catch, I'll correct the text, thanks.
> --
>
> Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-09 20:57 ` Sasha Levin
(?)
(?)
@ 2011-11-11 4:24 ` Rusty Russell
2011-11-11 7:39 ` Sasha Levin
` (2 more replies)
-1 siblings, 3 replies; 134+ messages in thread
From: Rusty Russell @ 2011-11-11 4:24 UTC (permalink / raw)
To: Sasha Levin, Michael S. Tsirkin
Cc: lkml - Kernel Mailing List, Alexey Kardashevskiy, Amit Shah,
Christian Borntraeger, Krishna Kumar, Pawel Moll, Wang Sheng-Hui,
virtualization, kvm, avi, penberg
On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > It'll be a bit harder deprecating it in the future.
> >
> > Harder than ... what ?
>
> Harder than allowing devices not to present it at all if new layout
> config is used. Right now the simple implementation is to use MMIO for
> config and device specific, and let it fallback to legacy for ISR and
> notifications (and therefore, this is probably how everybody will
> implement it), which means that when you do want to deprecate legacy,
> there will be extra work to be done then, instead of doing it now.
Indeed, I'd like to see two changes to your proposal:
(1) It should be all or nothing. If a driver can find the virtio header
capability, it should only use the capabilties. Otherwise, it
should fall back to legacy. Your draft suggests a mix is possible;
I prefer a clean failure (ie. one day don't present a BAR 0 *at
all*, so ancient drivers just fail to load.).
(2) There's no huge win in keeping the same layout. Let's make some
cleanups. There are more users ahead of us then behind us (I
hope!).
But I think this is the right direction!
Thanks,
Rusty.
^ permalink raw reply [flat|nested] 134+ messages in thread* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-11 4:24 ` Rusty Russell
@ 2011-11-11 7:39 ` Sasha Levin
2011-11-11 13:03 ` Michael S. Tsirkin
2011-11-13 15:14 ` Michael S. Tsirkin
2 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-11 7:39 UTC (permalink / raw)
To: Rusty Russell
Cc: Krishna Kumar, kvm, Pawel Moll, Michael S. Tsirkin,
Alexey Kardashevskiy, Wang Sheng-Hui, lkml - Kernel Mailing List,
virtualization, penberg, Christian Borntraeger, avi, Amit Shah
On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
>> On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
>> > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
>> > > It'll be a bit harder deprecating it in the future.
>> >
>> > Harder than ... what ?
>>
>> Harder than allowing devices not to present it at all if new layout
>> config is used. Right now the simple implementation is to use MMIO for
>> config and device specific, and let it fallback to legacy for ISR and
>> notifications (and therefore, this is probably how everybody will
>> implement it), which means that when you do want to deprecate legacy,
>> there will be extra work to be done then, instead of doing it now.
>
> Indeed, I'd like to see two changes to your proposal:
>
> (1) It should be all or nothing. If a driver can find the virtio header
> capability, it should only use the capabilties. Otherwise, it
> should fall back to legacy. Your draft suggests a mix is possible;
> I prefer a clean failure (ie. one day don't present a BAR 0 *at
> all*, so ancient drivers just fail to load.).
>
> (2) There's no huge win in keeping the same layout. Let's make some
> cleanups. There are more users ahead of us then behind us (I
> hope!).
Actually, if we already do cleanups, here are two more suggestions:
1. Make 64bit features a one big 64bit block, instead of having 32bits
in one place and 32 in another.
2. Remove the reserved fields out of the config (the ones that were
caused by moving the ISR and the notifications out).
> But I think this is the right direction!
>
> Thanks,
> Rusty.
>
Also, an unrelated questions: With PIO, requests were ordered, which
means that if we wrote to the queue selector and then read from a
queue register we would read the correct queue info.
Is the same thing assured to us with MMIO? If we write to a queue
selector and immediately read from queue info would we be reading the
right info, or is there the slight chance that it would get reordered
and we would be reading queue info first and writing to the selector
later?
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-11 7:39 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-11 7:39 UTC (permalink / raw)
To: Rusty Russell
Cc: Michael S. Tsirkin, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm,
avi, penberg
On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
>> On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
>> > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
>> > > It'll be a bit harder deprecating it in the future.
>> >
>> > Harder than ... what ?
>>
>> Harder than allowing devices not to present it at all if new layout
>> config is used. Right now the simple implementation is to use MMIO for
>> config and device specific, and let it fallback to legacy for ISR and
>> notifications (and therefore, this is probably how everybody will
>> implement it), which means that when you do want to deprecate legacy,
>> there will be extra work to be done then, instead of doing it now.
>
> Indeed, I'd like to see two changes to your proposal:
>
> (1) It should be all or nothing. If a driver can find the virtio header
> capability, it should only use the capabilties. Otherwise, it
> should fall back to legacy. Your draft suggests a mix is possible;
> I prefer a clean failure (ie. one day don't present a BAR 0 *at
> all*, so ancient drivers just fail to load.).
>
> (2) There's no huge win in keeping the same layout. Let's make some
> cleanups. There are more users ahead of us then behind us (I
> hope!).
Actually, if we already do cleanups, here are two more suggestions:
1. Make 64bit features a one big 64bit block, instead of having 32bits
in one place and 32 in another.
2. Remove the reserved fields out of the config (the ones that were
caused by moving the ISR and the notifications out).
> But I think this is the right direction!
>
> Thanks,
> Rusty.
>
Also, an unrelated questions: With PIO, requests were ordered, which
means that if we wrote to the queue selector and then read from a
queue register we would read the correct queue info.
Is the same thing assured to us with MMIO? If we write to a queue
selector and immediately read from queue info would we be reading the
right info, or is there the slight chance that it would get reordered
and we would be reading queue info first and writing to the selector
later?
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-11 7:39 ` Sasha Levin
@ 2011-11-11 12:59 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-11 12:59 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, avi, Amit Shah
On Fri, Nov 11, 2011 at 09:39:13AM +0200, Sasha Levin wrote:
> On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> > On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> >> On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> >> > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> >> > > It'll be a bit harder deprecating it in the future.
> >> >
> >> > Harder than ... what ?
> >>
> >> Harder than allowing devices not to present it at all if new layout
> >> config is used. Right now the simple implementation is to use MMIO for
> >> config and device specific, and let it fallback to legacy for ISR and
> >> notifications (and therefore, this is probably how everybody will
> >> implement it), which means that when you do want to deprecate legacy,
> >> there will be extra work to be done then, instead of doing it now.
> >
> > Indeed, I'd like to see two changes to your proposal:
> >
> > (1) It should be all or nothing. If a driver can find the virtio header
> > capability, it should only use the capabilties. Otherwise, it
> > should fall back to legacy. Your draft suggests a mix is possible;
> > I prefer a clean failure (ie. one day don't present a BAR 0 *at
> > all*, so ancient drivers just fail to load.).
> >
> > (2) There's no huge win in keeping the same layout. Let's make some
> > cleanups. There are more users ahead of us then behind us (I
> > hope!).
>
> Actually, if we already do cleanups, here are two more suggestions:
>
> 1. Make 64bit features a one big 64bit block, instead of having 32bits
> in one place and 32 in another.
> 2. Remove the reserved fields out of the config (the ones that were
> caused by moving the ISR and the notifications out).
>
> > But I think this is the right direction!
> >
> > Thanks,
> > Rusty.
> >
>
> Also, an unrelated questions: With PIO, requests were ordered, which
> means that if we wrote to the queue selector and then read from a
> queue register we would read the correct queue info.
> Is the same thing assured to us with MMIO?
For real PCI, reads do not bypass writes in PCI. However this
is only true if both are MMIO or both PIO reads.
I don't think the ordering of MMIO versus PIO is guaranteed.
On KVM, the kernel doesn't do anything to guarantee ordering.
So you get the natural ordering of the CPU.
> If we write to a queue
> selector and immediately read from queue info would we be reading the
> right info, or is there the slight chance that it would get reordered
> and we would be reading queue info first and writing to the selector
> later?
The thing to realize is that write to queue selector with KVM is in the
end performed by host. And reading queue info means that host will be
reading the queue selector. So this is a write followed by read
from the same address. AFAIK no CPUs can reorder such accesses,
so you get the right info.
--
MST
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-11 12:59 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-11 12:59 UTC (permalink / raw)
To: Sasha Levin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Fri, Nov 11, 2011 at 09:39:13AM +0200, Sasha Levin wrote:
> On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> > On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> >> On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> >> > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> >> > > It'll be a bit harder deprecating it in the future.
> >> >
> >> > Harder than ... what ?
> >>
> >> Harder than allowing devices not to present it at all if new layout
> >> config is used. Right now the simple implementation is to use MMIO for
> >> config and device specific, and let it fallback to legacy for ISR and
> >> notifications (and therefore, this is probably how everybody will
> >> implement it), which means that when you do want to deprecate legacy,
> >> there will be extra work to be done then, instead of doing it now.
> >
> > Indeed, I'd like to see two changes to your proposal:
> >
> > (1) It should be all or nothing. If a driver can find the virtio header
> > capability, it should only use the capabilties. Otherwise, it
> > should fall back to legacy. Your draft suggests a mix is possible;
> > I prefer a clean failure (ie. one day don't present a BAR 0 *at
> > all*, so ancient drivers just fail to load.).
> >
> > (2) There's no huge win in keeping the same layout. Let's make some
> > cleanups. There are more users ahead of us then behind us (I
> > hope!).
>
> Actually, if we already do cleanups, here are two more suggestions:
>
> 1. Make 64bit features a one big 64bit block, instead of having 32bits
> in one place and 32 in another.
> 2. Remove the reserved fields out of the config (the ones that were
> caused by moving the ISR and the notifications out).
>
> > But I think this is the right direction!
> >
> > Thanks,
> > Rusty.
> >
>
> Also, an unrelated questions: With PIO, requests were ordered, which
> means that if we wrote to the queue selector and then read from a
> queue register we would read the correct queue info.
> Is the same thing assured to us with MMIO?
For real PCI, reads do not bypass writes in PCI. However this
is only true if both are MMIO or both PIO reads.
I don't think the ordering of MMIO versus PIO is guaranteed.
On KVM, the kernel doesn't do anything to guarantee ordering.
So you get the natural ordering of the CPU.
> If we write to a queue
> selector and immediately read from queue info would we be reading the
> right info, or is there the slight chance that it would get reordered
> and we would be reading queue info first and writing to the selector
> later?
The thing to realize is that write to queue selector with KVM is in the
end performed by host. And reading queue info means that host will be
reading the queue selector. So this is a write followed by read
from the same address. AFAIK no CPUs can reorder such accesses,
so you get the right info.
--
MST
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-11 12:59 ` Michael S. Tsirkin
(?)
@ 2011-11-11 13:06 ` Pawel Moll
-1 siblings, 0 replies; 134+ messages in thread
From: Pawel Moll @ 2011-11-11 13:06 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm@vger.kernel.org, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List,
virtualization@lists.linux-foundation.org, penberg@kernel.org,
Christian Borntraeger, Sasha Levin, Amit Shah, avi@redhat.com
> > Also, an unrelated questions: With PIO, requests were ordered, which
> > means that if we wrote to the queue selector and then read from a
> > queue register we would read the correct queue info.
> > Is the same thing assured to us with MMIO?
>
> For real PCI, reads do not bypass writes in PCI. However this
> is only true if both are MMIO or both PIO reads.
> I don't think the ordering of MMIO versus PIO is guaranteed.
>
> On KVM, the kernel doesn't do anything to guarantee ordering.
> So you get the natural ordering of the CPU.
>
> > If we write to a queue
> > selector and immediately read from queue info would we be reading the
> > right info, or is there the slight chance that it would get reordered
> > and we would be reading queue info first and writing to the selector
> > later?
>
> The thing to realize is that write to queue selector with KVM is in the
> end performed by host. And reading queue info means that host will be
> reading the queue selector. So this is a write followed by read
> from the same address. AFAIK no CPUs can reorder such accesses,
> so you get the right info.
(As far as I understand all the complexity ;-) Memory mapped using
ioremap()-like functions should preserve access order. In case of ARM
architecture such memory region is defined (at the page tables level) as
a "device memory" (contrary to "normal memory") and the processor will
not try to be clever about it. I know next-to-nothing about x86, but I
suppose similar idea applies.
Cheers!
Paweł
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-11 12:59 ` Michael S. Tsirkin
(?)
(?)
@ 2011-11-11 13:06 ` Pawel Moll
-1 siblings, 0 replies; 134+ messages in thread
From: Pawel Moll @ 2011-11-11 13:06 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Sasha Levin, Rusty Russell, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Wang Sheng-Hui,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
avi@redhat.com, penberg@kernel.org
> > Also, an unrelated questions: With PIO, requests were ordered, which
> > means that if we wrote to the queue selector and then read from a
> > queue register we would read the correct queue info.
> > Is the same thing assured to us with MMIO?
>
> For real PCI, reads do not bypass writes in PCI. However this
> is only true if both are MMIO or both PIO reads.
> I don't think the ordering of MMIO versus PIO is guaranteed.
>
> On KVM, the kernel doesn't do anything to guarantee ordering.
> So you get the natural ordering of the CPU.
>
> > If we write to a queue
> > selector and immediately read from queue info would we be reading the
> > right info, or is there the slight chance that it would get reordered
> > and we would be reading queue info first and writing to the selector
> > later?
>
> The thing to realize is that write to queue selector with KVM is in the
> end performed by host. And reading queue info means that host will be
> reading the queue selector. So this is a write followed by read
> from the same address. AFAIK no CPUs can reorder such accesses,
> so you get the right info.
(As far as I understand all the complexity ;-) Memory mapped using
ioremap()-like functions should preserve access order. In case of ARM
architecture such memory region is defined (at the page tables level) as
a "device memory" (contrary to "normal memory") and the processor will
not try to be clever about it. I know next-to-nothing about x86, but I
suppose similar idea applies.
Cheers!
Paweł
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-11 7:39 ` Sasha Levin
@ 2011-11-15 23:58 ` Rusty Russell
-1 siblings, 0 replies; 134+ messages in thread
From: Rusty Russell @ 2011-11-15 23:58 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, kvm, Pawel Moll, Michael S. Tsirkin,
Alexey Kardashevskiy, Wang Sheng-Hui, lkml - Kernel Mailing List,
virtualization, penberg, Christian Borntraeger, avi, Amit Shah
On Fri, 11 Nov 2011 09:39:13 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> > (2) There's no huge win in keeping the same layout. Let's make some
> > cleanups. There are more users ahead of us then behind us (I
> > hope!).
>
> Actually, if we already do cleanups, here are two more suggestions:
>
> 1. Make 64bit features a one big 64bit block, instead of having 32bits
> in one place and 32 in another.
> 2. Remove the reserved fields out of the config (the ones that were
> caused by moving the ISR and the notifications out).
Yes, those were exactly what I was thinking. I left it vague because
there might be others you can see if we're prepared to abandon the
current format.
Cheers,
Rusty.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-15 23:58 ` Rusty Russell
0 siblings, 0 replies; 134+ messages in thread
From: Rusty Russell @ 2011-11-15 23:58 UTC (permalink / raw)
To: Sasha Levin
Cc: Michael S. Tsirkin, lkml - Kernel Mailing List,
Alexey Kardashevskiy, Amit Shah, Christian Borntraeger,
Krishna Kumar, Pawel Moll, Wang Sheng-Hui, virtualization, kvm,
avi, penberg
On Fri, 11 Nov 2011 09:39:13 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> > (2) There's no huge win in keeping the same layout. Let's make some
> > cleanups. There are more users ahead of us then behind us (I
> > hope!).
>
> Actually, if we already do cleanups, here are two more suggestions:
>
> 1. Make 64bit features a one big 64bit block, instead of having 32bits
> in one place and 32 in another.
> 2. Remove the reserved fields out of the config (the ones that were
> caused by moving the ISR and the notifications out).
Yes, those were exactly what I was thinking. I left it vague because
there might be others you can see if we're prepared to abandon the
current format.
Cheers,
Rusty.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-15 23:58 ` Rusty Russell
@ 2011-11-16 7:21 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-16 7:21 UTC (permalink / raw)
To: Rusty Russell
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, Sasha Levin, Amit Shah, avi
On Wed, Nov 16, 2011 at 10:28:52AM +1030, Rusty Russell wrote:
> On Fri, 11 Nov 2011 09:39:13 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> > On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> > > (2) There's no huge win in keeping the same layout. Let's make some
> > > cleanups. There are more users ahead of us then behind us (I
> > > hope!).
> >
> > Actually, if we already do cleanups, here are two more suggestions:
> >
> > 1. Make 64bit features a one big 64bit block, instead of having 32bits
> > in one place and 32 in another.
> > 2. Remove the reserved fields out of the config (the ones that were
> > caused by moving the ISR and the notifications out).
>
> Yes, those were exactly what I was thinking. I left it vague because
> there might be others you can see if we're prepared to abandon the
> current format.
>
> Cheers,
> Rusty.
Yes but driver code doesn't get any cleaner by moving the fields.
And in fact, the legacy support makes the code messier.
What are the advantages?
--
MST
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-16 7:21 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-16 7:21 UTC (permalink / raw)
To: Rusty Russell
Cc: Sasha Levin, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, Nov 16, 2011 at 10:28:52AM +1030, Rusty Russell wrote:
> On Fri, 11 Nov 2011 09:39:13 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> > On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> > > (2) There's no huge win in keeping the same layout. Let's make some
> > > cleanups. There are more users ahead of us then behind us (I
> > > hope!).
> >
> > Actually, if we already do cleanups, here are two more suggestions:
> >
> > 1. Make 64bit features a one big 64bit block, instead of having 32bits
> > in one place and 32 in another.
> > 2. Remove the reserved fields out of the config (the ones that were
> > caused by moving the ISR and the notifications out).
>
> Yes, those were exactly what I was thinking. I left it vague because
> there might be others you can see if we're prepared to abandon the
> current format.
>
> Cheers,
> Rusty.
Yes but driver code doesn't get any cleaner by moving the fields.
And in fact, the legacy support makes the code messier.
What are the advantages?
--
MST
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-16 7:21 ` Michael S. Tsirkin
@ 2011-11-16 8:17 ` Sasha Levin
-1 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-16 8:17 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, avi, Amit Shah
On Wed, 2011-11-16 at 09:21 +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 16, 2011 at 10:28:52AM +1030, Rusty Russell wrote:
> > On Fri, 11 Nov 2011 09:39:13 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> > > On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> > > > (2) There's no huge win in keeping the same layout. Let's make some
> > > > cleanups. There are more users ahead of us then behind us (I
> > > > hope!).
> > >
> > > Actually, if we already do cleanups, here are two more suggestions:
> > >
> > > 1. Make 64bit features a one big 64bit block, instead of having 32bits
> > > in one place and 32 in another.
> > > 2. Remove the reserved fields out of the config (the ones that were
> > > caused by moving the ISR and the notifications out).
> >
> > Yes, those were exactly what I was thinking. I left it vague because
> > there might be others you can see if we're prepared to abandon the
> > current format.
> >
> > Cheers,
> > Rusty.
>
> Yes but driver code doesn't get any cleaner by moving the fields.
> And in fact, the legacy support makes the code messier.
> What are the advantages?
>
What about splitting the parts which handle legacy code and new code?
It'll make it easier playing with the new spec more freely and will also
make it easier removing legacy code in the future since you'll need to
simply delete a chunk of code instead of removing legacy bits out of
working code with a surgical knife.
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-16 8:17 ` Sasha Levin
0 siblings, 0 replies; 134+ messages in thread
From: Sasha Levin @ 2011-11-16 8:17 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, 2011-11-16 at 09:21 +0200, Michael S. Tsirkin wrote:
> On Wed, Nov 16, 2011 at 10:28:52AM +1030, Rusty Russell wrote:
> > On Fri, 11 Nov 2011 09:39:13 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> > > On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> > > > (2) There's no huge win in keeping the same layout. Let's make some
> > > > cleanups. There are more users ahead of us then behind us (I
> > > > hope!).
> > >
> > > Actually, if we already do cleanups, here are two more suggestions:
> > >
> > > 1. Make 64bit features a one big 64bit block, instead of having 32bits
> > > in one place and 32 in another.
> > > 2. Remove the reserved fields out of the config (the ones that were
> > > caused by moving the ISR and the notifications out).
> >
> > Yes, those were exactly what I was thinking. I left it vague because
> > there might be others you can see if we're prepared to abandon the
> > current format.
> >
> > Cheers,
> > Rusty.
>
> Yes but driver code doesn't get any cleaner by moving the fields.
> And in fact, the legacy support makes the code messier.
> What are the advantages?
>
What about splitting the parts which handle legacy code and new code?
It'll make it easier playing with the new spec more freely and will also
make it easier removing legacy code in the future since you'll need to
simply delete a chunk of code instead of removing legacy bits out of
working code with a surgical knife.
--
Sasha.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-16 8:17 ` Sasha Levin
@ 2011-11-16 9:09 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-16 9:09 UTC (permalink / raw)
To: Sasha Levin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, avi, Amit Shah
On Wed, Nov 16, 2011 at 10:17:39AM +0200, Sasha Levin wrote:
> On Wed, 2011-11-16 at 09:21 +0200, Michael S. Tsirkin wrote:
> > On Wed, Nov 16, 2011 at 10:28:52AM +1030, Rusty Russell wrote:
> > > On Fri, 11 Nov 2011 09:39:13 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> > > > On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> > > > > (2) There's no huge win in keeping the same layout. Let's make some
> > > > > cleanups. There are more users ahead of us then behind us (I
> > > > > hope!).
> > > >
> > > > Actually, if we already do cleanups, here are two more suggestions:
> > > >
> > > > 1. Make 64bit features a one big 64bit block, instead of having 32bits
> > > > in one place and 32 in another.
> > > > 2. Remove the reserved fields out of the config (the ones that were
> > > > caused by moving the ISR and the notifications out).
> > >
> > > Yes, those were exactly what I was thinking. I left it vague because
> > > there might be others you can see if we're prepared to abandon the
> > > current format.
> > >
> > > Cheers,
> > > Rusty.
> >
> > Yes but driver code doesn't get any cleaner by moving the fields.
> > And in fact, the legacy support makes the code messier.
> > What are the advantages?
> >
The advantages question is what should really balance out the overhead.
> What about splitting the parts which handle legacy code and new code?
Well, I considered that. Something along the lines of
#define VIRTIO_NEW_MSI_CONFIG_VECTOR 18
And so on for all registers.
This seems to add a significant maintainance burden because of code
duplication. Note that, for example, vector programming is affected.
Multiply that by the number of guest OSes.
> It'll make it easier playing with the new spec more freely
I'm really worried about maintaing drivers long term.
Ease of experimentation is secondary for me.
> and will also
> make it easier removing legacy code in the future since you'll need to
> simply delete a chunk of code instead of removing legacy bits out of
> working code with a surgical knife.
It's unlikely to be a single chunk: we'd have structures and macros
which are separate. So at least 3 chunks.
Just for fun, here's what's involved in removing legacy map
support on top of my patch. As you see there are 4 chunks:
structure decl, map, unmap, and msix enable/disable.
And finding them was as simple as looking for legacy_map.
---
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index d242fcc..6c4d2faf 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -64,9 +64,6 @@ struct virtio_pci_device
/* Various IO mappings: used for resource tracking only. */
- /* Legacy BAR0: typically PIO. */
- void __iomem *legacy_map;
-
/* Mappings specified by device capabilities: typically in MMIO */
void __iomem *isr_map;
void __iomem *notify_map;
@@ -81,11 +78,7 @@ struct virtio_pci_device
static void virtio_pci_set_msix_enabled(struct virtio_pci_device *vp_dev, int enabled)
{
vp_dev->msix_enabled = enabled;
- if (vp_dev->device_map)
- vp_dev->ioaddr_device = vp_dev->device_map;
- else
- vp_dev->ioaddr_device = vp_dev->legacy_map +
- VIRTIO_PCI_CONFIG(vp_dev);
+ vp_dev->ioaddr_device = vp_dev->device_map;
}
static void __iomem *virtio_pci_map_cfg(struct virtio_pci_device *vp_dev, u8 cap_id,
@@ -147,8 +140,6 @@ err:
static void virtio_pci_iounmap(struct virtio_pci_device *vp_dev)
{
- if (vp_dev->legacy_map)
- pci_iounmap(vp_dev->pci_dev, vp_dev->legacy_map);
if (vp_dev->isr_map)
pci_iounmap(vp_dev->pci_dev, vp_dev->isr_map);
if (vp_dev->notify_map)
@@ -176,36 +167,15 @@ static int virtio_pci_iomap(struct virtio_pci_device *vp_dev)
if (!vp_dev->notify_map || !vp_dev->common_map ||
!vp_dev->device_map) {
- /*
- * If not all capabilities present, map legacy PIO.
- * Legacy access is at BAR 0. We never need to map
- * more than 256 bytes there, since legacy config space
- * used PIO which has this size limit.
- * */
- vp_dev->legacy_map = pci_iomap(vp_dev->pci_dev, 0, 256);
- if (!vp_dev->legacy_map) {
- dev_err(&vp_dev->vdev.dev, "Unable to map legacy PIO");
- goto err;
- }
+ dev_err(&vp_dev->vdev.dev, "Unable to map IO");
+ goto err;
}
- /* Prefer MMIO if available. If not, fallback to legacy PIO. */
- if (vp_dev->common_map)
- vp_dev->ioaddr = vp_dev->common_map;
- else
- vp_dev->ioaddr = vp_dev->legacy_map;
+ vp_dev->ioaddr = vp_dev->common_map;
- if (vp_dev->device_map)
- vp_dev->ioaddr_device = vp_dev->device_map;
- else
- vp_dev->ioaddr_device = vp_dev->legacy_map +
- VIRTIO_PCI_CONFIG(vp_dev);
+ vp_dev->ioaddr_device = vp_dev->device_map;
- if (vp_dev->notify_map)
- vp_dev->ioaddr_notify = vp_dev->notify_map;
- else
- vp_dev->ioaddr_notify = vp_dev->legacy_map +
- VIRTIO_PCI_QUEUE_NOTIFY;
+ vp_dev->ioaddr_notify = vp_dev->notify_map;
return 0;
err:
^ permalink raw reply related [flat|nested] 134+ messages in thread* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-16 9:09 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-16 9:09 UTC (permalink / raw)
To: Sasha Levin
Cc: Rusty Russell, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, Nov 16, 2011 at 10:17:39AM +0200, Sasha Levin wrote:
> On Wed, 2011-11-16 at 09:21 +0200, Michael S. Tsirkin wrote:
> > On Wed, Nov 16, 2011 at 10:28:52AM +1030, Rusty Russell wrote:
> > > On Fri, 11 Nov 2011 09:39:13 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> > > > On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> > > > > (2) There's no huge win in keeping the same layout. Let's make some
> > > > > cleanups. There are more users ahead of us then behind us (I
> > > > > hope!).
> > > >
> > > > Actually, if we already do cleanups, here are two more suggestions:
> > > >
> > > > 1. Make 64bit features a one big 64bit block, instead of having 32bits
> > > > in one place and 32 in another.
> > > > 2. Remove the reserved fields out of the config (the ones that were
> > > > caused by moving the ISR and the notifications out).
> > >
> > > Yes, those were exactly what I was thinking. I left it vague because
> > > there might be others you can see if we're prepared to abandon the
> > > current format.
> > >
> > > Cheers,
> > > Rusty.
> >
> > Yes but driver code doesn't get any cleaner by moving the fields.
> > And in fact, the legacy support makes the code messier.
> > What are the advantages?
> >
The advantages question is what should really balance out the overhead.
> What about splitting the parts which handle legacy code and new code?
Well, I considered that. Something along the lines of
#define VIRTIO_NEW_MSI_CONFIG_VECTOR 18
And so on for all registers.
This seems to add a significant maintainance burden because of code
duplication. Note that, for example, vector programming is affected.
Multiply that by the number of guest OSes.
> It'll make it easier playing with the new spec more freely
I'm really worried about maintaing drivers long term.
Ease of experimentation is secondary for me.
> and will also
> make it easier removing legacy code in the future since you'll need to
> simply delete a chunk of code instead of removing legacy bits out of
> working code with a surgical knife.
It's unlikely to be a single chunk: we'd have structures and macros
which are separate. So at least 3 chunks.
Just for fun, here's what's involved in removing legacy map
support on top of my patch. As you see there are 4 chunks:
structure decl, map, unmap, and msix enable/disable.
And finding them was as simple as looking for legacy_map.
---
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index d242fcc..6c4d2faf 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -64,9 +64,6 @@ struct virtio_pci_device
/* Various IO mappings: used for resource tracking only. */
- /* Legacy BAR0: typically PIO. */
- void __iomem *legacy_map;
-
/* Mappings specified by device capabilities: typically in MMIO */
void __iomem *isr_map;
void __iomem *notify_map;
@@ -81,11 +78,7 @@ struct virtio_pci_device
static void virtio_pci_set_msix_enabled(struct virtio_pci_device *vp_dev, int enabled)
{
vp_dev->msix_enabled = enabled;
- if (vp_dev->device_map)
- vp_dev->ioaddr_device = vp_dev->device_map;
- else
- vp_dev->ioaddr_device = vp_dev->legacy_map +
- VIRTIO_PCI_CONFIG(vp_dev);
+ vp_dev->ioaddr_device = vp_dev->device_map;
}
static void __iomem *virtio_pci_map_cfg(struct virtio_pci_device *vp_dev, u8 cap_id,
@@ -147,8 +140,6 @@ err:
static void virtio_pci_iounmap(struct virtio_pci_device *vp_dev)
{
- if (vp_dev->legacy_map)
- pci_iounmap(vp_dev->pci_dev, vp_dev->legacy_map);
if (vp_dev->isr_map)
pci_iounmap(vp_dev->pci_dev, vp_dev->isr_map);
if (vp_dev->notify_map)
@@ -176,36 +167,15 @@ static int virtio_pci_iomap(struct virtio_pci_device *vp_dev)
if (!vp_dev->notify_map || !vp_dev->common_map ||
!vp_dev->device_map) {
- /*
- * If not all capabilities present, map legacy PIO.
- * Legacy access is at BAR 0. We never need to map
- * more than 256 bytes there, since legacy config space
- * used PIO which has this size limit.
- * */
- vp_dev->legacy_map = pci_iomap(vp_dev->pci_dev, 0, 256);
- if (!vp_dev->legacy_map) {
- dev_err(&vp_dev->vdev.dev, "Unable to map legacy PIO");
- goto err;
- }
+ dev_err(&vp_dev->vdev.dev, "Unable to map IO");
+ goto err;
}
- /* Prefer MMIO if available. If not, fallback to legacy PIO. */
- if (vp_dev->common_map)
- vp_dev->ioaddr = vp_dev->common_map;
- else
- vp_dev->ioaddr = vp_dev->legacy_map;
+ vp_dev->ioaddr = vp_dev->common_map;
- if (vp_dev->device_map)
- vp_dev->ioaddr_device = vp_dev->device_map;
- else
- vp_dev->ioaddr_device = vp_dev->legacy_map +
- VIRTIO_PCI_CONFIG(vp_dev);
+ vp_dev->ioaddr_device = vp_dev->device_map;
- if (vp_dev->notify_map)
- vp_dev->ioaddr_notify = vp_dev->notify_map;
- else
- vp_dev->ioaddr_notify = vp_dev->legacy_map +
- VIRTIO_PCI_QUEUE_NOTIFY;
+ vp_dev->ioaddr_notify = vp_dev->notify_map;
return 0;
err:
^ permalink raw reply related [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-11 4:24 ` Rusty Russell
@ 2011-11-11 13:03 ` Michael S. Tsirkin
2011-11-11 13:03 ` Michael S. Tsirkin
2011-11-13 15:14 ` Michael S. Tsirkin
2 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-11 13:03 UTC (permalink / raw)
To: Rusty Russell
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, Sasha Levin, Amit Shah, avi
On Fri, Nov 11, 2011 at 02:54:31PM +1030, Rusty Russell wrote:
> On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> > On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > > It'll be a bit harder deprecating it in the future.
> > >
> > > Harder than ... what ?
> >
> > Harder than allowing devices not to present it at all if new layout
> > config is used. Right now the simple implementation is to use MMIO for
> > config and device specific, and let it fallback to legacy for ISR and
> > notifications (and therefore, this is probably how everybody will
> > implement it), which means that when you do want to deprecate legacy,
> > there will be extra work to be done then, instead of doing it now.
>
> Indeed, I'd like to see two changes to your proposal:
>
> (1) It should be all or nothing. If a driver can find the virtio header
> capability, it should only use the capabilties. Otherwise, it
> should fall back to legacy. Your draft suggests a mix is possible;
> I prefer a clean failure (ie. one day don't present a BAR 0 *at
> all*, so ancient drivers just fail to load.).
> (2) There's no huge win in keeping the same layout. Let's make some
> cleanups. There are more users ahead of us then behind us (I
> hope!).
> But I think this is the right direction!
>
> Thanks,
> Rusty.
I'll do these changes, thanks!
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-11 13:03 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-11 13:03 UTC (permalink / raw)
To: Rusty Russell
Cc: Sasha Levin, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Fri, Nov 11, 2011 at 02:54:31PM +1030, Rusty Russell wrote:
> On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> > On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > > It'll be a bit harder deprecating it in the future.
> > >
> > > Harder than ... what ?
> >
> > Harder than allowing devices not to present it at all if new layout
> > config is used. Right now the simple implementation is to use MMIO for
> > config and device specific, and let it fallback to legacy for ISR and
> > notifications (and therefore, this is probably how everybody will
> > implement it), which means that when you do want to deprecate legacy,
> > there will be extra work to be done then, instead of doing it now.
>
> Indeed, I'd like to see two changes to your proposal:
>
> (1) It should be all or nothing. If a driver can find the virtio header
> capability, it should only use the capabilties. Otherwise, it
> should fall back to legacy. Your draft suggests a mix is possible;
> I prefer a clean failure (ie. one day don't present a BAR 0 *at
> all*, so ancient drivers just fail to load.).
> (2) There's no huge win in keeping the same layout. Let's make some
> cleanups. There are more users ahead of us then behind us (I
> hope!).
> But I think this is the right direction!
>
> Thanks,
> Rusty.
I'll do these changes, thanks!
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-11 4:24 ` Rusty Russell
@ 2011-11-13 15:14 ` Michael S. Tsirkin
2011-11-11 13:03 ` Michael S. Tsirkin
2011-11-13 15:14 ` Michael S. Tsirkin
2 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-13 15:14 UTC (permalink / raw)
To: Rusty Russell
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, Sasha Levin, Amit Shah, avi
On Fri, Nov 11, 2011 at 02:54:31PM +1030, Rusty Russell wrote:
> On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> > On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > > It'll be a bit harder deprecating it in the future.
> > >
> > > Harder than ... what ?
> >
> > Harder than allowing devices not to present it at all if new layout
> > config is used. Right now the simple implementation is to use MMIO for
> > config and device specific, and let it fallback to legacy for ISR and
> > notifications (and therefore, this is probably how everybody will
> > implement it), which means that when you do want to deprecate legacy,
> > there will be extra work to be done then, instead of doing it now.
>
> Indeed, I'd like to see two changes to your proposal:
>
> (1) It should be all or nothing. If a driver can find the virtio header
> capability, it should only use the capabilties. Otherwise, it
> should fall back to legacy.
Okay, but going forward, if we add more capabilities, we probably won't
want to require them and fail to load if not there. That's really why I
wanted to make the failover ignore any capability separately - to make
this future proof. I'm not terribly fixated on this, it just seemed a
bit more symmetrical to treat all capabilities in the same way. Hmm?
> Your draft suggests a mix is possible;
> I prefer a clean failure (ie. one day don't present a BAR 0 *at
> all*, so ancient drivers just fail to load.).
Just to clarify, as written in draft this is possible with the current
spec proposal. So I'm guessing there's some other motivation that you
had in mind?
> (2) There's no huge win in keeping the same layout. Let's make some
> cleanups.
About this last point - what cleanups do you have in mind? Just move
some registers around? I guess we could put feature bits near each
other, and move device status towards the end to avoid wasting 3 bytes.
The win seems minimal, but the change does make legacy hypervisor
support in guests more cumbersome, as we need to spread coditional code
around instead of localizing it in the initialization path.
> There are more users ahead of us then behind us (I
> hope!).
In that case isn't it safe to assume we'll find some uses
for the reserved registers?
> But I think this is the right direction!
>
> Thanks,
> Rusty.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-13 15:14 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-13 15:14 UTC (permalink / raw)
To: Rusty Russell
Cc: Sasha Levin, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Fri, Nov 11, 2011 at 02:54:31PM +1030, Rusty Russell wrote:
> On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> > On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > > It'll be a bit harder deprecating it in the future.
> > >
> > > Harder than ... what ?
> >
> > Harder than allowing devices not to present it at all if new layout
> > config is used. Right now the simple implementation is to use MMIO for
> > config and device specific, and let it fallback to legacy for ISR and
> > notifications (and therefore, this is probably how everybody will
> > implement it), which means that when you do want to deprecate legacy,
> > there will be extra work to be done then, instead of doing it now.
>
> Indeed, I'd like to see two changes to your proposal:
>
> (1) It should be all or nothing. If a driver can find the virtio header
> capability, it should only use the capabilties. Otherwise, it
> should fall back to legacy.
Okay, but going forward, if we add more capabilities, we probably won't
want to require them and fail to load if not there. That's really why I
wanted to make the failover ignore any capability separately - to make
this future proof. I'm not terribly fixated on this, it just seemed a
bit more symmetrical to treat all capabilities in the same way. Hmm?
> Your draft suggests a mix is possible;
> I prefer a clean failure (ie. one day don't present a BAR 0 *at
> all*, so ancient drivers just fail to load.).
Just to clarify, as written in draft this is possible with the current
spec proposal. So I'm guessing there's some other motivation that you
had in mind?
> (2) There's no huge win in keeping the same layout. Let's make some
> cleanups.
About this last point - what cleanups do you have in mind? Just move
some registers around? I guess we could put feature bits near each
other, and move device status towards the end to avoid wasting 3 bytes.
The win seems minimal, but the change does make legacy hypervisor
support in guests more cumbersome, as we need to spread coditional code
around instead of localizing it in the initialization path.
> There are more users ahead of us then behind us (I
> hope!).
In that case isn't it safe to assume we'll find some uses
for the reserved registers?
> But I think this is the right direction!
>
> Thanks,
> Rusty.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-13 15:14 ` Michael S. Tsirkin
@ 2011-11-14 6:59 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-14 6:59 UTC (permalink / raw)
To: Rusty Russell
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, Sasha Levin, Amit Shah, avi
On Sun, Nov 13, 2011 at 05:14:27PM +0200, Michael S. Tsirkin wrote:
> On Fri, Nov 11, 2011 at 02:54:31PM +1030, Rusty Russell wrote:
> > On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> > > On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > > > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > > > It'll be a bit harder deprecating it in the future.
> > > >
> > > > Harder than ... what ?
> > >
> > > Harder than allowing devices not to present it at all if new layout
> > > config is used. Right now the simple implementation is to use MMIO for
> > > config and device specific, and let it fallback to legacy for ISR and
> > > notifications (and therefore, this is probably how everybody will
> > > implement it), which means that when you do want to deprecate legacy,
> > > there will be extra work to be done then, instead of doing it now.
> >
> > Indeed, I'd like to see two changes to your proposal:
> >
> > (1) It should be all or nothing. If a driver can find the virtio header
> > capability, it should only use the capabilties. Otherwise, it
> > should fall back to legacy.
>
> Okay, but going forward, if we add more capabilities, we probably won't
> want to require them and fail to load if not there. That's really why I
> wanted to make the failover ignore any capability separately - to make
> this future proof. I'm not terribly fixated on this, it just seemed a
> bit more symmetrical to treat all capabilities in the same way. Hmm?
>
> > Your draft suggests a mix is possible;
> > I prefer a clean failure (ie. one day don't present a BAR 0 *at
> > all*, so ancient drivers just fail to load.).
>
> Just to clarify, as written in draft this is possible with the current
> spec proposal. So I'm guessing there's some other motivation that you
> had in mind?
>
> > (2) There's no huge win in keeping the same layout. Let's make some
> > cleanups.
>
> About this last point - what cleanups do you have in mind? Just move
> some registers around? I guess we could put feature bits near each
> other, and move device status towards the end to avoid wasting 3 bytes.
> The win seems minimal, but the change does make legacy hypervisor
> support in guests more cumbersome, as we need to spread coditional code
> around instead of localizing it in the initialization path.
>
> > There are more users ahead of us then behind us (I
> > hope!).
>
> In that case isn't it safe to assume we'll find some uses
> for the reserved registers?
>
> > But I think this is the right direction!
> >
> > Thanks,
> > Rusty.
Note: waiting on response to the above before I tweak the
spec again.
--
MST
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-14 6:59 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-14 6:59 UTC (permalink / raw)
To: Rusty Russell
Cc: Sasha Levin, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Sun, Nov 13, 2011 at 05:14:27PM +0200, Michael S. Tsirkin wrote:
> On Fri, Nov 11, 2011 at 02:54:31PM +1030, Rusty Russell wrote:
> > On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> > > On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > > > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > > > It'll be a bit harder deprecating it in the future.
> > > >
> > > > Harder than ... what ?
> > >
> > > Harder than allowing devices not to present it at all if new layout
> > > config is used. Right now the simple implementation is to use MMIO for
> > > config and device specific, and let it fallback to legacy for ISR and
> > > notifications (and therefore, this is probably how everybody will
> > > implement it), which means that when you do want to deprecate legacy,
> > > there will be extra work to be done then, instead of doing it now.
> >
> > Indeed, I'd like to see two changes to your proposal:
> >
> > (1) It should be all or nothing. If a driver can find the virtio header
> > capability, it should only use the capabilties. Otherwise, it
> > should fall back to legacy.
>
> Okay, but going forward, if we add more capabilities, we probably won't
> want to require them and fail to load if not there. That's really why I
> wanted to make the failover ignore any capability separately - to make
> this future proof. I'm not terribly fixated on this, it just seemed a
> bit more symmetrical to treat all capabilities in the same way. Hmm?
>
> > Your draft suggests a mix is possible;
> > I prefer a clean failure (ie. one day don't present a BAR 0 *at
> > all*, so ancient drivers just fail to load.).
>
> Just to clarify, as written in draft this is possible with the current
> spec proposal. So I'm guessing there's some other motivation that you
> had in mind?
>
> > (2) There's no huge win in keeping the same layout. Let's make some
> > cleanups.
>
> About this last point - what cleanups do you have in mind? Just move
> some registers around? I guess we could put feature bits near each
> other, and move device status towards the end to avoid wasting 3 bytes.
> The win seems minimal, but the change does make legacy hypervisor
> support in guests more cumbersome, as we need to spread coditional code
> around instead of localizing it in the initialization path.
>
> > There are more users ahead of us then behind us (I
> > hope!).
>
> In that case isn't it safe to assume we'll find some uses
> for the reserved registers?
>
> > But I think this is the right direction!
> >
> > Thanks,
> > Rusty.
Note: waiting on response to the above before I tweak the
spec again.
--
MST
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-13 15:14 ` Michael S. Tsirkin
@ 2011-11-15 23:58 ` Rusty Russell
-1 siblings, 0 replies; 134+ messages in thread
From: Rusty Russell @ 2011-11-15 23:58 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, Sasha Levin, Amit Shah, avi
On Sun, 13 Nov 2011 17:14:27 +0200, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> On Fri, Nov 11, 2011 at 02:54:31PM +1030, Rusty Russell wrote:
> > Indeed, I'd like to see two changes to your proposal:
> >
> > (1) It should be all or nothing. If a driver can find the virtio header
> > capability, it should only use the capabilties. Otherwise, it
> > should fall back to legacy.
>
> Okay, but going forward, if we add more capabilities, we probably won't
> want to require them and fail to load if not there. That's really why I
> wanted to make the failover ignore any capability separately - to make
> this future proof. I'm not terribly fixated on this, it just seemed a
> bit more symmetrical to treat all capabilities in the same way. Hmm?
Sure, a future capbility may not exist. But once a driver finds that
virtio header structure in the capability, it should *never* fall back
to the legacy area. ie. it can expect that Queue Notify, ISR Status and
Device Header all exist.
ie. either use legacy mode, or use capabilities. Never both.
>
> > Your draft suggests a mix is possible;
> > I prefer a clean failure (ie. one day don't present a BAR 0 *at
> > all*, so ancient drivers just fail to load.).
>
> Just to clarify, as written in draft this is possible with the current
> spec proposal. So I'm guessing there's some other motivation that you
> had in mind?
At the moment you give a hybrid model where both are used. In five
years' time, that's going to be particularly ugly.
>
> > (2) There's no huge win in keeping the same layout. Let's make some
> > cleanups.
>
> About this last point - what cleanups do you have in mind? Just move
> some registers around? I guess we could put feature bits near each
> other, and move device status towards the end to avoid wasting 3
> bytes.
> The win seems minimal, but the change does make legacy hypervisor
> support in guests more cumbersome, as we need to spread coditional code
> around instead of localizing it in the initialization path.
But the separation between "legacy" and "modern" will be sharper, making
it easier to excise the legacy portion later.
And in five years' time, people implementing virtio will really thank us
that they can completely ignore the legacy header.
> > There are more users ahead of us then behind us (I
> > hope!).
>
> In that case isn't it safe to assume we'll find some uses
> for the reserved registers?
How would we tell? If we use a new capability struct for it, it's
obvious. Otherwise, you're going to need to steal more feature bits.
Cheers,
Rusty.
PS. Sorry, was off sick for a few days.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-15 23:58 ` Rusty Russell
0 siblings, 0 replies; 134+ messages in thread
From: Rusty Russell @ 2011-11-15 23:58 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Sasha Levin, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Sun, 13 Nov 2011 17:14:27 +0200, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> On Fri, Nov 11, 2011 at 02:54:31PM +1030, Rusty Russell wrote:
> > Indeed, I'd like to see two changes to your proposal:
> >
> > (1) It should be all or nothing. If a driver can find the virtio header
> > capability, it should only use the capabilties. Otherwise, it
> > should fall back to legacy.
>
> Okay, but going forward, if we add more capabilities, we probably won't
> want to require them and fail to load if not there. That's really why I
> wanted to make the failover ignore any capability separately - to make
> this future proof. I'm not terribly fixated on this, it just seemed a
> bit more symmetrical to treat all capabilities in the same way. Hmm?
Sure, a future capbility may not exist. But once a driver finds that
virtio header structure in the capability, it should *never* fall back
to the legacy area. ie. it can expect that Queue Notify, ISR Status and
Device Header all exist.
ie. either use legacy mode, or use capabilities. Never both.
>
> > Your draft suggests a mix is possible;
> > I prefer a clean failure (ie. one day don't present a BAR 0 *at
> > all*, so ancient drivers just fail to load.).
>
> Just to clarify, as written in draft this is possible with the current
> spec proposal. So I'm guessing there's some other motivation that you
> had in mind?
At the moment you give a hybrid model where both are used. In five
years' time, that's going to be particularly ugly.
>
> > (2) There's no huge win in keeping the same layout. Let's make some
> > cleanups.
>
> About this last point - what cleanups do you have in mind? Just move
> some registers around? I guess we could put feature bits near each
> other, and move device status towards the end to avoid wasting 3
> bytes.
> The win seems minimal, but the change does make legacy hypervisor
> support in guests more cumbersome, as we need to spread coditional code
> around instead of localizing it in the initialization path.
But the separation between "legacy" and "modern" will be sharper, making
it easier to excise the legacy portion later.
And in five years' time, people implementing virtio will really thank us
that they can completely ignore the legacy header.
> > There are more users ahead of us then behind us (I
> > hope!).
>
> In that case isn't it safe to assume we'll find some uses
> for the reserved registers?
How would we tell? If we use a new capability struct for it, it's
obvious. Otherwise, you're going to need to steal more feature bits.
Cheers,
Rusty.
PS. Sorry, was off sick for a few days.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-15 23:58 ` Rusty Russell
@ 2011-11-16 7:03 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-16 7:03 UTC (permalink / raw)
To: Rusty Russell
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, Sasha Levin, Amit Shah, avi
On Wed, Nov 16, 2011 at 10:28:05AM +1030, Rusty Russell wrote:
> On Sun, 13 Nov 2011 17:14:27 +0200, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> > On Fri, Nov 11, 2011 at 02:54:31PM +1030, Rusty Russell wrote:
> > > Indeed, I'd like to see two changes to your proposal:
> > >
> > > (1) It should be all or nothing. If a driver can find the virtio header
> > > capability, it should only use the capabilties. Otherwise, it
> > > should fall back to legacy.
> >
> > Okay, but going forward, if we add more capabilities, we probably won't
> > want to require them and fail to load if not there. That's really why I
> > wanted to make the failover ignore any capability separately - to make
> > this future proof. I'm not terribly fixated on this, it just seemed a
> > bit more symmetrical to treat all capabilities in the same way. Hmm?
>
> Sure, a future capbility may not exist. But once a driver finds that
> virtio header structure in the capability, it should *never* fall back
> to the legacy area. ie. it can expect that Queue Notify, ISR Status and
> Device Header all exist.
>
> ie. either use legacy mode, or use capabilities. Never both.
>
> >
> > > Your draft suggests a mix is possible;
> > > I prefer a clean failure (ie. one day don't present a BAR 0 *at
> > > all*, so ancient drivers just fail to load.).
> >
> > Just to clarify, as written in draft this is possible with the current
> > spec proposal. So I'm guessing there's some other motivation that you
> > had in mind?
>
> At the moment you give a hybrid model where both are used. In five
> years' time, that's going to be particularly ugly.
> >
> > > (2) There's no huge win in keeping the same layout. Let's make some
> > > cleanups.
> >
> > About this last point - what cleanups do you have in mind? Just move
> > some registers around? I guess we could put feature bits near each
> > other, and move device status towards the end to avoid wasting 3
> > bytes.
>
> > The win seems minimal, but the change does make legacy hypervisor
> > support in guests more cumbersome, as we need to spread coditional code
> > around instead of localizing it in the initialization path.
>
> But the separation between "legacy" and "modern" will be sharper, making
> it easier to excise the legacy portion later.
>
> And in five years' time, people implementing virtio will really thank us
> that they can completely ignore the legacy header.
OK, I get it I think.
> > > There are more users ahead of us then behind us (I
> > > hope!).
> >
> > In that case isn't it safe to assume we'll find some uses
> > for the reserved registers?
>
> How would we tell? If we use a new capability struct for it, it's
> obvious. Otherwise, you're going to need to steal more feature bits.
Yes, exactly, if as you suggest, we disable legacy header
when there is a capability - we can use reserved registers
for other stuff.
> Cheers,
> Rusty.
> PS. Sorry, was off sick for a few days.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
@ 2011-11-16 7:03 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-16 7:03 UTC (permalink / raw)
To: Rusty Russell
Cc: Sasha Levin, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
On Wed, Nov 16, 2011 at 10:28:05AM +1030, Rusty Russell wrote:
> On Sun, 13 Nov 2011 17:14:27 +0200, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> > On Fri, Nov 11, 2011 at 02:54:31PM +1030, Rusty Russell wrote:
> > > Indeed, I'd like to see two changes to your proposal:
> > >
> > > (1) It should be all or nothing. If a driver can find the virtio header
> > > capability, it should only use the capabilties. Otherwise, it
> > > should fall back to legacy.
> >
> > Okay, but going forward, if we add more capabilities, we probably won't
> > want to require them and fail to load if not there. That's really why I
> > wanted to make the failover ignore any capability separately - to make
> > this future proof. I'm not terribly fixated on this, it just seemed a
> > bit more symmetrical to treat all capabilities in the same way. Hmm?
>
> Sure, a future capbility may not exist. But once a driver finds that
> virtio header structure in the capability, it should *never* fall back
> to the legacy area. ie. it can expect that Queue Notify, ISR Status and
> Device Header all exist.
>
> ie. either use legacy mode, or use capabilities. Never both.
>
> >
> > > Your draft suggests a mix is possible;
> > > I prefer a clean failure (ie. one day don't present a BAR 0 *at
> > > all*, so ancient drivers just fail to load.).
> >
> > Just to clarify, as written in draft this is possible with the current
> > spec proposal. So I'm guessing there's some other motivation that you
> > had in mind?
>
> At the moment you give a hybrid model where both are used. In five
> years' time, that's going to be particularly ugly.
> >
> > > (2) There's no huge win in keeping the same layout. Let's make some
> > > cleanups.
> >
> > About this last point - what cleanups do you have in mind? Just move
> > some registers around? I guess we could put feature bits near each
> > other, and move device status towards the end to avoid wasting 3
> > bytes.
>
> > The win seems minimal, but the change does make legacy hypervisor
> > support in guests more cumbersome, as we need to spread coditional code
> > around instead of localizing it in the initialization path.
>
> But the separation between "legacy" and "modern" will be sharper, making
> it easier to excise the legacy portion later.
>
> And in five years' time, people implementing virtio will really thank us
> that they can completely ignore the legacy header.
OK, I get it I think.
> > > There are more users ahead of us then behind us (I
> > > hope!).
> >
> > In that case isn't it safe to assume we'll find some uses
> > for the reserved registers?
>
> How would we tell? If we use a new capability struct for it, it's
> obvious. Otherwise, you're going to need to steal more feature bits.
Yes, exactly, if as you suggest, we disable legacy header
when there is a capability - we can use reserved registers
for other stuff.
> Cheers,
> Rusty.
> PS. Sorry, was off sick for a few days.
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout
2011-11-09 20:57 ` Sasha Levin
` (2 preceding siblings ...)
(?)
@ 2011-11-11 4:24 ` Rusty Russell
-1 siblings, 0 replies; 134+ messages in thread
From: Rusty Russell @ 2011-11-11 4:24 UTC (permalink / raw)
To: Sasha Levin, Michael S. Tsirkin
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, avi, Amit Shah
On Wed, 09 Nov 2011 22:57:28 +0200, Sasha Levin <levinsasha928@gmail.com> wrote:
> On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote:
> > On Wed, Nov 09, 2011 at 10:24:47PM +0200, Sasha Levin wrote:
> > > It'll be a bit harder deprecating it in the future.
> >
> > Harder than ... what ?
>
> Harder than allowing devices not to present it at all if new layout
> config is used. Right now the simple implementation is to use MMIO for
> config and device specific, and let it fallback to legacy for ISR and
> notifications (and therefore, this is probably how everybody will
> implement it), which means that when you do want to deprecate legacy,
> there will be extra work to be done then, instead of doing it now.
Indeed, I'd like to see two changes to your proposal:
(1) It should be all or nothing. If a driver can find the virtio header
capability, it should only use the capabilties. Otherwise, it
should fall back to legacy. Your draft suggests a mix is possible;
I prefer a clean failure (ie. one day don't present a BAR 0 *at
all*, so ancient drivers just fail to load.).
(2) There's no huge win in keeping the same layout. Let's make some
cleanups. There are more users ahead of us then behind us (I
hope!).
But I think this is the right direction!
Thanks,
Rusty.
^ permalink raw reply [flat|nested] 134+ messages in thread
* [PATCHv3 RFC] virtio-spec: flexible configuration layout
2011-11-09 19:59 ` Michael S. Tsirkin
@ 2011-11-10 12:24 ` Michael S. Tsirkin
-1 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-10 12:24 UTC (permalink / raw)
To: Rusty Russell
Cc: Krishna Kumar, kvm, Pawel Moll, Wang Sheng-Hui,
Alexey Kardashevskiy, lkml - Kernel Mailing List, virtualization,
penberg, Christian Borntraeger, Sasha Levin, Amit Shah, avi
Another update. I'll get to testing the linux guest patch now,
next version should hopefully be a non-RFC one, and be accompanied by
guest driver, assuming driver works fine.
Alignment negotiation is still TBD, it's easy to add but I'd like
to get agreement on the general approach first.
One drawback is that for device config header,
we can't reuse same memory for both legacy and new -
this is because the legacy offset changes dynamically,
and I'd like to avoid doing that with the new one.
This should not be a problem as device header can
go into MMIO which is not as space constrained as PIO.
Changes from v2:
- Clarify that 'first region' is BAR0.
- Clarify that devices should provide all capabilities
(fallback is for compatibility).
- Remove a left-over mention of bit 31 use.
- Correct virtio header size.
Changes from v1:
- add an example configuration
- scale tables so they fit within page
- clean up some remaining items mentioning feature bit 31
Description from v1:
Here's a spec change documenting what my C patch does
(almost - I tweaked the layout a bit, but the idea is the same).
Some more cleanups are needed but I thought I'd send it
for early flames/comments.
The idea is simple: we split functionally unrelated
register groups to independent structures, and let
the device place is anywhere using a capability
in PCI configuration space.
It can then go into MMIO space which is cheaper than PIO.
A legacy portion of the configuration is mirrored
in the first BAR, to keep legacy drivers working.
Any new fields can be added in existing structures
at the end, so they won't affect legacy.
Alternatively we can add new structures with new
structure IDs, pointed to from PCI configuration space.
As we don't yet have devices or drivers with 64 bit features,
I decided we don't need high feature bits in legacy space.
This also frees up feature bit 31 as we don't need it
to enable high feature bits anymore.
I don't think any released software actually uses it
(the kvm tool HEAD apparently does,
but I think it's not too late to fix it).
As this solves the dynamic placement of MSIX vectors
and high feature bits,
I thought it's easier to just reserve space for that
programming than give it a separate structure. This
can be changed by a patch on top.
Note that data path is split from configuration.
PDF will follow.
Please comment.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
diff --git a/virtio-spec.lyx b/virtio-spec.lyx
index 6426f8f..36ac61f 100644
--- a/virtio-spec.lyx
+++ b/virtio-spec.lyx
@@ -3,6 +3,9 @@
\begin_document
\begin_header
\textclass report
+\begin_preamble
+\usepackage{graphicx}
+\end_preamble
\use_default_options false
\maintain_unincluded_children false
\language english
@@ -56,6 +59,7 @@
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
+\author 1986246365 "Michael S. Tsirkin"
\end_header
\begin_body
@@ -570,7 +574,34 @@ Device Configuration
\end_layout
\begin_layout Standard
-To configure the device, we use the first I/O region of the PCI device.
+To configure the device, we
+\change_inserted 1986246365 1320783354
+use I/O and/or memory regions of the PCI device.
+ These contain the virtio header registers, the notification register, the
+ ISR status register and device specific registers, as specified by Virtio
+ Structure PCI Capabilities
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320920233
+For backwards compatibility, devices should present part of these configuration
+ registers in a legacy configuration structure in BAR0 in the first I/O
+ region of the PCI device
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+
+\change_deleted 1986246365 1320766512
+use the first I/O region of the PCI device.
This contains a
\emph on
virtio header
@@ -578,105 +609,3120 @@ virtio header
followed by a
\emph on
device-specific region.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+There may be different widths of accesses to the I/O region; the
+\begin_inset Quotes eld
+\end_inset
+
+natural
+\begin_inset Quotes erd
+\end_inset
+
+ access method for each field in the virtio header must be used (i.e.
+ 32-bit accesses for 32-bit fields, etc), but the device-specific region
+ can be accessed using any width accesses, and should obtain the same results.
+\end_layout
+
+\begin_layout Standard
+Note that this is possible because while the virtio header
+\change_inserted 1986246365 1320767249
+, notification and ISR status are
+\change_deleted 1986246365 1320767251
+ is
+\change_unchanged
+ PCI (i.e.
+ little) endian, the device-specific
+\change_deleted 1986246365 1320767335
+ region is
+\change_inserted 1986246365 1320767337
+registers are
+\change_unchanged
+ encoded in the native endian of the guest (where such distinction is applicable
+).
+\change_inserted 1986246365 1320767660
+
+\end_layout
+
+\begin_layout Subsection
+Device Initialization Sequence
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:Device-Initialization-Sequence"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+We start with an overview of device initialization, then expand on the details
+ of the device and how each step is preformed.
+\end_layout
+
+\begin_layout Enumerate
+Reset the device.
+ This is not required on initial start up.
+\change_inserted 1986246365 1320918056
+
+\end_layout
+
+\begin_layout Enumerate
+
+\change_inserted 1986246365 1320918057
+PCI capability list scan, detecting virtio configuration layout using Virtio
+ Structure PCI capabilities.
+
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320918057
+Historically drivers skipped this step, using legacy configuration space
+ unconditionally.
+\end_layout
+
+\end_inset
+
+
+\change_unchanged
+
+\end_layout
+
+\begin_layout Enumerate
+The ACKNOWLEDGE status bit is set: we have noticed the device.
+\end_layout
+
+\begin_layout Enumerate
+The DRIVER status bit is set: we know how to drive the device.
+\end_layout
+
+\begin_layout Enumerate
+Device-specific setup, including reading the Device Feature Bits, discovery
+ of virtqueues for the device, optional MSI-X setup, and reading and possibly
+ writing the virtio configuration space.
+\end_layout
+
+\begin_layout Enumerate
+The subset of Device Feature Bits understood by the driver is written to
+ the device.
+\end_layout
+
+\begin_layout Enumerate
+The DRIVER_OK status bit is set.
+\end_layout
+
+\begin_layout Enumerate
+The device can now be used (ie.
+ buffers added to the virtqueues)
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+Historically, drivers have used the device before steps 5 and 6.
+ This is only allowed if the driver does not use any features which would
+ alter this early use of the device.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+If any of these steps go irrecoverably wrong, the guest should set the FAILED
+ status bit to indicate that it has given up on the device (it can reset
+ the device later to restart if desired).
+\end_layout
+
+\begin_layout Standard
+We now cover the fields required for general setup in detail.
+\change_inserted 1986246365 1320766663
+
+\end_layout
+
+\begin_layout Subsection
+
+\change_inserted 1986246365 1320781584
+Virtio Structure PCI Capability
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320781061
+Virtio configuration layout includes virtio configuration header, notification
+ and ISR status and device configuration structures.
+ Each structure is mapped by a Base Address register (BAR) belonging to
+ the function, located beginning at 10h in Configuration Space.
+
+\emph on
+Structure ID
+\emph default
+indentifies the structure
+\emph on
+, Size
+\emph default
+ indicates the structure size, in bytes, a
+\emph on
+BAR Indicator register (BIR)
+\emph default
+ indicates which BAR, and
+\emph on
+Offset
+\emph default
+ indicates where the structure begins relative to the base address associated
+ with the BAR.
+ The BAR is permitted to be either 32-bit or 64-bit, it can map Memory Space
+ or I/O Space.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320838522
+These registers are specified using vendor-specific PCI capability located
+ on capability list in PCI configuration space of the device.
+ This virtio structure capability uses little-endian format; all bits are
+ read-only:
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+resizebox{
+\backslash
+textwidth}{!}{%
+\end_layout
+
+\end_inset
+
+
+\change_inserted 1986246365 1320839073
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="34">
+<features tabularvalignment="bottom">
+<column alignment="center" valignment="top" width="0pt">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0pt">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771774
+
+\size tiny
+Bit
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771777
+
+\size tiny
+31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771779
+
+\size tiny
+30
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771781
+
+\size tiny
+29
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771783
+
+\size tiny
+28
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771786
+
+\size tiny
+27
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771810
+
+\size tiny
+26
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771813
+
+\size tiny
+25
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771815
+
+\size tiny
+24
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771817
+
+\size tiny
+23
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771819
+
+\size tiny
+22
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771821
+
+\size tiny
+21
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771823
+
+\size tiny
+20
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771825
+
+\size tiny
+19
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771829
+
+\size tiny
+18
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771831
+
+\size tiny
+17
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771833
+
+\size tiny
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771835
+
+\size tiny
+15
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771840
+
+\size tiny
+14
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771841
+
+\size tiny
+13
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771843
+
+\size tiny
+12
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771845
+
+\size tiny
+11
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771847
+
+\size tiny
+10
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771850
+
+\size tiny
+9
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771852
+
+\size tiny
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771854
+
+\size tiny
+7
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771856
+
+\size tiny
+6
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771858
+
+\size tiny
+5
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771859
+
+\size tiny
+4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771861
+
+\size tiny
+3
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771862
+
+\size tiny
+2
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771864
+
+\size tiny
+1
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771888
+
+\size tiny
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771997
+
+\size tiny
+Offset
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320781029
+
+\size larger
+Structure ID
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850302
+
+\size larger
+CapLength = 12
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850298
+
+\size larger
+NextCapPtr
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850289
+
+\size larger
+CapID = 9
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772004
+0
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772549
+
+\size larger
+Size
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850408
+
+\size larger
+BIR
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772007
+4
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772540
+
+\size larger
+Offset
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772011
+8
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\change_unchanged
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+
+\change_inserted 1986246365 1320839073
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320838992
+Purpose:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320780912
+
+\emph on
+Capability ID
+\emph default
+,
+\emph on
+Next Capability Pointer
+\emph default
+,
+\emph on
+Capability Length
+\emph default
+ - these fields are specified by PCI local bus specification, Rev 3.0
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320785073
+
+\emph on
+Structure ID
+\emph default
+ - identifies the structure mapped.
+ If an ID representing a specific structure is absent, the structure is
+ located in the legacy virtio configuration in the first PCI BAR.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320782689
+
+\emph on
+Size
+\emph default
+ - size of the structure mapped.
+ This size might include padding, or fields unused by the driver.
+ Drivers are also recommended to only map part of configuration structure
+ large enough for device operation.
+ For example, a future device might present a large structure size of several
+ MBytes.
+ As current devices never utilize structures larger than 4KBytes in size,
+ driver can limit the mapped structure size to e.g.
+ 4KBytes to allow forward compatibility with such devices without loss of
+ functionality and without wasting resources.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320839833
+
+\emph on
+BIR - BAR Indicator Register
+\emph default
+ - Indicates which one of the BAR registers, located beginning at 10h in
+ Configuration Space, is used to map the structure into Memory or I/O Space.
+ Legal values are 0 - 5.
+ BAR offset is calculated as
+\emph on
+BAR
+\emph default
+ = 10h + 4 *
+\emph on
+BIR.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320781002
+
+\emph on
+Offset
+\emph default
+ - Used as an offset from the address contained by one of the function’s
+ Base Address registers to point to the base of the structure.
+ Depending on the structure, the lower bits are masked off (set to zero)
+ by software to form an aligned offset.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320785098
+A single device has multiple virtio capabilities on the PCI capability linked-li
+st.
+ To locate a specific register, driver scans the PCI capability list looking
+ for capabilities using the vendor specific
+\emph on
+Capability ID
+\emph default
+, that is
+\emph on
+Capability ID
+\emph default
+ value
+\emph on
+9
+\emph default
+, according to the PCI spec.
+ For each capability, it verifies that the
+\emph on
+Capability Length
+\emph default
+ field matches the expected value (12) - if it doesn't, this indicates a
+ layout change, which causes driver to ignore the specific PCI capability
+ and proceed to the next PCI capability in the list.
+ Next,
+\emph on
+ Structure ID
+\emph default
+ single-byte field is read at offset 3.
+ Unrecognized
+\emph on
+Structure ID
+\emph default
+ values are ignored.
+ Low bits in the
+\emph on
+Offset
+\emph default
+ register are masked to match alignment requirements, if any.
+ Device drivers are recommended to sanity check
+\emph on
+BIR
+\emph default
+,
+\emph on
+Offset
+\emph default
+, and
+\emph on
+Size
+\emph default
+ fields, ignoring the capability or failing gracefully on error.
+ Drivers are also recommended to only map part of configuration structure
+ large enough for device operation.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320920511
+For backwards compatibility, devices should also present legacy configuration
+ space in BAR0 in the first I/O region of the PCI device, mirroring virtio
+ configuration structures in this space.
+ For forwards compatibility, drivers should fall back on this legacy structure
+ if a specific Virtio Structure capability is missing in the PCI capability
+ list.
+ However, devices are not required to map the whole configuration structure
+ in legacy space - only the initial segment expected by legacy drivers needs
+ to be mapped.
+ Devices are further required to implement all Structure IDs for the structures
+ they present, as opposed to relying on driver legacy fallback.
+ The minimal size of such legacy segment size, for each structure, is listed
+ below.
+ Drivers are discouraged from using legacy space if a specific Structure
+ ID is present; this is to allow deprecating the legacy space in the future.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320850770
+Below is the list of supported Virtio structures, including Structure ID,
+ offset alignment, and where it can be located in the legacy configuration
+ space.
+ Note that legacy space layout changes as the MSI-X capability is enabled
+ and disabled
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320856794
+ie.
+ once you enable MSI-X on the device, some legacy fields move.
+ If you turn it off again, they move back! this does not affect the new
+ configuration
+\end_layout
+
+\end_inset
+
+.
+ Alignment, offset and all sizes are in bytes.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786868
+\begin_inset Tabular
+<lyxtabular version="3" rows="6" columns="6">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<row>
+<cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Structure
+\change_inserted 1986246365 1320855560
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+ID
+\change_inserted 1986246365 1320855560
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Align-
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855560
+MinSize
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785821
+Offset in
+\change_deleted 1986246365 1320785817
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850780
+MinSize in
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell multirow="4" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="4" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855625
+ment
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="4" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855593
+legacy space
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855610
+ legacy space
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785855
+Virtio Header
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785860
+0x1
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786157
+4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320918196
+32 bytes
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786145
+0
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855180
+24 or 20
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855511
+\begin_inset CommandInset label
+LatexCommand label
+name "fn:24-or-20"
+
+\end_inset
+
+24 bytes if MSI-X is enabled, 20 bytes if it is disabled
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786188
+Queue Notify
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786191
+0x2
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786267
+2 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786228
+2 bytes
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786505
+16 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786303
+2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786878
+ISR Status
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786260
+0x3
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786270
+1 byte
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786273
+1 byte
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786534
+19 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786306
+1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786847
+Device Header
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786474
+0x4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786477
+1 byte
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320918121
+...
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855417
+\begin_inset CommandInset label
+LatexCommand label
+name "fn:Device-specific"
+
+\end_inset
+
+Device specific
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855534
+24 or 20
+\begin_inset Formula $^{\text{\ref{fn:24-or-20}}}$
+\end_inset
+
+
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320918125
+...
+\begin_inset Formula $^{\text{\ref{fn:Device-specific}}}$
+\end_inset
+
+
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786973
+Drivers should assume that each structure size can be extended in the future.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320859762
+Queue Notify and ISR status are single-field registers.
+ Device Header has device specific structure.
+ Virtio Header structure is documented below.
+\end_layout
+
+\begin_layout Subsubsection
+
+\change_inserted 1986246365 1320867253
+Example Virtio Structure Layout
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320865758
+Let's assume that a virtio block device presents two Virtio Structure capabiliti
+es in PCI capability list:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863392
+Structure ID 0x1; BIR 1; Offset 0x1000; Size 0x100
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863399
+Structure ID 0x4; BIR 1; Offset 0x1100; Size 0x200
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863479
+Let's further assume that MSI-X is disabled.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863498
+In this case, the driver should use:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863543
+Virtio Header at offset 0x1000 in BAR 1
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863568
+Device Header at offset 0x1100 in BAR1
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320868074
+Queue Notify at offset 0x10 in BAR0 (legacy configuration space is used
+ since Structure ID is not present)
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320868077
+ISR status at offset 0x13 in BAR0 (legacy configuration space is used since
+ Structure ID is not present)
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320867162
+For use by legacy drivers, the first 20 bytes in BAR0 mirror bytes 0x1000
+ to 0x1013 in BAR1, and the following 32 bytes in BAR0 should mirror bytes
+ 0x1100 to 111F in BAR1.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320867231
+Enabling MSI-X only affects the legacy drivers: with MSI-X enabled, the
+ first 24 bytes in BAR0 mirror bytes 0x1000 to 0x1017 in BAR1, and the following
+ 32 bytes in BAR0 should mirror bytes 0x1100 to 111F in BAR1.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Subsection
+
+\change_inserted 1986246365 1320855988
+Virtio Header
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320858571
+The virtio header looks as follows:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320858597
+\begin_inset Tabular
+<lyxtabular version="3" rows="13" columns="3">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858603
+Bits
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858614
+R/W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858619
+Purpose
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858841
+32
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858858
+R
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858870
+Device Features bits 0:31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858873
+32
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858876
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858885
+Guest Features bits 0:31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858889
+32
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858891
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858907
+Queue Address
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859001
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859006
+R
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858953
+Queue Size
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859012
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859008
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858957
+Queue Select
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859015
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858964
+Reserved
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859029
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859032
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858972
+Device Status
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859052
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858989
+Reserved
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859063
+16
+\change_unchanged
+
\end_layout
-\begin_layout Standard
-There may be different widths of accesses to the I/O region; the
-\begin_inset Quotes eld
\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
-natural
-\begin_inset Quotes erd
-\end_inset
+\begin_layout Plain Layout
- access method for each field in the virtio header must be used (i.e.
- 32-bit accesses for 32-bit fields, etc), but the device-specific region
- can be accessed using any width accesses, and should obtain the same results.
-\end_layout
+\change_inserted 1986246365 1320859065
+R+W
+\change_unchanged
-\begin_layout Standard
-Note that this is possible because while the virtio header is PCI (i.e.
- little) endian, the device-specific region is encoded in the native endian
- of the guest (where such distinction is applicable).
\end_layout
-\begin_layout Subsection
-Device Initialization Sequence
-\begin_inset CommandInset label
-LatexCommand label
-name "sub:Device-Initialization-Sequence"
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859081
+MSI-X Configuration Vector
+\change_unchanged
+
+\end_layout
\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859083
+16
+\change_unchanged
\end_layout
-\begin_layout Standard
-We start with an overview of device initialization, then expand on the details
- of the device and how each step is preformed.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859088
+R+W
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-Reset the device.
- This is not required on initial start up.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859095
+MSI-X Queue Vector
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The ACKNOWLEDGE status bit is set: we have noticed the device.
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859102
+32
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The DRIVER status bit is set: we know how to drive the device.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859106
+R
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-Device-specific setup, including reading the Device Feature Bits, discovery
- of virtqueues for the device, optional MSI-X setup, and reading and possibly
- writing the virtio configuration space.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859116
+Device Features bits 32:63
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The subset of Device Feature Bits understood by the driver is written to
- the device.
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859122
+32
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The DRIVER_OK status bit is set.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859119
+R+W
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The device can now be used (ie.
- buffers added to the virtqueues)
-\begin_inset Foot
-status open
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
\begin_layout Plain Layout
-Historically, drivers have used the device before steps 5 and 6.
- This is only allowed if the driver does not use any features which would
- alter this early use of the device.
+
+\change_inserted 1986246365 1320859130
+Guest Features bits 32:63
+\change_unchanged
+
\end_layout
\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
\end_layout
-\begin_layout Standard
-If any of these steps go irrecoverably wrong, the guest should set the FAILED
- status bit to indicate that it has given up on the device (it can reset
- the device later to restart if desired).
+\begin_layout Subsubsection
+
+\change_inserted 1986246365 1320856004
+Legacy
+\change_unchanged
+Virtio Header
\end_layout
\begin_layout Standard
-We now cover the fields required for general setup in detail.
-\end_layout
-\begin_layout Subsection
-Virtio Header
+\change_inserted 1986246365 1320867482
+For backwards compatibility, devices should mirror the initial part of virtio
+ header and device header structures, Queue Notify and ISR Status registers
+ in legacy configuration space in the first I/O region of the PCI device.
+ Drivers should fall back on this legacy structure if a specific Virtio
+ Structure capability is missing in the PCI capability list.
+ Drivers are discouraged from using legacy space if a specific Structure
+ ID is present; this is to allow deprecating the legacy space in the future.
\end_layout
\begin_layout Standard
-The virtio header looks as follows:
+
+\change_inserted 1986246365 1320859848
+For reference, the
+\change_deleted 1986246365 1320856044
+The
+\change_unchanged
+
+\change_inserted 1986246365 1320859848
+legacy
+\change_unchanged
+virtio header looks as follows
+\change_inserted 1986246365 1320859848
+; one observes that most register offsets match the new virtio header, to
+ make compatibility easier
+\change_unchanged
+:
\end_layout
\begin_layout Standard
@@ -1067,11 +4113,15 @@ Status
If MSI-X is enabled for the device, two additional fields immediately follow
this header:
\begin_inset Foot
-status collapsed
+status open
\begin_layout Plain Layout
ie.
- once you enable MSI-X on the device, the other fields move.
+ once you enable MSI-X on the device, the other fields
+\change_inserted 1986246365 1320867540
+in legacy configuration
+\change_unchanged
+move.
If you turn it off again, they move back!
\end_layout
@@ -1219,11 +4269,15 @@ Vector
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320867563
Finally, if feature bits (VIRTIO_F_FEATURES_HI) this is immediately followed
by two additional fields:
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320867563
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features tabularvalignment="middle">
@@ -1359,11 +4413,16 @@ Features bits 32:63
\end_inset
+\change_unchanged
+
\end_layout
\begin_layout Standard
-Immediately following these general headers, there may be device-specific
- headers:
+Immediately following these general headers, there may be
+\change_inserted 1986246365 1320856347
+legacy
+\change_unchanged
+device-specific headers:
\end_layout
\begin_layout Standard
@@ -1459,6 +4518,17 @@ Device Specific...
\end_inset
+\change_inserted 1986246365 1320856108
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320856109
+Legacy device-specific headers are supported for backwards compatibility.
+ As such, they are not required to map the whole device configuration structure
+ - only the initial segment expected by legacy drivers needs to be mapped.
+ The size of such legacy segment size is device specific.
\end_layout
\begin_layout Subsubsection
@@ -1531,8 +4601,10 @@ name "sub:Feature-Bits"
The least significant 31 bits of the first configuration field indicates
the features that the device supports (the high bit is reserved, and will
be used to indicate the presence of future feature bits elsewhere).
- If more than 31 feature bits are supported, the device indicates so by
- setting feature bit 31 (see
+
+\change_deleted 1986246365 1320784929
+If more than 31 feature bits are supported, the device indicates so by setting
+ feature bit 31 (see
\begin_inset CommandInset ref
LatexCommand ref
reference "cha:Reserved-Feature-Bits"
@@ -1540,7 +4612,9 @@ reference "cha:Reserved-Feature-Bits"
\end_inset
).
- The bits are allocated as follows:
+
+\change_unchanged
+The bits are allocated as follows:
\end_layout
\begin_layout Description
@@ -1615,10 +4689,14 @@ This allows for forwards and backwards compatibility: if the device is enhanced
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320784940
Access to feature bits 32 to 63 is enabled by Guest by setting feature bit
31.
If this bit is unset, Device must assume that all feature bits > 31 are
unset.
+\change_unchanged
+
\end_layout
\begin_layout Subsubsection
@@ -1629,10 +4707,14 @@ Configuration/Queue Vectors
When MSI-X capability is present and enabled in the device (through standard
PCI configuration space) 4 bytes at byte offset 20 are used to map configuratio
n change and queue interrupts to MSI-X vectors.
- In this case, the ISR Status field is unused, and device specific configuration
- starts at byte offset 24 in virtio header structure.
+ In this case, the ISR Status field is unused
+\change_deleted 1986246365 1320784981
+, and device specific configuration starts at byte offset 24 in virtio header
+ structure.
When MSI-X capability is not enabled, device specific configuration starts
- at byte offset 20 in virtio header.
+ at byte offset 20 in virtio header
+\change_unchanged
+.
\end_layout
\begin_layout Standard
@@ -3829,7 +6911,13 @@ Appendix B: Reserved Feature Bits
\end_layout
\begin_layout Standard
-Currently there are five device-independent feature bits defined:
+Currently there are
+\change_deleted 1986246365 1320867366
+five
+\change_inserted 1986246365 1320867367
+four
+\change_unchanged
+ device-independent feature bits defined:
\end_layout
\begin_layout Description
@@ -3926,9 +7014,13 @@ An experimental virtio PCI driver contained in Linux version 2.6.25 had this
\end_layout
\begin_layout Description
+
+\change_deleted 1986246365 1320867370
VIRTIO_F_FEATURES_HIGH(31) This feature indicates that the device supports
feature bits 32:63.
If unset, feature bits 32:63 are unset.
+\change_unchanged
+
\end_layout
\begin_layout Chapter*
@@ -4186,6 +7278,24 @@ struct virtio_net_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867743
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 8 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
@@ -5226,6 +8336,24 @@ struct virtio_blk_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867779
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 32 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
@@ -5780,6 +8908,24 @@ struct virtio_console_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867806
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 8 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
@@ -5994,6 +9140,28 @@ configuration
\end_inset
layout None currently defined.
+\change_inserted 1986246365 1320867840
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1986246365 1320867845
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 0 bytes.
+\change_unchanged
+
\end_layout
\begin_layout Section*
@@ -6127,6 +9295,24 @@ struct virtio_balloon_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867865
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 4 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCHv3 RFC] virtio-spec: flexible configuration layout
@ 2011-11-10 12:24 ` Michael S. Tsirkin
0 siblings, 0 replies; 134+ messages in thread
From: Michael S. Tsirkin @ 2011-11-10 12:24 UTC (permalink / raw)
To: Rusty Russell
Cc: Sasha Levin, lkml - Kernel Mailing List, Alexey Kardashevskiy,
Amit Shah, Christian Borntraeger, Krishna Kumar, Pawel Moll,
Wang Sheng-Hui, virtualization, kvm, avi, penberg
Another update. I'll get to testing the linux guest patch now,
next version should hopefully be a non-RFC one, and be accompanied by
guest driver, assuming driver works fine.
Alignment negotiation is still TBD, it's easy to add but I'd like
to get agreement on the general approach first.
One drawback is that for device config header,
we can't reuse same memory for both legacy and new -
this is because the legacy offset changes dynamically,
and I'd like to avoid doing that with the new one.
This should not be a problem as device header can
go into MMIO which is not as space constrained as PIO.
Changes from v2:
- Clarify that 'first region' is BAR0.
- Clarify that devices should provide all capabilities
(fallback is for compatibility).
- Remove a left-over mention of bit 31 use.
- Correct virtio header size.
Changes from v1:
- add an example configuration
- scale tables so they fit within page
- clean up some remaining items mentioning feature bit 31
Description from v1:
Here's a spec change documenting what my C patch does
(almost - I tweaked the layout a bit, but the idea is the same).
Some more cleanups are needed but I thought I'd send it
for early flames/comments.
The idea is simple: we split functionally unrelated
register groups to independent structures, and let
the device place is anywhere using a capability
in PCI configuration space.
It can then go into MMIO space which is cheaper than PIO.
A legacy portion of the configuration is mirrored
in the first BAR, to keep legacy drivers working.
Any new fields can be added in existing structures
at the end, so they won't affect legacy.
Alternatively we can add new structures with new
structure IDs, pointed to from PCI configuration space.
As we don't yet have devices or drivers with 64 bit features,
I decided we don't need high feature bits in legacy space.
This also frees up feature bit 31 as we don't need it
to enable high feature bits anymore.
I don't think any released software actually uses it
(the kvm tool HEAD apparently does,
but I think it's not too late to fix it).
As this solves the dynamic placement of MSIX vectors
and high feature bits,
I thought it's easier to just reserve space for that
programming than give it a separate structure. This
can be changed by a patch on top.
Note that data path is split from configuration.
PDF will follow.
Please comment.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
diff --git a/virtio-spec.lyx b/virtio-spec.lyx
index 6426f8f..36ac61f 100644
--- a/virtio-spec.lyx
+++ b/virtio-spec.lyx
@@ -3,6 +3,9 @@
\begin_document
\begin_header
\textclass report
+\begin_preamble
+\usepackage{graphicx}
+\end_preamble
\use_default_options false
\maintain_unincluded_children false
\language english
@@ -56,6 +59,7 @@
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
+\author 1986246365 "Michael S. Tsirkin"
\end_header
\begin_body
@@ -570,7 +574,34 @@ Device Configuration
\end_layout
\begin_layout Standard
-To configure the device, we use the first I/O region of the PCI device.
+To configure the device, we
+\change_inserted 1986246365 1320783354
+use I/O and/or memory regions of the PCI device.
+ These contain the virtio header registers, the notification register, the
+ ISR status register and device specific registers, as specified by Virtio
+ Structure PCI Capabilities
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320920233
+For backwards compatibility, devices should present part of these configuration
+ registers in a legacy configuration structure in BAR0 in the first I/O
+ region of the PCI device
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+
+\change_deleted 1986246365 1320766512
+use the first I/O region of the PCI device.
This contains a
\emph on
virtio header
@@ -578,105 +609,3120 @@ virtio header
followed by a
\emph on
device-specific region.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+There may be different widths of accesses to the I/O region; the
+\begin_inset Quotes eld
+\end_inset
+
+natural
+\begin_inset Quotes erd
+\end_inset
+
+ access method for each field in the virtio header must be used (i.e.
+ 32-bit accesses for 32-bit fields, etc), but the device-specific region
+ can be accessed using any width accesses, and should obtain the same results.
+\end_layout
+
+\begin_layout Standard
+Note that this is possible because while the virtio header
+\change_inserted 1986246365 1320767249
+, notification and ISR status are
+\change_deleted 1986246365 1320767251
+ is
+\change_unchanged
+ PCI (i.e.
+ little) endian, the device-specific
+\change_deleted 1986246365 1320767335
+ region is
+\change_inserted 1986246365 1320767337
+registers are
+\change_unchanged
+ encoded in the native endian of the guest (where such distinction is applicable
+).
+\change_inserted 1986246365 1320767660
+
+\end_layout
+
+\begin_layout Subsection
+Device Initialization Sequence
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:Device-Initialization-Sequence"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+We start with an overview of device initialization, then expand on the details
+ of the device and how each step is preformed.
+\end_layout
+
+\begin_layout Enumerate
+Reset the device.
+ This is not required on initial start up.
+\change_inserted 1986246365 1320918056
+
+\end_layout
+
+\begin_layout Enumerate
+
+\change_inserted 1986246365 1320918057
+PCI capability list scan, detecting virtio configuration layout using Virtio
+ Structure PCI capabilities.
+
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320918057
+Historically drivers skipped this step, using legacy configuration space
+ unconditionally.
+\end_layout
+
+\end_inset
+
+
+\change_unchanged
+
+\end_layout
+
+\begin_layout Enumerate
+The ACKNOWLEDGE status bit is set: we have noticed the device.
+\end_layout
+
+\begin_layout Enumerate
+The DRIVER status bit is set: we know how to drive the device.
+\end_layout
+
+\begin_layout Enumerate
+Device-specific setup, including reading the Device Feature Bits, discovery
+ of virtqueues for the device, optional MSI-X setup, and reading and possibly
+ writing the virtio configuration space.
+\end_layout
+
+\begin_layout Enumerate
+The subset of Device Feature Bits understood by the driver is written to
+ the device.
+\end_layout
+
+\begin_layout Enumerate
+The DRIVER_OK status bit is set.
+\end_layout
+
+\begin_layout Enumerate
+The device can now be used (ie.
+ buffers added to the virtqueues)
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+Historically, drivers have used the device before steps 5 and 6.
+ This is only allowed if the driver does not use any features which would
+ alter this early use of the device.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+If any of these steps go irrecoverably wrong, the guest should set the FAILED
+ status bit to indicate that it has given up on the device (it can reset
+ the device later to restart if desired).
+\end_layout
+
+\begin_layout Standard
+We now cover the fields required for general setup in detail.
+\change_inserted 1986246365 1320766663
+
+\end_layout
+
+\begin_layout Subsection
+
+\change_inserted 1986246365 1320781584
+Virtio Structure PCI Capability
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320781061
+Virtio configuration layout includes virtio configuration header, notification
+ and ISR status and device configuration structures.
+ Each structure is mapped by a Base Address register (BAR) belonging to
+ the function, located beginning at 10h in Configuration Space.
+
+\emph on
+Structure ID
+\emph default
+indentifies the structure
+\emph on
+, Size
+\emph default
+ indicates the structure size, in bytes, a
+\emph on
+BAR Indicator register (BIR)
+\emph default
+ indicates which BAR, and
+\emph on
+Offset
+\emph default
+ indicates where the structure begins relative to the base address associated
+ with the BAR.
+ The BAR is permitted to be either 32-bit or 64-bit, it can map Memory Space
+ or I/O Space.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320838522
+These registers are specified using vendor-specific PCI capability located
+ on capability list in PCI configuration space of the device.
+ This virtio structure capability uses little-endian format; all bits are
+ read-only:
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+resizebox{
+\backslash
+textwidth}{!}{%
+\end_layout
+
+\end_inset
+
+
+\change_inserted 1986246365 1320839073
+
+\begin_inset Tabular
+<lyxtabular version="3" rows="4" columns="34">
+<features tabularvalignment="bottom">
+<column alignment="center" valignment="top" width="0pt">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0pt">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771774
+
+\size tiny
+Bit
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771777
+
+\size tiny
+31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771779
+
+\size tiny
+30
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771781
+
+\size tiny
+29
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771783
+
+\size tiny
+28
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771786
+
+\size tiny
+27
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771810
+
+\size tiny
+26
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771813
+
+\size tiny
+25
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771815
+
+\size tiny
+24
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771817
+
+\size tiny
+23
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771819
+
+\size tiny
+22
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771821
+
+\size tiny
+21
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771823
+
+\size tiny
+20
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771825
+
+\size tiny
+19
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771829
+
+\size tiny
+18
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771831
+
+\size tiny
+17
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771833
+
+\size tiny
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771835
+
+\size tiny
+15
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771840
+
+\size tiny
+14
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771841
+
+\size tiny
+13
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771843
+
+\size tiny
+12
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771845
+
+\size tiny
+11
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771847
+
+\size tiny
+10
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771850
+
+\size tiny
+9
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771852
+
+\size tiny
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771854
+
+\size tiny
+7
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771856
+
+\size tiny
+6
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771858
+
+\size tiny
+5
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771859
+
+\size tiny
+4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771861
+
+\size tiny
+3
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771862
+
+\size tiny
+2
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771864
+
+\size tiny
+1
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771888
+
+\size tiny
+0
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320771997
+
+\size tiny
+Offset
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320781029
+
+\size larger
+Structure ID
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850302
+
+\size larger
+CapLength = 12
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850298
+
+\size larger
+NextCapPtr
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850289
+
+\size larger
+CapID = 9
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772004
+0
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772549
+
+\size larger
+Size
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850408
+
+\size larger
+BIR
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772007
+4
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772540
+
+\size larger
+Offset
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320772011
+8
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\change_unchanged
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+}
+\end_layout
+
+\end_inset
+
+
+\change_inserted 1986246365 1320839073
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320838992
+Purpose:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320780912
+
+\emph on
+Capability ID
+\emph default
+,
+\emph on
+Next Capability Pointer
+\emph default
+,
+\emph on
+Capability Length
+\emph default
+ - these fields are specified by PCI local bus specification, Rev 3.0
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320785073
+
+\emph on
+Structure ID
+\emph default
+ - identifies the structure mapped.
+ If an ID representing a specific structure is absent, the structure is
+ located in the legacy virtio configuration in the first PCI BAR.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320782689
+
+\emph on
+Size
+\emph default
+ - size of the structure mapped.
+ This size might include padding, or fields unused by the driver.
+ Drivers are also recommended to only map part of configuration structure
+ large enough for device operation.
+ For example, a future device might present a large structure size of several
+ MBytes.
+ As current devices never utilize structures larger than 4KBytes in size,
+ driver can limit the mapped structure size to e.g.
+ 4KBytes to allow forward compatibility with such devices without loss of
+ functionality and without wasting resources.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320839833
+
+\emph on
+BIR - BAR Indicator Register
+\emph default
+ - Indicates which one of the BAR registers, located beginning at 10h in
+ Configuration Space, is used to map the structure into Memory or I/O Space.
+ Legal values are 0 - 5.
+ BAR offset is calculated as
+\emph on
+BAR
+\emph default
+ = 10h + 4 *
+\emph on
+BIR.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320781002
+
+\emph on
+Offset
+\emph default
+ - Used as an offset from the address contained by one of the function’s
+ Base Address registers to point to the base of the structure.
+ Depending on the structure, the lower bits are masked off (set to zero)
+ by software to form an aligned offset.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320785098
+A single device has multiple virtio capabilities on the PCI capability linked-li
+st.
+ To locate a specific register, driver scans the PCI capability list looking
+ for capabilities using the vendor specific
+\emph on
+Capability ID
+\emph default
+, that is
+\emph on
+Capability ID
+\emph default
+ value
+\emph on
+9
+\emph default
+, according to the PCI spec.
+ For each capability, it verifies that the
+\emph on
+Capability Length
+\emph default
+ field matches the expected value (12) - if it doesn't, this indicates a
+ layout change, which causes driver to ignore the specific PCI capability
+ and proceed to the next PCI capability in the list.
+ Next,
+\emph on
+ Structure ID
+\emph default
+ single-byte field is read at offset 3.
+ Unrecognized
+\emph on
+Structure ID
+\emph default
+ values are ignored.
+ Low bits in the
+\emph on
+Offset
+\emph default
+ register are masked to match alignment requirements, if any.
+ Device drivers are recommended to sanity check
+\emph on
+BIR
+\emph default
+,
+\emph on
+Offset
+\emph default
+, and
+\emph on
+Size
+\emph default
+ fields, ignoring the capability or failing gracefully on error.
+ Drivers are also recommended to only map part of configuration structure
+ large enough for device operation.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320920511
+For backwards compatibility, devices should also present legacy configuration
+ space in BAR0 in the first I/O region of the PCI device, mirroring virtio
+ configuration structures in this space.
+ For forwards compatibility, drivers should fall back on this legacy structure
+ if a specific Virtio Structure capability is missing in the PCI capability
+ list.
+ However, devices are not required to map the whole configuration structure
+ in legacy space - only the initial segment expected by legacy drivers needs
+ to be mapped.
+ Devices are further required to implement all Structure IDs for the structures
+ they present, as opposed to relying on driver legacy fallback.
+ The minimal size of such legacy segment size, for each structure, is listed
+ below.
+ Drivers are discouraged from using legacy space if a specific Structure
+ ID is present; this is to allow deprecating the legacy space in the future.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320850770
+Below is the list of supported Virtio structures, including Structure ID,
+ offset alignment, and where it can be located in the legacy configuration
+ space.
+ Note that legacy space layout changes as the MSI-X capability is enabled
+ and disabled
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320856794
+ie.
+ once you enable MSI-X on the device, some legacy fields move.
+ If you turn it off again, they move back! this does not affect the new
+ configuration
+\end_layout
+
+\end_inset
+
+.
+ Alignment, offset and all sizes are in bytes.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786868
+\begin_inset Tabular
+<lyxtabular version="3" rows="6" columns="6">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<row>
+<cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Structure
+\change_inserted 1986246365 1320855560
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+ID
+\change_inserted 1986246365 1320855560
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Align-
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855560
+MinSize
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785821
+Offset in
+\change_deleted 1986246365 1320785817
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320850780
+MinSize in
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell multirow="4" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="4" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855625
+ment
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="4" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855593
+legacy space
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855610
+ legacy space
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785855
+Virtio Header
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320785860
+0x1
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786157
+4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320918196
+32 bytes
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786145
+0
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855180
+24 or 20
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855511
+\begin_inset CommandInset label
+LatexCommand label
+name "fn:24-or-20"
+
+\end_inset
+
+24 bytes if MSI-X is enabled, 20 bytes if it is disabled
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786188
+Queue Notify
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786191
+0x2
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786267
+2 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786228
+2 bytes
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786505
+16 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786303
+2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786878
+ISR Status
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786260
+0x3
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786270
+1 byte
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786273
+1 byte
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786534
+19 bytes
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786306
+1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786847
+Device Header
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786474
+0x4
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320786477
+1 byte
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320918121
+...
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855417
+\begin_inset CommandInset label
+LatexCommand label
+name "fn:Device-specific"
+
+\end_inset
+
+Device specific
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320855534
+24 or 20
+\begin_inset Formula $^{\text{\ref{fn:24-or-20}}}$
+\end_inset
+
+
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320918125
+...
+\begin_inset Formula $^{\text{\ref{fn:Device-specific}}}$
+\end_inset
+
+
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320786973
+Drivers should assume that each structure size can be extended in the future.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320859762
+Queue Notify and ISR status are single-field registers.
+ Device Header has device specific structure.
+ Virtio Header structure is documented below.
+\end_layout
+
+\begin_layout Subsubsection
+
+\change_inserted 1986246365 1320867253
+Example Virtio Structure Layout
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320865758
+Let's assume that a virtio block device presents two Virtio Structure capabiliti
+es in PCI capability list:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863392
+Structure ID 0x1; BIR 1; Offset 0x1000; Size 0x100
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863399
+Structure ID 0x4; BIR 1; Offset 0x1100; Size 0x200
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863479
+Let's further assume that MSI-X is disabled.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863498
+In this case, the driver should use:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863543
+Virtio Header at offset 0x1000 in BAR 1
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320863568
+Device Header at offset 0x1100 in BAR1
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320868074
+Queue Notify at offset 0x10 in BAR0 (legacy configuration space is used
+ since Structure ID is not present)
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320868077
+ISR status at offset 0x13 in BAR0 (legacy configuration space is used since
+ Structure ID is not present)
+\change_unchanged
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320867162
+For use by legacy drivers, the first 20 bytes in BAR0 mirror bytes 0x1000
+ to 0x1013 in BAR1, and the following 32 bytes in BAR0 should mirror bytes
+ 0x1100 to 111F in BAR1.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320867231
+Enabling MSI-X only affects the legacy drivers: with MSI-X enabled, the
+ first 24 bytes in BAR0 mirror bytes 0x1000 to 0x1017 in BAR1, and the following
+ 32 bytes in BAR0 should mirror bytes 0x1100 to 111F in BAR1.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Subsection
+
+\change_inserted 1986246365 1320855988
+Virtio Header
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320858571
+The virtio header looks as follows:
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320858597
+\begin_inset Tabular
+<lyxtabular version="3" rows="13" columns="3">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858603
+Bits
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858614
+R/W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858619
+Purpose
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858841
+32
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858858
+R
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858870
+Device Features bits 0:31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858873
+32
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858876
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858885
+Guest Features bits 0:31
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858889
+32
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858891
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858907
+Queue Address
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859001
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859006
+R
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858953
+Queue Size
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859012
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859008
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858957
+Queue Select
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859015
+16
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858964
+Reserved
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859029
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859032
+R+W
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858972
+Device Status
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859052
+8
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320858989
+Reserved
+\change_unchanged
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859063
+16
+\change_unchanged
+
\end_layout
-\begin_layout Standard
-There may be different widths of accesses to the I/O region; the
-\begin_inset Quotes eld
\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
-natural
-\begin_inset Quotes erd
-\end_inset
+\begin_layout Plain Layout
- access method for each field in the virtio header must be used (i.e.
- 32-bit accesses for 32-bit fields, etc), but the device-specific region
- can be accessed using any width accesses, and should obtain the same results.
-\end_layout
+\change_inserted 1986246365 1320859065
+R+W
+\change_unchanged
-\begin_layout Standard
-Note that this is possible because while the virtio header is PCI (i.e.
- little) endian, the device-specific region is encoded in the native endian
- of the guest (where such distinction is applicable).
\end_layout
-\begin_layout Subsection
-Device Initialization Sequence
-\begin_inset CommandInset label
-LatexCommand label
-name "sub:Device-Initialization-Sequence"
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859081
+MSI-X Configuration Vector
+\change_unchanged
+
+\end_layout
\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859083
+16
+\change_unchanged
\end_layout
-\begin_layout Standard
-We start with an overview of device initialization, then expand on the details
- of the device and how each step is preformed.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859088
+R+W
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-Reset the device.
- This is not required on initial start up.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859095
+MSI-X Queue Vector
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The ACKNOWLEDGE status bit is set: we have noticed the device.
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859102
+32
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The DRIVER status bit is set: we know how to drive the device.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859106
+R
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-Device-specific setup, including reading the Device Feature Bits, discovery
- of virtqueues for the device, optional MSI-X setup, and reading and possibly
- writing the virtio configuration space.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859116
+Device Features bits 32:63
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The subset of Device Feature Bits understood by the driver is written to
- the device.
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859122
+32
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The DRIVER_OK status bit is set.
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\change_inserted 1986246365 1320859119
+R+W
+\change_unchanged
+
\end_layout
-\begin_layout Enumerate
-The device can now be used (ie.
- buffers added to the virtqueues)
-\begin_inset Foot
-status open
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
\begin_layout Plain Layout
-Historically, drivers have used the device before steps 5 and 6.
- This is only allowed if the driver does not use any features which would
- alter this early use of the device.
+
+\change_inserted 1986246365 1320859130
+Guest Features bits 32:63
+\change_unchanged
+
\end_layout
\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
\end_layout
-\begin_layout Standard
-If any of these steps go irrecoverably wrong, the guest should set the FAILED
- status bit to indicate that it has given up on the device (it can reset
- the device later to restart if desired).
+\begin_layout Subsubsection
+
+\change_inserted 1986246365 1320856004
+Legacy
+\change_unchanged
+Virtio Header
\end_layout
\begin_layout Standard
-We now cover the fields required for general setup in detail.
-\end_layout
-\begin_layout Subsection
-Virtio Header
+\change_inserted 1986246365 1320867482
+For backwards compatibility, devices should mirror the initial part of virtio
+ header and device header structures, Queue Notify and ISR Status registers
+ in legacy configuration space in the first I/O region of the PCI device.
+ Drivers should fall back on this legacy structure if a specific Virtio
+ Structure capability is missing in the PCI capability list.
+ Drivers are discouraged from using legacy space if a specific Structure
+ ID is present; this is to allow deprecating the legacy space in the future.
\end_layout
\begin_layout Standard
-The virtio header looks as follows:
+
+\change_inserted 1986246365 1320859848
+For reference, the
+\change_deleted 1986246365 1320856044
+The
+\change_unchanged
+
+\change_inserted 1986246365 1320859848
+legacy
+\change_unchanged
+virtio header looks as follows
+\change_inserted 1986246365 1320859848
+; one observes that most register offsets match the new virtio header, to
+ make compatibility easier
+\change_unchanged
+:
\end_layout
\begin_layout Standard
@@ -1067,11 +4113,15 @@ Status
If MSI-X is enabled for the device, two additional fields immediately follow
this header:
\begin_inset Foot
-status collapsed
+status open
\begin_layout Plain Layout
ie.
- once you enable MSI-X on the device, the other fields move.
+ once you enable MSI-X on the device, the other fields
+\change_inserted 1986246365 1320867540
+in legacy configuration
+\change_unchanged
+move.
If you turn it off again, they move back!
\end_layout
@@ -1219,11 +4269,15 @@ Vector
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320867563
Finally, if feature bits (VIRTIO_F_FEATURES_HI) this is immediately followed
by two additional fields:
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320867563
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features tabularvalignment="middle">
@@ -1359,11 +4413,16 @@ Features bits 32:63
\end_inset
+\change_unchanged
+
\end_layout
\begin_layout Standard
-Immediately following these general headers, there may be device-specific
- headers:
+Immediately following these general headers, there may be
+\change_inserted 1986246365 1320856347
+legacy
+\change_unchanged
+device-specific headers:
\end_layout
\begin_layout Standard
@@ -1459,6 +4518,17 @@ Device Specific...
\end_inset
+\change_inserted 1986246365 1320856108
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1986246365 1320856109
+Legacy device-specific headers are supported for backwards compatibility.
+ As such, they are not required to map the whole device configuration structure
+ - only the initial segment expected by legacy drivers needs to be mapped.
+ The size of such legacy segment size is device specific.
\end_layout
\begin_layout Subsubsection
@@ -1531,8 +4601,10 @@ name "sub:Feature-Bits"
The least significant 31 bits of the first configuration field indicates
the features that the device supports (the high bit is reserved, and will
be used to indicate the presence of future feature bits elsewhere).
- If more than 31 feature bits are supported, the device indicates so by
- setting feature bit 31 (see
+
+\change_deleted 1986246365 1320784929
+If more than 31 feature bits are supported, the device indicates so by setting
+ feature bit 31 (see
\begin_inset CommandInset ref
LatexCommand ref
reference "cha:Reserved-Feature-Bits"
@@ -1540,7 +4612,9 @@ reference "cha:Reserved-Feature-Bits"
\end_inset
).
- The bits are allocated as follows:
+
+\change_unchanged
+The bits are allocated as follows:
\end_layout
\begin_layout Description
@@ -1615,10 +4689,14 @@ This allows for forwards and backwards compatibility: if the device is enhanced
\end_layout
\begin_layout Standard
+
+\change_deleted 1986246365 1320784940
Access to feature bits 32 to 63 is enabled by Guest by setting feature bit
31.
If this bit is unset, Device must assume that all feature bits > 31 are
unset.
+\change_unchanged
+
\end_layout
\begin_layout Subsubsection
@@ -1629,10 +4707,14 @@ Configuration/Queue Vectors
When MSI-X capability is present and enabled in the device (through standard
PCI configuration space) 4 bytes at byte offset 20 are used to map configuratio
n change and queue interrupts to MSI-X vectors.
- In this case, the ISR Status field is unused, and device specific configuration
- starts at byte offset 24 in virtio header structure.
+ In this case, the ISR Status field is unused
+\change_deleted 1986246365 1320784981
+, and device specific configuration starts at byte offset 24 in virtio header
+ structure.
When MSI-X capability is not enabled, device specific configuration starts
- at byte offset 20 in virtio header.
+ at byte offset 20 in virtio header
+\change_unchanged
+.
\end_layout
\begin_layout Standard
@@ -3829,7 +6911,13 @@ Appendix B: Reserved Feature Bits
\end_layout
\begin_layout Standard
-Currently there are five device-independent feature bits defined:
+Currently there are
+\change_deleted 1986246365 1320867366
+five
+\change_inserted 1986246365 1320867367
+four
+\change_unchanged
+ device-independent feature bits defined:
\end_layout
\begin_layout Description
@@ -3926,9 +7014,13 @@ An experimental virtio PCI driver contained in Linux version 2.6.25 had this
\end_layout
\begin_layout Description
+
+\change_deleted 1986246365 1320867370
VIRTIO_F_FEATURES_HIGH(31) This feature indicates that the device supports
feature bits 32:63.
If unset, feature bits 32:63 are unset.
+\change_unchanged
+
\end_layout
\begin_layout Chapter*
@@ -4186,6 +7278,24 @@ struct virtio_net_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867743
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 8 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
@@ -5226,6 +8336,24 @@ struct virtio_blk_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867779
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 32 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
@@ -5780,6 +8908,24 @@ struct virtio_console_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867806
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 8 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
@@ -5994,6 +9140,28 @@ configuration
\end_inset
layout None currently defined.
+\change_inserted 1986246365 1320867840
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1986246365 1320867845
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 0 bytes.
+\change_unchanged
+
\end_layout
\begin_layout Section*
@@ -6127,6 +9295,24 @@ struct virtio_balloon_config {
\end_layout
+\begin_layout Description
+
+\change_inserted 1986246365 1320867865
+Device
+\begin_inset space ~
+\end_inset
+
+legacy
+\begin_inset space ~
+\end_inset
+
+configuration
+\begin_inset space ~
+\end_inset
+
+size for this device is 4 bytes.
+\end_layout
+
\begin_layout Section*
Device Initialization
\end_layout
^ permalink raw reply related [flat|nested] 134+ messages in thread