Introduce transitional mmr pci device
cover Introduce transitional mmr pci device
Overview:
---------
The Transitional MMR device is a variant of the transitional PCI device. It has its own small Device ID range. It does not have I/O region BAR; instead it exposes legacy configuration and device specific registers at an offset in the memory region BAR.
Such transitional MMR devices will be used at the scale of thousands of devices using PCI SR-IOV and/or future scalable virtualization technology to provide backward compatibility (for legacy devices) and also future compatibility with new features.
Usecase:
--------
1. A hypervisor/system needs to provide transitional virtio devices to the guest VM at scale of thousands, typically, one to eight devices per VM.
2. A hypervisor/system needs to provide such devices using a vendor agnostic driver in the hypervisor system.
3. A hypervisor system prefers to have single stack regardless of virtio device type (net/blk) and be future compatible with a single vfio stack using SR-IOV or other scalable device virtualization technology to map PCI devices to the guest VM. (as transitional or otherwise)
Motivation/Background:
----------------------
The existing transitional PCI device is missing support for PCI SR-IOV based devices. Currently it does not work beyond PCI PF, or as software emulated device in reality. It currently has below cited system level limitations:
[a] PCIe spec citation:
VFs do not support I/O Space and thus VF BARs shall not indicate I/O Space.
[b] cpu arch citiation:
Intel 64 and IA-32 Architectures Software Developer’s Manual:
The processor’s I/O address space is separate and distinct from the physical-memory address space. The I/O address space consists of 64K individually addressable 8-bit I/O ports, numbered 0 through FFFFH.
[c] PCIe spec citation:
If a bridge implements an I/O address range,...I/O address range will be aligned to a 4 KB boundary.
[d] I/O region accesses at PCI system level is slow as they are non-posted operations in PCIe fabric.
The usecase requirements and limitations above can be solved by extending the transitional device, mapping legacy and device specific configuration registers in a memory PCI BAR instead of using non composable I/O region.
Please review.
Patch summary:
--------------
patch 1 to 5 prepares the spec
patch 6 to 11 defines transitional mmr device
patch-1 uses lower case alphabets to name device id patch-2 move transitional device id in legay section along with
revision id
patch-3 splits legacy feature bits description from device id patch-4 rename and moves virtio config registers next to 1.x
registers section
patch-5 Adds missing helper verb in terminology definitions patch-6 introduces transitional mmr device
patch-7 introduces transitional mmr device pci device ids patch-8 introduces virtio extended pci capability patch-9 describes new pci capability to locate legacy mmr
registers
patch-10 extended usage of driver notification capability for
the transitional mmr device
patch-11 adds conformance section of the transitional mmr device
This design and details further described below.
Design:
-------
Below picture captures the main small difference between current transitional PCI SR-IOV VF and transitional MMR SR-IOV VF.
+------------------+ +--------------------+ +--------------------+
|virtio 1.x | |Transitional | |Transitional |
|SRIOV VF | |SRIOV VF | |MMR SRIOV VF |
| | | | | |
++---------------+ | ++---------------+ | ++---------------+ |
||dev_id = | | ||dev_id = | | ||dev_id = | |
||{0x1040-0x106C}| | ||{0x1000-0x103f}| | ||{0x10f9-0x10ff}| |
|+---------------+ | |+---------------+ | |+---------------+ |
| | | | | |
|+------------+ | |+------------+ | |+-----------------+ |
||Memory BAR | | ||Memory BAR | | ||Memory BAR | |
|+------------+ | |+------------+ | || | |
| | | | || +--------------+| |
| | |+-----------------+ | || |legacy virtio || |
| | ||IOBAR impossible | | || |+ dev cfg || |
| | |+-----------------+ | || |registers || |
| | | | || +--------------+| |
| | | | |+-----------------+ |
+------------------+ +--------------------+ +--------------------+Here transitional MMR SR-IOV VF has legacy configuration and legacy device specific registers located at an offset in the memory region BAR.
A memory region can be dedicated at BAR0 or it can be in an existing BAR, allowing flexibility when implementing support in a hardware device.
Transitional MMR SR-IOV VFs use a distinct device ID range to that of existing virtio SR-IOV VFs to allow flexibility in driver binding.
A more zoom-in version of transitional MMR SR-IOV device shows that the location of the legacy registers are discovered by the driver using a new capability.
+------------------------------+
|Transitional |
|MMR SRIOV VF |
| |
++---------------+ |
||dev_id = | |
||{0x10f9-0x10ff}| |
|+---------------+ |
| |
++--------------------+ |
|| PCIe ext cap = 0xB | |
|| cfg_type = 10 | |
|| offset = 0x1000 | |
|| bar = N {0..5}| |
|+--|-----------------+ |
| | |
| | |
| | +-------------------+ |
| | | Memory BAR = A | |
| | | | |
| +------>+--------------+ | |
| | |legacy virtio | | |
| | |+ dev cfg | | |
| | |registers | | |
| | +--------------+ | |
| +-----------------+ | |
+------------------------------+Software usage:
---------------
Transitional MMR device can be used by multiple ways.
1. The most common way to use and map to the guest VM is by using vfio driver framework in Linux kernel.
+----------------------+
|pci_dev_id = 0x100X |
+---------------|pci_rev_id = 0x0 |-----+
|vfio device |BAR0 = I/O region | |
| |Other attributes | |
| +----------------------+ |
| |
+ +--------------+ +-----------------+ |
| |I/O to memory | | Other vfio | |
| |rd/wr mapper | | functionalities | |
| +--------------+ +-----------------+ |
| |
+-------------------+------------------------+
|
+------------+-----------------+
| Transitional |
| MMR SRIOV VF |
+------------------------------+2. Virtio pci driver to bind to the listed device id and use it as native device in the host.
3. Use it in a light weight hypervisor to run bare-metal OS.
Parav Pandit (11):
transport-pci: Use lowecase alphabets
transport-pci: Move transitional device id to legacy section
transport-pci: Split notes of PCI Device Layout
transport-pci: Rename and move legacy PCI Device layout section
introduction: Add missing helping verb
introduction: Introduce transitional MMR interface
transport-pci: Introduce transitional MMR device id
transport-pci: Introduce virtio extended capability
transport-pci: Describe PCI MMR dev config registers
transport-pci: Use driver notification PCI capability
conformance: Add transitional MMR interface conformance
conformance.tex | 11 +- introduction.tex | 34 +++- tmmr-conformance.tex | 27 +++ transport-pci.tex | 405 ++++++++++++++++++++++++++++++------------- 4 files changed, 354 insertions(+), 123 deletions(-) create mode 100644 tmmr-conformance.tex
Signature · 18 lines
2.26.2 This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
PATCH 1/11 transport-pci: Use lowecase alphabets
Use uniformly lowercase alphabets to write PCI vendor id and device id.
--- transport-pci.tex | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
transport-pci.tex +7 -7
@@ -18,17 +18,17 @@ \section{Virtio Over PCI Bus}\label{sec:Virtio Transport Options / Virtio Over P \subsection{PCI Device Discovery}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery} -Any PCI device with PCI Vendor ID 0x1AF4, and PCI Device ID 0x1000 through -0x107F inclusive is a virtio device. The actual value within this range +Any PCI device with PCI Vendor ID 0x1af4, and PCI Device ID 0x1000 through +0x107f inclusive is a virtio device. The actual value within this range indicates which virtio device is supported by the device. The PCI Device ID is calculated by adding 0x1040 to the Virtio Device ID, as indicated in section \ref{sec:Device Types}. Additionally, devices MAY utilize a Transitional PCI Device ID range, -0x1000 to 0x103F depending on the device type. +0x1000 to 0x103f depending on the device type. \devicenormative{\subsubsection}{PCI Device Discovery}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery} -Devices MUST have the PCI Vendor ID 0x1AF4. +Devices MUST have the PCI Vendor ID 0x1af4. Devices MUST either have the PCI Device ID calculated by adding 0x1040 to the Virtio Device ID, as indicated in section \ref{sec:Device Types} or have the Transitional PCI Device ID depending on the device type,
@@ -69,13 +69,13 @@ \subsection{PCI Device Discovery}\label{sec:Virtio Transport Options / Virtio Ov to drive the device. \drivernormative{\subsubsection}{PCI Device Discovery}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery} -Drivers MUST match devices with the PCI Vendor ID 0x1AF4 and +Drivers MUST match devices with the PCI Vendor ID 0x1af4 and the PCI Device ID in the range 0x1040 to 0x107f, calculated by adding 0x1040 to the Virtio Device ID, as indicated in section \ref{sec:Device Types}. Drivers for device types listed in section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery} -MUST match devices with the PCI Vendor ID 0x1AF4 and +MUST match devices with the PCI Vendor ID 0x1af4 and the Transitional PCI Device ID indicated in section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}.
@@ -691,7 +691,7 @@ \subsubsection{Vendor data capability}\label{sec:Virtio Devices CAN present multiple Vendor data capabilities with either different or identical \field{vendor_id} values. -The value \field{vendor_id} MUST NOT equal 0x1AF4. +The value \field{vendor_id} MUST NOT equal 0x1af4. The size of the Vendor data capability MUST be a multiple of 4 bytes.
Signature · 6 lines
2.26.2 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
PATCH 2/11 transport-pci: Move transitional device id to legacy section
In reply to Parav PanditCurrently PCI device discovery details for the transitional device are documented in two different sections.
For example, PCI device and vendor ID registers are documented in 'Device Requirements: PCI Device Discovery' section, while PCI revision id is documented in 'Legacy Interfaces: A Note on PCI Device Discovery' section.
Transitional devices requirements should be documented in "legacy interfaces" section as clearly mentioned in
'Legacy Interface: A Note on Feature Bits'.
Hence,
1. Move transitional device requirements to its designated Legacy interface section
2. Describe regular device requirements without quoting it as "non transitional device"
While at it, write the description using a singular object definition.
--- transport-pci.tex | 70 ++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 34 deletions(-)
transport-pci.tex +36 -34
@@ -28,46 +28,24 @@ \subsection{PCI Device Discovery}\label{sec:Virtio Transport Options / Virtio Ov \devicenormative{\subsubsection}{PCI Device Discovery}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery} -Devices MUST have the PCI Vendor ID 0x1af4. -Devices MUST either have the PCI Device ID calculated by adding 0x1040 +The device MUST have the PCI Vendor ID 0x1af4. +The device MUST calculate PCI Device ID by adding 0x1040 to the Virtio Device ID, as indicated in section \ref{sec:Device -Types} or have the Transitional PCI Device ID depending on the device type, -as follows: - -\begin{tabular}{|l|c|} -\hline -Transitional PCI Device ID & Virtio Device \\ -\hline \hline -0x1000 & network device \\ -\hline -0x1001 & block device \\ -\hline -0x1002 & memory ballooning (traditional) \\ -\hline -0x1003 & console \\ -\hline -0x1004 & SCSI host \\ -\hline -0x1005 & entropy source \\ -\hline -0x1009 & 9P transport \\ -\hline -\end{tabular} +Types}. For example, the network device with the Virtio Device ID 1 -has the PCI Device ID 0x1041 or the Transitional PCI Device ID 0x1000. - -The PCI Subsystem Vendor ID and the PCI Subsystem Device ID MAY reflect -the PCI Vendor and Device ID of the environment (for informational purposes by the driver). +has the PCI Device ID 0x1041. -Non-transitional devices SHOULD have a PCI Device ID in the range -0x1040 to 0x107f. -Non-transitional devices SHOULD have a PCI Revision ID of 1 or higher. -Non-transitional devices SHOULD have a PCI Subsystem Device ID of 0x40 or higher. +The device SHOULD have a PCI Device ID in the range 0x1040 to 0x107f. +The device SHOULD have a PCI Revision ID of 1 or higher. +The device SHOULD have a PCI Subsystem Device ID of 0x40 or higher. This is to reduce the chance of a legacy driver attempting to drive the device. +The PCI Subsystem Vendor ID and the PCI Subsystem Device ID MAY reflect +the PCI Vendor and Device ID of the environment (for informational purposes by the driver). + \drivernormative{\subsubsection}{PCI Device Discovery}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery} Drivers MUST match devices with the PCI Vendor ID 0x1af4 and the PCI Device ID in the range 0x1040 to 0x107f,
@@ -85,8 +63,32 @@ \subsection{PCI Device Discovery}\label{sec:Virtio Transport Options / Virtio Ov PCI Subsystem Device ID value. \subsubsection{Legacy Interfaces: A Note on PCI Device Discovery}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery / Legacy Interfaces: A Note on PCI Device Discovery} -Transitional devices MUST have a PCI Revision ID of 0. -Transitional devices MUST have the PCI Subsystem Device ID + +The transitional device has one of the following PCI Device ID +depending on the device type: + +\begin{tabular}{|l|c|} +\hline +Transitional PCI Device ID & Virtio Device \\ +\hline \hline +0x1000 & network device \\ +\hline +0x1001 & block device \\ +\hline +0x1002 & memory ballooning (traditional) \\ +\hline +0x1003 & console \\ +\hline +0x1004 & SCSI host \\ +\hline +0x1005 & entropy source \\ +\hline +0x1009 & 9P transport \\ +\hline +\end{tabular} + +The transitional device MUST have a PCI Revision ID of 0. +The transitional device MUST have the PCI Subsystem Device ID matching the Virtio Device ID, as indicated in section \ref{sec:Device Types}. Transitional devices MUST have the Transitional PCI Device ID in the range 0x1000 to 0x103f.
Signature · 6 lines
2.26.2 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH 02/11] transport-pci: Move transitional device id to legacy section
Quoted 11 lines · Parav Pandit
Currently PCI device discovery details for the transitional device are documented in two different sections.
For example, PCI device and vendor ID registers are documented in 'Device Requirements: PCI Device Discovery' section, while PCI revision id is documented in 'Legacy Interfaces: A Note on PCI Device Discovery' section.
Transitional devices requirements should be documented in "legacy interfaces" section as clearly mentioned in
'Legacy Interface: A Note on Feature Bits'.
I already commented on this, I disagree.
Modern drivers must be able
to completely ignore legacy interface sections, but they do bind to transitional device IDs.
This change breaks this assumption.
Quoted 112 lines
Hence,
1. Move transitional device requirements to its designated Legacy interface section
2. Describe regular device requirements without quoting it as "non transitional device"While at it, write the description using a singular object definition.
Reviewed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>--- transport-pci.tex | 70 ++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 34 deletions(-)transport-pci.tex +36
-34@@ -28,46 +28,24 @@ \subsection{PCI Device Discovery}\label{sec:Virtio Transport Options / Virtio Ov \devicenormative{\subsubsection}{PCI Device Discovery}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery} -Devices MUST have the PCI Vendor ID 0x1af4. -Devices MUST either have the PCI Device ID calculated by adding 0x1040 +The device MUST have the PCI Vendor ID 0x1af4. +The device MUST calculate PCI Device ID by adding 0x1040 to the Virtio Device ID, as indicated in section \ref{sec:Device -Types} or have the Transitional PCI Device ID depending on the device type, -as follows: - -\begin{tabular}{|l|c|} -\hline -Transitional PCI Device ID & Virtio Device \\ -\hline \hline -0x1000 & network device \\ -\hline -0x1001 & block device \\ -\hline -0x1002 & memory ballooning (traditional) \\ -\hline -0x1003 & console \\ -\hline -0x1004 & SCSI host \\ -\hline -0x1005 & entropy source \\ -\hline -0x1009 & 9P transport \\ -\hline -\end{tabular} +Types}. For example, the network device with the Virtio Device ID 1 -has the PCI Device ID 0x1041 or the Transitional PCI Device ID 0x1000. - -The PCI Subsystem Vendor ID and the PCI Subsystem Device ID MAY reflect -the PCI Vendor and Device ID of the environment (for informational purposes by the driver). +has the PCI Device ID 0x1041. -Non-transitional devices SHOULD have a PCI Device ID in the range -0x1040 to 0x107f. -Non-transitional devices SHOULD have a PCI Revision ID of 1 or higher. -Non-transitional devices SHOULD have a PCI Subsystem Device ID of 0x40 or higher. +The device SHOULD have a PCI Device ID in the range 0x1040 to 0x107f. +The device SHOULD have a PCI Revision ID of 1 or higher. +The device SHOULD have a PCI Subsystem Device ID of 0x40 or higher. This is to reduce the chance of a legacy driver attempting to drive the device. +The PCI Subsystem Vendor ID and the PCI Subsystem Device ID MAY reflect +the PCI Vendor and Device ID of the environment (for informational purposes by the driver). + \drivernormative{\subsubsection}{PCI Device Discovery}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery} Drivers MUST match devices with the PCI Vendor ID 0x1af4 and the PCI Device ID in the range 0x1040 to 0x107f,@@ -85,8 +63,32 @@ \subsection{PCI Device Discovery}\label{sec:Virtio Transport Options / Virtio Ov PCI Subsystem Device ID value. \subsubsection{Legacy Interfaces: A Note on PCI Device Discovery}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery / Legacy Interfaces: A Note on PCI Device Discovery} -Transitional devices MUST have a PCI Revision ID of 0. -Transitional devices MUST have the PCI Subsystem Device ID + +The transitional device has one of the following PCI Device ID +depending on the device type: + +\begin{tabular}{|l|c|} +\hline +Transitional PCI Device ID & Virtio Device \\ +\hline \hline +0x1000 & network device \\ +\hline +0x1001 & block device \\ +\hline +0x1002 & memory ballooning (traditional) \\ +\hline +0x1003 & console \\ +\hline +0x1004 & SCSI host \\ +\hline +0x1005 & entropy source \\ +\hline +0x1009 & 9P transport \\ +\hline +\end{tabular} + +The transitional device MUST have a PCI Revision ID of 0. +The transitional device MUST have the PCI Subsystem Device ID matching the Virtio Device ID, as indicated in section \ref{sec:Device Types}. Transitional devices MUST have the Transitional PCI Device ID in the range 0x1000 to 0x103f.Signature · 1 line
2.26.2
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH 02/11] transport-pci: Move transitional device id to legacy section
Quoted 18 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Friday, March 31, 2023 2:44 AMQuoted 11 lines · Parav Pandit
Currently PCI device discovery details for the transitional device are documented in two different sections.
For example, PCI device and vendor ID registers are documented in 'Device Requirements: PCI Device Discovery' section, while PCI revision id is documented in 'Legacy Interfaces: A Note on PCI Device Discovery' section.
Transitional devices requirements should be documented in "legacy interfaces" section as clearly mentioned in 'Legacy Interface: A Note on Feature Bits'.
Quoted 6 lines
I already commented on this, I disagree.
Modern drivers must be able
to completely ignore legacy interface sections, but they do bind to transitional device IDs.
This change breaks this assumption.
Legacy interface section holds the detail about transitional devices. We do not have,
"Legacy only" section.
It doesn't make sense to partial information in legacy and partial in other place. Modern drivers are not mentioned in the spec terminology section.
Can you please explain, how can modern driver ignore the text " Transitional devices MUST have a PCI Revision ID of 0." written in legacy interface section?
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 02/11] transport-pci: Move transitional device id to legacy section
Quoted 24 lines · Parav Pandit
Quoted 18 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Friday, March 31, 2023 2:44 AMQuoted 11 lines · Parav Pandit
Currently PCI device discovery details for the transitional device are documented in two different sections.
For example, PCI device and vendor ID registers are documented in 'Device Requirements: PCI Device Discovery' section, while PCI revision id is documented in 'Legacy Interfaces: A Note on PCI Device Discovery' section.
Transitional devices requirements should be documented in "legacy interfaces" section as clearly mentioned in 'Legacy Interface: A Note on Feature Bits'.
Quoted 6 lines
I already commented on this, I disagree.
Modern drivers must be able
to completely ignore legacy interface sections, but they do bind to transitional device IDs.
This change breaks this assumption.
Quoted 8 lines
Legacy interface section holds the detail about transitional devices. We do not have,
"Legacy only" section.It doesn't make sense to partial information in legacy and partial in other place. Modern drivers are not mentioned in the spec terminology section.
Can you please explain, how can modern driver ignore the text " Transitional devices MUST have a PCI Revision ID of 0." written in legacy interface section?
Modern drivers ignore revision ID. It is 0 to accomodate legacy drivers.
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH 02/11] transport-pci: Move transitional device id to legacy section
Quoted 34 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, April 2, 2023 3:55 AMQuoted 28 lines · Parav Pandit
Quoted 18 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Friday, March 31, 2023 2:44 AMQuoted 11 lines · Parav Pandit
Currently PCI device discovery details for the transitional device are documented in two different sections.
For example, PCI device and vendor ID registers are documented in 'Device Requirements: PCI Device Discovery' section, while PCI revision id is documented in 'Legacy Interfaces: A Note on PCI Device Discovery' section.
Transitional devices requirements should be documented in "legacy interfaces" section as clearly mentioned in 'Legacy Interface: A Note on Feature Bits'.
Quoted 6 lines
I already commented on this, I disagree.
Modern drivers must be able
to completely ignore legacy interface sections, but they do bind to transitional device IDs.
This change breaks this assumption.Legacy interface section holds the detail about transitional devices. We do not have,
"Legacy only" section.
Quoted 8 lines
Quoted 1 line
It doesn't make sense to partial information in legacy and partial in other
place.
Quoted 3 lines
Modern drivers are not mentioned in the spec terminology section.
Can you please explain, how can modern driver ignore the text " Transitional
devices MUST have a PCI Revision ID of 0." written in legacy interface section?
Modern drivers ignore revision ID. It is 0 to accommodate legacy drivers.
For transitional device the revision ID must be zero and "a driver" miust check it be zero. The section refers to Legacy interface covering transitional devices (not just legacy device). So it cannot be written in spec from undefined modern driver POV in the spec.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 02/11] transport-pci: Move transitional device id to legacy section
Quoted 38 lines · Parav Pandit
Quoted 38 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, April 2, 2023 3:55 AMQuoted 24 lines · Parav Pandit
Quoted 18 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Friday, March 31, 2023 2:44 AMQuoted 11 lines · Parav Pandit
Currently PCI device discovery details for the transitional device are documented in two different sections.
For example, PCI device and vendor ID registers are documented in 'Device Requirements: PCI Device Discovery' section, while PCI revision id is documented in 'Legacy Interfaces: A Note on PCI Device Discovery' section.
Transitional devices requirements should be documented in "legacy interfaces" section as clearly mentioned in 'Legacy Interface: A Note on Feature Bits'.
Quoted 6 lines
I already commented on this, I disagree.
Modern drivers must be able
to completely ignore legacy interface sections, but they do bind to transitional device IDs.
This change breaks this assumption.Quoted 5 lines
Legacy interface section holds the detail about transitional devices. We do not have,
"Legacy only" section.It doesn't make sense to partial information in legacy and partial in other
place.
Quoted 2 lines
Modern drivers are not mentioned in the spec terminology section.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Can you please explain, how can modern driver ignore the text " Transitional
devices MUST have a PCI Revision ID of 0." written in legacy interface section?
Modern drivers ignore revision ID. It is 0 to accommodate legacy drivers.
For transitional device the revision ID must be zero and "a driver" miust check it be zero. The section refers to Legacy interface covering transitional devices (not just legacy device). So it cannot be written in spec from undefined modern driver POV in the spec.
No idea what all this means, sorry. Please do not move text that affects modern drivers to a legacy section. And we've spilled way too much ink on this already.
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH 02/11] transport-pci: Move transitional device id to legacy section
Quoted 7 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, April 3, 2023 10:50 AMNo idea what all this means, sorry. Please do not move text that affects modern drivers to a legacy section. And we've spilled way too much ink on this already.
I disagree because spec do not describe modern driver and what you are describing is not aligned the way current spec is written. I prefer to avoid mentioning it again the same feature bits section that talks about Transitional interface.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH 02/11] transport-pci: Move transitional device id to legacy section
Quoted 10 lines · Parav Pandit
Quoted 7 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, April 3, 2023 10:50 AMNo idea what all this means, sorry. Please do not move text that affects modern drivers to a legacy section. And we've spilled way too much ink on this already.
I disagree because spec do not describe modern driver and what you are describing is not aligned the way current spec is written. I prefer to avoid mentioning it again the same feature bits section that talks about Transitional interface.
Sorry I don't understand what you are trying to say here. This is all cosmetics, matter of personal preference. But I did my best to try to explain the reason this is not a cleanup but a breaking change. Was I misunderstood or you just don't agree? No idea.
The reason for current placement is this:
A conformant implementation MUST be either transitional or non-transitional, see \ref{intro:Legacy
Interface: Terminology}.
An implementation MAY choose to implement OPTIONAL support for the legacy interface, including support for legacy drivers or devices, by conforming to all of the MUST or REQUIRED level requirements for the legacy interface for the transitional devices and drivers.
The requirements for the legacy interface for transitional implementations are located in sections named ``Legacy Interface'' listed below:
Binding to a transitional ID is mandatory for modern drivers. *This* is why this ID can not go to legacy section - all of legacy sections are and must stay optional.
What is true (and unfortunate) is that legacy sections are not as formal as modern ones - originally we wanted them to be informational only. For example there is no clear separation between driver and device conformance sections. Work on this if you like, that is welcome. But please stop moving mandatory text to legacy sections.
Signature · 6 lines
MSR --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
PATCH 3/11 transport-pci: Split notes of PCI Device Layout
In reply to Parav PanditCurrently single legacy interface section describes PCI common configuration layout and feature bits operation for the legacy interface.
Hence, split PCI Device Layout legacy interface section into two parts. First subsection for common configuration and second subsection for feature bits.
--- conformance.tex | 1 + transport-pci.tex | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-)
conformance.tex +1 -0
@@ -263,6 +263,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} \item Section \ref{sec:General Initialization And Device Operation / Device Initialization / Legacy Interface: Device Initialization} \item Section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery / Legacy Interfaces: A Note on PCI Device Discovery} \item Section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Legacy Interfaces: A Note on PCI Device Layout} +\item Section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Legacy Interface: A Note on Feature Bits} \item Section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Device Initialization / Virtio Device Configuration Layout Detection / Legacy Interface: A Note on Device Layout Detection} \item Section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Device Initialization / Virtqueue Configuration / Legacy Interface: A Note on Virtqueue Configuration} \item Section \ref{sec:Virtio Transport Options / Virtio Over MMIO / Legacy interface}
transport-pci.tex +9 -5
@@ -845,16 +845,20 @@ \subsubsection{Legacy Interfaces: A Note on PCI Device Layout}\label{sec:Virtio devices MUST present the device-specific configuration space if any at an offset immediately following the general headers. -Note that only Feature Bits 0 to 31 are accessible through the -Legacy Interface. When used through the Legacy Interface, -Transitional Devices MUST assume that Feature Bits 32 to 63 -are not acknowledged by Driver. - As legacy devices had no \field{config_generation} field, see \ref{sec:Basic Facilities of a Virtio Device / Device Configuration Space / Legacy Interface: Device Configuration Space}~\nameref{sec:Basic Facilities of a Virtio Device / Device Configuration Space / Legacy Interface: Device Configuration Space} for workarounds. +\subsubsection{Legacy Interface: A Note on Feature Bits} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / +Virtio Structure PCI Capabilities / Legacy Interface: A Note on Feature Bits} + +Only Feature Bits 0 to 31 are accessible through the +Legacy Interface. When used through the Legacy Interface, +Transitional Devices MUST assume that Feature Bits 32 to 63 +are not acknowledged by Driver. + \subsubsection{Non-transitional Device With Legacy Driver: A Note on PCI Device Layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Non-transitional Device With
Signature · 6 lines
2.26.2 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
PATCH 4/11 transport-pci: Rename and move legacy PCI Device layout section
In reply to Parav PanditCurrent 'Legacy Interfaces: A Note on PCI Device Layout' explains virtio legacy registers which consist of common configuration structure and device specific registers. It has little to do with the existing PCI Device layout section.
For example, non transitional device's common configuration layout is described in 'Common configuration structure layout' section outside of 'PCI Device Layout' section.
Hence, to keep Legacy common configuration registers section consistent with 1.x, rename and move it adjacent to 1.x common configuration structure.
--- conformance.tex | 2 +- transport-pci.tex | 162 +++++++++++++++++++++++----------------------- 2 files changed, 83 insertions(+), 81 deletions(-)
conformance.tex +1 -1
@@ -262,7 +262,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} \item Section \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Message Framing / Legacy Interface: Message Framing} \item Section \ref{sec:General Initialization And Device Operation / Device Initialization / Legacy Interface: Device Initialization} \item Section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery / Legacy Interfaces: A Note on PCI Device Discovery} -\item Section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Legacy Interfaces: A Note on PCI Device Layout} +\item Section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Common configuration structure layout / Legacy Interfaces: A Note on Configuration Registers} \item Section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Legacy Interface: A Note on Feature Bits} \item Section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Device Initialization / Virtio Device Configuration Layout Detection / Legacy Interface: A Note on Device Layout Detection} \item Section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Device Initialization / Virtqueue Configuration / Legacy Interface: A Note on Virtqueue Configuration}
transport-pci.tex +82 -80
174 lines not on this page · raw message
Signature · 6 lines
2.26.2 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
PATCH 5/11 introduction: Add missing helping verb
In reply to Parav PanditThe terminology of Transitional device and driver is missing the helping verb 'is' similar to other terminologies.
Hence, add them to complete the sentence.
--- introduction.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
introduction.tex +2 -2
@@ -145,14 +145,14 @@ \subsection{Legacy Interface: Terminology}\label{intro:Legacy \begin{description} \item[Transitional Device] - a device supporting both drivers conforming to this + is a device supporting both drivers conforming to this specification, and allowing legacy drivers. \end{description} Similarly, a driver MAY implement: \begin{description} \item[Transitional Driver] - a driver supporting both devices conforming to this + is a driver supporting both devices conforming to this specification, and legacy devices. \end{description}
Signature · 6 lines
2.26.2 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
PATCH 6/11 introduction: Introduce transitional MMR interface
In reply to Parav PanditIntroduce terminology for the transitional MMR device and transitional MMR driver.
Add description of the transitional MMR device. It is a PCI device that implements legacy virtio common configuration registers followed by legacy device specific registers in a memory region at an offset.
This enables hypervisor such as vfio driver to emulate I/O region towards the guest at BAR0. By doing so VFIO driver can translate read/write accesses on I/O region from the guest to the device memory region.
High level comparison of 1.x, transitional & transitional MMR sriov vf device:
+------------------+ +--------------------+ +--------------------+
|virtio 1.x | |Transitional | |Transitional |
|SRIOV VF | |SRIOV VF | |MMR SRIOV VF |
| | | | | |
++---------------+ | ++---------------+ | ++---------------+ |
||dev_id = | | ||dev_id = | | ||dev_id = | |
||{0x1040-0x106C}| | ||{0x1000-0x103f}| | ||{0x10f9-0x10ff}| |
|+---------------+ | |+---------------+ | |+---------------+ |
| | | | | |
|+------------+ | |+------------+ | |+-----------------+ |
||Memory BAR | | ||Memory BAR | | ||Memory BAR | |
|+------------+ | |+------------+ | || | |
| | | | || +--------------+| |
| | |+-----------------+ | || |legacy virtio || |
| | ||IOBAR impossible | | || |+ dev cfg || |
| | |+-----------------+ | || |registers || |
| | | | || +--------------+| |
| | | | |+-----------------+ |
+------------------+ +--------------------+ +--------------------+Motivation and background:
PCIe and system limitations:
1. PCIe VFs do not support IOBAR cited at [1].
Perhaps the PCIe spec could be extended, however it would be only useful for virtio transitional devices. Even if such an extension is present, there are other system limitations described below in (2) and (3).
2. cpu io port space limit and fragmentationx86_64 is limited to only 64K worth of IO port space at [2], which is shared with many other onboard system peripherals which are behind PCIe bridge; such I/O region also needs to be aligned to 4KB at PCIe bridge level cited at [3]. This can lead to a I/O space fragmentation. Due to this fragmentation and alignment need, actual usable range is small.
3. IO space access of PCI device is done through non-posted message which requires higher completion time in the PCIe fabric for
round trip travel.
[1] PCIe spec citation:
VFs do not support I/O Space and thus VF BARs shall not indicate I/O Space.
[2] cpu arch citiation:
Intel 64 and IA-32 Architectures Software Developer’s Manual The processor’s I/O address space is separate and distinct from the physical-memory address space. The I/O address space consists of 64K individually addressable 8-bit I/O ports, numbered 0 through FFFFH.
[3] PCIe spec citation:
If a bridge implements an I/O address range,...I/O address range will be aligned to a 4 KB boundary.
--- introduction.tex | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
introduction.tex +30 -0
@@ -161,6 +161,20 @@ \subsection{Legacy Interface: Terminology}\label{intro:Legacy have a need for backwards compatibility! \end{note} +\begin{description} +\item[Transitional MMR Device] + is a PCI device which exposes legacy virtio configuration + registers followed by legacy device configuration registers as + memory mapped registers (MMR) at an offset in a memory region + BAR, has no I/O region BAR, having its own PCI Device ID range, + and follows the rest of the functionalities of the transitional device. +\end{description} + +\begin{description} +\item[Transitional MMR Driver] + is a PCI device driver that supports the Transitional MMR device. +\end{description} + Devices or drivers with no legacy compatibility are referred to as non-transitional devices and drivers, respectively.
@@ -174,6 +188,22 @@ \subsection{Transition from earlier specification drafts}\label{sec:Transition f sections tagged "Legacy Interface" in the section title. These highlight the changes made since the earlier drafts. +\subsection{Transitional MMR interface: specification drafts}\label{sec:Transitional MMR interface: specification drafts} + +The transitional MMR device and driver differs from the +transitional device and driver respectively in few areas. Such +differences are contained in sections named +'Transitional MMR interface', like this one. When no differences +are mentioned explicitly, the transitional MMR device and driver +follow exactly the same functionalities as that of the +transitional device and driver respectively. + +\begin{note} +Transitional MMR interface is only required to support backward +compatibility. It should not be implemented unless there is a need +for the backward compatibility. +\end{note} + \section{Structure Specifications}\label{sec:Structure Specifications} Many device and driver in-memory structure layouts are documented using
Signature · 6 lines
2.26.2 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH 06/11] introduction: Introduce transitional MMR interface
Quoted 81 lines · Parav Pandit
Introduce terminology for the transitional MMR device and transitional MMR driver.
Add description of the transitional MMR device. It is a PCI device that implements legacy virtio common configuration registers followed by legacy device specific registers in a memory region at an offset.
This enables hypervisor such as vfio driver to emulate I/O region towards the guest at BAR0. By doing so VFIO driver can translate read/write accesses on I/O region from the guest to the device memory region.
High level comparison of 1.x, transitional & transitional MMR sriov vf device:
+------------------+ +--------------------+ +--------------------+ |virtio 1.x | |Transitional | |Transitional | |SRIOV VF | |SRIOV VF | |MMR SRIOV VF | | | | | | | ++---------------+ | ++---------------+ | ++---------------+ | ||dev_id = | | ||dev_id = | | ||dev_id = | | ||{0x1040-0x106C}| | ||{0x1000-0x103f}| | ||{0x10f9-0x10ff}| | |+---------------+ | |+---------------+ | |+---------------+ | | | | | | | |+------------+ | |+------------+ | |+-----------------+ | ||Memory BAR | | ||Memory BAR | | ||Memory BAR | | |+------------+ | |+------------+ | || | | | | | | || +--------------+| | | | |+-----------------+ | || |legacy virtio || | | | ||IOBAR impossible | | || |+ dev cfg || | | | |+-----------------+ | || |registers || | | | | | || +--------------+| | | | | | |+-----------------+ | +------------------+ +--------------------+ +--------------------+Motivation and background:
PCIe and system limitations:
1. PCIe VFs do not support IOBAR cited at [1].Perhaps the PCIe spec could be extended, however it would be only useful for virtio transitional devices. Even if such an extension is present, there are other system limitations described below in (2) and (3).
2. cpu io port space limit and fragmentation
x86_64is limited to only 64K worth of IO port space at [2], which is shared with many other onboard system peripherals which are behind PCIe bridge; such I/O region also needs to be aligned to 4KB at PCIe bridge level cited at [3]. This can lead to a I/O space fragmentation. Due to this fragmentation and alignment need, actual usable range is small.3. IO space access of PCI device is done through non-posted message which requires higher completion time in the PCIe fabric for
round trip travel.[1] PCIe spec citation:
VFs do not support I/O Space and thus VF BARs shall not indicate I/O Space.[2] cpu arch citiation:
Intel 64 and IA-32 Architectures Software Developer’s Manual The processor’s I/O address space is separate and distinct from the physical-memory address space. The I/O address space consists of 64K individually addressable 8-bit I/O ports, numbered 0 through FFFFH.[3] PCIe spec citation:
If a bridge implements an I/O address range,...I/O address range will be aligned to a 4 KB boundary.Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>--- introduction.tex | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)introduction.tex +0
-0
introduction.tex \subsection{Legacy Interface: Terminology}\label{intro:Legacy · line 169
Quoted 9 lines
introduction.tex +6
-0@@ -161,6 +161,20 @@ \subsection{Legacy Interface: Terminology}\label{intro:Legacy have a need for backwards compatibility! \end{note} +\begin{description} +\item[Transitional MMR Device] + is a PCI device which exposes legacy virtio configuration + registers followed by legacy device configuration registers as + memory mapped registers (MMR) at an offset in a memory region + BAR, has no I/O region BAR,
in fact, most of existing pci interface can be in either IO or memory bar, I don't think we specify that it's in a memory bar in the spec. For example IIRC qemu has a flag that uses IO for signalling kicks for modern VQs, this is slightly faster on some architectures.
introduction.tex \subsection{Legacy Interface: Terminology}\label{intro:Legacy · line 171
Quoted 2 lines
introduction.tex +1
-0having its own PCI Device ID range, + and follows the rest of the functionalities
this setence isn't grammatical.
not sure what exactly you are trying to say here, can not help you rewrite.
Quoted 1 line
of the transitional device.
a transitional device probably.
Quoted 11 lines
+\end{description}
introduction.tex +6
-0+ +\begin{description} +\item[Transitional MMR Driver] + is a PCI device driver that supports the Transitional MMR device. +\end{description} + Devices or drivers with no legacy compatibility are referred to as non-transitional devices and drivers, respectively.
introduction.tex \subsection{Transition from earlier specification drafts}\label{sec:Transition f · line 194
Quoted 7 lines
introduction.tex +4
-0@@ -174,6 +188,22 @@ \subsection{Transition from earlier specification drafts}\label{sec:Transition f sections tagged "Legacy Interface" in the section title. These highlight the changes made since the earlier drafts. +\subsection{Transitional MMR interface: specification drafts}\label{sec:Transitional MMR interface: specification drafts} + +The transitional MMR device and driver differs from the +transitional device and driver respectively in few areas. Such
a few
introduction.tex \subsection{Transition from earlier specification drafts}\label{sec:Transition f · line 199
Quoted 5 lines
introduction.tex +5
-0+differences are contained in sections named +'Transitional MMR interface', like this one. When no differences +are mentioned explicitly, the transitional MMR device and driver +follow exactly the same functionalities as that of the +transitional device and driver respectively.
Ugh, we called these transitional because they were there for the transition period :)
The thing that I feel you miss here is that transitional driver using transitional device MUST NOT use the legacy interface.
The new thing with this MMR is that it's a memory mapped access to legacy registers.
Going back to my idea of just adding legacy MMR capability to existing modern and transitional devices, as opposed to a completely new type of device, we would basically have a modern driver access the new capability, and forward accesses from a legacy driver to there. So "memory mapped legacy interface" would be a better name I think.
Quoted 12 lines
introduction.tex +7
-0+ +\begin{note} +Transitional MMR interface is only required to support backward +compatibility. It should not be implemented unless there is a need +for the backward compatibility. +\end{note} + \section{Structure Specifications}\label{sec:Structure Specifications} Many device and driver in-memory structure layouts are documented usingSignature · 1 line
2.26.2
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
PATCH 7/11 transport-pci: Introduce transitional MMR device id
In reply to Parav PanditTransitional MMR device PCI Device IDs are unique. Hence, any of the existing drivers do not bind to it. This further maintains the backward compatibility with existing drivers.
--- transport-pci.tex | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-)
transport-pci.tex +41 -4
@@ -19,12 +19,14 @@ \section{Virtio Over PCI Bus}\label{sec:Virtio Transport Options / Virtio Over P \subsection{PCI Device Discovery}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery} Any PCI device with PCI Vendor ID 0x1af4, and PCI Device ID 0x1000 through -0x107f inclusive is a virtio device. The actual value within this range -indicates which virtio device is supported by the device. +0x107f inclusive and DeviceID 0x10f9 through 0x10ff is a virtio device. +The actual value within this range indicates which virtio device +type it is. The PCI Device ID is calculated by adding 0x1040 to the Virtio Device ID, as indicated in section \ref{sec:Device Types}. -Additionally, devices MAY utilize a Transitional PCI Device ID range, -0x1000 to 0x103f depending on the device type. +Additionally, devices MAY utilize a Transitional PCI Device ID range +0x1000 to 0x103f inclusive or a Transitional MMR PCI Device ID range +0x10f9 to 0x10ff inclusive, depending on the device type. \devicenormative{\subsubsection}{PCI Device Discovery}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}
@@ -95,6 +97,41 @@ \subsubsection{Legacy Interfaces: A Note on PCI Device Discovery}\label{sec:Virt This is to match legacy drivers. +\subsubsection{Transitional MMR Interface: A Note on PCI Device +Discovery}\label{sec:Virtio Transport Options / Virtio Over PCI +Bus / PCI Device Discovery / Transitional MMR Interface: A Note on PCI Device Discovery} + +The transitional MMR device has one of the following PCI Device ID +depending on the device type: + +\begin{tabular}{|l|c|} +\hline +Transitional PCI Device ID & Virtio Device \\ +\hline \hline +0x10f9 & network device \\ +\hline +0x10fa & block device \\ +\hline +0x10fb & memory ballooning (traditional) \\ +\hline +0x10fc & console \\ +\hline +0x10fd & SCSI host \\ +\hline +0x10fe & entropy source \\ +\hline +0x10ff & 9P transport \\ +\hline +\end{tabular} + +The PCI Subsystem Vendor ID and the PCI Subsystem Device ID MAY +reflect the PCI Vendor and Device ID of the environment. + +The transitional MMR driver MUST match any PCI Revision ID value. + +The transitional MMR driver MAY match any PCI Subsystem Vendor ID and +any PCI Subsystem Device ID value. + \subsection{PCI Device Layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout} The device is configured via I/O and/or memory regions (though see
Signature · 6 lines
2.26.2 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH 07/11] transport-pci: Introduce transitional MMR device id
Quoted 7 lines · Parav Pandit
Transitional MMR device PCI Device IDs are unique. Hence, any of the existing drivers do not bind to it. This further maintains the backward compatibility with existing drivers.
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>
I took a fresh look at it, and I don't get it: what exactly is wrong with just using modern ID? Why do we need new ones?
Quoted 71 lines
--- transport-pci.tex | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-)transport-pci.tex +41
-4@@ -19,12 +19,14 @@ \section{Virtio Over PCI Bus}\label{sec:Virtio Transport Options / Virtio Over P \subsection{PCI Device Discovery}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery} Any PCI device with PCI Vendor ID 0x1af4, and PCI Device ID 0x1000 through -0x107f inclusive is a virtio device. The actual value within this range -indicates which virtio device is supported by the device. +0x107f inclusive and DeviceID 0x10f9 through 0x10ff is a virtio device. +The actual value within this range indicates which virtio device +type it is. The PCI Device ID is calculated by adding 0x1040 to the Virtio Device ID, as indicated in section \ref{sec:Device Types}. -Additionally, devices MAY utilize a Transitional PCI Device ID range, -0x1000 to 0x103f depending on the device type. +Additionally, devices MAY utilize a Transitional PCI Device ID range +0x1000 to 0x103f inclusive or a Transitional MMR PCI Device ID range +0x10f9 to 0x10ff inclusive, depending on the device type. \devicenormative{\subsubsection}{PCI Device Discovery}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}@@ -95,6 +97,41 @@ \subsubsection{Legacy Interfaces: A Note on PCI Device Discovery}\label{sec:Virt This is to match legacy drivers. +\subsubsection{Transitional MMR Interface: A Note on PCI Device +Discovery}\label{sec:Virtio Transport Options / Virtio Over PCI +Bus / PCI Device Discovery / Transitional MMR Interface: A Note on PCI Device Discovery} + +The transitional MMR device has one of the following PCI Device ID +depending on the device type: + +\begin{tabular}{|l|c|} +\hline +Transitional PCI Device ID & Virtio Device \\ +\hline \hline +0x10f9 & network device \\ +\hline +0x10fa & block device \\ +\hline +0x10fb & memory ballooning (traditional) \\ +\hline +0x10fc & console \\ +\hline +0x10fd & SCSI host \\ +\hline +0x10fe & entropy source \\ +\hline +0x10ff & 9P transport \\ +\hline +\end{tabular} + +The PCI Subsystem Vendor ID and the PCI Subsystem Device ID MAY +reflect the PCI Vendor and Device ID of the environment. + +The transitional MMR driver MUST match any PCI Revision ID value. + +The transitional MMR driver MAY match any PCI Subsystem Vendor ID and +any PCI Subsystem Device ID value. + \subsection{PCI Device Layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout} The device is configured via I/O and/or memory regions (though seeSignature · 1 line
2.26.2
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 07/11] transport-pci: Introduce transitional MMR device id
Quoted 11 lines · Michael S. Tsirkin
Quoted 7 lines · Parav Pandit
Transitional MMR device PCI Device IDs are unique. Hence, any of the existing drivers do not bind to it. This further maintains the backward compatibility with existing drivers.
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>I took a fresh look at it, and I don't get it: what exactly is wrong with just using modern ID? Why do we need new ones?
A modern (non transitional device) do not support legacy functionality such as virtio net hdr, device reset sequence.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 07/11] transport-pci: Introduce transitional MMR device id
Quoted 9 lines · Parav Pandit
Quoted 6 lines · Michael S. Tsirkin
Quoted 5 lines · Parav Pandit
Transitional MMR device PCI Device IDs are unique. Hence, any of the existing drivers do not bind to it. This further maintains the backward compatibility with existing drivers.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>I took a fresh look at it, and I don't get it: what exactly is wrong with just using modern ID? Why do we need new ones?
A modern (non transitional device) do not support legacy functionality such as virtio net hdr,
It's all a question of terminology, but it is not worth sacrificing functionality for cleaner terminology. Basically most of the spec just talks about the legacy interface, and will work fine with this.
Yes we do say:
Devices or drivers with no legacy compatibility are referred to as non-transitional devices and drivers, respectively.
So we will want to refine this somewhat. Maybe:
Devices not compatible with legacy drivers and drivers not compatible with legacy devices are referred to as non-transitional devices and drivers, respectively.
This allows non-transitional devices to expose the legacy capability - having this capability does not make them compatible with
Similarly in the conformance section:
An implementation MAY choose to implement OPTIONAL support for the legacy interface, including support for legacy drivers or devices, by conforming to all of the MUST or REQUIRED level requirements for the legacy interface for the transitional devices and drivers.
we would just remove "for the transitional devices and drivers" here as now non-transitional can have a legacy interface.
Similarly:
The requirements for the legacy interface for transitional implementations
would become:
"The requirements for the legacy interface"
Quoted 1 line
device reset sequence.
what is this one?
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 07/11] transport-pci: Introduce transitional MMR device id
Quoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Friday, April 7, 2023 8:03 AMOn Tue, Apr 04, 2023 at 12:08:54PM -0400, Parav Pandit wrote:
[..]
Quoted 36 lines
Quoted 5 lines
Quoted 2 lines
I took a fresh look at it, and I don't get it: what exactly is wrong with just using modern ID? Why do we need new ones?
A modern (non transitional device) do not support legacy functionality such as virtio net hdr,
It's all a question of terminology, but it is not worth sacrificing functionality for cleaner terminology.
Basically most of the spec just talks about the legacy interface, and will work fine with this.Yes we do say:
Devices or drivers with no legacy compatibility are referred to as non- transitional devices and drivers, respectively.So we will want to refine this somewhat. Maybe:
Devices not compatible with legacy drivers and drivers not compatible with legacy devices are referred to as non-transitional devices and drivers, respectively.
This allows non-transitional devices to expose the legacy capability - having this capability does not make them compatible with
Similarly in the conformance section:
An implementation MAY choose to implement OPTIONAL support for the legacy interface, including support for legacy drivers or devices, by conforming to all of the MUST or REQUIRED level requirements for the legacy interface for the transitional devices and drivers.
we would just remove "for the transitional devices and drivers" here as now non-transitional can have a legacy interface.
Quoted 9 lines
Similarly:
The requirements for the legacy interface for transitional implementations
would become:
"The requirements for the legacy interface"
I will hold to respond to other emails in this series, because the key part is here.
If I understand you correctly, will above wording translate to below behavior?
1. A non-transitional device will expose a capability (not a feature bit, but a capability at transport level). This capability indicates that, it supports legacy interface.
Lets name it legacy_if_emulation for sake of this discussion.
It is a two-way pci capability.
Device reports it.
And driver enables it. (Why two way and why driver needs to enable it, described later in point #d below).
Hence, such non transitional device does not need to comply to below listed requirements #a and #b.
a. A driver MUST accept VIRTIO_F_VERSION_1 if it is offered.
(Because hypervisor driver is a passthrough driver; and legacy driver will not accept this feature bit).
b. device MAY fail to operate further if VIRTIO_F_VERSION_1 is not accepted.
c. A non-transitional device with above legacy_if_supported capability, will allow device reset sequence, described in
[1] Driver Requirements: Device Initialization (3.1.1)
[2] Legacy Interface: Device Initialization (3.1.2)
Quoted 3 lines
Quoted 1 line
device reset sequence.
what is this one?
I listed above in #c.
And
d. When legacy_if_emulation capability is offered and hypervisor driver enabled it, when driver perform device reset, driver will not wait for device reset to go zero. When legacy_if_emulation capability is not enabled by (hypervisor or other say existing) driver, driver will wait for device reset to turn 0. (Following the driver requirement 2.4.2).
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 07/11] transport-pci: Introduce transitional MMR device id
Quoted 49 lines · Parav Pandit
Quoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Friday, April 7, 2023 8:03 AMOn Tue, Apr 04, 2023 at 12:08:54PM -0400, Parav Pandit wrote:
[..]
Quoted 42 lines
Quoted 5 lines
Quoted 2 lines
I took a fresh look at it, and I don't get it: what exactly is wrong with just using modern ID? Why do we need new ones?
A modern (non transitional device) do not support legacy functionality such as virtio net hdr,
It's all a question of terminology, but it is not worth sacrificing functionality for cleaner terminology.
Basically most of the spec just talks about the legacy interface, and will work fine with this.Yes we do say:
Devices or drivers with no legacy compatibility are referred to as non- transitional devices and drivers, respectively.So we will want to refine this somewhat. Maybe:
Devices not compatible with legacy drivers and drivers not compatible with legacy devices are referred to as non-transitional devices and drivers, respectively.
This allows non-transitional devices to expose the legacy capability - having this capability does not make them compatible with
Similarly in the conformance section:
An implementation MAY choose to implement OPTIONAL support for the legacy interface, including support for legacy drivers or devices, by conforming to all of the MUST or REQUIRED level requirements for the legacy interface for the transitional devices and drivers.
we would just remove "for the transitional devices and drivers" here as now non-transitional can have a legacy interface.
Similarly:
The requirements for the legacy interface for transitional implementations
would become:
Quoted 8 lines
Quoted 3 lines
"The requirements for the legacy interface"
I will hold to respond to other emails in this series, because the key part is here.
If I understand you correctly, will above wording translate to below behavior?
1. A non-transitional device will expose a capability (not a feature bit, but a capability at transport level).
Note that we can allow this capability in transitional devices too. This is useful since IO bar might not be enabled even if present.
Quoted 10 lines
This capability indicates that, it supports legacy interface.
Lets name itlegacy_if_emulationfor sake of this discussion.
It is a two-way pci capability.
Device reports it.
And driver enables it. (Why two way and why driver needs to enable it, described later in point #d below).Hence, such non transitional device does not need to comply to below listed requirements #a and #b.
a. A driver MUST accept
VIRTIO_F_VERSION_1if it is offered.
(Because hypervisor driver is a passthrough driver; and legacy driver will not accept this feature bit).
This is not a device requirement at all.
Quoted 1 line
b. device MAY fail to operate further if
VIRTIO_F_VERSION_1is not accepted.
This is optional not a requirement.
Quoted 6 lines
c. A non-transitional device with above
legacy_if_supportedcapability, will allow device reset sequence, described in
[1] Driver Requirements: Device Initialization (3.1.1)
[2] Legacy Interface: Device Initialization (3.1.2)Quoted 2 lines
Quoted 1 line
device reset sequence.
Quoted 7 lines
Quoted 1 line
what is this one?
I listed above in #c.
Andd. When
legacy_if_emulationcapability is offered and hypervisor driver enabled it, when driver perform device reset, driver will not wait for device reset to go zero. Whenlegacy_if_emulationcapability is not enabled by (hypervisor or other say existing) driver, driver will wait for device reset to turn 0. (Following the driver requirement 2.4.2).
It might not be a bad idea to enable it, but I observe that it is possible for hypervisor to expose a standard transitional device on top of this MMR capability. Thus it will not be known whether guest driver accesses legacy or modern BAR until guest runs.
I propose, instead, that device exposes same registers
at two addresses and executes reset correctly depending
on which address it was accessed through. WDYT?
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] Re: [PATCH 07/11] transport-pci: Introduce transitional MMR device id
Quoted 10 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Friday, April 7, 2023 11:51 AMQuoted 1 line
1. A non-transitional device will expose a capability (not a feature bit, but a
capability at transport level).
Note that we can allow this capability in transitional devices too. This is useful since IO bar might not be enabled even if present.
This capability exposure makes a device transitional in some sense.
Quoted 7 lines
Quoted 5 lines
This capability indicates that, it supports legacy interface. Lets name it
legacy_if_emulationfor sake of this discussion. It is a two-way pci capability.
Device reports it.
And driver enables it. (Why two way and why driver needs to enable it,described later in point #d below).
Quoted 1 line
Quoted 9 lines
Quoted 1 line
Hence, such non transitional device does not need to comply to below listed
requirements #a and #b.
Quoted 3 lines
a. A driver MUST accept
VIRTIO_F_VERSION_1if it is offered. (Because hypervisor driver is a passthrough driver; and legacy driver will notaccept this feature bit).
This is not a device requirement at all.
Those this is written as driver requirement; a device expects this feature bit to be negotiated. What should device implementor do? It should allow driver to not negotiate bit, right?
Which means, below line to be change:
from:
device MAY fail to operate further if VIRTIO_F_VERSION_1 is not accepted.
to:
Non transitional device that does not have legacy interface capability MAY fail to operate further if V_1 is not accepted. Non transitional device that has legacy interface capability SHOULD operate further even if V_1 is not accepted.
Quoted 4 lines
Quoted 1 line
b. device MAY fail to operate further if
VIRTIO_F_VERSION_1is not accepted.This is optional not a requirement.
Please see above wording, if its acceptable.
Quoted 19 lines
Quoted 5 lines
c. A non-transitional device with above
legacy_if_supportedcapability, will allow device reset sequence, described in [1] Driver
Requirements: Device Initialization (3.1.1) [2] Legacy Interface:
Device Initialization (3.1.2)Quoted 8 lines
Quoted 3 lines
Quoted 1 line
device reset sequence.
what is this one?
I listed above in #c.
Andd. When
legacy_if_emulationcapability is offered and hypervisor driverenabled it, when driver perform device reset, driver will not wait for device reset to go zero.
Quoted 1 line
When
legacy_if_emulationcapability is not enabled by (hypervisor or othersay existing) driver, driver will wait for device reset to turn 0. (Following the driver requirement 2.4.2).
Quoted 7 lines
It might not be a bad idea to enable it, but I observe that it is possible for hypervisor to expose a standard transitional device on top of this MMR capability. Thus it will not be known whether guest driver accesses legacy or modern BAR until guest runs.
I propose, instead, that device exposes same registers at two addresses and executes reset correctly depending on which address it was accessed through. WDYT?
Yep, this the exact proposal here.
Legacy registers exposes via AQ (aka TVQ) or MMR location, behaves like legacy. And regular registers at their location as-is.
With that feature bit negotiation is the only thing to relax like worded above.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [PATCH 07/11] transport-pci: Introduce transitional MMR device id
Quoted 11 lines · Parav Pandit
Quoted 10 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Friday, April 7, 2023 11:51 AMQuoted 1 line
1. A non-transitional device will expose a capability (not a feature bit, but a
capability at transport level).
Note that we can allow this capability in transitional devices too. This is useful since IO bar might not be enabled even if present.
This capability exposure makes a device transitional in some sense.
not in the sense spec uses it at the moment: transitional devices are those that legacy drivers can bind to. transitional drivers btw are those that can bind to legacy devices.
perhaps suprisingly, a transitional driver using a transitional device does not rely on any legacy spec at all, they will use the standard interfaces.
Quoted 19 lines
Quoted 7 lines
Quoted 5 lines
This capability indicates that, it supports legacy interface. Lets name it
legacy_if_emulationfor sake of this discussion. It is a two-way pci capability.
Device reports it.
And driver enables it. (Why two way and why driver needs to enable it,described later in point #d below).
Quoted 1 line
Quoted 9 lines
Quoted 1 line
Hence, such non transitional device does not need to comply to below listed
requirements #a and #b.
Quoted 3 lines
a. A driver MUST accept
VIRTIO_F_VERSION_1if it is offered. (Because hypervisor driver is a passthrough driver; and legacy driver will notaccept this feature bit).
This is not a device requirement at all.
Those this is written as driver requirement; a device expects this feature bit to be negotiated. What should device implementor do? It should allow driver to not negotiate bit, right?
Quoted 8 lines
Which means, below line to be change:
from:
device MAY fail to operate further ifVIRTIO_F_VERSION_1is not accepted.to:
Non transitional device that does not have legacy interface capability MAY fail to operate further ifV_1is not accepted. Non transitional device that has legacy interface capability SHOULD operate further even ifV_1is not accepted.
Look nothing changes with MMR capability at all.
We currently have:
A device MUST offer VIRTIO_F_VERSION_1. A device MAY fail to operate further if VIRTIO_F_VERSION_1 is not accepted.
it's implied that this does not refer to legacy interface.
You want to clarify this adding to legacy interface section text explaining that of course VIRTIO_F_VERSION_1 must not be offered through that? Sure but it's a separate issue from MMR capability. don't try to drink the ocean.
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
b. device MAY fail to operate further if
VIRTIO_F_VERSION_1is not accepted.This is optional not a requirement.
Please see above wording, if its acceptable.
you don't need any of that for this effort, generally VIRTIO_F_VERSION_1 thing needs a lot of work, if you want to invest the time just ask I'll try to list the issues.
But nothing to do with memory mapped legacy interface directly.
Quoted 26 lines
Quoted 19 lines
Quoted 5 lines
c. A non-transitional device with above
legacy_if_supportedcapability, will allow device reset sequence, described in [1] Driver
Requirements: Device Initialization (3.1.1) [2] Legacy Interface:
Device Initialization (3.1.2)Quoted 8 lines
Quoted 3 lines
Quoted 1 line
device reset sequence.
what is this one?
I listed above in #c.
Andd. When
legacy_if_emulationcapability is offered and hypervisor driverenabled it, when driver perform device reset, driver will not wait for device reset to go zero.
Quoted 1 line
When
legacy_if_emulationcapability is not enabled by (hypervisor or othersay existing) driver, driver will wait for device reset to turn 0. (Following the driver requirement 2.4.2).
Quoted 7 lines
It might not be a bad idea to enable it, but I observe that it is possible for hypervisor to expose a standard transitional device on top of this MMR capability. Thus it will not be known whether guest driver accesses legacy or modern BAR until guest runs.
I propose, instead, that device exposes same registers at two addresses and executes reset correctly depending on which address it was accessed through. WDYT?
Quoted 5 lines
Yep, this the exact proposal here.
Legacy registers exposes via AQ (aka TVQ) or MMR location, behaves like legacy. And regular registers at their location as-is.With that feature bit negotiation is the only thing to relax like worded above.
It's not really different from IO port legacy then.
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 07/11] transport-pci: Introduce transitional MMR device id
Quoted 52 lines · Michael S. Tsirkin
Quoted 11 lines · Parav Pandit
Quoted 10 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Friday, April 7, 2023 11:51 AMQuoted 1 line
1. A non-transitional device will expose a capability (not a feature bit, but a
capability at transport level).
Note that we can allow this capability in transitional devices too. This is useful since IO bar might not be enabled even if present.
This capability exposure makes a device transitional in some sense.
not in the sense spec uses it at the moment: transitional devices are those that legacy drivers can bind to. transitional drivers btw are those that can bind to legacy devices.
perhaps suprisingly, a transitional driver using a transitional device does not rely on any legacy spec at all, they will use the standard interfaces.
Quoted 19 lines
Quoted 7 lines
Quoted 5 lines
This capability indicates that, it supports legacy interface. Lets name it
legacy_if_emulationfor sake of this discussion. It is a two-way pci capability.
Device reports it.
And driver enables it. (Why two way and why driver needs to enable it,described later in point #d below).
Quoted 1 line
Quoted 9 lines
Quoted 1 line
Hence, such non transitional device does not need to comply to below listed
requirements #a and #b.
Quoted 3 lines
a. A driver MUST accept
VIRTIO_F_VERSION_1if it is offered. (Because hypervisor driver is a passthrough driver; and legacy driver will notaccept this feature bit).
This is not a device requirement at all.
Those this is written as driver requirement; a device expects this feature bit to be negotiated. What should device implementor do? It should allow driver to not negotiate bit, right?
Quoted 8 lines
Which means, below line to be change:
from:
device MAY fail to operate further ifVIRTIO_F_VERSION_1is not accepted.to:
Non transitional device that does not have legacy interface capability MAY fail to operate further ifV_1is not accepted. Non transitional device that has legacy interface capability SHOULD operate further even ifV_1is not accepted.
Quoted 8 lines
Look nothing changes with MMR capability at all.
We currently have:A device MUST offer
VIRTIO_F_VERSION_1. A device MAY fail to operate further ifVIRTIO_F_VERSION_1is not accepted.it's implied that this does not refer to legacy interface.
But the interface being exposes is not a legacy interface at the PCI device level.
A PCI device is exposing a interface that can be used
by either
a. existing non transitional driver who will negotiate _1, just fine. or
b. by legacy driver in the guest VM, which will not negotiate _1.
And here device must not fail to operate.
Hence spec should say that it should not fail to operate.
Quoted 4 lines
You want to clarify this adding to legacy interface section text explaining that of course
VIRTIO_F_VERSION_1must not be offered through that?
It will be offered because hypervisor driver is not getting involved in the reset flow and in read/write of the feature bits etc.
Hypervisor driver is only providing the transport channel from the guest vm to the device.
And since the guest driver may be 1.x, _1 will be offered by the device.
Quoted 14 lines
Sure but it's a separate issue
from MMR capability. don't try to drink the ocean.Quoted 5 lines
Quoted 4 lines
Quoted 1 line
b. device MAY fail to operate further if
VIRTIO_F_VERSION_1is not accepted.This is optional not a requirement.
Please see above wording, if its acceptable.
Quoted 7 lines
you don't need any of that for this effort, generally
VIRTIO_F_VERSION_1thing needs a lot of work, if you want to invest the time just ask I'll try to list the issues.But nothing to do with memory mapped legacy interface directly.
I likely dont understand your above point. The point is, a device with new capability needs to
a. offer VERSION_1 offer, allow negotiation VERSION_1 b. allow not negotiation of VERSION_1
With single virtio device id, how to frame this in the spec? One way I proposed above that a new transport capability indicates this.
I didnt follow your idea of how above #a and #b can be worded without the new capability wording.
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 7 lines
c. A non-transitional device with above
legacy_if_supportedcapability, will allow device reset sequence, described in [1] Driver
Requirements: Device Initialization (3.1.1) [2] Legacy Interface:
Device Initialization (3.1.2)Quoted 8 lines
Quoted 3 lines
Quoted 1 line
device reset sequence.
what is this one?
I listed above in #c.
Andd. When
legacy_if_emulationcapability is offered and hypervisor driverenabled it, when driver perform device reset, driver will not wait for device reset to go zero.
Quoted 1 line
When
legacy_if_emulationcapability is not enabled by (hypervisor or othersay existing) driver, driver will wait for device reset to turn 0. (Following the driver requirement 2.4.2).
It might not be a bad idea to enable it, but I observe that it is possible for hypervisor to expose a standard transitional device on top of this MMR capability. Thus it will not be known whether guest driver accesses legacy or modern BAR until guest runs.
I propose, instead, that device exposes same registers at two addresses and executes reset correctly depending on which address it was accessed through. WDYT?
Quoted 8 lines
Quoted 5 lines
Yep, this the exact proposal here.
Legacy registers exposes via AQ (aka TVQ) or MMR location, behaves like legacy. And regular registers at their location as-is.With that feature bit negotiation is the only thing to relax like worded above.
It's not really different from IO port legacy then.
Yes, it is no different, because what is provided is just the transport, not a new functional behavior.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 07/11] transport-pci: Introduce transitional MMR device id
Quoted 66 lines · Parav Pandit
Quoted 52 lines · Michael S. Tsirkin
Quoted 11 lines · Parav Pandit
Quoted 10 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Friday, April 7, 2023 11:51 AMQuoted 1 line
1. A non-transitional device will expose a capability (not a feature bit, but a
capability at transport level).
Note that we can allow this capability in transitional devices too. This is useful since IO bar might not be enabled even if present.
This capability exposure makes a device transitional in some sense.
not in the sense spec uses it at the moment: transitional devices are those that legacy drivers can bind to. transitional drivers btw are those that can bind to legacy devices.
perhaps suprisingly, a transitional driver using a transitional device does not rely on any legacy spec at all, they will use the standard interfaces.
Quoted 19 lines
Quoted 7 lines
Quoted 5 lines
This capability indicates that, it supports legacy interface. Lets name it
legacy_if_emulationfor sake of this discussion. It is a two-way pci capability.
Device reports it.
And driver enables it. (Why two way and why driver needs to enable it,described later in point #d below).
Quoted 1 line
Quoted 9 lines
Quoted 1 line
Hence, such non transitional device does not need to comply to below listed
requirements #a and #b.
Quoted 3 lines
a. A driver MUST accept
VIRTIO_F_VERSION_1if it is offered. (Because hypervisor driver is a passthrough driver; and legacy driver will notaccept this feature bit).
This is not a device requirement at all.
Those this is written as driver requirement; a device expects this feature bit to be negotiated. What should device implementor do? It should allow driver to not negotiate bit, right?
Quoted 8 lines
Which means, below line to be change:
from:
device MAY fail to operate further ifVIRTIO_F_VERSION_1is not accepted.to:
Non transitional device that does not have legacy interface capability MAY fail to operate further ifV_1is not accepted. Non transitional device that has legacy interface capability SHOULD operate further even ifV_1is not accepted.Quoted 8 lines
Look nothing changes with MMR capability at all.
We currently have:A device MUST offer
VIRTIO_F_VERSION_1. A device MAY fail to operate further ifVIRTIO_F_VERSION_1is not accepted.it's implied that this does not refer to legacy interface.
But the interface being exposes is not a legacy interface at the PCI device level.
Quoted 8 lines
A PCI device is exposing a interface that can be used
by either
a. existing non transitional driver who will negotiate _1, just fine. or
b. by legacy driver in the guest VM, which will not negotiate _1.And here device must not fail to operate.
Hence spec should say that it should not fail to operate.
sorry, what? it's exactly the legacy interface that's the whole value of this hack, just exposed through another bar.
Quoted 11 lines
Quoted 4 lines
You want to clarify this adding to legacy interface section text explaining that of course
VIRTIO_F_VERSION_1must not be offered through that?It will be offered because hypervisor driver is not getting involved in the reset flow and in read/write of the feature bits etc.
Hypervisor driver is only providing the transport channel from the guest vm to the device.
And since the guest driver may be 1.x, _1 will be offered by the device.
_1 is not offered in the legacy interface. And if you negotiate _1 you better not touch legacy with a 10 foot pole.
Quoted 24 lines
Quoted 14 lines
Sure but it's a separate issue
from MMR capability. don't try to drink the ocean.Quoted 5 lines
Quoted 4 lines
Quoted 1 line
b. device MAY fail to operate further if
VIRTIO_F_VERSION_1is not accepted.This is optional not a requirement.
Please see above wording, if its acceptable.
Quoted 7 lines
you don't need any of that for this effort, generally
VIRTIO_F_VERSION_1thing needs a lot of work, if you want to invest the time just ask I'll try to list the issues.But nothing to do with memory mapped legacy interface directly.
I likely dont understand your above point. The point is, a device with new capability needs to
Quoted 8 lines
a. offer
VERSION_1offer, allow negotiationVERSION_1b. allow not negotiation ofVERSION_1With single virtio device id, how to frame this in the spec? One way I proposed above that a new transport capability indicates this.
I didnt follow your idea of how above #a and #b can be worded without the new capability wording.
Just add a new capability and explain that it exposes the legacy interface in a window at an offset inside a memory bar. that is mostly it. if there's an adapting layer that forwards IO requests from legacy driver to that window, this allows this driver to work and use the device through the legacy interface.
There could be a small patch or two on top to tweak wording if there are places where it says "non transitional devices have no legacy interfaces". And probably an explicit list of devices
which are allowed to have this capability.
That is it really.
Quoted 32 lines
Quoted 32 lines
Quoted 32 lines
Quoted 21 lines
Quoted 7 lines
c. A non-transitional device with above
legacy_if_supportedcapability, will allow device reset sequence, described in [1] Driver
Requirements: Device Initialization (3.1.1) [2] Legacy Interface:
Device Initialization (3.1.2)Quoted 8 lines
Quoted 3 lines
Quoted 1 line
device reset sequence.
what is this one?
I listed above in #c.
Andd. When
legacy_if_emulationcapability is offered and hypervisor driverenabled it, when driver perform device reset, driver will not wait for device reset to go zero.
Quoted 1 line
When
legacy_if_emulationcapability is not enabled by (hypervisor or othersay existing) driver, driver will wait for device reset to turn 0. (Following the driver requirement 2.4.2).
Quoted 7 lines
It might not be a bad idea to enable it, but I observe that it is possible for hypervisor to expose a standard transitional device on top of this MMR capability. Thus it will not be known whether guest driver accesses legacy or modern BAR until guest runs.
I propose, instead, that device exposes same registers at two addresses and executes reset correctly depending on which address it was accessed through. WDYT?Yep, this the exact proposal here.
Legacy registers exposes via AQ (aka TVQ) or MMR location, behaves like legacy. And regular registers at their location as-is.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
With that feature bit negotiation is the only thing to relax like worded above.
It's not really different from IO port legacy then.
Yes, it is no different, because what is provided is just the transport, not a new functional behavior.
So let it be, just add stuff where capability is different. Leave cleanups of legacy and transitional stuff for later.
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 07/11] transport-pci: Introduce transitional MMR device id
Quoted 16 lines · Michael S. Tsirkin
Quoted 14 lines · Parav Pandit
Quoted 5 lines
A device MUST offer
VIRTIO_F_VERSION_1. A device MAY fail to operate further ifVIRTIO_F_VERSION_1is not accepted.it's implied that this does not refer to legacy interface.
But the interface being exposes is not a legacy interface at the PCI device level.
A PCI device is exposing a interface that can be used
by either
a. existing non transitional driver who will negotiate _1, just fine. or
b. by legacy driver in the guest VM, which will not negotiate _1.
Quoted 6 lines
Quoted 2 lines
And here device must not fail to operate.
Hence spec should say that it should not fail to operate.sorry, what? it's exactly the legacy interface that's the whole value of this hack, just exposed through another bar.
I am aligned with you on this part of exposing legacy interface via another bar (or a window within an existing memory bar).
What is translates to is a spec wording something like below:
A non transitional device exposes legacy interface using a memory mapped registers in a BAR or its parent PCI device through AQ.
Legacy common configuration registers and device specific registers accessed through such interface work as legacy interface defined in rest of the specification.
Quoted 3 lines
Quoted 1 line
And since the guest driver may be 1.x, _1 will be offered by the device.
_1 is not offered in the legacy interface. And if you negotiate
Right.
Quoted 2 lines
_1 you better not touch legacy with a 10 foot pole.
Right.
Quoted 7 lines
Just add a new capability and explain that it exposes the legacy interface in a window at an offset inside a memory bar. that is mostly it. if there's an adapting layer that forwards IO requests from legacy driver to that window, this allows this driver to work and use the device through the legacy interface.
ok. Something like above?
Quoted 6 lines
There could be a small patch or two on top to tweak wording if there are places where it says "non transitional devices have no legacy interfaces". And probably an explicit list of devices
which are allowed to have this capability.
Make sense to me.
effectively we will have,
1. one or two patches, as you describe in above point for tweaking wording + device list.
2. new optional capability (in extended area because legacy area is near to full). a. indicates it supports memory mapped and/or
b. via aq (when aq is ready)
3. patch to make use of notification region as done in patch-10.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 07/11] transport-pci: Introduce transitional MMR device id
In reply to Parav PanditQuoted 7 lines · Parav Pandit
Transitional MMR device PCI Device IDs are unique. Hence, any of the existing drivers do not bind to it. This further maintains the backward compatibility with existing drivers.
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>
This is IMO just too big a change: fundamentally this is a completely new transport since no existing drivers can use this device at all. Not a thing we should do lightly. And we have options on the table such as AQ, which address most of the issue. Yes they do not work for passthrough of a PF but that seems like a minor issue. If we want to save the MMR idea, let's find a way to cut down this patchset's size significantly.
On a more positive side, I do not really see a reason to have a new ID at all. Device can have a normal device ID and additionally the new capability.
Quoted 71 lines
--- transport-pci.tex | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-)transport-pci.tex +41
-4@@ -19,12 +19,14 @@ \section{Virtio Over PCI Bus}\label{sec:Virtio Transport Options / Virtio Over P \subsection{PCI Device Discovery}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery} Any PCI device with PCI Vendor ID 0x1af4, and PCI Device ID 0x1000 through -0x107f inclusive is a virtio device. The actual value within this range -indicates which virtio device is supported by the device. +0x107f inclusive and DeviceID 0x10f9 through 0x10ff is a virtio device. +The actual value within this range indicates which virtio device +type it is. The PCI Device ID is calculated by adding 0x1040 to the Virtio Device ID, as indicated in section \ref{sec:Device Types}. -Additionally, devices MAY utilize a Transitional PCI Device ID range, -0x1000 to 0x103f depending on the device type. +Additionally, devices MAY utilize a Transitional PCI Device ID range +0x1000 to 0x103f inclusive or a Transitional MMR PCI Device ID range +0x10f9 to 0x10ff inclusive, depending on the device type. \devicenormative{\subsubsection}{PCI Device Discovery}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}@@ -95,6 +97,41 @@ \subsubsection{Legacy Interfaces: A Note on PCI Device Discovery}\label{sec:Virt This is to match legacy drivers. +\subsubsection{Transitional MMR Interface: A Note on PCI Device +Discovery}\label{sec:Virtio Transport Options / Virtio Over PCI +Bus / PCI Device Discovery / Transitional MMR Interface: A Note on PCI Device Discovery} + +The transitional MMR device has one of the following PCI Device ID +depending on the device type: + +\begin{tabular}{|l|c|} +\hline +Transitional PCI Device ID & Virtio Device \\ +\hline \hline +0x10f9 & network device \\ +\hline +0x10fa & block device \\ +\hline +0x10fb & memory ballooning (traditional) \\ +\hline +0x10fc & console \\ +\hline +0x10fd & SCSI host \\ +\hline +0x10fe & entropy source \\ +\hline +0x10ff & 9P transport \\ +\hline +\end{tabular} + +The PCI Subsystem Vendor ID and the PCI Subsystem Device ID MAY +reflect the PCI Vendor and Device ID of the environment. + +The transitional MMR driver MUST match any PCI Revision ID value. + +The transitional MMR driver MAY match any PCI Subsystem Vendor ID and +any PCI Subsystem Device ID value. + \subsection{PCI Device Layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout} The device is configured via I/O and/or memory regions (though seeSignature · 1 line
2.26.2
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
PATCH 8/11 transport-pci: Introduce virtio extended capability
In reply to Parav PanditPCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.
--- transport-pci.tex | 69 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-)
transport-pci.tex +68 -1
@@ -174,7 +174,8 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option the function, or accessed via the special VIRTIO_PCI_CAP_PCI_CFG field in the PCI configuration space. The location of each structure is specified using a vendor-specific PCI capability located -on the capability list in PCI configuration space of the device. +on the capability list in PCI configuration space of the device +unless stated otherwise. This virtio structure capability uses little-endian format; all fields are read-only for the driver unless stated otherwise:
@@ -301,6 +302,72 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option fields provide the most significant 32 bits of a total 64 bit offset and length within the BAR specified by \field{cap.bar}. +Virtio extended PCI Express capability structure defines +the location of certain virtio device configuration related +structures using PCI Express extended capability. Virtio +extended PCI Express capability structure uses PCI Express +vendor specific extended capability (VSEC). It has a below +layout: + +\begin{lstlisting} +struct pcie_ext_cap { + le16 cap_vendor_id; /* Generic PCI field: 0xB */ + le16 cap_version : 2; /* Generic PCI field: 0 */ + le16 next_cap_offset : 14; /* Generic PCI field: next cap or 0 */ +}; + +struct virtio_pcie_ext_cap { + struct pcie_ext_cap pcie_ecap; + u8 cfg_type; /* Identifies the structure. */ + u8 bar; /* Index of the BAR where its located */ + u8 id; /* Multiple capabilities of the same type */ + u8 zero_padding[1]; + le64 offset; /* Offset with the bar */ + le64 length; /* Length of the structure, in bytes. */ + u8 data[]; /* Optional variable length data */ +}; +\end{lstlisting} + +This structure contains optional data, depending on +\field{cfg_type}. The fields are interpreted as follows: + +\begin{description} +\item[\field{cap_vendor_id}] + 0x0B; identifies a vendor-specific extended capability. + +\item[\field{cap_version}] + contains a value of 0. + +\item[\field{next_cap_offset}] + Offset to the next capability. + +\item[\field{cfg_type}] + follows the same definition as \field{cfg_type} + from the \field{struct virtio_pci_cap}. + +\item[\field{bar}] + follows the same same definition as \field{bar} + from the \field{struct virtio_pci_cap}. + +\item[\field{id}] + follows the same same definition as \field{id} + from the \field{struct virtio_pci_cap}. + +\item[\field{offset}] + indicates where the structure begins relative to the + base address associated with the BAR. The alignment + requirements of offset are indicated in each + structure-specific section that uses + \field{struct virtio_pcie_ext_cap}. + +\item[\field{length}] + indicates the length of the structure indicated by this + capability. + +\item[\field{data}] + optional data of this capability. +\end{description} + \drivernormative{\subsubsection}{Virtio Structure PCI Capabilities}{Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities} The driver MUST ignore any vendor-specific capability structure which has
Signature · 6 lines
2.26.2 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 9 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>
What does it "Co-developed-by" mean exactly that Signed-off-by does not?
Quoted 20 lines
Signed-off-by Parav Pandit <[email protected]>--- transport-pci.tex | 69 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-)transport-pci.tex +2
-1@@ -174,7 +174,8 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option the function, or accessed via the special VIRTIO_PCI_CAP_PCI_CFG field in the PCI configuration space. The location of each structure is specified using a vendor-specific PCI capability located -on the capability list in PCI configuration space of the device. +on the capability list in PCI configuration space of the device +unless stated otherwise. This virtio structure capability uses little-endian format; all fields are read-only for the driver unless stated otherwise:
transport-pci.tex \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option · line 309
Quoted 8 lines
transport-pci.tex +5
-0@@ -301,6 +302,72 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option fields provide the most significant 32 bits of a total 64 bit offset and length within the BAR specified by \field{cap.bar}. +Virtio extended PCI Express capability structure defines +the location of certain virtio device configuration related +structures using PCI Express extended capability. Virtio +extended PCI Express capability structure uses PCI Express +vendor specific extended capability (VSEC). It has a below
a layout below, or the following layout
Quoted 8 lines
transport-pci.tex +8
-0+layout: + +\begin{lstlisting} +struct pcie_ext_cap { + le16 cap_vendor_id; /* Generic PCI field: 0xB */ + le16 cap_version : 2; /* Generic PCI field: 0 */ + le16 next_cap_offset : 14; /* Generic PCI field: next cap or 0 */ +};
transport-pci.tex \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option · line 327
Quoted 10 lines
transport-pci.tex +10
-0+ +struct virtio_pcie_ext_cap { + struct pcie_ext_cap pcie_ecap; + u8 cfg_type; /* Identifies the structure. */ + u8 bar; /* Index of the BAR where its located */ + u8 id; /* Multiple capabilities of the same type */ + u8 zero_padding[1]; + le64 offset; /* Offset with the bar */ + le64 length; /* Length of the structure, in bytes. */ + u8 data[]; /* Optional variable length data */
Maybe le64 data[], for alignment?
Quoted 48 lines
transport-pci.tex +43
-0+}; +\end{lstlisting} + +This structure contains optional data, depending on +\field{cfg_type}. The fields are interpreted as follows: + +\begin{description} +\item[\field{cap_vendor_id}] + 0x0B; identifies a vendor-specific extended capability. + +\item[\field{cap_version}] + contains a value of 0. + +\item[\field{next_cap_offset}] + Offset to the next capability. + +\item[\field{cfg_type}] + follows the same definition as \field{cfg_type} + from the \field{struct virtio_pci_cap}. + +\item[\field{bar}] + follows the same same definition as \field{bar} + from the \field{struct virtio_pci_cap}. + +\item[\field{id}] + follows the same same definition as \field{id} + from the \field{struct virtio_pci_cap}. + +\item[\field{offset}] + indicates where the structure begins relative to the + base address associated with the BAR. The alignment + requirements of offset are indicated in each + structure-specific section that uses + \field{struct virtio_pcie_ext_cap}. + +\item[\field{length}] + indicates the length of the structure indicated by this + capability. + +\item[\field{data}] + optional data of this capability. +\end{description} + \drivernormative{\subsubsection}{Virtio Structure PCI Capabilities}{Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities} The driver MUST ignore any vendor-specific capability structure which hasSignature · 1 line
2.26.2
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 5 lines · Michael S. Tsirkin
Quoted 4 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Quoted 8 lines
Quoted 5 lines
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>What does it "Co-developed-by" mean exactly that Signed-off-by does not?
AIUI, "Co-developed-by:" is more akin to a second "Author:", i.e. to give attribution. (Linux kernel rules actually state that any "Co-developed-by:" must be followed by a "Signed-off-by:" for that author, but we don't really do DCO here, the S-o-b is more of a convention.)
Quoted 3 lines
Quoted 3 lines
Signed-off-by Parav Pandit <[email protected]>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 13 lines · Cornelia Huck
Quoted 11 lines · Michael S. Tsirkin
Quoted 9 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>
Quoted 8 lines
Quoted 2 lines
What does it "Co-developed-by" mean exactly that Signed-off-by does not?
AIUI, "Co-developed-by:" is more akin to a second "Author:", i.e. to give attribution. (Linux kernel rules actually state that any "Co-developed-by:" must be followed by a "Signed-off-by:" for that author, but we don't really do DCO here, the S-o-b is more of a convention.)
Actually, we might want to generally, to signify agreement to the IPR. How about adding this to our rules? But in this case Satananda Burla is a TC member so yes, no problem.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Signed-off-by Parav Pandit <[email protected]>
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 24 lines · Michael S. Tsirkin
Quoted 13 lines · Cornelia Huck
Quoted 11 lines · Michael S. Tsirkin
Quoted 9 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>Quoted 8 lines
Quoted 2 lines
What does it "Co-developed-by" mean exactly that Signed-off-by does not?
AIUI, "Co-developed-by:" is more akin to a second "Author:", i.e. to give attribution. (Linux kernel rules actually state that any "Co-developed-by:" must be followed by a "Signed-off-by:" for that author, but we don't really do DCO here, the S-o-b is more of a convention.)
Quoted 3 lines
Actually, we might want to generally, to signify agreement to the IPR. How about adding this to our rules? But in this case Satananda Burla is a TC member so yes, no problem.
Adding a s-o-b requirement is not a bad idea... do you want to propose an update?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 10 lines · Cornelia Huck
Quoted 10 lines
Quoted 8 lines
Quoted 2 lines
What does it "Co-developed-by" mean exactly that Signed-off-by does not?
AIUI, "Co-developed-by:" is more akin to a second "Author:", i.e. to give attribution. (Linux kernel rules actually state that any "Co-developed-by:" must be followed by a "Signed-off-by:" for that author, but we don't really do DCO here, the S-o-b is more of a convention.)
Quoted 6 lines
Quoted 3 lines
Actually, we might want to generally, to signify agreement to the IPR. How about adding this to our rules? But in this case Satananda Burla is a TC member so yes, no problem.
Adding a s-o-b requirement is not a bad idea... do you want to propose an update?
OK how about the following:
---------------
The process for forwarding comments from others:
Generally, subscribing to the virtio comments mailing list requires agreement to the OASIS feedback license, at
https://www.oasis-open.org/who/ipr/feedback_license.pdf
When forwarding (in modified or unmodified form) comments from others, please make sure the commenter has read and agreed to the
feedback license. If this is the case, please include the following:
License-consent: commenter's name <commenter's email>
where commenter's name <commenter's email> is a valid name-addr as specified in RFC 5322, see
https://datatracker.ietf.org/doc/html/rfc5322#section-3.4
If the comment is on behalf of an organization, please use the organization's email address.
If forwarding a comment from a TC member, please instead get consent to the full Virtio TC IPR, and then, as before, include
License-consent: commenter's name <commenter's email>
If you are reusing a comment that has already been posted to the TC mailing list, the above tags are not required.
---------------
We could reuse Signed-off-by though I am a bit concerned whether people will assume it's a DCO thing which everyone copies. Thoughts?
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 18 lines · Michael S. Tsirkin
Quoted 10 lines · Cornelia Huck
Quoted 10 lines
Quoted 8 lines
Quoted 2 lines
What does it "Co-developed-by" mean exactly that Signed-off-by does not?
AIUI, "Co-developed-by:" is more akin to a second "Author:", i.e. to give attribution. (Linux kernel rules actually state that any "Co-developed-by:" must be followed by a "Signed-off-by:" for that author, but we don't really do DCO here, the S-o-b is more of a convention.)
Quoted 6 lines
Quoted 3 lines
Actually, we might want to generally, to signify agreement to the IPR. How about adding this to our rules? But in this case Satananda Burla is a TC member so yes, no problem.
Adding a s-o-b requirement is not a bad idea... do you want to propose an update?
Quoted 9 lines
OK how about the following:
---------------
The process for forwarding comments from others:Generally, subscribing to the virtio comments mailing list requires agreement to the OASIS feedback license, at
https://www.oasis-open.org/who/ipr/feedback_license.pdf
It is not straight forward for non virtio tc member to realize above obligation. It is worth to document it in the section [1].
[1] https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio#feedback
Something like,
From:
If you're interested in following ongoing development and can't join the committee, I recommend you subscribe to the virtio-comment and virtio-dev lists.
To:
If you're interested in following ongoing development and can't join the committee, I recommend you subscribe to the virtio-comment and virtio-dev lists. Your contribution to above mailing lists is licensed under the OASIS feedback license agreement describe at [1].
Quoted 10 lines
When forwarding (in modified or unmodified form) comments from others, please make sure the commenter has read and agreed to the
feedback license. If this is the case, please include the following:License-consent: commenter's name <commenter's email>
where commenter's name <commenter's email> is a valid name-addr as specified in RFC 5322, see
https://datatracker.ietf.org/doc/html/rfc5322#section-3.4
Quoted 9 lines
If the comment is on behalf of an organization, please use the organization's email address.
If forwarding a comment from a TC member, please instead get consent to the full Virtio TC IPR, and then, as before, include
License-consent: commenter's name <commenter's email>
License-consent tag do not capture the contribution by other virtio tc member(s) in the generated comment.
Signed-off-by captures it.
So both tags are needed depending on comment contribution type.
Rest above change looks good to me.
Quoted 8 lines
If you are reusing a comment that has already been posted to the TC mailing list, the above tags are not required.
---------------
We could reuse Signed-off-by though I am a bit concerned whether people will assume it's a DCO thing which everyone copies. Thoughts?
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 44 lines · Parav Pandit
Quoted 18 lines · Michael S. Tsirkin
Quoted 10 lines · Cornelia Huck
Quoted 10 lines
Quoted 8 lines
Quoted 2 lines
What does it "Co-developed-by" mean exactly that Signed-off-by does not?
AIUI, "Co-developed-by:" is more akin to a second "Author:", i.e. to give attribution. (Linux kernel rules actually state that any "Co-developed-by:" must be followed by a "Signed-off-by:" for that author, but we don't really do DCO here, the S-o-b is more of a convention.)
Quoted 6 lines
Quoted 3 lines
Actually, we might want to generally, to signify agreement to the IPR. How about adding this to our rules? But in this case Satananda Burla is a TC member so yes, no problem.
Adding a s-o-b requirement is not a bad idea... do you want to propose an update?
Quoted 9 lines
OK how about the following:
---------------
The process for forwarding comments from others:Generally, subscribing to the virtio comments mailing list requires agreement to the OASIS feedback license, at
https://www.oasis-open.org/who/ipr/feedback_license.pdfIt is not straight forward for non virtio tc member to realize above obligation.
It is worth to document it in the section [1].[1]
https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio#feedbackSomething like,
From:
If you're interested in following ongoing development and can't join the committee, I recommend you subscribe to the virtio-comment and virtio-dev lists.
Quoted 5 lines
To:
If you're interested in following ongoing development and can't join the committee, I recommend you subscribe to the virtio-comment and virtio-dev lists. Your contribution to above mailing lists is licensed under the OASIS feedback license agreement describe at [1].
yes. unfortunately oasis does not let us tweak this section.
Quoted 17 lines
Quoted 17 lines
When forwarding (in modified or unmodified form) comments from others, please make sure the commenter has read and agreed to the
feedback license. If this is the case, please include the following:License-consent: commenter's name <commenter's email>
where commenter's name <commenter's email> is a valid name-addr as specified in RFC 5322, see
https://datatracker.ietf.org/doc/html/rfc5322#section-3.4If the comment is on behalf of an organization, please use the organization's email address.
If forwarding a comment from a TC member, please instead get consent to the full Virtio TC IPR, and then, as before, include
Quoted 7 lines
Quoted 2 lines
License-consent: commenter's name <commenter's email>
License-consent tag do not capture the contribution by other virtio tc member(s) in the generated comment.
Signed-off-by captures it.
So both tags are needed depending on comment contribution type.
Attribution is nice but Signed-off-by is not that.
And fundamentally people go read the PDF where the Signed-off-by does not appear at all no one pokes at git history. Let's just do:
Thanks-to: name <email>
if you want attribution.
will be helpful to fill in the thanks section in the spec and does not mention signatures.
Quoted 10 lines
Rest above change looks good to me.
Quoted 8 lines
If you are reusing a comment that has already been posted to the TC mailing list, the above tags are not required.
---------------
We could reuse Signed-off-by though I am a bit concerned whether people will assume it's a DCO thing which everyone copies. Thoughts?
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] RE: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, April 10, 2023 3:49 PMAttribution is nice but Signed-off-by is not that.
Then what is Signed-off-by for virtio spec?
Can it be same definition as what Linux kernel and many other projects use like [1]?
[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html?highlight=signed%20off
Quoted 2 lines
And fundamentally people go read the PDF where the Signed-off-by does not appear at all no one pokes at git history.
When people read PDF, they do not care about the sign-off. Signed-off-by is not for that.
Quoted 4 lines
Let's just do:
Thanks-to: name <email>
Why to now learn a new term?
Why terminology of [1] is not enough like AQ status codes? :)
Quoted 4 lines
if you want attribution.
will be helpful to fill in the thanks section in the spec and does not mention signatures.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 7 lines · Parav Pandit
Quoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, April 10, 2023 3:49 PMAttribution is nice but Signed-off-by is not that.
Then what is Signed-off-by for virtio spec?
we never defined it. using it kind of by
Quoted 3 lines
Can it be same definition as what Linux kernel and many other projects use like [1]?
[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html?highlight=signed%20off
That is DCO. useful for linux pointless for us as is since we want people to agree to our IPR.
Unless you want to make DCO refer to our IPR. That might be possible.
We will need to float this past OASIS stuff.
I prefer explicit agreement to license personally.
Quoted 10 lines
Quoted 2 lines
And fundamentally people go read the PDF where the Signed-off-by does not appear at all no one pokes at git history.
When people read PDF, they do not care about the sign-off. Signed-off-by is not for that.
Quoted 4 lines
Let's just do:
Thanks-to: name <email>
Why to now learn a new term?
Why terminology of [1] is not enough like AQ status codes? :)
I have no idea what problem you are trying to address. If it is attribution Signed-off-by is not that. If it is IPR Signed-off-by is not that either but might be made to imply that.
Quoted 4 lines
Quoted 4 lines
if you want attribution.
will be helpful to fill in the thanks section in the spec and does not mention signatures.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 13 lines · Michael S. Tsirkin
Quoted 7 lines · Parav Pandit
Quoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, April 10, 2023 3:49 PMAttribution is nice but Signed-off-by is not that.
Then what is Signed-off-by for virtio spec?
we never defined it. using it kind of by
Quoted 2 lines
Can it be same definition as what Linux kernel and many other projects use like [1]?
Quoted 8 lines
Quoted 1 line
[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html?highlight=signed%20off
That is DCO. useful for linux pointless for us as is since we want people to agree to our IPR.
Unless you want to make DCO refer to our IPR. That might be possible.
We will need to float this past OASIS stuff.
I prefer explicit agreement to license personally.
In most projects, s-o-b either means "I abide by the DCO", or "I'm adding this because it seems to be the usual thing to do". "Agreeing to the IPR" would be a somewhat surprising meaning, so I'd prefer to keep IPR agreement separate as well. Not sure if we want to actually specify what we mean by s-o-b; when I'm attaching it when merging I'm using it mostly in the "let's record the chain" meaning. (Specifying that we indeed use it in that sense, and not the full DCO sense, might make sense -- or it might be overkill.)
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
And fundamentally people go read the PDF where the Signed-off-by does not appear at all no one pokes at git history.
When people read PDF, they do not care about the sign-off. Signed-off-by is not for that.
Quoted 4 lines
Let's just do:
Thanks-to: name <email>
Quoted 7 lines
Quoted 2 lines
Why to now learn a new term?
Why terminology of [1] is not enough like AQ status codes? :)I have no idea what problem you are trying to address. If it is attribution Signed-off-by is not that. If it is IPR Signed-off-by is not that either but might be made to imply that.
Yes, s-o-b is distinct from attribution (and that's why the Linux kernel requires it on top of a Co-developed-by: to satisfy the DCO, not instead of it.) If we think that Co-developed-by: without a s-o-b might be confusing, a Thanks-to: could be a better term (and also a broader one meaning "I discussed this with this person, and I want to acknowledge them".)
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] RE: [PATCH 08/11] transport-pci: Introduce virtio extended capability
In reply to Michael S. TsirkinQuoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, April 4, 2023 3:35 AM
Quoted 8 lines
Review
Quoted 5 lines
(quoted diff) +5
-0+Virtio extended PCI Express capability structure defines the location +of certain virtio device configuration related structures using PCI +Express extended capability. Virtio extended PCI Express capability +structure uses PCI Express vendor specific extended capability +(VSEC). It has a belowa layout below, or the following layout
Yes. somehow it got trimmed.
Will fix it.
Quoted 12 lines
Quoted 12 lines
transport-pci.tex +12
-0+layout: + +\begin{lstlisting} +struct pcie_ext_cap { + le16 cap_vendor_id; /* Generic PCI field: 0xB */ + le16 cap_version : 2; /* Generic PCI field: 0 */ + le16 next_cap_offset : 14; /* Generic PCI field: next cap or +0 */ }; + +struct virtio_pcie_ext_cap { + struct pcie_ext_cap pcie_ecap; + u8 cfg_type; /* Identifies the structure. */
Quoted 9 lines
transport-pci.tex \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option · line 327
Quoted 6 lines
transport-pci.tex +6
-0+ u8 bar; /* Index of the BAR where its located */ + u8 id; /* Multiple capabilities of the same type */ + u8 zero_padding[1]; + le64 offset; /* Offset with the bar */ + le64 length; /* Length of the structure, in bytes. */ + u8 data[]; /* Optional variable length data */Maybe le64 data[], for alignment?
It gets harder to decode (typecasting ..) if its string with le64 data type. I will extend the comment,
+ u8 data[]; /* Optional variable length data, must be aligned to 8 bytes */
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 37 lines · Parav Pandit
Quoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, April 4, 2023 3:35 AMQuoted 8 lines
Review
Quoted 5 lines
(quoted diff) +5
-0+Virtio extended PCI Express capability structure defines the location +of certain virtio device configuration related structures using PCI +Express extended capability. Virtio extended PCI Express capability +structure uses PCI Express vendor specific extended capability +(VSEC). It has a belowa layout below, or the following layout
Yes. somehow it got trimmed.
Will fix it.Quoted 12 lines
Quoted 12 lines
transport-pci.tex +12
-0+layout: + +\begin{lstlisting} +struct pcie_ext_cap { + le16 cap_vendor_id; /* Generic PCI field: 0xB */ + le16 cap_version : 2; /* Generic PCI field: 0 */ + le16 next_cap_offset : 14; /* Generic PCI field: next cap or +0 */ }; + +struct virtio_pcie_ext_cap { + struct pcie_ext_cap pcie_ecap; + u8 cfg_type; /* Identifies the structure. */Quoted 9 lines
transport-pci.tex \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option · line 327
Quoted 6 lines
transport-pci.tex +6
-0+ u8 bar; /* Index of the BAR where its located */ + u8 id; /* Multiple capabilities of the same type */ + u8 zero_padding[1]; + le64 offset; /* Offset with the bar */ + le64 length; /* Length of the structure, in bytes. */ + u8 data[]; /* Optional variable length data */Maybe le64 data[], for alignment?
Quoted 1 line
It gets harder to decode (typecasting ..) if its string with le64 data type.
In what language? In C you have to cast anyway, string is char *, often signed, not u8.
Quoted 3 lines
I will extend the comment,
+ u8 data[]; /* Optional variable length data, must be aligned to 8 bytes */
I'd keep it le64 or u64, it is highly unlikely we'll pass strings through this interface anyway.
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] RE: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 22 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, April 5, 2023 1:11 AMQuoted 10 lines
Quoted 10 lines
Quoted 9 lines
transport-pci.tex +9
-0+struct virtio_pcie_ext_cap { + struct pcie_ext_cap pcie_ecap; + u8 cfg_type; /* Identifies the structure. */ + u8 bar; /* Index of the BAR where its located */ + u8 id; /* Multiple capabilities of the same type */ + u8 zero_padding[1]; + le64 offset; /* Offset with the bar */ + le64 length; /* Length of the structure, in bytes. */ + u8 data[]; /* Optional variable length data */Quoted 3 lines
Quoted 2 lines
Maybe le64 data[], for alignment?
It gets harder to decode (typecasting ..) if its string with le64 data type.
In what language? In C you have to cast anyway, string is char *, often signed, not u8.
Quoted 7 lines
Quoted 4 lines
I will extend the comment,
+ u8 data[]; /* Optional variable length data, must be aligned
+ to 8 bytes */I'd keep it le64 or u64, it is highly unlikely we'll pass strings through this interface anyway.
Ok. will change.
What about rest of the patches? If we proceed using MMR interface, rest of the patches are fine?
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 27 lines · Parav Pandit
Quoted 27 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, April 5, 2023 1:11 AMQuoted 10 lines
Quoted 10 lines
Quoted 9 lines
transport-pci.tex +9
-0+struct virtio_pcie_ext_cap { + struct pcie_ext_cap pcie_ecap; + u8 cfg_type; /* Identifies the structure. */ + u8 bar; /* Index of the BAR where its located */ + u8 id; /* Multiple capabilities of the same type */ + u8 zero_padding[1]; + le64 offset; /* Offset with the bar */ + le64 length; /* Length of the structure, in bytes. */ + u8 data[]; /* Optional variable length data */Quoted 3 lines
Quoted 2 lines
Maybe le64 data[], for alignment?
It gets harder to decode (typecasting ..) if its string with le64 data type.
In what language? In C you have to cast anyway, string is char *, often signed, not u8.
Quoted 4 lines
I will extend the comment,
+ u8 data[]; /* Optional variable length data, must be aligned
+ to 8 bytes */
Quoted 6 lines
Quoted 2 lines
I'd keep it le64 or u64, it is highly unlikely we'll pass strings through this interface anyway.
Ok. will change.
What about rest of the patches? If we proceed using MMR interface, rest of the patches are fine?
Biggest problem is 7/11 - the new IDs, breaking all existing drivers.
I thought I replied on that but don't see it on that specific patch. Let me repost my thoughts now I had time to think it over.
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
In reply to Parav PanditQuoted 11 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>
Can you explain the differences compared to what I've used to propose?
https://www.mail-archive.com/[email protected]/msg08078.html
This can save time for everybody.
Thanks
Quoted 95 lines
--- transport-pci.tex | 69 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-)transport-pci.tex +68
-2@@ -174,7 +174,8 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option the function, or accessed via the special VIRTIO_PCI_CAP_PCI_CFG field in the PCI configuration space. The location of each structure is specified using a vendor-specific PCI capability located -on the capability list in PCI configuration space of the device. +on the capability list in PCI configuration space of the device +unless stated otherwise. This virtio structure capability uses little-endian format; all fields are read-only for the driver unless stated otherwise:@@ -301,6 +302,72 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option fields provide the most significant 32 bits of a total 64 bit offset and length within the BAR specified by \field{cap.bar}. +Virtio extended PCI Express capability structure defines +the location of certain virtio device configuration related +structures using PCI Express extended capability. Virtio +extended PCI Express capability structure uses PCI Express +vendor specific extended capability (VSEC). It has a below +layout: + +\begin{lstlisting} +struct pcie_ext_cap { + le16 cap_vendor_id; /* Generic PCI field: 0xB */ + le16 cap_version : 2; /* Generic PCI field: 0 */ + le16 next_cap_offset : 14; /* Generic PCI field: next cap or 0 */ +}; + +struct virtio_pcie_ext_cap { + struct pcie_ext_cap pcie_ecap; + u8 cfg_type; /* Identifies the structure. */ + u8 bar; /* Index of the BAR where its located */ + u8 id; /* Multiple capabilities of the same type */ + u8 zero_padding[1]; + le64 offset; /* Offset with the bar */ + le64 length; /* Length of the structure, in bytes. */ + u8 data[]; /* Optional variable length data */ +}; +\end{lstlisting} + +This structure contains optional data, depending on +\field{cfg_type}. The fields are interpreted as follows: + +\begin{description} +\item[\field{cap_vendor_id}] + 0x0B; identifies a vendor-specific extended capability. + +\item[\field{cap_version}] + contains a value of 0. + +\item[\field{next_cap_offset}] + Offset to the next capability. + +\item[\field{cfg_type}] + follows the same definition as \field{cfg_type} + from the \field{struct virtio_pci_cap}. + +\item[\field{bar}] + follows the same same definition as \field{bar} + from the \field{struct virtio_pci_cap}. + +\item[\field{id}] + follows the same same definition as \field{id} + from the \field{struct virtio_pci_cap}. + +\item[\field{offset}] + indicates where the structure begins relative to the + base address associated with the BAR. The alignment + requirements of offset are indicated in each + structure-specific section that uses + \field{struct virtio_pcie_ext_cap}. + +\item[\field{length}] + indicates the length of the structure indicated by this + capability. + +\item[\field{data}] + optional data of this capability. +\end{description} + \drivernormative{\subsubsection}{Virtio Structure PCI Capabilities}{Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities} The driver MUST ignore any vendor-specific capability structure which has --2.26.2
Quoted 4 lines
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 13 lines · Jason Wang
Quoted 11 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>
Quoted 7 lines
Can you explain the differences compared to what I've used to propose?
https://www.mail-archive.com/[email protected]/msg08078.html
This can save time for everybody.
Thanks
BTW another advantage of extended capabilities is - these are actually cheaper to access from a VM than classic config space.
Several points
- I don't like it that yours is 32 bit. We do not need 2 variants just
make it all 64 bit
- We need to document that if driver does not scan extended capbilities it will not find them. And existing drivers do not scan them. So what is safe
to put there? vendor specific? extra access types?
Can we make scanning these mandatory in future drivers? future devices?
I guess we can add a feature bit to flag that.
Is accessing these possible from bios?
So I like this one better as a basis - care reviewing it and adding stuff?
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 17 lines · Michael S. Tsirkin
Quoted 15 lines · Jason Wang
Quoted 11 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>Can you explain the differences compared to what I've used to propose?
Quoted 8 lines
Quoted 5 lines
https://www.mail-archive.com/[email protected]/msg08078.html
This can save time for everybody.
Thanks
BTW another advantage of extended capabilities is - these are actually cheaper to access from a VM than classic config space.
Config space/BAR is allowed by both of the proposals or anything I missed?
Quoted 5 lines
Several points
- I don't like it that yours is 32 bit. We do not need 2 variants just make it all 64 bit
That's fine.
Quoted 1 line
- We need to document that if driver does not scan extended capbilities it will not find them.
This is implicit since I remember we don't have such documentation for pci capability, anything makes pcie special?
Quoted 2 lines
And existing drivers do not scan them. So what is safe to put there? vendor specific? extra access types?
For PASID at least, since it's a PCI-E feature, vendor specific should be fine. Not sure about legacy MMIO then.
Quoted 2 lines
Can we make scanning these mandatory in future drivers? future devices? I guess we can add a feature bit to flag that.
For PASID, it doesn't need this, otherwise we may duplicate transport specific features.
Quoted 1 line
Is accessing these possible from bios?
Not at least for the two use cases now PASID or legacy MMIO.
Quoted 3 lines
So I like this one better as a basis - care reviewing it and adding stuff?
There are very few differences and I will have a look.
Thanks
Quoted 4 lines
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 35 lines · Jason Wang
Quoted 17 lines · Michael S. Tsirkin
Quoted 15 lines · Jason Wang
Quoted 11 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>Can you explain the differences compared to what I've used to propose?
Quoted 8 lines
Quoted 5 lines
https://www.mail-archive.com/[email protected]/msg08078.html
This can save time for everybody.
Thanks
BTW another advantage of extended capabilities is - these are actually cheaper to access from a VM than classic config space.
Config space/BAR is allowed by both of the proposals or anything I missed?
Quoted 5 lines
Several points
- I don't like it that yours is 32 bit. We do not need 2 variants just make it all 64 bit
Quoted 6 lines
That's fine.
Quoted 1 line
- We need to document that if driver does not scan extended capbilities it will not find them.
This is implicit since I remember we don't have such documentation for pci capability, anything makes pcie special?
yes - the fact that there are tons of existing drivers expecting everything in standard space.
Quoted 11 lines
Quoted 2 lines
And existing drivers do not scan them. So what is safe to put there? vendor specific? extra access types?
For PASID at least, since it's a PCI-E feature, vendor specific should be fine. Not sure about legacy MMIO then.
Quoted 2 lines
Can we make scanning these mandatory in future drivers? future devices? I guess we can add a feature bit to flag that.
For PASID, it doesn't need this, otherwise we may duplicate transport specific features.
i don't get it. what does PASID have to do with it? A new feature will allow clean split at least:
we make any new features and new devices that expect express capability depend on this new feature bit.
Quoted 3 lines
Quoted 1 line
Is accessing these possible from bios?
Not at least for the two use cases now PASID or legacy MMIO.
can't parse english here. what does this mean?
Quoted 12 lines
Quoted 3 lines
So I like this one better as a basis - care reviewing it and adding stuff?
There are very few differences and I will have a look.
Thanks
Quoted 4 lines
--
MST
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 54 lines · Michael S. Tsirkin
Quoted 35 lines · Jason Wang
Quoted 17 lines · Michael S. Tsirkin
Quoted 15 lines · Jason Wang
Quoted 11 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>Can you explain the differences compared to what I've used to propose?
Quoted 8 lines
Quoted 5 lines
https://www.mail-archive.com/[email protected]/msg08078.html
This can save time for everybody.
Thanks
BTW another advantage of extended capabilities is - these are actually cheaper to access from a VM than classic config space.
Config space/BAR is allowed by both of the proposals or anything I missed?
Quoted 5 lines
Several points
- I don't like it that yours is 32 bit. We do not need 2 variants just make it all 64 bitQuoted 6 lines
That's fine.
Quoted 1 line
- We need to document that if driver does not scan extended capbilities it will not find them.
This is implicit since I remember we don't have such documentation for pci capability, anything makes pcie special?
yes - the fact that there are tons of existing drivers expecting everything in standard space.
Quoted 6 lines
Quoted 2 lines
And existing drivers do not scan them. So what is safe to put there? vendor specific? extra access types?
For PASID at least, since it's a PCI-E feature, vendor specific should be fine. Not sure about legacy MMIO then.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Can we make scanning these mandatory in future drivers? future devices? I guess we can add a feature bit to flag that.
For PASID, it doesn't need this, otherwise we may duplicate transport specific features.
i don't get it. what does PASID have to do with it?
My proposal is to allow PASID capability to be placed on top. So what I meant is:
if the driver needs to use PASID, it needs to scan extend capability
So it is only used for future drivers. I think this applies to legacy MMIO as well.
Quoted 9 lines
A new feature will allow clean split at least:
we make any new features and new devices that expect express capability depend on this new feature bit.Quoted 3 lines
Quoted 1 line
Is accessing these possible from bios?
Not at least for the two use cases now PASID or legacy MMIO.
can't parse english here. what does this mean?
I meant, it depends on the capability semantics. Both PASID and legacy MMIO don't need to be accessed by BIOS. We can't change legacy BIOS to use legacy MMIO bars.
Thanks
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
So I like this one better as a basis - care reviewing it and adding stuff?
Quoted 9 lines
Quoted 8 lines
There are very few differences and I will have a look.
Thanks
Quoted 4 lines
--
MST
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 58 lines · Jason Wang
Quoted 57 lines · Michael S. Tsirkin
Quoted 35 lines · Jason Wang
Quoted 17 lines · Michael S. Tsirkin
Quoted 15 lines · Jason Wang
Quoted 11 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>Can you explain the differences compared to what I've used to propose?
Quoted 8 lines
Quoted 5 lines
https://www.mail-archive.com/[email protected]/msg08078.html
This can save time for everybody.
Thanks
BTW another advantage of extended capabilities is - these are actually cheaper to access from a VM than classic config space.
Config space/BAR is allowed by both of the proposals or anything I missed?
Quoted 5 lines
Several points
- I don't like it that yours is 32 bit. We do not need 2 variants just make it all 64 bitQuoted 6 lines
That's fine.
Quoted 1 line
- We need to document that if driver does not scan extended capbilities it will not find them.
This is implicit since I remember we don't have such documentation for pci capability, anything makes pcie special?
yes - the fact that there are tons of existing drivers expecting everything in standard space.
Quoted 9 lines
Quoted 2 lines
And existing drivers do not scan them. So what is safe to put there? vendor specific? extra access types?
For PASID at least, since it's a PCI-E feature, vendor specific should be fine. Not sure about legacy MMIO then.
Quoted 2 lines
Can we make scanning these mandatory in future drivers? future devices? I guess we can add a feature bit to flag that.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
For PASID, it doesn't need this, otherwise we may duplicate transport specific features.
i don't get it. what does PASID have to do with it?
My proposal is to allow PASID capability to be placed on top.
Assuming you mean a patch applied on top of this one.
Quoted 7 lines
So what
I meant is:if the driver needs to use PASID, it needs to scan extend capability
So it is only used for future drivers. I think this applies to legacy MMIO as well.
sure
Quoted 8 lines
Quoted 8 lines
A new feature will allow clean split at least:
we make any new features and new devices that expect express capability depend on this new feature bit.Quoted 3 lines
Quoted 1 line
Is accessing these possible from bios?
Not at least for the two use cases now PASID or legacy MMIO.
Quoted 7 lines
Quoted 1 line
can't parse english here. what does this mean?
I meant, it depends on the capability semantics. Both PASID and legacy MMIO don't need to be accessed by BIOS. We can't change legacy BIOS to use legacy MMIO bars.
Thanks
makes sense.
now, imagine someone building a new device. if existing drivers are not a concern, it is possible to move capabilities all to extended space. is that possible while keeping the bios working?
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
So I like this one better as a basis - care reviewing it and adding stuff?
There are very few differences and I will have a look.
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Thanks
Quoted 4 lines
--
MST
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 93 lines · Michael S. Tsirkin
Quoted 58 lines · Jason Wang
Quoted 57 lines · Michael S. Tsirkin
Quoted 35 lines · Jason Wang
Quoted 17 lines · Michael S. Tsirkin
Quoted 15 lines · Jason Wang
Quoted 11 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>Can you explain the differences compared to what I've used to propose?
Quoted 8 lines
Quoted 5 lines
https://www.mail-archive.com/[email protected]/msg08078.html
This can save time for everybody.
Thanks
BTW another advantage of extended capabilities is - these are actually cheaper to access from a VM than classic config space.
Config space/BAR is allowed by both of the proposals or anything I missed?
Quoted 5 lines
Several points
- I don't like it that yours is 32 bit. We do not need 2 variants just make it all 64 bitQuoted 6 lines
That's fine.
Quoted 1 line
- We need to document that if driver does not scan extended capbilities it will not find them.
This is implicit since I remember we don't have such documentation for pci capability, anything makes pcie special?
yes - the fact that there are tons of existing drivers expecting everything in standard space.
Quoted 9 lines
Quoted 2 lines
And existing drivers do not scan them. So what is safe to put there? vendor specific? extra access types?
For PASID at least, since it's a PCI-E feature, vendor specific should be fine. Not sure about legacy MMIO then.
Quoted 2 lines
Can we make scanning these mandatory in future drivers? future devices? I guess we can add a feature bit to flag that.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
For PASID, it doesn't need this, otherwise we may duplicate transport specific features.
i don't get it. what does PASID have to do with it?
My proposal is to allow PASID capability to be placed on top.
Assuming you mean a patch applied on top of this one.
Quoted 7 lines
So what
I meant is:if the driver needs to use PASID, it needs to scan extend capability
So it is only used for future drivers. I think this applies to legacy MMIO as well.
sure
Quoted 14 lines
Quoted 9 lines
A new feature will allow clean split at least:
we make any new features and new devices that expect express capability depend on this new feature bit.Quoted 3 lines
Quoted 1 line
Is accessing these possible from bios?
Not at least for the two use cases now PASID or legacy MMIO.
can't parse english here. what does this mean?
I meant, it depends on the capability semantics. Both PASID and legacy MMIO don't need to be accessed by BIOS. We can't change legacy BIOS to use legacy MMIO bars.
Quoted 8 lines
Quoted 1 line
Thanks
makes sense.
now, imagine someone building a new device. if existing drivers are not a concern, it is possible to move capabilities all to extended space. is that possible while keeping the bios working?
This is possible but I'm not sure it's worthwhile. What happens if the device puts all capabilities in the extended space but the bios can't scan there? We can place them at both but it then doesn't address the out of space issue. Things will be easier if we allow new features/capabilities to be placed on the extended space.
Thanks
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
So I like this one better as a basis - care reviewing it and adding stuff?
There are very few differences and I will have a look.
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Thanks
Quoted 4 lines
--
MST
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 99 lines · Jason Wang
Quoted 98 lines · Michael S. Tsirkin
Quoted 58 lines · Jason Wang
Quoted 57 lines · Michael S. Tsirkin
Quoted 35 lines · Jason Wang
Quoted 17 lines · Michael S. Tsirkin
Quoted 15 lines · Jason Wang
Quoted 11 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>Can you explain the differences compared to what I've used to propose?
Quoted 8 lines
Quoted 5 lines
https://www.mail-archive.com/[email protected]/msg08078.html
This can save time for everybody.
Thanks
BTW another advantage of extended capabilities is - these are actually cheaper to access from a VM than classic config space.
Config space/BAR is allowed by both of the proposals or anything I missed?
Quoted 5 lines
Several points
- I don't like it that yours is 32 bit. We do not need 2 variants just make it all 64 bitQuoted 6 lines
That's fine.
Quoted 1 line
- We need to document that if driver does not scan extended capbilities it will not find them.
This is implicit since I remember we don't have such documentation for pci capability, anything makes pcie special?
yes - the fact that there are tons of existing drivers expecting everything in standard space.
Quoted 9 lines
Quoted 2 lines
And existing drivers do not scan them. So what is safe to put there? vendor specific? extra access types?
For PASID at least, since it's a PCI-E feature, vendor specific should be fine. Not sure about legacy MMIO then.
Quoted 2 lines
Can we make scanning these mandatory in future drivers? future devices? I guess we can add a feature bit to flag that.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
For PASID, it doesn't need this, otherwise we may duplicate transport specific features.
i don't get it. what does PASID have to do with it?
My proposal is to allow PASID capability to be placed on top.
Assuming you mean a patch applied on top of this one.
Quoted 7 lines
So what
I meant is:if the driver needs to use PASID, it needs to scan extend capability
So it is only used for future drivers. I think this applies to legacy MMIO as well.
sure
Quoted 8 lines
Quoted 8 lines
A new feature will allow clean split at least:
we make any new features and new devices that expect express capability depend on this new feature bit.Quoted 3 lines
Quoted 1 line
Is accessing these possible from bios?
Not at least for the two use cases now PASID or legacy MMIO.
Quoted 7 lines
Quoted 1 line
can't parse english here. what does this mean?
I meant, it depends on the capability semantics. Both PASID and legacy MMIO don't need to be accessed by BIOS. We can't change legacy BIOS to use legacy MMIO bars.
Thanks
makes sense.
Quoted 7 lines
Quoted 3 lines
now, imagine someone building a new device. if existing drivers are not a concern, it is possible to move capabilities all to extended space. is that possible while keeping the bios working?
This is possible but I'm not sure it's worthwhile. What happens if the device puts all capabilities in the extended space but the bios can't scan there?
that's my question. can seabios access extended caps?
Quoted 4 lines
We can place them at both but it then doesn't address the out of space issue. Things will be easier if we allow new features/capabilities to be placed on the extended space.
Quoted 19 lines
Thanks
Quoted 17 lines
Quoted 16 lines
Quoted 16 lines
Quoted 15 lines
Quoted 6 lines
So I like this one better as a basis - care reviewing it and adding stuff?
There are very few differences and I will have a look.
Thanks
Quoted 4 lines
--
MST
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] RE: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
In reply to Jason WangQuoted 10 lines
From: Jason Wang <[email protected]>
Sent: Tuesday, April 11, 2023 5:07 AMThis is possible but I'm not sure it's worthwhile. What happens if the device puts all capabilities in the extended space but the bios can't scan there? We can place them at both but it then doesn't address the out of space issue. Things will be easier if we allow new features/capabilities to be placed on the extended space.
+1.
Driver side code to refer to extended pci area for new cap negligible being ext cap is far more common outside of virtio.
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
In reply to Jason WangQuoted 7 lines · Jason Wang
Quoted 3 lines
now, imagine someone building a new device. if existing drivers are not a concern, it is possible to move capabilities all to extended space. is that possible while keeping the bios working?
This is possible but I'm not sure it's worthwhile. What happens if the device puts all capabilities in the extended space but the bios can't scan there?
that's my question. why can't bios scan there?
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
In reply to Michael S. TsirkinQuoted 4 lines · Michael S. Tsirkin
Quoted 4 lines
I meant, it depends on the capability semantics. Both PASID and legacy MMIO don't need to be accessed by BIOS. We can't change legacy BIOS to use legacy MMIO bars.
Quoted 9 lines
Quoted 1 line
Thanks
makes sense.
now, imagine someone building a new device. if existing drivers are not a concern, it is possible to move capabilities all to extended space. is that possible while keeping the bios working?
unlikely as bios is looking in the legacy section.
New capabilities like legacy (and pasid) has no backward compat requirement from bios and drivers. so they can start from new.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 10 lines · Parav Pandit
Quoted 6 lines · Michael S. Tsirkin
Quoted 5 lines
I meant, it depends on the capability semantics. Both PASID and legacy MMIO don't need to be accessed by BIOS. We can't change legacy BIOS to use legacy MMIO bars.
Thanks
Quoted 8 lines
Quoted 7 lines
makes sense.
now, imagine someone building a new device. if existing drivers are not a concern, it is possible to move capabilities all to extended space. is that possible while keeping the bios working?
unlikely as bios is looking in the legacy section.
what do you mean by the legacy section?
Quoted 3 lines
New capabilities like legacy (and pasid) has no backward compat requirement from bios and drivers.
so they can start from new.
sure.
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 6 lines
From: [email protected] <[email protected] open.org> On Behalf Of Michael S. Tsirkin
Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
now, imagine someone building a new device. if existing drivers are not a concern, it is possible to move capabilities all to extended space. is that possible while keeping the bios working?
unlikely as bios is looking in the legacy section.
what do you mean by the legacy section?
Existing virtio PCI capabilities which are in the PCI capabilities region in first 256 bytes of the PCI config space.
Quoted 5 lines
Quoted 3 lines
New capabilities like legacy (and pasid) has no backward compat requirement from bios and drivers.
so they can start from new.sure.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 10 lines · Parav Pandit
Quoted 10 lines
From: [email protected] <[email protected] open.org> On Behalf Of Michael S. Tsirkin
Quoted 5 lines
Quoted 5 lines
now, imagine someone building a new device. if existing drivers are not a concern, it is possible to move capabilities all to extended space. is that possible while keeping the bios working?
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
unlikely as bios is looking in the legacy section.
what do you mean by the legacy section?
Existing virtio PCI capabilities which are in the PCI capabilities region in first 256 bytes of the PCI config space.
well, of course, my question was for a new, future device, can we put all capabilities in the extended space? will we be able to teach bios to access these?
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
New capabilities like legacy (and pasid) has no backward compat requirement from bios and drivers.
so they can start from new.sure.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 8 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, April 11, 2023 10:10 AMwell, of course, my question was for a new, future device, can we put all capabilities in the extended space? will we be able to teach bios to access these?
Cannot speak for BIOS vendors,
but from PCI spec side, the extended capability exists for more than a decade ago. ACS, SR-IOV etc are part of extended.
We still need to teach BIOS for the new device where to look for.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
In reply to Jason WangHi Jason,
Quoted 10 lines · Jason Wang
Quoted 9 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.
Quoted 9 lines
Quoted 2 lines
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>Can you explain the differences compared to what I've used to propose?
https://www.mail-archive.com/[email protected]/msg08078.html
This can save time for everybody.
What is proposed in this patch similar to [1].
The main difference is, the proposed new capability is always placed in the pci extended capability section, This is because legacy capability section is nearly to its full level as described in commit message.
So providing it at either of the two locations is not valuable.
What you proposed in [1] is in general useful regardless;
However, it is not backward compatible, if the device place them in extended capability, it will not work.
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
In other words, it will have to be a both places.
Otherwise its similar.
We should do this regardless, and it will also make this series shorter which is also what Michael prefers.
Would you like join efforts with me of drafting [1] + above description as independent patch? We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
[1] https://www.mail-archive.com/[email protected]/msg08078.html
PASID part of the patch is not relevant here, so will skip to comment.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 6 lines
From: [email protected] <[email protected] open.org> On Behalf Of Parav Pandit
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
I mixed up the two structures. AQ related field expansion doesn’t need capability expansion. Sorry about it.
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
In reply to Parav PanditQuoted 31 lines · Parav Pandit
Hi Jason,
Quoted 10 lines · Jason Wang
Quoted 9 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Quoted 9 lines
Quoted 2 lines
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>Can you explain the differences compared to what I've used to propose?
https://www.mail-archive.com/[email protected]/msg08078.html
This can save time for everybody.
What is proposed in this patch similar to [1].
The main difference is, the proposed new capability is always placed in the pci extended capability section,
This is because legacy capability section is nearly to its full level as described in commit message.
Quoted 7 lines
So providing it at either of the two locations is not valuable.
What you proposed in [1] is in general useful regardless;
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
"
+The location of the virtio structures that depend on the PCI Express +capability are specified using a vendor-specific extended capabilities +on the extended capabilities list in PCI Express extended +configuration space of the device.
"
Quoted 5 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
In other words, it will have to be a both places.
Then we will run out of config space again? Otherwise we need to deal with the case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.
Quoted 8 lines
Otherwise its similar.
We should do this regardless, and it will also make this series shorter which is also what Michael prefers.
Would you like join efforts with me of drafting [1] + above description as independent patch?
I think it should be fine but I'm not sure what it looks like.
Quoted 2 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
Thanks
Quoted 6 lines
[1]
https://www.mail-archive.com/[email protected]/msg08078.htmlPASID part of the patch is not relevant here, so will skip to comment.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 11 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PMQuoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not your intention. Right?
Quoted 7 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI Express +capability are specified using a vendor-specific extended capabilities +on the extended capabilities list in PCI Express extended configuration +space of the device."
Quoted 7 lines
Quoted 5 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
In other words, it will have to be a both places.
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.
New fields don’t need to be placed in PCI cap, because no driver is looking there.
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.
Not sure I understand feature bit.
PCI transport fields existence is usually not dependent on upper layer protocol.
Quoted 6 lines
Quoted 2 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
No. it was my short sight. I responded right after above text that AQ doesn’t need cap extension.
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 32 lines · Parav Pandit
Quoted 11 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PMQuoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not your intention. Right?Quoted 7 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI Express +capability are specified using a vendor-specific extended capabilities +on the extended capabilities list in PCI Express extended configuration +space of the device."
Quoted 7 lines
Quoted 5 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
In other words, it will have to be a both places.
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.
New fields don’t need to be placed in PCI cap, because no driver is looking there.
Quoted 8 lines
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.Not sure I understand feature bit.
This is because we have a concept of dependency between features but not a concept of dependency of feature on capability.
Quoted 9 lines
PCI transport fields existence is usually not dependent on upper layer protocol.
Quoted 6 lines
Quoted 2 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
No. it was my short sight. I responded right after above text that AQ doesn’t need cap extension.
You know, thinking about this, I begin to feel that we should require that if at least one extended config exists then all caps present in the regular config are *also* mirrored in the extended config. IOW extended >= regular. The reason is that extended config can be emulated more efficiently (2x less exits).
WDYT?
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 45 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, April 11, 2023 5:25 PMQuoted 5 lines · Parav Pandit
Quoted 4 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PMQuoted 8 lines
Quoted 6 lines
Quoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not yourintention. Right?
Quoted 12 lines
Quoted 12 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI +Express capability are specified using a vendor-specific extended +capabilities on the extended capabilities list in PCI Express +extended configuration space of the device."
Quoted 4 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
In other words, it will have to be a both places.
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.
New fields don’t need to be placed in PCI cap, because no driver is lookingthere.
Quoted 8 lines
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.
Quoted 5 lines
Quoted 1 line
Not sure I understand feature bit.
This is because we have a concept of dependency between features but not a concept of dependency of feature on capability.
A feature bit is accessible after virtio level initialization is complete. Virtio level initialization depends on the PCI layer transport attributes. So pci level attributes should exists regardless of upper layer initialization.
Quoted 9 lines
Quoted 1 line
PCI transport fields existence is usually not dependent on upper layer
protocol.
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
Quoted 8 lines
Quoted 1 line
No. it was my short sight. I responded right after above text that AQ doesn’t
need cap extension.
You know, thinking about this, I begin to feel that we should require that if at least one extended config exists then all caps present in the regular config are *also* mirrored in the extended config. IOW extended >= regular.
Fair but why is this a requirement to mirror?
Is the below one to improve the perf?
If so, it is fine, but I guess it is optional.
Quoted 7 lines
The reason is that extended config can be emulated more efficiently (2x less exits).
WDYT?--
MST
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 45 lines · Parav Pandit
Quoted 45 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, April 11, 2023 5:25 PMQuoted 5 lines · Parav Pandit
Quoted 4 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PMQuoted 8 lines
Quoted 6 lines
Quoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not yourintention. Right?
Quoted 12 lines
Quoted 12 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI +Express capability are specified using a vendor-specific extended +capabilities on the extended capabilities list in PCI Express +extended configuration space of the device."
Quoted 4 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
In other words, it will have to be a both places.
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.
New fields don’t need to be placed in PCI cap, because no driver is lookingthere.
Quoted 8 lines
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Not sure I understand feature bit.
This is because we have a concept of dependency between features but not a concept of dependency of feature on capability.
A feature bit is accessible after virtio level initialization is complete. Virtio level initialization depends on the PCI layer transport attributes. So pci level attributes should exists regardless of upper layer initialization.
sure
Quoted 14 lines
Quoted 14 lines
Quoted 1 line
PCI transport fields existence is usually not dependent on upper layer
protocol.
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
No. it was my short sight. I responded right after above text that AQ doesn’t
need cap extension.
Quoted 5 lines
Quoted 3 lines
You know, thinking about this, I begin to feel that we should require that if at least one extended config exists then all caps present in the regular config are *also* mirrored in the extended config. IOW extended >= regular.
Fair but why is this a requirement to mirror?
Is the below one to improve the perf?
yes
Quoted 1 line
If so, it is fine, but I guess it is optional.
It can not be optional otherwise guest has to scan legacy capability list too losing perf advantage :).
Quoted 8 lines
Quoted 7 lines
The reason is that extended config can be emulated more efficiently (2x less exits).
WDYT?--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
In reply to Michael S. TsirkinQuoted 59 lines · Michael S. Tsirkin
Quoted 32 lines · Parav Pandit
Quoted 11 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PMQuoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not your intention. Right?Quoted 7 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI Express +capability are specified using a vendor-specific extended capabilities +on the extended capabilities list in PCI Express extended configuration +space of the device."
Quoted 7 lines
Quoted 5 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
In other words, it will have to be a both places.
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.
New fields don’t need to be placed in PCI cap, because no driver is looking there.Quoted 8 lines
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.Not sure I understand feature bit.
This is because we have a concept of dependency between features but not a concept of dependency of feature on capability.
Quoted 9 lines
PCI transport fields existence is usually not dependent on upper layer protocol.
Quoted 6 lines
Quoted 2 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
No. it was my short sight. I responded right after above text that AQ doesn’t need cap extension.
Quoted 6 lines
You know, thinking about this, I begin to feel that we should require that if at least one extended config exists then all caps present in the regular config are *also* mirrored in the extended config. IOW extended >= regular. The reason is that extended config can be emulated more efficiently (2x less exits).
Any reason for it to get less exits? At least it has not been done in current Qemu's emulation. (And do we really care about the performance of config space access?)
Thanks
Quoted 6 lines
WDYT?
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 60 lines · Jason Wang
Quoted 59 lines · Michael S. Tsirkin
Quoted 32 lines · Parav Pandit
Quoted 11 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PMQuoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not your intention. Right?Quoted 7 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI Express +capability are specified using a vendor-specific extended capabilities +on the extended capabilities list in PCI Express extended configuration +space of the device."
Quoted 7 lines
Quoted 5 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
In other words, it will have to be a both places.
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.
New fields don’t need to be placed in PCI cap, because no driver is looking there.Quoted 8 lines
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.Not sure I understand feature bit.
This is because we have a concept of dependency between features but not a concept of dependency of feature on capability.
Quoted 9 lines
PCI transport fields existence is usually not dependent on upper layer protocol.
Quoted 6 lines
Quoted 2 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
No. it was my short sight. I responded right after above text that AQ doesn’t need cap extension.
Quoted 8 lines
Quoted 6 lines
You know, thinking about this, I begin to feel that we should require that if at least one extended config exists then all caps present in the regular config are *also* mirrored in the extended config. IOW extended >= regular. The reason is that extended config can be emulated more efficiently (2x less exits).
Any reason for it to get less exits?
For a variety of reasons having to do with buggy hardware e.g. linux likes to use cf8/cfc for legacy ranges. 2 accesses are required for each read/write. extended space is just 1.
Quoted 5 lines
At least it has not been done in
current Qemu's emulation. (And do we really care about the performance of config space access?)Thanks
For boot speed, yes. Not minor 5% things but 2x, sure.
Quoted 6 lines
Quoted 6 lines
WDYT?
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 69 lines · Michael S. Tsirkin
Quoted 67 lines · Jason Wang
Quoted 65 lines · Michael S. Tsirkin
Quoted 32 lines · Parav Pandit
Quoted 11 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PMQuoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not your intention. Right?Quoted 7 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI Express +capability are specified using a vendor-specific extended capabilities +on the extended capabilities list in PCI Express extended configuration +space of the device."
Quoted 7 lines
Quoted 5 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
In other words, it will have to be a both places.
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.
New fields don’t need to be placed in PCI cap, because no driver is looking there.Quoted 8 lines
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.Not sure I understand feature bit.
This is because we have a concept of dependency between features but not a concept of dependency of feature on capability.
Quoted 9 lines
PCI transport fields existence is usually not dependent on upper layer protocol.
Quoted 6 lines
Quoted 2 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
No. it was my short sight. I responded right after above text that AQ doesn’t need cap extension.
You know, thinking about this, I begin to feel that we should require that if at least one extended config exists then all caps present in the regular config are *also* mirrored in the extended config. IOW extended >= regular. The reason is that extended config can be emulated more efficiently (2x less exits).
Quoted 6 lines
Quoted 1 line
Any reason for it to get less exits?
For a variety of reasons having to do with buggy hardware e.g. linux likes to use cf8/cfc for legacy ranges. 2 accesses are required for each read/write. extended space is just 1.
Ok.
Quoted 8 lines
Quoted 6 lines
At least it has not been done in
current Qemu's emulation. (And do we really care about the performance of config space access?)Thanks
For boot speed, yes. Not minor 5% things but 2x, sure.
If we care about boot speed we should avoid using the PCI layer in the guest completely.
Thanks
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
WDYT?
--
MSTThis publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Quoted 9 lines
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 84 lines · Jason Wang
Quoted 69 lines · Michael S. Tsirkin
Quoted 67 lines · Jason Wang
Quoted 65 lines · Michael S. Tsirkin
Quoted 32 lines · Parav Pandit
Quoted 11 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PMQuoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not your intention. Right?Quoted 7 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI Express +capability are specified using a vendor-specific extended capabilities +on the extended capabilities list in PCI Express extended configuration +space of the device."
Quoted 7 lines
Quoted 5 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
In other words, it will have to be a both places.
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.
New fields don’t need to be placed in PCI cap, because no driver is looking there.Quoted 8 lines
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.Not sure I understand feature bit.
This is because we have a concept of dependency between features but not a concept of dependency of feature on capability.
Quoted 9 lines
PCI transport fields existence is usually not dependent on upper layer protocol.
Quoted 6 lines
Quoted 2 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
No. it was my short sight. I responded right after above text that AQ doesn’t need cap extension.
You know, thinking about this, I begin to feel that we should require that if at least one extended config exists then all caps present in the regular config are *also* mirrored in the extended config. IOW extended >= regular. The reason is that extended config can be emulated more efficiently (2x less exits).
Quoted 6 lines
Quoted 1 line
Any reason for it to get less exits?
For a variety of reasons having to do with buggy hardware e.g. linux likes to use cf8/cfc for legacy ranges. 2 accesses are required for each read/write. extended space is just 1.
Ok.
Quoted 5 lines
Quoted 5 lines
At least it has not been done in
current Qemu's emulation. (And do we really care about the performance of config space access?)
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Thanks
For boot speed, yes. Not minor 5% things but 2x, sure.
If we care about boot speed we should avoid using the PCI layer in the guest completely.
Thanks
Woa. And do what? Add a ton of functionality in a PV way to MMIO? NUMA, MSI, power management .... the list goes on and on. If you have pci on the host it is way easier to pass that through to guest than do a completely different thing.
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 88 lines · Michael S. Tsirkin
Quoted 86 lines · Jason Wang
Quoted 69 lines · Michael S. Tsirkin
Quoted 67 lines · Jason Wang
Quoted 65 lines · Michael S. Tsirkin
Quoted 32 lines · Parav Pandit
Quoted 11 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PMQuoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not your intention. Right?Quoted 7 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI Express +capability are specified using a vendor-specific extended capabilities +on the extended capabilities list in PCI Express extended configuration +space of the device."
Quoted 7 lines
Quoted 5 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
In other words, it will have to be a both places.
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.
New fields don’t need to be placed in PCI cap, because no driver is looking there.Quoted 8 lines
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.Not sure I understand feature bit.
This is because we have a concept of dependency between features but not a concept of dependency of feature on capability.
Quoted 9 lines
PCI transport fields existence is usually not dependent on upper layer protocol.
Quoted 6 lines
Quoted 2 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
No. it was my short sight. I responded right after above text that AQ doesn’t need cap extension.
You know, thinking about this, I begin to feel that we should require that if at least one extended config exists then all caps present in the regular config are *also* mirrored in the extended config. IOW extended >= regular. The reason is that extended config can be emulated more efficiently (2x less exits).
Quoted 6 lines
Quoted 1 line
Any reason for it to get less exits?
For a variety of reasons having to do with buggy hardware e.g. linux likes to use cf8/cfc for legacy ranges. 2 accesses are required for each read/write. extended space is just 1.
Ok.
Quoted 7 lines
Quoted 6 lines
At least it has not been done in
current Qemu's emulation. (And do we really care about the performance of config space access?)Thanks
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
For boot speed, yes. Not minor 5% things but 2x, sure.
If we care about boot speed we should avoid using the PCI layer in the guest completely.
Thanks
Woa. And do what? Add a ton of functionality in a PV way to MMIO?
Probably, we have microVM already. And hyperv drops PCI since Gen2.
Quoted 3 lines
NUMA, MSI, power management .... the list goes on and on. If you have pci on the host it is way easier to pass that through to guest than do a completely different thing.
It's a balance. If you want functionality, PCI is probably a must. But if you care about only the boot speed, the boot speed is not slowed down by a single device but the whole PCI layer.
Thanks
Quoted 4 lines
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 104 lines · Jason Wang
Quoted 88 lines · Michael S. Tsirkin
Quoted 86 lines · Jason Wang
Quoted 69 lines · Michael S. Tsirkin
Quoted 67 lines · Jason Wang
Quoted 65 lines · Michael S. Tsirkin
Quoted 32 lines · Parav Pandit
Quoted 11 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PMQuoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not your intention. Right?Quoted 7 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI Express +capability are specified using a vendor-specific extended capabilities +on the extended capabilities list in PCI Express extended configuration +space of the device."
Quoted 7 lines
Quoted 5 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
In other words, it will have to be a both places.
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.
New fields don’t need to be placed in PCI cap, because no driver is looking there.Quoted 8 lines
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.Not sure I understand feature bit.
This is because we have a concept of dependency between features but not a concept of dependency of feature on capability.
Quoted 9 lines
PCI transport fields existence is usually not dependent on upper layer protocol.
Quoted 6 lines
Quoted 2 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
No. it was my short sight. I responded right after above text that AQ doesn’t need cap extension.
You know, thinking about this, I begin to feel that we should require that if at least one extended config exists then all caps present in the regular config are *also* mirrored in the extended config. IOW extended >= regular. The reason is that extended config can be emulated more efficiently (2x less exits).
Quoted 6 lines
Quoted 1 line
Any reason for it to get less exits?
For a variety of reasons having to do with buggy hardware e.g. linux likes to use cf8/cfc for legacy ranges. 2 accesses are required for each read/write. extended space is just 1.
Ok.
Quoted 7 lines
Quoted 6 lines
At least it has not been done in
current Qemu's emulation. (And do we really care about the performance of config space access?)Thanks
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
For boot speed, yes. Not minor 5% things but 2x, sure.
If we care about boot speed we should avoid using the PCI layer in the guest completely.
Thanks
Woa. And do what? Add a ton of functionality in a PV way to MMIO?
Probably, we have microVM already. And hyperv drops PCI since Gen2.
Quoted 3 lines
NUMA, MSI, power management .... the list goes on and on. If you have pci on the host it is way easier to pass that through to guest than do a completely different thing.
Quoted 5 lines
It's a balance. If you want functionality, PCI is probably a must. But if you care about only the boot speed, the boot speed is not slowed down by a single device but the whole PCI layer.
Thanks
I don't know that if we add a ton of features to the mmio layer that it won't slow down, too.
Quoted 4 lines
Quoted 4 lines
--
MST
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
In reply to Parav PanditQuoted 6 lines · Parav Pandit
Quoted 5 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PM
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not your intention. Right?
Right, but what I want to say is, such migration may cause unnecessary problems. And I don't see why it is a must for your legacy MMIO bar proposal.
Quoted 12 lines
Quoted 12 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI Express +capability are specified using a vendor-specific extended capabilities +on the extended capabilities list in PCI Express extended configuration +space of the device."
Quoted 4 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
In other words, it will have to be a both places.
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.
What's the advantage of doing this?
New drivers should provide backward compatibility so they must scan the pci cap. The Old driver can only scan the pci cap.
Quoted 1 line
New fields don’t need to be placed in PCI cap, because no driver is looking there.
It would be much more simple if we forbid placing new fields in the PCI cap, it is already out of space.
Thanks
Quoted 11 lines
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.Not sure I understand feature bit.
PCI transport fields existence is usually not dependent on upper layer protocol.
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
No. it was my short sight. I responded right after above text that AQ doesn’t need cap extension.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] RE: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 5 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 12:05 AM
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not yourintention. Right?
Right, but what I want to say is, such migration may cause unnecessary problems. And I don't see why it is a must for your legacy MMIO bar proposal.
As I explained in the commit log, there is very small space left in the PCI capabilities. Last time I counted, our VF doesn’t even have space in the PCI cap 192 bytes anymore.
So starting with the extended PCI cap for legacy MMIO bar window.
Quoted 4 lines
Quoted 1 line
Only currently defined caps to be placed in two places.
What's the advantage of doing this?
I think Michael found one advantage of being 2x faster?
Quoted 2 lines
New drivers should provide backward compatibility so they must scan the pci cap.
Yes.
Quoted 2 lines
The Old driver can only scan the pci cap.
Yes.
Quoted 6 lines
Quoted 1 line
New fields don’t need to be placed in PCI cap, because no driver is looking
there.
It would be much more simple if we forbid placing new fields in the PCI cap, it is already out of space.
Yes. We both are saying same point. :)
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
In reply to Jason WangQuoted 34 lines · Jason Wang
Quoted 6 lines · Parav Pandit
Quoted 5 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PMQuoted 8 lines
Quoted 6 lines
Quoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not your intention. Right?Right, but what I want to say is, such migration may cause unnecessary problems. And I don't see why it is a must for your legacy MMIO bar proposal.
Quoted 14 lines
Quoted 14 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI Express +capability are specified using a vendor-specific extended capabilities +on the extended capabilities list in PCI Express extended configuration +space of the device."
Quoted 5 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
In other words, it will have to be a both places.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.What's the advantage of doing this?
New drivers should provide backward compatibility so they must scan the pci cap.
No, they can start with express cap. Finding one they can skip the old cap completely.
Quoted 27 lines
The Old driver can only scan the pci cap.
Quoted 1 line
New fields don’t need to be placed in PCI cap, because no driver is looking there.
It would be much more simple if we forbid placing new fields in the PCI cap, it is already out of space.
Thanks
Quoted 18 lines
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.Not sure I understand feature bit.
PCI transport fields existence is usually not dependent on upper layer protocol.Quoted 6 lines
Quoted 2 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
No. it was my short sight. I responded right after above text that AQ doesn’t need cap extension.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 40 lines · Michael S. Tsirkin
Quoted 38 lines · Jason Wang
Quoted 6 lines · Parav Pandit
Quoted 5 lines
From: [email protected] <[email protected]> On Behalf Of Jason Wang
Sent: Monday, April 10, 2023 11:29 PMQuoted 8 lines
Quoted 6 lines
Quoted 3 lines
However, it is not backward compatible, if the device place them in extended capability, it will not work.
It is kind of intended since it is only used for new PCI-E features:
New fields in new extended pci cap area is fine.
Migrating old fields to be present in the new extended pci cap, is not your intention. Right?Right, but what I want to say is, such migration may cause unnecessary problems. And I don't see why it is a must for your legacy MMIO bar proposal.
Quoted 17 lines
Quoted 8 lines
"
(quoted diff) +4
-0+The location of the virtio structures that depend on the PCI Express +capability are specified using a vendor-specific extended capabilities +on the extended capabilities list in PCI Express extended configuration +space of the device."
Quoted 7 lines
Quoted 5 lines
To make it backward compatible, a device needs to expose existing structure in legacy area. And extended structure for same capability in extended pci capability region.
In other words, it will have to be a both places.
Then we will run out of config space again?
No.
Only currently defined caps to be placed in two places.
Quoted 6 lines
Quoted 3 lines
What's the advantage of doing this?
New drivers should provide backward compatibility so they must scan the pci cap.
No, they can start with express cap. Finding one they can skip the old cap completely.
Then the driver can't work on the old device.
Thanks
Quoted 21 lines
Quoted 21 lines
The Old driver can only scan the pci cap.
Quoted 1 line
New fields don’t need to be placed in PCI cap, because no driver is looking there.
It would be much more simple if we forbid placing new fields in the PCI cap, it is already out of space.
Thanks
Quoted 11 lines
We probably already discussed this in previous email by now.
Quoted 5 lines
Otherwise we need to deal with the
case when existing structures were only placed at extended capability. Michael suggest to add a new feature, but the driver may not negotiate the feature which requires more thought.Not sure I understand feature bit.
PCI transport fields existence is usually not dependent on upper layer protocol.
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
We may need it even sooner than this because the AQ patch is expanding the structure located in legacy area.
Just to make sure I understand this, assuming we have adminq, any reason a dedicated pcie ext cap is required?
No. it was my short sight. I responded right after above text that AQ doesn’t need cap extension.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
In reply to Parav PanditQuoted 10 lines · Parav Pandit
PCI device configuration space for capabilities is limited to only 192 bytes shared by many PCI capabilities of generic PCI device and virtio specific.
Hence, introduce virtio extended capability that uses PCI Express extended capability.
Subsequent patch uses this virtio extended capability.Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>
So looking at this in isolation, it probably warrants an extra github issue. So I would like to find out whether we should introduce this capability and switch to it for new devices.
My main question is whether e.g. seabios will be able to use it. Could you take a look at the source and let us all know?
Quoted 93 lines
--- transport-pci.tex | 69 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-)transport-pci.tex +68
-1@@ -174,7 +174,8 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option the function, or accessed via the special VIRTIO_PCI_CAP_PCI_CFG field in the PCI configuration space. The location of each structure is specified using a vendor-specific PCI capability located -on the capability list in PCI configuration space of the device. +on the capability list in PCI configuration space of the device +unless stated otherwise. This virtio structure capability uses little-endian format; all fields are read-only for the driver unless stated otherwise:@@ -301,6 +302,72 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option fields provide the most significant 32 bits of a total 64 bit offset and length within the BAR specified by \field{cap.bar}. +Virtio extended PCI Express capability structure defines +the location of certain virtio device configuration related +structures using PCI Express extended capability. Virtio +extended PCI Express capability structure uses PCI Express +vendor specific extended capability (VSEC). It has a below +layout: + +\begin{lstlisting} +struct pcie_ext_cap { + le16 cap_vendor_id; /* Generic PCI field: 0xB */ + le16 cap_version : 2; /* Generic PCI field: 0 */ + le16 next_cap_offset : 14; /* Generic PCI field: next cap or 0 */ +}; + +struct virtio_pcie_ext_cap { + struct pcie_ext_cap pcie_ecap; + u8 cfg_type; /* Identifies the structure. */ + u8 bar; /* Index of the BAR where its located */ + u8 id; /* Multiple capabilities of the same type */ + u8 zero_padding[1]; + le64 offset; /* Offset with the bar */ + le64 length; /* Length of the structure, in bytes. */ + u8 data[]; /* Optional variable length data */ +}; +\end{lstlisting} + +This structure contains optional data, depending on +\field{cfg_type}. The fields are interpreted as follows: + +\begin{description} +\item[\field{cap_vendor_id}] + 0x0B; identifies a vendor-specific extended capability. + +\item[\field{cap_version}] + contains a value of 0. + +\item[\field{next_cap_offset}] + Offset to the next capability. + +\item[\field{cfg_type}] + follows the same definition as \field{cfg_type} + from the \field{struct virtio_pci_cap}. + +\item[\field{bar}] + follows the same same definition as \field{bar} + from the \field{struct virtio_pci_cap}. + +\item[\field{id}] + follows the same same definition as \field{id} + from the \field{struct virtio_pci_cap}. + +\item[\field{offset}] + indicates where the structure begins relative to the + base address associated with the BAR. The alignment + requirements of offset are indicated in each + structure-specific section that uses + \field{struct virtio_pcie_ext_cap}. + +\item[\field{length}] + indicates the length of the structure indicated by this + capability. + +\item[\field{data}] + optional data of this capability. +\end{description} + \drivernormative{\subsubsection}{Virtio Structure PCI Capabilities}{Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities} The driver MUST ignore any vendor-specific capability structure which hasSignature · 1 line
2.26.2
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 10 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Friday, May 19, 2023 2:10 AMSo looking at this in isolation, it probably warrants an extra github issue. So I would like to find out whether we should introduce this capability and switch to it for new devices.
My main question is whether e.g. seabios will be able to use it. Could you take a look at the source and let us all know?
Existing unmodified seabios cannot use it because it is not looking at the new offset and cap_id. But that is the case with any existing software, not just seabios.
New capability is in addition to the existing one.
And code already exists to refer to the old one, so I am not seeing any gain to create them now. Any new capability that one creates in the future can be in the extended area.
You mentioned a perf angle that it takes half the time, but I don't see how as the only change between legacy and ext is: offset.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 11 lines · Parav Pandit
Quoted 10 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Friday, May 19, 2023 2:10 AMSo looking at this in isolation, it probably warrants an extra github issue. So I would like to find out whether we should introduce this capability and switch to it for new devices.
My main question is whether e.g. seabios will be able to use it. Could you take a look at the source and let us all know?
Existing unmodified seabios cannot use it because it is not looking at the new offset and
cap_id.
Yes but neither can it support new devices because it does not look for the new device id. So it's fine - I was talking about new devices using extended capability.
We shouldn't just laser-focus on existing software and devices, there's probably more to come.
Quoted 5 lines
But that is the case with any existing software, not just seabios.
New capability is in addition to the existing one.
And code already exists to refer to the old one, so I am not seeing any gain to create them now. Any new capability that one creates in the future can be in the extended area.
Question is about MCFG in general. Is adding capability to access MCFG to seabios for pci accesses practical? hard?
Quoted 2 lines
You mentioned a perf angle that it takes half the time, but I don't see how as the only change between legacy and ext is: offset.
For a variety of reasons Linux does not use memory mapped accesses for legacy config space, it uses cf8/cfc for that.
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 10 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, May 21, 2023 1:58 AMYes but neither can it support new devices because it does not look for the new device id. So it's fine - I was talking about new devices using extended capability.
We shouldn't just laser-focus on existing software and devices, there's probably more to come.
Sure, new devices can use new capability.
I will roll this as separate patch and github issue.
As we discussed, legacy register access over AQ does not need this capability anyway.
So not related to v2 discussion.
I am in middle of splitting this as separate patch unrelated to the v2 for legacy access.
Quoted 11 lines
Quoted 5 lines
But that is the case with any existing software, not just seabios.
New capability is in addition to the existing one.
And code already exists to refer to the old one, so I am not seeing any gain tocreate them now.
Quoted 1 line
Any new capability that one creates in the future can be in the extended area.
Question is about MCFG in general. Is adding capability to access MCFG to seabios for pci accesses practical? hard?
What is MCFG?
Quoted 5 lines
Quoted 2 lines
You mentioned a perf angle that it takes half the time, but I don't see how as the only change between legacy and ext is: offset.
For a variety of reasons Linux does not use memory mapped accesses for legacy config space, it uses cf8/cfc for that.
And does it use memory mapped accesses for non-legacy config space?
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 08/11] transport-pci: Introduce virtio extended capability
Quoted 22 lines · Parav Pandit
Quoted 10 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, May 21, 2023 1:58 AMYes but neither can it support new devices because it does not look for the new device id. So it's fine - I was talking about new devices using extended capability.
We shouldn't just laser-focus on existing software and devices, there's probably more to come.
Sure, new devices can use new capability.
I will roll this as separate patch and github issue.
As we discussed, legacy register access over AQ does not need this capability anyway.So not related to v2 discussion.
I am in middle of splitting this as separate patch unrelated to the v2 for legacy access.Quoted 5 lines
Quoted 5 lines
But that is the case with any existing software, not just seabios.
New capability is in addition to the existing one.
And code already exists to refer to the old one, so I am not seeing any gain to
Quoted 7 lines
Quoted 6 lines
create them now.
Quoted 1 line
Any new capability that one creates in the future can be in the extended area.
Question is about MCFG in general. Is adding capability to access MCFG to seabios for pci accesses practical? hard?
What is MCFG?
This is the name of the ACPI table describing memory mapped pci config accesses.
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
You mentioned a perf angle that it takes half the time, but I don't see how as the only change between legacy and ext is: offset.
For a variety of reasons Linux does not use memory mapped accesses for legacy config space, it uses cf8/cfc for that.
And does it use memory mapped accesses for non-legacy config space?
No other way to access that, right?
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
PATCH 9/11 transport-pci: Describe PCI MMR dev config registers
In reply to Parav PanditLegacy virtio configuration registers and adjacent device configuration registers are located somewhere in a memory BAR.
A new capability supplies the location of these registers which a driver can use to map I/O access to legacy memory mapped registers.
This gives the ability to locate legacy registers in either the existing memory BAR or as completely new BAR at BAR 0.
A below example diagram attempts to depicts it in an existing memory BAR.
+------------------------------+
|Transitional |
|MMR SRIOV VF |
| |
++---------------+ |
||dev_id = | |
||{0x10f9-0x10ff}| |
|+---------------+ |
| |
++--------------------+ |
|| PCIe ext cap = 0xB | |
|| cfg_type = 10 | |
|| offset = 0x1000 | |
|| bar = A {0..5}| |
|+--|-----------------+ |
| | |
| | |
| | +-------------------+ |
| | | Memory BAR = A | |
| | | | |
| +------>+--------------+ | |
| | |legacy virtio | | |
| | |+ dev cfg | | |
| | |registers | | |
| | +--------------+ | |
| +-----------------+ | |
+------------------------------+--- transport-pci.tex | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-)
transport-pci.tex +31 -2
@@ -168,6 +168,7 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option \item ISR Status \item Device-specific configuration (optional) \item PCI configuration access +\item Legacy memory mapped configuration registers (optional) \end{itemize} Each structure can be mapped by a Base Address register (BAR) belonging to
@@ -228,6 +229,8 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option #define VIRTIO_PCI_CAP_SHARED_MEMORY_CFG 8 /* Vendor-specific data */ #define VIRTIO_PCI_CAP_VENDOR_CFG 9 +/* Legacy configuration registers capability */ +#define VIRTIO_PCI_CAP_LEGACY_MMR_CFG 10 \end{lstlisting} Any other value is reserved for future use.
@@ -682,6 +685,18 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport Configuration Space / Legacy Interface: Device Configuration Space}~\nameref{sec:Basic Facilities of a Virtio Device / Device Configuration Space / Legacy Interface: Device Configuration Space} for workarounds. +\paragraph{Transitional MMR Interface: A Note on Configuration Registers} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Common configuration structure layout / Transitional MMR Interface: A Note on Configuration Registers} + +The transitional MMR device MUST present legacy virtio registers +consisting of legacy common configuration registers followed by +legacy device specific configuration registers described in section +\ref{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Common configuration structure layout / Legacy Interfaces: A Note on Configuration Registers} +in a memory region PCI BAR. + +The transitional MMR device MUST provide the location of the +legacy virtio configuration registers using a legacy memory mapped +registers capability described in section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Transitional MMR Interface: Legacy Memory Mapped Configuration Registers Capability}. \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification capability}
@@ -956,9 +971,23 @@ \subsubsection{PCI configuration access capability}\label{sec:Virtio Transport O specified by some other Virtio Structure PCI Capability of type other than \field{VIRTIO_PCI_CAP_PCI_CFG}. +\subsubsection{Transitional MMR Interface: Legacy Memory Mapped Configuration Registers Capability} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Transitional MMR Interface: Legacy Memory Mapped Configuration Registers Capability} + +The optional VIRTIO_PCI_CAP_LEGACY_MMR_CFG capability defines +the location of the legacy virtio configuration registers +followed by legacy device specific configuration registers in +the memory region BAR for the transitional MMR device. + +The \field{cap.offset} MUST be 4-byte aligned. +The \field{cap.offset} SHOULD be 4KBytes aligned and +\field{cap.length} SHOULD be 4KBytes. + +The transitional MMR device MUST present a legacy configuration +memory mapped registers capability using \field{virtio_pcie_ext_cap}. + \subsubsection{Legacy Interface: A Note on Feature Bits} -\label{sec:Virtio Transport Options / Virtio Over PCI Bus / -Virtio Structure PCI Capabilities / Legacy Interface: A Note on Feature Bits} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Legacy Interface: A Note on Feature Bits} Only Feature Bits 0 to 31 are accessible through the Legacy Interface. When used through the Legacy Interface,
Signature · 18 lines
2.26.2 This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 42 lines · Parav Pandit
Legacy virtio configuration registers and adjacent device configuration registers are located somewhere in a memory BAR.
A new capability supplies the location of these registers which a driver can use to map I/O access to legacy memory mapped registers.
This gives the ability to locate legacy registers in either the existing memory BAR or as completely new BAR at BAR 0.
A below example diagram attempts to depicts it in an existing memory BAR.
+------------------------------+ |Transitional | |MMR SRIOV VF | | | ++---------------+ | ||dev_id = | | ||{0x10f9-0x10ff}| | |+---------------+ | | | ++--------------------+ | || PCIe ext cap = 0xB | | || cfg_type = 10 | | || offset = 0x1000 | | || bar = A {0..5}| | |+--|-----------------+ | | | | | | | | | +-------------------+ | | | | Memory BAR = A | | | | | | | | +------>+--------------+ | | | | |legacy virtio | | | | | |+ dev cfg | | | | | |registers | | | | | +--------------+ | | | +-----------------+ | | +------------------------------+
Quoted 2 lines
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>
I am split about using the extended capability for this, since in practice this makes for more code in hypervisors. How about just using an existing capability as opposed to the extended capability? Less work for existing hypervisors, no? And let's begin to use the extended capability for something more important than legacy access.
Quoted 48 lines
--- transport-pci.tex | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-)transport-pci.tex +15
-0@@ -168,6 +168,7 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option \item ISR Status \item Device-specific configuration (optional) \item PCI configuration access +\item Legacy memory mapped configuration registers (optional) \end{itemize} Each structure can be mapped by a Base Address register (BAR) belonging to@@ -228,6 +229,8 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option #define VIRTIO_PCI_CAP_SHARED_MEMORY_CFG 8 /* Vendor-specific data */ #define VIRTIO_PCI_CAP_VENDOR_CFG 9 +/* Legacy configuration registers capability */ +#define VIRTIO_PCI_CAP_LEGACY_MMR_CFG 10 \end{lstlisting} Any other value is reserved for future use.@@ -682,6 +685,18 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport Configuration Space / Legacy Interface: Device Configuration Space}~\nameref{sec:Basic Facilities of a Virtio Device / Device Configuration Space / Legacy Interface: Device Configuration Space} for workarounds. +\paragraph{Transitional MMR Interface: A Note on Configuration Registers} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Common configuration structure layout / Transitional MMR Interface: A Note on Configuration Registers} + +The transitional MMR device MUST present legacy virtio registers +consisting of legacy common configuration registers followed by +legacy device specific configuration registers described in section +\ref{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Common configuration structure layout / Legacy Interfaces: A Note on Configuration Registers} +in a memory region PCI BAR. + +The transitional MMR device MUST provide the location of the +legacy virtio configuration registers using a legacy memory mapped +registers capability described in section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Transitional MMR Interface: Legacy Memory Mapped Configuration Registers Capability}. \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification capability}@@ -956,9 +971,23 @@ \subsubsection{PCI configuration access capability}\label{sec:Virtio Transport O specified by some other Virtio Structure PCI Capability of type other than \field{VIRTIO_PCI_CAP_PCI_CFG}.
transport-pci.tex \subsubsection{PCI configuration access capability}\label{sec:Virtio Transport O · line 983
Quoted 10 lines
transport-pci.tex +10
-0+\subsubsection{Transitional MMR Interface: Legacy Memory Mapped Configuration Registers Capability} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Transitional MMR Interface: Legacy Memory Mapped Configuration Registers Capability} + +The optional VIRTIO_PCI_CAP_LEGACY_MMR_CFG capability defines +the location of the legacy virtio configuration registers +followed by legacy device specific configuration registers in +the memory region BAR for the transitional MMR device. + +The \field{cap.offset} MUST be 4-byte aligned. +The \field{cap.offset} SHOULD be 4KBytes aligned and
what's the point of this?
transport-pci.tex \subsubsection{PCI configuration access capability}\label{sec:Virtio Transport O · line 984
Quoted 1 line
transport-pci.tex +1
-0+\field{cap.length} SHOULD be 4KBytes.
Why is length 4KBytes? Why not the actual length?
transport-pci.tex \subsubsection{PCI configuration access capability}\label{sec:Virtio Transport O · line 991
Quoted 9 lines
transport-pci.tex +5
-2+ +The transitional MMR device MUST present a legacy configuration +memory mapped registers capability using \field{virtio_pcie_ext_cap}. + \subsubsection{Legacy Interface: A Note on Feature Bits} -\label{sec:Virtio Transport Options / Virtio Over PCI Bus / -Virtio Structure PCI Capabilities / Legacy Interface: A Note on Feature Bits} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Legacy Interface: A Note on Feature Bits}
So it is not by chance that we abadoned the legacy interface, it had some fundamental issues.
Let me list some off the top of my mind:
- no atomicity across accesses, so if a register changes while it is read driver gets trash. solved using generation id
- no defined endian-ness. solved using le
- no way to reject driver configuration
we just did a new thing instead, but I feel if you are reviving the legacy interface yet again, it is worth thinking about solving the worst of the warts. For example, I can see an endian-ness register that hypervisor can either read to check device is compatible with guest, or maybe even write to force device to specific endian-ness.
A generation counter that hypervisor can check to
verify value is consistent? Can work if hypervisor
caches configuration.
A bad state flag that device can set to make hypervisor
stop guest? Better than corrupting it ...
Quoted 4 lines
transport-pci.tex +0
-0Only Feature Bits 0 to 31 are accessible through the Legacy Interface. When used through the Legacy Interface,Signature · 1 line
2.26.2
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 134 lines · Michael S. Tsirkin
Quoted 42 lines · Parav Pandit
Legacy virtio configuration registers and adjacent device configuration registers are located somewhere in a memory BAR.
A new capability supplies the location of these registers which a driver can use to map I/O access to legacy memory mapped registers.
This gives the ability to locate legacy registers in either the existing memory BAR or as completely new BAR at BAR 0.
A below example diagram attempts to depicts it in an existing memory BAR.
+------------------------------+ |Transitional | |MMR SRIOV VF | | | ++---------------+ | ||dev_id = | | ||{0x10f9-0x10ff}| | |+---------------+ | | | ++--------------------+ | || PCIe ext cap = 0xB | | || cfg_type = 10 | | || offset = 0x1000 | | || bar = A {0..5}| | |+--|-----------------+ | | | | | | | | | +-------------------+ | | | | Memory BAR = A | | | | | | | | +------>+--------------+ | | | | |legacy virtio | | | | | |+ dev cfg | | | | | |registers | | | | | +--------------+ | | | +-----------------+ | | +------------------------------+Quoted 2 lines
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>I am split about using the extended capability for this, since in practice this makes for more code in hypervisors. How about just using an existing capability as opposed to the extended capability? Less work for existing hypervisors, no? And let's begin to use the extended capability for something more important than legacy access.
Quoted 48 lines
--- transport-pci.tex | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-)transport-pci.tex +15
-0@@ -168,6 +168,7 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option \item ISR Status \item Device-specific configuration (optional) \item PCI configuration access +\item Legacy memory mapped configuration registers (optional) \end{itemize} Each structure can be mapped by a Base Address register (BAR) belonging to@@ -228,6 +229,8 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option #define VIRTIO_PCI_CAP_SHARED_MEMORY_CFG 8 /* Vendor-specific data */ #define VIRTIO_PCI_CAP_VENDOR_CFG 9 +/* Legacy configuration registers capability */ +#define VIRTIO_PCI_CAP_LEGACY_MMR_CFG 10 \end{lstlisting} Any other value is reserved for future use.@@ -682,6 +685,18 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport Configuration Space / Legacy Interface: Device Configuration Space}~\nameref{sec:Basic Facilities of a Virtio Device / Device Configuration Space / Legacy Interface: Device Configuration Space} for workarounds. +\paragraph{Transitional MMR Interface: A Note on Configuration Registers} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Common configuration structure layout / Transitional MMR Interface: A Note on Configuration Registers} + +The transitional MMR device MUST present legacy virtio registers +consisting of legacy common configuration registers followed by +legacy device specific configuration registers described in section +\ref{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Common configuration structure layout / Legacy Interfaces: A Note on Configuration Registers} +in a memory region PCI BAR. + +The transitional MMR device MUST provide the location of the +legacy virtio configuration registers using a legacy memory mapped +registers capability described in section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Transitional MMR Interface: Legacy Memory Mapped Configuration Registers Capability}. \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification capability}@@ -956,9 +971,23 @@ \subsubsection{PCI configuration access capability}\label{sec:Virtio Transport O specified by some other Virtio Structure PCI Capability of type other than \field{VIRTIO_PCI_CAP_PCI_CFG}.transport-pci.tex \subsubsection{PCI configuration access capability}\label{sec:Virtio Transport O · line 983
Quoted 10 lines
transport-pci.tex +10
-0+\subsubsection{Transitional MMR Interface: Legacy Memory Mapped Configuration Registers Capability} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Transitional MMR Interface: Legacy Memory Mapped Configuration Registers Capability} + +The optional VIRTIO_PCI_CAP_LEGACY_MMR_CFG capability defines +the location of the legacy virtio configuration registers +followed by legacy device specific configuration registers in +the memory region BAR for the transitional MMR device. + +The \field{cap.offset} MUST be 4-byte aligned. +The \field{cap.offset} SHOULD be 4KBytes aligned andwhat's the point of this?
transport-pci.tex \subsubsection{PCI configuration access capability}\label{sec:Virtio Transport O · line 984
Quoted 1 line
transport-pci.tex +1
-0+\field{cap.length} SHOULD be 4KBytes.Why is length 4KBytes? Why not the actual length?
transport-pci.tex \subsubsection{PCI configuration access capability}\label{sec:Virtio Transport O · line 991
Quoted 9 lines
transport-pci.tex +5
-2+ +The transitional MMR device MUST present a legacy configuration +memory mapped registers capability using \field{virtio_pcie_ext_cap}. + \subsubsection{Legacy Interface: A Note on Feature Bits} -\label{sec:Virtio Transport Options / Virtio Over PCI Bus / -Virtio Structure PCI Capabilities / Legacy Interface: A Note on Feature Bits} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Legacy Interface: A Note on Feature Bits}
Quoted 7 lines
So it is not by chance that we abadoned the legacy interface, it had some fundamental issues.
Let me list some off the top of my mind:
- no atomicity across accesses, so if a register changes while it is read driver gets trash. solved using generation id
- no defined endian-ness. solved using le
- no way to reject driver configuration
I can think more:
- VIRTIO_F_ACCESS_PLATFORM
- VIRTIO_F_ORDER_PLATFORM
The above two are a must for hardware devices which are almost impossible for legacy interfaces.
Hardware transitional devices are really tricky, ENI is one example which can only work for x86.
config ALIBABA_ENI_VDPA
tristate "vDPA driver for Alibaba ENI"
select VIRTIO_PCI_LIB_LEGACY
depends on PCI_MSI && X86
It has an MMIO bar for legacy registers and it works by chance for Linux drivers; DPDK requires patches to let it work.
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Thanks
Quoted 28 lines
we just did a new thing instead, but I feel if you are reviving the legacy interface yet again, it is worth thinking about solving the worst of the warts. For example, I can see an endian-ness register that hypervisor can either read to check device is compatible with guest, or maybe even write to force device to specific endian-ness.
A generation counter that hypervisor can check to
verify value is consistent? Can work if hypervisor
caches configuration.
A bad state flag that device can set to make hypervisor
stop guest? Better than corrupting it ...Quoted 4 lines
transport-pci.tex +0
-1Only Feature Bits 0 to 31 are accessible through the Legacy Interface. When used through the Legacy Interface, --2.26.2
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Quoted 9 lines
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 4 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Thanks
Well virtio legacy has a long history of documenting existing hacks :) But yes, VIRTIO_F_ORDER_PLATFORM has to be documented.
And we have to decide what to do about ACCESS_PLATFORM since
there's a security problem if device allows not acking it.
Two options:
- relax the rules a bit and say device will assume ACCESS_PLATFORM
is acked anyway
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 8 lines · Michael S. Tsirkin
Quoted 4 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anyway
This will break legacy drivers which assume physical addresses.
Quoted 1 line
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
And what about ORDER_PLATFORM, I don't think we can modify legacy drivers...
Thanks
Quoted 4 lines
--
MST
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 6 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
I mean driver behaviour derives from the code but we do document it in the spec to help people build devices.
Quoted 8 lines
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anywayThis will break legacy drivers which assume physical addresses.
not that they are not already broken.
Quoted 3 lines
Quoted 1 line
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
it's not just for legacy.
Quoted 3 lines
And what about
ORDER_PLATFORM, I don't think we can modify legacy drivers...Thanks
You play some tricks with shadow VQ I guess.
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 26 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
I mean driver behaviour derives from the code but we do document it in the spec to help people build devices.
Quoted 7 lines
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anyway
Quoted 3 lines
Quoted 1 line
This will break legacy drivers which assume physical addresses.
not that they are not already broken.
I may miss something, the whole point is to allow legacy drivers to run otherwise a modern device is sufficient?
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
it's not just for legacy.
We have the ACCESS_PLATFORM feature bit, what is the useage for this new flag?
Quoted 6 lines
Quoted 4 lines
And what about
ORDER_PLATFORM, I don't think we can modify legacy drivers...Thanks
You play some tricks with shadow VQ I guess.
Do we really want to add a new feature in the virtio spec that can only work with the datapath mediation?
Thanks
Quoted 4 lines
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 27 lines · Jason Wang
Quoted 26 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
I mean driver behaviour derives from the code but we do document it in the spec to help people build devices.
Quoted 7 lines
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anyway
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
This will break legacy drivers which assume physical addresses.
not that they are not already broken.
I may miss something, the whole point is to allow legacy drivers to run otherwise a modern device is sufficient?
yes and if legacy drivers don't work in a given setup then we should not worry.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
it's not just for legacy.
We have the
ACCESS_PLATFORMfeature bit, what is the useage for this new flag?
ACCESS_PLATFORM is also a security boundary. so devices must fail negotiation if it's not there. this new one won't be.
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines
And what about
ORDER_PLATFORM, I don't think we can modify legacy drivers...Thanks
You play some tricks with shadow VQ I guess.
Do we really want to add a new feature in the virtio spec that can only work with the datapath mediation?
Thanks
As long as a feature is useful and can't be supported otherwise we are out of options. Keeping field practice things out of the spec helps no one.
Quoted 4 lines
Quoted 4 lines
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 60 lines · Michael S. Tsirkin
Quoted 27 lines · Jason Wang
Quoted 26 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
I mean driver behaviour derives from the code but we do document it in the spec to help people build devices.
Quoted 7 lines
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anywayQuoted 6 lines
Quoted 3 lines
Quoted 1 line
This will break legacy drivers which assume physical addresses.
not that they are not already broken.
I may miss something, the whole point is to allow legacy drivers to run otherwise a modern device is sufficient?
yes and if legacy drivers don't work in a given setup then we should not worry.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
it's not just for legacy.
We have the
ACCESS_PLATFORMfeature bit, what is the useage for this new flag?
ACCESS_PLATFORMis also a security boundary. so devices must fail negotiation if it's not there. this new one won't be.Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
And what about
ORDER_PLATFORM, I don't think we can modify legacy drivers...Thanks
You play some tricks with shadow VQ I guess.
Quoted 7 lines
Quoted 4 lines
Do we really want to add a new feature in the virtio spec that can only work with the datapath mediation?
Thanks
As long as a feature is useful and can't be supported otherwise we are out of options.
Probably not? Is it as simple as relaxing this:
"Transitional devices MUST expose the Legacy Interface in I/O space in BAR0."
To allow memory space.
This works for both software and hardware devices (I had a handy hardware that supports legacy virtio drivers in this way).
Thanks
Quoted 8 lines
Keeping field practice things out of the
spec helps no one.Quoted 4 lines
Quoted 4 lines
--
MST
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 71 lines · Jason Wang
Quoted 60 lines · Michael S. Tsirkin
Quoted 27 lines · Jason Wang
Quoted 26 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
I mean driver behaviour derives from the code but we do document it in the spec to help people build devices.
Quoted 7 lines
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anywayQuoted 6 lines
Quoted 3 lines
Quoted 1 line
This will break legacy drivers which assume physical addresses.
not that they are not already broken.
I may miss something, the whole point is to allow legacy drivers to run otherwise a modern device is sufficient?
yes and if legacy drivers don't work in a given setup then we should not worry.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
it's not just for legacy.
We have the
ACCESS_PLATFORMfeature bit, what is the useage for this new flag?
ACCESS_PLATFORMis also a security boundary. so devices must fail negotiation if it's not there. this new one won't be.Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
And what about
ORDER_PLATFORM, I don't think we can modify legacy drivers...Thanks
You play some tricks with shadow VQ I guess.
Quoted 7 lines
Quoted 4 lines
Do we really want to add a new feature in the virtio spec that can only work with the datapath mediation?
Thanks
As long as a feature is useful and can't be supported otherwise we are out of options.
Probably not? Is it as simple as relaxing this:
Quoted 8 lines
"Transitional devices MUST expose the Legacy Interface in I/O space in BAR0."
To allow memory space.
This works for both software and hardware devices (I had a handy hardware that supports legacy virtio drivers in this way).
Thanks
Yes it is certainly simpler.
Question: what happens if you try to run existing windows guests or dpdk on these? Do they crash horribly or exit gracefully?
The point of the capability is to allow using modern device ID so such guests will not even try to bind.
Quoted 8 lines
Quoted 8 lines
Keeping field practice things out of the
spec helps no one.Quoted 4 lines
Quoted 4 lines
--
MST
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 80 lines · Michael S. Tsirkin
Quoted 78 lines · Jason Wang
Quoted 60 lines · Michael S. Tsirkin
Quoted 27 lines · Jason Wang
Quoted 26 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
I mean driver behaviour derives from the code but we do document it in the spec to help people build devices.
Quoted 7 lines
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anywayQuoted 6 lines
Quoted 3 lines
Quoted 1 line
This will break legacy drivers which assume physical addresses.
not that they are not already broken.
I may miss something, the whole point is to allow legacy drivers to run otherwise a modern device is sufficient?
yes and if legacy drivers don't work in a given setup then we should not worry.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
it's not just for legacy.
We have the
ACCESS_PLATFORMfeature bit, what is the useage for this new flag?
ACCESS_PLATFORMis also a security boundary. so devices must fail negotiation if it's not there. this new one won't be.Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
And what about
ORDER_PLATFORM, I don't think we can modify legacy drivers...Thanks
You play some tricks with shadow VQ I guess.
Quoted 7 lines
Quoted 4 lines
Do we really want to add a new feature in the virtio spec that can only work with the datapath mediation?
Thanks
As long as a feature is useful and can't be supported otherwise we are out of options.
Probably not? Is it as simple as relaxing this:
"Transitional devices MUST expose the Legacy Interface in I/O space in BAR0."
To allow memory space.
This works for both software and hardware devices (I had a handy hardware that supports legacy virtio drivers in this way).
Quoted 6 lines
Quoted 1 line
Thanks
Yes it is certainly simpler.
Question: what happens if you try to run existing windows guests or dpdk on these? Do they crash horribly or exit gracefully?
Haven't tried DPDK and windows. But I remember DPDK supported legacy MMIO bars for a while.
Adding Maxime and Yan for comments here.
Quoted 3 lines
The point of the capability is to allow using modern device ID so such guests will not even try to bind.
It means a mediation layer is required to use. Then it's not an issue for this simple relaxing any more?
An advantage of such relaxing is that, for the legacy drivers like an ancient Linux version that can already do MMIO access to legacy BAR it can work without any mediation.
At least, if ID can help, it can be used with this as well.
Thanks
Quoted 11 lines
Quoted 10 lines
Quoted 10 lines
Keeping field practice things out of the
spec helps no one.Quoted 4 lines
Quoted 4 lines
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
A message that is not in the archive (sent off-list or not yet received): CALBs2cXURMEzCGnULicXbsBfwnKE5cZOz=M-_hhFCXZ=Lqb9Nw@mail.gmail.com
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 101 lines · Yan Vugenfirer
Quoted 84 lines · Jason Wang
Quoted 82 lines · Michael S. Tsirkin
Quoted 79 lines · Jason Wang
Quoted 60 lines · Michael S. Tsirkin
Quoted 27 lines · Jason Wang
Quoted 26 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
I mean driver behaviour derives from the code but we do document it in the spec to help people build devices.
Quoted 7 lines
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anywayQuoted 6 lines
Quoted 3 lines
Quoted 1 line
This will break legacy drivers which assume physical addresses.
not that they are not already broken.
I may miss something, the whole point is to allow legacy drivers to run otherwise a modern device is sufficient?
yes and if legacy drivers don't work in a given setup then we should not worry.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
it's not just for legacy.
We have the
ACCESS_PLATFORMfeature bit, what is the useage for this new flag?
ACCESS_PLATFORMis also a security boundary. so devices must fail negotiation if it's not there. this new one won't be.Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
And what about
ORDER_PLATFORM, I don't think we can modify legacy drivers...Thanks
You play some tricks with shadow VQ I guess.
Quoted 7 lines
Quoted 4 lines
Do we really want to add a new feature in the virtio spec that can only work with the datapath mediation?
Thanks
As long as a feature is useful and can't be supported otherwise we are out of options.
Probably not? Is it as simple as relaxing this:
"Transitional devices MUST expose the Legacy Interface in I/O space in BAR0."
To allow memory space.
This works for both software and hardware devices (I had a handy hardware that supports legacy virtio drivers in this way).
Thanks
Quoted 7 lines
Quoted 4 lines
Yes it is certainly simpler.
Question: what happens if you try to run existing windows guests or dpdk on these? Do they crash horribly or exit gracefully?
Haven't tried DPDK and windows. But I remember DPDK supported legacy MMIO bars for a while.
Regarding Windows drivers:
1. We are ackingVIRTIO_F_ACCESS_PLATFORMin the driver. But, if you remember the "ATS" issue (Windows is either not detecting it or, even if detected, not using it) - then actually, we are not forcing Windows to remap the memory because Window fails to work with it correctly.
2. Current Windows drivers implementation doesn't support MMIO bars. We can enable the support if needed.
Quoted 2 lines
Best regards,
Yan.
The question was about old legacy drivers, not modern ones. What if they attach to a device and BAR0
is a memory not an IO bar?
Will they fail gracefully or crash?
Quoted 27 lines
Quoted 27 lines
Adding Maxime and Yan for comments here.
Quoted 3 lines
The point of the capability is to allow using modern device ID so such guests will not even try to bind.
It means a mediation layer is required to use. Then it's not an issue for this simple relaxing any more?
An advantage of such relaxing is that, for the legacy drivers like an ancient Linux version that can already do MMIO access to legacy BAR it can work without any mediation.
At least, if ID can help, it can be used with this as well.
Thanks
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Keeping field practice things out of the
spec helps no one.Quoted 1 line
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-dev] Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Sent from my iPhone
Quoted 104 lines · Michael S. Tsirkin
Quoted 101 lines · Yan Vugenfirer
Quoted 85 lines · Jason Wang
Quoted 82 lines · Michael S. Tsirkin
Quoted 79 lines · Jason Wang
Quoted 60 lines · Michael S. Tsirkin
Quoted 27 lines · Jason Wang
Quoted 26 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
I mean driver behaviour derives from the code but we do document it in the spec to help people build devices.
Quoted 7 lines
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anywayQuoted 6 lines
Quoted 3 lines
Quoted 1 line
This will break legacy drivers which assume physical addresses.
not that they are not already broken.
I may miss something, the whole point is to allow legacy drivers to run otherwise a modern device is sufficient?
yes and if legacy drivers don't work in a given setup then we should not worry.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
it's not just for legacy.
We have the
ACCESS_PLATFORMfeature bit, what is the useage for this new flag?
ACCESS_PLATFORMis also a security boundary. so devices must fail negotiation if it's not there. this new one won't be.Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
And what about
ORDER_PLATFORM, I don't think we can modify legacy drivers...Thanks
You play some tricks with shadow VQ I guess.
Quoted 7 lines
Quoted 4 lines
Do we really want to add a new feature in the virtio spec that can only work with the datapath mediation?
Thanks
As long as a feature is useful and can't be supported otherwise we are out of options.
Probably not? Is it as simple as relaxing this:
"Transitional devices MUST expose the Legacy Interface in I/O space in BAR0."
To allow memory space.
This works for both software and hardware devices (I had a handy hardware that supports legacy virtio drivers in this way).
Thanks
Quoted 7 lines
Quoted 4 lines
Yes it is certainly simpler.
Question: what happens if you try to run existing windows guests or dpdk on these? Do they crash horribly or exit gracefully?
Haven't tried DPDK and windows. But I remember DPDK supported legacy MMIO bars for a while.
Regarding Windows drivers:
1. We are ackingVIRTIO_F_ACCESS_PLATFORMin the driver. But, if you remember the "ATS" issue (Windows is either not detecting it or, even if detected, not using it) - then actually, we are not forcing Windows to remap the memory because Window fails to work with it correctly.
2. Current Windows drivers implementation doesn't support MMIO bars. We can enable the support if needed.
Quoted 7 lines
Quoted 2 lines
Best regards,
Yan.The question was about old legacy drivers, not modern ones. What if they attach to a device and BAR0
is a memory not an IO bar?
Will they fail gracefully or crash?
The drivers should fail to load gracefully. There will be no crash, except in the case of the virtio-blk or virtio-scsi as a boot device.
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Adding Maxime and Yan for comments here.
Quoted 3 lines
The point of the capability is to allow using modern device ID so such guests will not even try to bind.
It means a mediation layer is required to use. Then it's not an issue for this simple relaxing any more?
An advantage of such relaxing is that, for the legacy drivers like an ancient Linux version that can already do MMIO access to legacy BAR it can work without any mediation.
At least, if ID can help, it can be used with this as well.
Thanks
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Keeping field practice things out of the
spec helps no one.Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
In reply to Jason WangQuoted 97 lines · Jason Wang
Quoted 80 lines · Michael S. Tsirkin
Quoted 78 lines · Jason Wang
Quoted 60 lines · Michael S. Tsirkin
Quoted 27 lines · Jason Wang
Quoted 26 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
I mean driver behaviour derives from the code but we do document it in the spec to help people build devices.
Quoted 7 lines
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anywayQuoted 6 lines
Quoted 3 lines
Quoted 1 line
This will break legacy drivers which assume physical addresses.
not that they are not already broken.
I may miss something, the whole point is to allow legacy drivers to run otherwise a modern device is sufficient?
yes and if legacy drivers don't work in a given setup then we should not worry.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
it's not just for legacy.
We have the
ACCESS_PLATFORMfeature bit, what is the useage for this new flag?
ACCESS_PLATFORMis also a security boundary. so devices must fail negotiation if it's not there. this new one won't be.Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
And what about
ORDER_PLATFORM, I don't think we can modify legacy drivers...Thanks
You play some tricks with shadow VQ I guess.
Quoted 7 lines
Quoted 4 lines
Do we really want to add a new feature in the virtio spec that can only work with the datapath mediation?
Thanks
As long as a feature is useful and can't be supported otherwise we are out of options.
Probably not? Is it as simple as relaxing this:
"Transitional devices MUST expose the Legacy Interface in I/O space in BAR0."
To allow memory space.
This works for both software and hardware devices (I had a handy hardware that supports legacy virtio drivers in this way).
Quoted 6 lines
Quoted 1 line
Thanks
Yes it is certainly simpler.
Question: what happens if you try to run existing windows guests or dpdk on these? Do they crash horribly or exit gracefully?
Haven't tried DPDK and windows. But I remember DPDK supported legacy MMIO bars for a while.
Adding Maxime and Yan for comments here.
Quoted 3 lines
The point of the capability is to allow using modern device ID so such guests will not even try to bind.
Quoted 6 lines
It means a mediation layer is required to use. Then it's not an issue for this simple relaxing any more?
An advantage of such relaxing is that, for the legacy drivers like an ancient Linux version that can already do MMIO access to legacy BAR it can work without any mediation.
Yes. But the capability approach does not prevent that -
just use a transitional ID.
The disadvantage of a transitional ID is some old drivers might crash, or fail to work in other ways. Using a modern ID with a capability prevents old drivers from attaching. Using a capability the system designed is in control and can decide which drivers to use.
Quoted 3 lines
At least, if ID can help, it can be used with this as well.
Thanks
I don't know what that means.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Keeping field practice things out of the
spec helps no one.Quoted 1 line
Quoted 1 line
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 102 lines · Michael S. Tsirkin
Quoted 100 lines · Jason Wang
Quoted 80 lines · Michael S. Tsirkin
Quoted 78 lines · Jason Wang
Quoted 60 lines · Michael S. Tsirkin
Quoted 27 lines · Jason Wang
Quoted 26 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
I mean driver behaviour derives from the code but we do document it in the spec to help people build devices.
Quoted 7 lines
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anywayQuoted 6 lines
Quoted 3 lines
Quoted 1 line
This will break legacy drivers which assume physical addresses.
not that they are not already broken.
I may miss something, the whole point is to allow legacy drivers to run otherwise a modern device is sufficient?
yes and if legacy drivers don't work in a given setup then we should not worry.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
it's not just for legacy.
We have the
ACCESS_PLATFORMfeature bit, what is the useage for this new flag?
ACCESS_PLATFORMis also a security boundary. so devices must fail negotiation if it's not there. this new one won't be.Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
And what about
ORDER_PLATFORM, I don't think we can modify legacy drivers...Thanks
You play some tricks with shadow VQ I guess.
Quoted 7 lines
Quoted 4 lines
Do we really want to add a new feature in the virtio spec that can only work with the datapath mediation?
Thanks
As long as a feature is useful and can't be supported otherwise we are out of options.
Probably not? Is it as simple as relaxing this:
"Transitional devices MUST expose the Legacy Interface in I/O space in BAR0."
To allow memory space.
This works for both software and hardware devices (I had a handy hardware that supports legacy virtio drivers in this way).
Quoted 6 lines
Quoted 1 line
Thanks
Yes it is certainly simpler.
Question: what happens if you try to run existing windows guests or dpdk on these? Do they crash horribly or exit gracefully?
Haven't tried DPDK and windows. But I remember DPDK supported legacy MMIO bars for a while.
Adding Maxime and Yan for comments here.
Quoted 3 lines
The point of the capability is to allow using modern device ID so such guests will not even try to bind.
It means a mediation layer is required to use. Then it's not an issue for this simple relaxing any more?
Quoted 8 lines
Quoted 3 lines
An advantage of such relaxing is that, for the legacy drivers like an ancient Linux version that can already do MMIO access to legacy BAR it can work without any mediation.
Yes. But the capability approach does not prevent that -
just use a transitional ID.
The disadvantage of a transitional ID is some old drivers might crash, or fail to work in other ways.
If the driver is wrote correctly it should fail gracefully if it can't request legacy I/O regions.
Quoted 2 lines
Using a modern ID with a capability
prevents old drivers from attaching.
Just to make sure we are at the same page.
It looks like the motivation for this series is allow hypervisor to mediate between legacy MMIO BAR and legacy driver. This end ups with a design that only work for a specific use case (virtualization) and a specific setups (e.g using Linux as a hypervisor). By definition, it's not a transitional device. What's more important, if it is only used for virtualization, legacy MMIO bar is not a must. We can present a legacy device on top of modern device by using necessary mediation technologies as discussed.
By relaxing to use MMIO at BAR0, we had a much broad use cases. By definition, it's a transitional device. It's useful for both bare metal and virtualization. We don't worry about the buggy drivers or at least fixing (I meant fail on no I/O bar) those drivers is not hard.
Quoted 2 lines
Using a capability the system
designed is in control and can decide which drivers to use.
Do we allow a virtio device only with this capability? If yes, this seems can mislead vendors. If not, we have already had modern interfaces so I don't see value to add that in the current Linux drivers. The only possible use case is the doing mediation in the hypervisor like Qemu not the driver.
Quoted 9 lines
Quoted 6 lines
At least, if ID can help, it can be used with this as well.
Thanks
I don't know what that means.
I mean having dedicated ID for this relaxing (though I don't see too much value).
Thanks
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Keeping field practice things out of the
spec helps no one.Quoted 1 line
Quoted 1 line
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
--
MST
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 107 lines · Jason Wang
Quoted 106 lines · Michael S. Tsirkin
Quoted 103 lines · Jason Wang
Quoted 80 lines · Michael S. Tsirkin
Quoted 78 lines · Jason Wang
Quoted 60 lines · Michael S. Tsirkin
Quoted 27 lines · Jason Wang
Quoted 26 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
I mean driver behaviour derives from the code but we do document it in the spec to help people build devices.
Quoted 7 lines
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anywayQuoted 6 lines
Quoted 3 lines
Quoted 1 line
This will break legacy drivers which assume physical addresses.
not that they are not already broken.
I may miss something, the whole point is to allow legacy drivers to run otherwise a modern device is sufficient?
yes and if legacy drivers don't work in a given setup then we should not worry.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
it's not just for legacy.
We have the
ACCESS_PLATFORMfeature bit, what is the useage for this new flag?
ACCESS_PLATFORMis also a security boundary. so devices must fail negotiation if it's not there. this new one won't be.Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
And what about
ORDER_PLATFORM, I don't think we can modify legacy drivers...Thanks
You play some tricks with shadow VQ I guess.
Quoted 7 lines
Quoted 4 lines
Do we really want to add a new feature in the virtio spec that can only work with the datapath mediation?
Thanks
As long as a feature is useful and can't be supported otherwise we are out of options.
Probably not? Is it as simple as relaxing this:
"Transitional devices MUST expose the Legacy Interface in I/O space in BAR0."
To allow memory space.
This works for both software and hardware devices (I had a handy hardware that supports legacy virtio drivers in this way).
Quoted 6 lines
Quoted 1 line
Thanks
Yes it is certainly simpler.
Question: what happens if you try to run existing windows guests or dpdk on these? Do they crash horribly or exit gracefully?
Haven't tried DPDK and windows. But I remember DPDK supported legacy MMIO bars for a while.
Adding Maxime and Yan for comments here.
Quoted 3 lines
The point of the capability is to allow using modern device ID so such guests will not even try to bind.
It means a mediation layer is required to use. Then it's not an issue for this simple relaxing any more?
An advantage of such relaxing is that, for the legacy drivers like an ancient Linux version that can already do MMIO access to legacy BAR it can work without any mediation.
Quoted 7 lines
Quoted 4 lines
Yes. But the capability approach does not prevent that -
just use a transitional ID.
The disadvantage of a transitional ID is some old drivers might crash, or fail to work in other ways.If the driver is wrote correctly it should fail gracefully if it can't request legacy I/O regions.
it's not just regions. it's things like iommu, ordering, endian-ness... we all know legacy is a mess.
Quoted 10 lines
Quoted 2 lines
Using a modern ID with a capability
prevents old drivers from attaching.Just to make sure we are at the same page.
It looks like the motivation for this series is allow hypervisor to mediate between legacy MMIO BAR and legacy driver. This end ups with a design that only work for a specific use case (virtualization) and a specific setups (e.g using Linux as a hypervisor). By definition, it's not a transitional device.
It can be a transitional or non-transitional device.
Quoted 4 lines
What's more important, if it is only used
for virtualization, legacy MMIO bar is not a must. We can present a legacy device on top of modern device by using necessary mediation technologies as discussed.
You may call it a bug, i call it a feature. I am not really excited about all the bugs we'll see reported because people will try to use legacy guests on bare metal virtio. Can we just not go there please or at least give people an option not to go there?
Quoted 5 lines
By relaxing to use MMIO at BAR0, we had a much broad use cases. By definition, it's a transitional device. It's useful for both bare metal and virtualization. We don't worry about the buggy drivers or at least fixing (I meant fail on no I/O bar) those drivers is not hard.
Quoted 8 lines
Quoted 2 lines
Using a capability the system
designed is in control and can decide which drivers to use.Do we allow a virtio device only with this capability? If yes, this seems can mislead vendors. If not, we have already had modern interfaces so I don't see value to add that in the current Linux drivers. The only possible use case is the doing mediation in the hypervisor like Qemu not the driver.
exactly.
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
At least, if ID can help, it can be used with this as well.
Thanks
Quoted 6 lines
Quoted 1 line
I don't know what that means.
I mean having dedicated ID for this relaxing (though I don't see too much value).
Thanks
me neither.
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Keeping field practice things out of the
spec helps no one.Quoted 1 line
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
--
MST
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 114 lines · Michael S. Tsirkin
Quoted 112 lines · Jason Wang
Quoted 110 lines · Michael S. Tsirkin
Quoted 97 lines · Jason Wang
Quoted 80 lines · Michael S. Tsirkin
Quoted 78 lines · Jason Wang
Quoted 60 lines · Michael S. Tsirkin
Quoted 27 lines · Jason Wang
Quoted 26 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Jason Wang
This is fine for vDPA but not for virtio if the design can only work for some specific setups (OSes/archs).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Thanks
Well virtio legacy has a long history of documenting existing hacks :)
Exactly, so the legacy behaviour is not (or can't be) defined by the spec but the codes.
I mean driver behaviour derives from the code but we do document it in the spec to help people build devices.
Quoted 7 lines
Quoted 6 lines
But yes,
VIRTIO_F_ORDER_PLATFORMhas to be documented. And we have to decide what to do aboutACCESS_PLATFORMsince there's a security problem if device allows not acking it. Two options:
- relax the rules a bit and say device will assumeACCESS_PLATFORMis acked anywayQuoted 6 lines
Quoted 3 lines
Quoted 1 line
This will break legacy drivers which assume physical addresses.
not that they are not already broken.
I may miss something, the whole point is to allow legacy drivers to run otherwise a modern device is sufficient?
yes and if legacy drivers don't work in a given setup then we should not worry.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
- a new flag that is insecure (so useful for sec but useless for dpdk) but optional
This looks like a new "hack" for the legacy hacks.
it's not just for legacy.
We have the
ACCESS_PLATFORMfeature bit, what is the useage for this new flag?
ACCESS_PLATFORMis also a security boundary. so devices must fail negotiation if it's not there. this new one won't be.Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
And what about
ORDER_PLATFORM, I don't think we can modify legacy drivers...Thanks
You play some tricks with shadow VQ I guess.
Quoted 7 lines
Quoted 4 lines
Do we really want to add a new feature in the virtio spec that can only work with the datapath mediation?
Thanks
As long as a feature is useful and can't be supported otherwise we are out of options.
Probably not? Is it as simple as relaxing this:
"Transitional devices MUST expose the Legacy Interface in I/O space in BAR0."
To allow memory space.
This works for both software and hardware devices (I had a handy hardware that supports legacy virtio drivers in this way).
Quoted 6 lines
Quoted 1 line
Thanks
Yes it is certainly simpler.
Question: what happens if you try to run existing windows guests or dpdk on these? Do they crash horribly or exit gracefully?
Haven't tried DPDK and windows. But I remember DPDK supported legacy MMIO bars for a while.
Adding Maxime and Yan for comments here.
Quoted 3 lines
The point of the capability is to allow using modern device ID so such guests will not even try to bind.
Quoted 6 lines
It means a mediation layer is required to use. Then it's not an issue for this simple relaxing any more?
An advantage of such relaxing is that, for the legacy drivers like an ancient Linux version that can already do MMIO access to legacy BAR it can work without any mediation.
Yes. But the capability approach does not prevent that -
just use a transitional ID.
The disadvantage of a transitional ID is some old drivers might crash, or fail to work in other ways.
Quoted 5 lines
Quoted 2 lines
If the driver is wrote correctly it should fail gracefully if it can't request legacy I/O regions.
it's not just regions. it's things like iommu, ordering, endian-ness... we all know legacy is a mess.
Yes, but this proposal will drag us back to legacy, isn't it? Or if it is used only in the vitalization environment, what's the advantages of doing it over simply mediating on top of modern device?
1) legacy MMIO bar: spec changes, hypervisor mediation
2) modern device: no spec changes, hypervisor mediation
Quoted 14 lines
Quoted 11 lines
Quoted 3 lines
Using a modern ID with a capability
prevents old drivers from attaching.Just to make sure we are at the same page.
It looks like the motivation for this series is allow hypervisor to mediate between legacy MMIO BAR and legacy driver. This end ups with a design that only work for a specific use case (virtualization) and a specific setups (e.g using Linux as a hypervisor). By definition, it's not a transitional device.
It can be a transitional or non-transitional device.
Quoted 8 lines
Quoted 4 lines
What's more important, if it is only used
for virtualization, legacy MMIO bar is not a must. We can present a legacy device on top of modern device by using necessary mediation technologies as discussed.You may call it a bug, i call it a feature. I am not really excited about all the bugs we'll see reported because people will try to use legacy guests on bare metal virtio.
I don't either but this (MMIO BAR0) have been used by several vendors for years.
Quoted 2 lines
Can we just not go there please or at least give people an option not to go there?
Yes, so we've already had modern device. We know it could be used to mediate a legacy device without worries ordering iommu etc.
So my understandings are:
1) it's better not invent any of new facilities for legacy
2) if legacy is insisted, allow MMIO BAR0 is much simpler and better
Thanks
Quoted 25 lines
Quoted 6 lines
By relaxing to use MMIO at BAR0, we had a much broad use cases. By definition, it's a transitional device. It's useful for both bare metal and virtualization. We don't worry about the buggy drivers or at least fixing (I meant fail on no I/O bar) those drivers is not hard.
Quoted 8 lines
Quoted 2 lines
Using a capability the system
designed is in control and can decide which drivers to use.Do we allow a virtio device only with this capability? If yes, this seems can mislead vendors. If not, we have already had modern interfaces so I don't see value to add that in the current Linux drivers. The only possible use case is the doing mediation in the hypervisor like Qemu not the driver.
exactly.
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
At least, if ID can help, it can be used with this as well.
Thanks
Quoted 25 lines
Quoted 6 lines
Quoted 1 line
I don't know what that means.
I mean having dedicated ID for this relaxing (though I don't see too much value).
Thanks
me neither.
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Quoted 13 lines
Keeping field practice things out of the
spec helps no one.Quoted 4 lines
Quoted 4 lines
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 6 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 12:51 AMYes, but this proposal will drag us back to legacy, isn't it?
No. This proposal supports the legacy transitional pci device.
Quoted 4 lines
Or if it is used only in
the vitalization environment, what's the advantages of doing it over simply mediating on top of modern device?
Because the spec for modern device do not allow it. Discussed in these threads.
Quoted 3 lines
1) legacy MMIO bar: spec changes, hypervisor mediation
2) modern device: no spec changes, hypervisor mediation
This question repeats the same discussion occurred in this patch series. You might want to refer it again to avoid repeating all over again.
Quoted 2 lines
1) it's better not invent any of new facilities for legacy
2) if legacy is insisted, allow MMIO BAR0 is much simpler and better
You have missed few emails. :)
MMIO BAR is proposed here and it is not limited to BAR 0.
It is left for the device to either map something in existing BAR or use BAR 0. Because PCI has only 3 BARs.
A device may want to support legacy and non-legacy functionality both at the same time. So better not to hard wire for BAR 0.
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 6 lines · Parav Pandit
Quoted 6 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 12:51 AM
Quoted 8 lines
Quoted 1 line
Yes, but this proposal will drag us back to legacy, isn't it?
No. This proposal supports the legacy transitional pci device.
Quoted 4 lines
Or if it is used only in
the vitalization environment, what's the advantages of doing it over simply mediating on top of modern device?Because the spec for modern device do not allow it. Discussed in these threads.
Can you please tell me which part of the spec disallows it? There's a long discussion in the virtualization-list a few months ago about mediating legacy devices on top of modern. We don't see any blocker do you?
Quoted 6 lines
Quoted 4 lines
1) legacy MMIO bar: spec changes, hypervisor mediation
2) modern device: no spec changes, hypervisor mediationThis question repeats the same discussion occurred in this patch series. You might want to refer it again to avoid repeating all over again.
No, I think you miss the point that modern devices could be used for mediating legacy devices.
Quoted 5 lines
Quoted 3 lines
1) it's better not invent any of new facilities for legacy
2) if legacy is insisted, allow MMIO BAR0 is much simpler and betterYou have missed few emails. :)
MMIO BAR is proposed here and it is not limited to BAR 0.
In the context of mediation, why do you need that flexibility?
Quoted 3 lines
It is left for the device to either map something in existing BAR or use BAR 0. Because PCI has only 3 BARs.
A device may want to support legacy and non-legacy functionality both at the same time.
This is perfectly fine, this is how Qemu did:
/*
* virtio pci bar layout used by default.
* subclasses can re-arrange things if needed. *
* region 0 -- virtio legacy io bar
* region 1 -- msi-x bar
* region 2 -- virtio modern io bar (off by default)
* region 4+5 -- virtio modern memory (64bit) bar
*
*/
Quoted 1 line
So better not to hard wire for BAR 0.
Using BAR0 doesn't prevent you from adding modern capabilities in BAR0, no?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 5 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 1:15 AM
Quoted 7 lines
Quoted 1 line
Because the spec for modern device do not allow it. Discussed in these
threads.
Can you please tell me which part of the spec disallows it? There's a long discussion in the virtualization-list a few months ago about mediating legacy devices on top of modern. We don't see any blocker do you?
Modern device says FEAETURE_1 must be offered and must be negotiated by driver. Legacy has Mac as RW area. (hypervisor can do it).
Reset flow is difference between the legacy and modern.
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines
1) legacy MMIO bar: spec changes, hypervisor mediation
2) modern device: no spec changes, hypervisor mediationThis question repeats the same discussion occurred in this patch series. You might want to refer it again to avoid repeating all over again.
No, I think you miss the point that modern devices could be used for mediating legacy devices.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
1) it's better not invent any of new facilities for legacy
2) if legacy is insisted, allow MMIO BAR0 is much simpler and betterYou have missed few emails. :)
MMIO BAR is proposed here and it is not limited to BAR 0.In the context of mediation, why do you need that flexibility?
The PCI device exposed is transitional to the guest VM, so it can do legacy as well as newer features. And if BAR 0 is hard coded, it may not be able to support features that may need additional BAR.
Quoted 18 lines
Quoted 3 lines
It is left for the device to either map something in existing BAR or use BAR 0. Because PCI has only 3 BARs.
A device may want to support legacy and non-legacy functionality both at thesame time.
This is perfectly fine, this is how Qemu did:
/*
* virtio pci bar layout used by default.
* subclasses can re-arrange things if needed. *
* region 0 -- virtio legacy io bar
* region 1 -- msi-x bar
* region 2 -- virtio modern io bar (off by default)
* region 4+5 -- virtio modern memory (64bit) bar
*
*/
Quoted 4 lines
Quoted 1 line
So better not to hard wire for BAR 0.
Using BAR0 doesn't prevent you from adding modern capabilities in BAR0, no?
Right, it doesn’t. But spec shouldn’t write BAR0 is only for legacy MMIO emulation, that would prevent BAR0 usage.
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 9 lines · Parav Pandit
Quoted 9 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 1:15 AMQuoted 1 line
Because the spec for modern device do not allow it. Discussed in these
threads.
Quoted 7 lines
Quoted 4 lines
Can you please tell me which part of the spec disallows it? There's a long discussion in the virtualization-list a few months ago about mediating legacy devices on top of modern. We don't see any blocker do you?
Modern device says
FEAETURE_1must be offered and must be negotiated by driver. Legacy has Mac as RW area. (hypervisor can do it).
Reset flow is difference between the legacy and modern.
Just to make sure we're at the same page. We're talking in the context of mediation. Without mediation, your proposal can't work.
So in this case, the guest driver is not talking with the device directly. Qemu needs to traps whatever it wants to achieve the mediation:
1) It's perfectly fine that Qemu negotiated VERSION_1 but presented a mediated legacy device to guests.
2) For MAC and Reset, Qemu can trap and do anything it wants.
Quoted 14 lines
Quoted 14 lines
Quoted 7 lines
Quoted 5 lines
1) legacy MMIO bar: spec changes, hypervisor mediation
2) modern device: no spec changes, hypervisor mediationThis question repeats the same discussion occurred in this patch series. You might want to refer it again to avoid repeating all over again.
No, I think you miss the point that modern devices could be used for mediating legacy devices.
Quoted 3 lines
Quoted 3 lines
1) it's better not invent any of new facilities for legacy
2) if legacy is insisted, allow MMIO BAR0 is much simpler and better
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
You have missed few emails. :)
MMIO BAR is proposed here and it is not limited to BAR 0.In the context of mediation, why do you need that flexibility?
The PCI device exposed is transitional to the guest VM, so it can do legacy as well as newer features. And if BAR 0 is hard coded, it may not be able to support features that may need additional BAR.
This part I don't understand, you can just put existing modern capabilities in BAR0, then everything is fine.
Quoted 19 lines
Quoted 19 lines
Quoted 4 lines
It is left for the device to either map something in existing BAR or use BAR 0. Because PCI has only 3 BARs.
A device may want to support legacy and non-legacy functionality both at thesame time.
This is perfectly fine, this is how Qemu did:
/*
* virtio pci bar layout used by default.
* subclasses can re-arrange things if needed. *
* region 0 -- virtio legacy io bar
* region 1 -- msi-x bar
* region 2 -- virtio modern io bar (off by default)
* region 4+5 -- virtio modern memory (64bit) bar
*
*/
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
So better not to hard wire for BAR 0.
Using BAR0 doesn't prevent you from adding modern capabilities in BAR0, no?
Right, it doesn’t. But spec shouldn’t write BAR0 is only for legacy MMIO emulation, that would prevent BAR0 usage.
How can it be prevented? Can you give me an example?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 5 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 1:38 AM
Quoted 8 lines
Quoted 1 line
Modern device says
FEAETURE_1must be offered and must be negotiated bydriver.
Quoted 2 lines
Legacy has Mac as RW area. (hypervisor can do it). Reset flow is difference between the legacy and modern.
Just to make sure we're at the same page. We're talking in the context of mediation. Without mediation, your proposal can't work.
Right.
Quoted 4 lines
So in this case, the guest driver is not talking with the device directly. Qemu needs to traps whatever it wants to achieve the
mediation:
I prefer to avoid picking specific sw component here, but yes. QEMU can trap.
Quoted 2 lines
1) It's perfectly fine that Qemu negotiated
VERSION_1but presented a mediated legacy device to guests.
Right but if VERSION_1 is negotiated, device will work as V_1 with 12B virtio_net_hdr.
Quoted 2 lines
2) For MAC and Reset, Qemu can trap and do anything it wants.
The idea is not to poke in the fields even though such sw can. MAC is RW in legacy.
Mac ia RO in 1.x.
So QEMU cannot make RO register into RW.
The proposed solution in this series enables it and avoid per field sw interpretation and mediation in parsing values etc.
Quoted 8 lines
Quoted 1 line
The PCI device exposed is transitional to the guest VM, so it can do legacy as
well as newer features.
Quoted 1 line
And if BAR 0 is hard coded, it may not be able to support features that may
need additional BAR.
This part I don't understand, you can just put existing modern capabilities in BAR0, then everything is fine.
Not sure I follow.
May be a step back.
What is proposed here, that
a. legacy registers are emulated as MMIO in a BAR. b. This can be either be BAR0 or some other BAR
Your question was why this flexibility?
The reason is:
a. if device prefers to implement only two BARs, it can do so and have window for this 60+ config registers in an existing BAR. b. if device prefers to implement a new BAR dedicated for legacy registers emulation, it is fine too.
A mediating sw will be able to forward them regardless.
Quoted 4 lines
Quoted 1 line
Right, it doesn’t. But spec shouldn’t write BAR0 is only for legacy MMIO
emulation, that would prevent BAR0 usage.
How can it be prevented? Can you give me an example?
I mean to say, that say if we write a spec like below,
A device exposes BAR 0 of size X bytes for supporting legacy configuration and device specific registers as memory mapped region.
Above line will prevent using BAR0 beyond legacy register emulation.
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 20 lines · Parav Pandit
Quoted 6 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 1:38 AMQuoted 8 lines
Quoted 1 line
Modern device says
FEAETURE_1must be offered and must be negotiated bydriver.
Quoted 2 lines
Legacy has Mac as RW area. (hypervisor can do it). Reset flow is difference between the legacy and modern.
Just to make sure we're at the same page. We're talking in the context of mediation. Without mediation, your proposal can't work.
Right.
Quoted 4 lines
So in this case, the guest driver is not talking with the device directly. Qemu needs to traps whatever it wants to achieve the
mediation:
Quoted 5 lines
I prefer to avoid picking specific sw component here, but yes. QEMU can trap.
Quoted 2 lines
1) It's perfectly fine that Qemu negotiated
VERSION_1but presented a mediated legacy device to guests.Right but if
VERSION_1is negotiated, device will work asV_1with 12Bvirtio_net_hdr.
Shadow virtqueue could be used here. And we have much more issues without shadow virtqueue, more below.
Quoted 8 lines
Quoted 3 lines
2) For MAC and Reset, Qemu can trap and do anything it wants.
The idea is not to poke in the fields even though such sw can. MAC is RW in legacy.
Mac ia RO in 1.x.So QEMU cannot make RO register into RW.
It can be done via using the control vq. Trap the MAC write and forward it via control virtqueue.
Quoted 2 lines
The proposed solution in this series enables it and avoid per field sw interpretation and mediation in parsing values etc.
I don't think it's possible. See the discussion about ORDER_PLATFORM and ACCESS_PLATFORM in previous threads.
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
The PCI device exposed is transitional to the guest VM, so it can do legacy as
well as newer features.
Quoted 1 line
And if BAR 0 is hard coded, it may not be able to support features that may
need additional BAR.
This part I don't understand, you can just put existing modern capabilities in BAR0, then everything is fine.
Quoted 8 lines
Not sure I follow.
May be a step back.What is proposed here, that
a. legacy registers are emulated as MMIO in a BAR. b. This can be either be BAR0 or some other BARYour question was why this flexibility?
Yes.
Quoted 6 lines
The reason is:
a. if device prefers to implement only two BARs, it can do so and have window for this 60+ config registers in an existing BAR. b. if device prefers to implement a new BAR dedicated for legacy registers emulation, it is fine too.A mediating sw will be able to forward them regardless.
I'm not sure I fully understand this. The only difference is that for b, it can only use BAR0. Unless there's a new feature that mandates BAR0 (which I think is impossible since all the features are advertised via capabilities now). We're fine.
Quoted 10 lines
Quoted 5 lines
Quoted 2 lines
Right, it doesn’t. But spec shouldn’t write BAR0 is only for legacy MMIO
emulation, that would prevent BAR0 usage.
How can it be prevented? Can you give me an example?
I mean to say, that say if we write a spec like below,
A device exposes BAR 0 of size X bytes for supporting legacy configuration and device specific registers as memory mapped region.
Ok, it looks just a matter of how the spec is written. The problematic part is that it tries to enforce a size which is suboptimal.
What's has been done is:
"
Transitional devices MUST expose the Legacy Interface in I/O space in BAR0. "
Without mentioning the size.
Thanks
Quoted 2 lines
Above line will prevent using BAR0 beyond legacy register emulation.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 40 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 2:15 AMQuoted 21 lines · Parav Pandit
Quoted 6 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 1:38 AMQuoted 9 lines
Quoted 2 lines
Modern device says
FEAETURE_1must be offered and must be negotiated bydriver.
Quoted 2 lines
Legacy has Mac as RW area. (hypervisor can do it). Reset flow is difference between the legacy and modern.
Just to make sure we're at the same page. We're talking in the context of mediation. Without mediation, your proposal can't work.
Right.
Quoted 4 lines
So in this case, the guest driver is not talking with the device directly. Qemu needs to traps whatever it wants to achieve the mediation:
Quoted 5 lines
I prefer to avoid picking specific sw component here, but yes. QEMU can trap.
Quoted 2 lines
1) It's perfectly fine that Qemu negotiated
VERSION_1but presented a mediated legacy device to guests.Right but if
VERSION_1is negotiated, device will work asV_1with 12B
virtio_net_hdr.Shadow virtqueue could be used here. And we have much more issues without shadow virtqueue, more below.
Quoted 3 lines
Quoted 3 lines
2) For MAC and Reset, Qemu can trap and do anything it wants.
Quoted 9 lines
Quoted 5 lines
The idea is not to poke in the fields even though such sw can. MAC is RW in legacy.
Mac ia RO in 1.x.So QEMU cannot make RO register into RW.
It can be done via using the control vq. Trap the MAC write and forward it via control virtqueue.
This proposal Is not implementing about vdpa mediator that requires far higher understanding in hypervisor. Such mediation works fine for vdpa and it is upto vdpa layer to do. Not relevant here.
Quoted 7 lines
Quoted 2 lines
The proposed solution in this series enables it and avoid per field sw
interpretation and mediation in parsing values etc.
I don't think it's possible. See the discussion about
ORDER_PLATFORMandACCESS_PLATFORMin previous threads.
I have read the previous thread.
Hypervisor will be limiting to those platforms where ORDER_PLATFORM is not needed.
And this is a pci transitional device that uses the standard platform dma anyway so ACCESS_PLATFORM is not related.
Quoted 12 lines
Quoted 6 lines
What is proposed here, that
a. legacy registers are emulated as MMIO in a BAR. b. This can be either be BAR0 or some other BARYour question was why this flexibility?
Yes.
Quoted 3 lines
The reason is:
a. if device prefers to implement only two BARs, it can do so and have window
Quoted 8 lines
for this 60+ config registers in an existing BAR.
Quoted 1 line
b. if device prefers to implement a new BAR dedicated for legacy registers
emulation, it is fine too.
Quoted 2 lines
A mediating sw will be able to forward them regardless.
I'm not sure I fully understand this. The only difference is that for b, it can only use BAR0.
Why do say it can use only BAR 0?
For example, a device may have implemented say only BAR2, and small portion of the BAR2 is pointing to legacy MMIO config registers. A mediator hypervisor sw will be able to read/write to it when BAR0 is exposed towards the guest VM as IOBAR 0.
Quoted 4 lines
Unless there's a new feature that mandates
BAR0 (which I think is impossible since all the features are advertised via capabilities now). We're fine.
No new feature. Legacy BAR emulation is exposed via the extended capability we discussed providing the location.
Quoted 16 lines
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
Right, it doesn’t. But spec shouldn’t write BAR0 is only for legacy MMIO
emulation, that would prevent BAR0 usage.
How can it be prevented? Can you give me an example?
I mean to say, that say if we write a spec like below,
A device exposes BAR 0 of size X bytes for supporting legacy configuration
and device specific registers as memory mapped region.
Quoted 1 line
Ok, it looks just a matter of how the spec is written. The problematic part is that it tries to enforce a size which is suboptimal.
Quoted 7 lines
What's has been done is:
"
Transitional devices MUST expose the Legacy Interface in I/O space in BAR0. "Without mentioning the size.
For new legacy MMIO registers can be implemented as BAR0 with same size. But better to not place such restriction like above wording.
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 45 lines · Parav Pandit
Quoted 45 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 2:15 AMQuoted 21 lines · Parav Pandit
Quoted 6 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 1:38 AMQuoted 9 lines
Quoted 2 lines
Modern device says
FEAETURE_1must be offered and must be negotiated bydriver.
Quoted 2 lines
Legacy has Mac as RW area. (hypervisor can do it). Reset flow is difference between the legacy and modern.
Just to make sure we're at the same page. We're talking in the context of mediation. Without mediation, your proposal can't work.
Right.
Quoted 4 lines
So in this case, the guest driver is not talking with the device directly. Qemu needs to traps whatever it wants to achieve the mediation:
Quoted 5 lines
I prefer to avoid picking specific sw component here, but yes. QEMU can trap.
Quoted 2 lines
1) It's perfectly fine that Qemu negotiated
VERSION_1but presented a mediated legacy device to guests.Right but if
VERSION_1is negotiated, device will work asV_1with 12B
virtio_net_hdr.Shadow virtqueue could be used here. And we have much more issues without shadow virtqueue, more below.
Quoted 7 lines
Quoted 3 lines
2) For MAC and Reset, Qemu can trap and do anything it wants.
The idea is not to poke in the fields even though such sw can. MAC is RW in legacy.
Mac ia RO in 1.x.
Quoted 6 lines
Quoted 5 lines
Quoted 1 line
So QEMU cannot make RO register into RW.
It can be done via using the control vq. Trap the MAC write and forward it via control virtqueue.
This proposal Is not implementing about vdpa mediator that requires far higher understanding in hypervisor.
It's not related to vDPA, it's about a common technology that is used in virtualization. You do a trap and emulate the status, why can't you do that for others?
Quoted 11 lines
Such mediation works fine for vdpa and it is upto vdpa layer to do. Not relevant here.
Quoted 7 lines
Quoted 2 lines
The proposed solution in this series enables it and avoid per field sw
interpretation and mediation in parsing values etc.
I don't think it's possible. See the discussion about
ORDER_PLATFORMandACCESS_PLATFORMin previous threads.I have read the previous thread.
Hypervisor will be limiting to those platforms whereORDER_PLATFORMis not needed.
So you introduce a bunch of new facilities that only work on some specific archs. This breaks the architecture independence of virtio since 1.0. The root cause is legacy is not fit for hardware implementation, any kind of hardware that tries to offer legacy function will finally run into those corner cases which require extra interfaces which may finally end up with a (partial) duplication of the modern interface.
Quoted 1 line
And this is a pci transitional device that uses the standard platform dma anyway so
ACCESS_PLATFORMis not related.
So which type of transactions did this device use when it is used via legacy MMIO BAR? Translated request or not?
Quoted 14 lines
Quoted 14 lines
Quoted 7 lines
What is proposed here, that
a. legacy registers are emulated as MMIO in a BAR. b. This can be either be BAR0 or some other BARYour question was why this flexibility?
Yes.
Quoted 3 lines
The reason is:
a. if device prefers to implement only two BARs, it can do so and have windowfor this 60+ config registers in an existing BAR.
Quoted 8 lines
Quoted 7 lines
Quoted 1 line
b. if device prefers to implement a new BAR dedicated for legacy registers
emulation, it is fine too.
Quoted 2 lines
A mediating sw will be able to forward them regardless.
I'm not sure I fully understand this. The only difference is that for b, it can only use BAR0.
Why do say it can use only BAR 0?
Because:
1) It's the way current transitional device works
2) it's simple, a small extension to the transitional device instead of a brunch of facilities that is can do much less than this
3) it works for legacy drivers on some OSes such as Linux and DPDK, it means it works for bare metal which can't be achieved by your proposal here
Quoted 2 lines
For example, a device may have implemented say only BAR2, and small portion of the BAR2 is pointing to legacy MMIO config registers.
We're discussing spec changes, not a specific implementation here. Why is the device can't use BAR0, do you see any restriction in the spec?
Quoted 1 line
A mediator hypervisor sw will be able to read/write to it when BAR0 is exposed towards the guest VM as IOBAR 0.
So I don't think it can work:
1) This is very dangerous unless the spec mandates the size (this is also tricky since page size varies among arches) for any BAR/capability which is not what virtio wants, the spec leave those flexibility to the implementation:
E.g
"""
The driver MUST accept a cap_len value which is larger than specified here. """
2) A blocker for live migration (and compatibility), the hypervisor should not assume the size for any capability so for whatever case it should have a fallback for the case where the BAR can't be assigned.
Quoted 25 lines
Quoted 5 lines
Unless there's a new feature that mandates
BAR0 (which I think is impossible since all the features are advertised via capabilities now). We're fine.No new feature. Legacy BAR emulation is exposed via the extended capability we discussed providing the location.
Quoted 18 lines
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
Right, it doesn’t. But spec shouldn’t write BAR0 is only for legacy MMIO
emulation, that would prevent BAR0 usage.
How can it be prevented? Can you give me an example?
I mean to say, that say if we write a spec like below,
A device exposes BAR 0 of size X bytes for supporting legacy configuration
and device specific registers as memory mapped region.
Quoted 1 line
Ok, it looks just a matter of how the spec is written. The problematic part is that it tries to enforce a size which is suboptimal.
What's has been done is:
Quoted 7 lines
Quoted 5 lines
"
Transitional devices MUST expose the Legacy Interface in I/O space in BAR0. "Without mentioning the size.
For new legacy MMIO registers can be implemented as BAR0 with same size. But better to not place such restriction like above wording.
Let me summarize, we had three ways currently:
1) legacy MMIO BAR via capability:
Pros:
- allow some flexibility to place MMIO BAR other than 0 Cons:
- new device ID
- non trivial spec changes which ends up of the tricky cases that tries to workaround legacy to fit for a hardware implementation
- work only for the case of virtualization with the help of meditation, can't work for bare metal
- only work for some specific archs without SVQ
2) allow BAR0 to be MMIO for transitional device
Pros:
- very minor change for the spec
- work for virtualization (and it work even without dedicated mediation for some setups)
- work for bare metal for some setups (without mediation) Cons:
- only work for some specific archs without SVQ
- BAR0 is required
3) modern device mediation for legacy
Pros:
- no changes in the spec
Cons:
- require mediation layer in order to work in bare metal
- require datapath mediation like SVQ to work for virtualization
Compared to method 2) the only advantages of method 1) is the flexibility of BAR0 but it has too many disadvantages. If we only care about virtualization, modern devices are sufficient. Then why bother for that?
Thanks
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 66 lines · Jason Wang
Quoted 45 lines · Parav Pandit
Quoted 45 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 2:15 AMQuoted 21 lines · Parav Pandit
Quoted 6 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 1:38 AMQuoted 9 lines
Quoted 2 lines
Modern device says
FEAETURE_1must be offered and must be negotiated bydriver.
Quoted 2 lines
Legacy has Mac as RW area. (hypervisor can do it). Reset flow is difference between the legacy and modern.
Just to make sure we're at the same page. We're talking in the context of mediation. Without mediation, your proposal can't work.
Right.
Quoted 4 lines
So in this case, the guest driver is not talking with the device directly. Qemu needs to traps whatever it wants to achieve the mediation:
Quoted 5 lines
I prefer to avoid picking specific sw component here, but yes. QEMU can trap.
Quoted 2 lines
1) It's perfectly fine that Qemu negotiated
VERSION_1but presented a mediated legacy device to guests.Right but if
VERSION_1is negotiated, device will work asV_1with 12B
virtio_net_hdr.Shadow virtqueue could be used here. And we have much more issues without shadow virtqueue, more below.
Quoted 7 lines
Quoted 3 lines
2) For MAC and Reset, Qemu can trap and do anything it wants.
The idea is not to poke in the fields even though such sw can. MAC is RW in legacy.
Mac ia RO in 1.x.Quoted 6 lines
Quoted 5 lines
Quoted 1 line
So QEMU cannot make RO register into RW.
It can be done via using the control vq. Trap the MAC write and forward it via control virtqueue.
This proposal Is not implementing about vdpa mediator that requires far higher understanding in hypervisor.
It's not related to vDPA, it's about a common technology that is used in virtualization. You do a trap and emulate the status, why can't you do that for others?
Quoted 9 lines
Such mediation works fine for vdpa and it is upto vdpa layer to do. Not relevant here.
Quoted 7 lines
Quoted 2 lines
The proposed solution in this series enables it and avoid per field sw
interpretation and mediation in parsing values etc.
I don't think it's possible. See the discussion about
ORDER_PLATFORMandACCESS_PLATFORMin previous threads.
Quoted 6 lines
Quoted 2 lines
I have read the previous thread.
Hypervisor will be limiting to those platforms whereORDER_PLATFORMis not needed.So you introduce a bunch of new facilities that only work on some specific archs. This breaks the architecture independence of virtio since 1.0.
The defined spec for PCI device does not work today for transitional device for virtualization. Only works in limited PF case. Hence this update. More below.
Quoted 6 lines
The root cause is legacy is not fit for hardware implementation, any kind of hardware that tries to offer legacy function will finally run into those corner cases which require extra interfaces which may finally end up with a (partial) duplication of the modern interface.
I agree with you. We cannot change the legacy.
What is being added here it to enable legacy transport via MMIO or AQ and using notification region.
Will comment where you listed 3 options.
Quoted 5 lines
Quoted 1 line
And this is a pci transitional device that uses the standard platform dma anyway so
ACCESS_PLATFORMis not related.So which type of transactions did this device use when it is used via legacy MMIO BAR? Translated request or not?
Device uses the PCI transport level addresses configured because its a PCI device.
Quoted 5 lines
Quoted 1 line
For example, a device may have implemented say only BAR2, and small portion of the BAR2 is pointing to legacy MMIO config registers.
We're discussing spec changes, not a specific implementation here. Why is the device can't use BAR0, do you see any restriction in the spec?
No restriction.
Forcing it to use BAR0 is the restrictive method.
Quoted 9 lines
Quoted 1 line
A mediator hypervisor sw will be able to read/write to it when BAR0 is exposed towards the guest VM as IOBAR 0.
So I don't think it can work:
1) This is very dangerous unless the spec mandates the size (this is also tricky since page size varies among arches) for any BAR/capability which is not what virtio wants, the spec leave those flexibility to the implementation:
Quoted 5 lines
E.g
"""
The driver MUST accept acap_lenvalue which is larger than specified here. """
cap_len talks about length of the PCI capability structure as defined by the PCI spec. BAR length is located in the le32 length.
So new MMIO region can be of any size and anywhere in the BAR.
For LM BAR length and number should be same between two PCI VFs. But its orthogonal to this point. Such checks will be done anyway.
Quoted 5 lines
2) A blocker for live migration (and compatibility), the hypervisor should not assume the size for any capability so for whatever case it should have a fallback for the case where the BAR can't be assigned.
I agree that hypervisor should not assume.
for LM such compatibility checks will be done anyway. So not a blocker, they should match on two sides is all needed.
Quoted 8 lines
Let me summarize, we had three ways currently:
1) legacy MMIO BAR via capability:
Pros:
- allow some flexibility to place MMIO BAR other than 0 Cons:
- new device ID
Not needed as Michael suggest. Existing transitional or non transitional device can expose this optional capability and its attached MMIO region.
Spec changes are similar to #2.
Quoted 4 lines
- non trivial spec changes which ends up of the tricky cases that tries to workaround legacy to fit for a hardware implementation
- work only for the case of virtualization with the help of meditation, can't work for bare metal
For bare-metal PFs usually thin hypervisors are used that does very minimal setup. But I agree that bare-metal is relatively less important.
Quoted 2 lines
- only work for some specific archs without SVQ
That is the legacy limitation that we don't worry about.
Quoted 4 lines
2) allow BAR0 to be MMIO for transitional device
Pros:
- very minor change for the spec
Spec changes wise they are similar to #1.
Quoted 2 lines
- work for virtualization (and it work even without dedicated mediation for some setups)
I am not aware where can it work without mediation. Do you know any specific kernel version where it actually works?
Quoted 5 lines
- work for bare metal for some setups (without mediation) Cons:
- only work for some specific archs without SVQ
- BAR0 is required
Both are not limitation as they are mainly coming from the legacy side of things.
Quoted 8 lines
3) modern device mediation for legacy
Pros:
- no changes in the spec
Cons:
- require mediation layer in order to work in bare metal
- require datapath mediation like SVQ to work for virtualization
Spec change is still require for net and blk because modern device do not understand legacy, even with mediation layer. FEATURE_1, RW cap via CVQ which is not really owned by the hypervisor.
A guest may be legacy or non legacy, so mediation shouldn't be always done.
Quoted 4 lines
Compared to method 2) the only advantages of method 1) is the flexibility of BAR0 but it has too many disadvantages. If we only care about virtualization, modern devices are sufficient. Then why bother for that?
So that a single stack which doesn't always have the knowledge of which driver version is running is guest can utilize it. Otherwise 1.x also end up doing mediation when guest driver = 1.x and device = transitional PCI VF.
so (1) and (2) both are equivalent, one is more flexible, if you know more valid cases where BAR0 as MMIO can work as_is, such option is open.
We can draft the spec that MMIO BAR SHOULD be exposes in BAR0.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 73 lines · Parav Pandit
Quoted 69 lines · Jason Wang
Quoted 45 lines · Parav Pandit
Quoted 45 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 2:15 AMQuoted 21 lines · Parav Pandit
Quoted 6 lines
From: Jason Wang <[email protected]>
Sent: Wednesday, April 12, 2023 1:38 AMQuoted 9 lines
Quoted 2 lines
Modern device says
FEAETURE_1must be offered and must be negotiated bydriver.
Quoted 2 lines
Legacy has Mac as RW area. (hypervisor can do it). Reset flow is difference between the legacy and modern.
Just to make sure we're at the same page. We're talking in the context of mediation. Without mediation, your proposal can't work.
Right.
Quoted 4 lines
So in this case, the guest driver is not talking with the device directly. Qemu needs to traps whatever it wants to achieve the mediation:
Quoted 5 lines
I prefer to avoid picking specific sw component here, but yes. QEMU can trap.
Quoted 2 lines
1) It's perfectly fine that Qemu negotiated
VERSION_1but presented a mediated legacy device to guests.Right but if
VERSION_1is negotiated, device will work asV_1with 12B
virtio_net_hdr.Shadow virtqueue could be used here. And we have much more issues without shadow virtqueue, more below.
Quoted 7 lines
Quoted 3 lines
2) For MAC and Reset, Qemu can trap and do anything it wants.
The idea is not to poke in the fields even though such sw can. MAC is RW in legacy.
Mac ia RO in 1.x.Quoted 6 lines
Quoted 5 lines
Quoted 1 line
So QEMU cannot make RO register into RW.
It can be done via using the control vq. Trap the MAC write and forward it via control virtqueue.
This proposal Is not implementing about vdpa mediator that requires far higher understanding in hypervisor.
It's not related to vDPA, it's about a common technology that is used in virtualization. You do a trap and emulate the status, why can't you do that for others?
Quoted 11 lines
Such mediation works fine for vdpa and it is upto vdpa layer to do. Not relevant here.
Quoted 7 lines
Quoted 2 lines
The proposed solution in this series enables it and avoid per field sw
interpretation and mediation in parsing values etc.
I don't think it's possible. See the discussion about
ORDER_PLATFORMandACCESS_PLATFORMin previous threads.I have read the previous thread.
Hypervisor will be limiting to those platforms whereORDER_PLATFORMis not needed.
Quoted 6 lines
Quoted 3 lines
So you introduce a bunch of new facilities that only work on some specific archs. This breaks the architecture independence of virtio since 1.0.
The defined spec for PCI device does not work today for transitional device for virtualization. Only works in limited PF case. Hence this update.
I fully understand the motivation. I just want to say
1) compare to the MMIO ar BAR0, this proposal doesn't provide much advantages
2) mediate on top of modern devices allows us to not worry about the device design which is hard for legacy
Quoted 43 lines
More below.
Quoted 6 lines
The root cause is legacy is not fit for hardware implementation, any kind of hardware that tries to offer legacy function will finally run into those corner cases which require extra interfaces which may finally end up with a (partial) duplication of the modern interface.
I agree with you. We cannot change the legacy.
What is being added here it to enable legacy transport via MMIO or AQ and using notification region.Will comment where you listed 3 options.
Quoted 5 lines
Quoted 1 line
And this is a pci transitional device that uses the standard platform dma anyway so
ACCESS_PLATFORMis not related.So which type of transactions did this device use when it is used via legacy MMIO BAR? Translated request or not?
Device uses the PCI transport level addresses configured because its a PCI device.
Quoted 5 lines
Quoted 1 line
For example, a device may have implemented say only BAR2, and small portion of the BAR2 is pointing to legacy MMIO config registers.
We're discussing spec changes, not a specific implementation here. Why is the device can't use BAR0, do you see any restriction in the spec?
No restriction.
Forcing it to use BAR0 is the restrictive method.Quoted 9 lines
Quoted 1 line
A mediator hypervisor sw will be able to read/write to it when BAR0 is exposed towards the guest VM as IOBAR 0.
So I don't think it can work:
1) This is very dangerous unless the spec mandates the size (this is also tricky since page size varies among arches) for any BAR/capability which is not what virtio wants, the spec leave those flexibility to the implementation:
Quoted 5 lines
E.g
"""
The driver MUST accept acap_lenvalue which is larger than specified here. """
Quoted 7 lines
cap_lentalks about length of the PCI capability structure as defined by the PCI spec. BAR length is located in the le32 length.So new MMIO region can be of any size and anywhere in the BAR.
For LM BAR length and number should be same between two PCI VFs. But its orthogonal to this point. Such checks will be done anyway.
Quoted the wrong sections, I think it should be:
"
length MAY include padding, or fields unused by the driver, or future extensions. Note: 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 MAY limit the mapped structure size to e.g. 4KBytes (thus ignoring parts of structure after the first 4KBytes) to allow forward compatibility with such devices without loss of functionality and without wasting resources. "
Quoted 12 lines
Quoted 6 lines
2) A blocker for live migration (and compatibility), the hypervisor should not assume the size for any capability so for whatever case it should have a fallback for the case where the BAR can't be assigned.
I agree that hypervisor should not assume.
for LM such compatibility checks will be done anyway. So not a blocker, they should match on two sides is all needed.Quoted 2 lines
Let me summarize, we had three ways currently:
Quoted 7 lines
Quoted 6 lines
1) legacy MMIO BAR via capability:
Pros:
- allow some flexibility to place MMIO BAR other than 0 Cons:
- new device IDNot needed as Michael suggest. Existing transitional or non transitional
If it's a transitional device but not placed at BAR0, it might have side effects for Linux drivers which assumes BAR0 for legacy.
I don't see how easy it could be a non transitional device:
"
Devices or drivers with no legacy compatibility are referred to as non-transitional devices and drivers, respectively.
"
Quoted 9 lines
device can expose this optional capability and its attached MMIO region.
Spec changes are similar to #2.
Quoted 4 lines
- non trivial spec changes which ends up of the tricky cases that tries to workaround legacy to fit for a hardware implementation
- work only for the case of virtualization with the help of meditation, can't work for bare metalFor bare-metal PFs usually thin hypervisors are used that does very minimal setup. But I agree that bare-metal is relatively less important.
This is not what I understand. I know several vendors that are using virtio devices for bare metal.
Quoted 10 lines
Quoted 3 lines
- only work for some specific archs without SVQ
That is the legacy limitation that we don't worry about.
Quoted 4 lines
2) allow BAR0 to be MMIO for transitional device
Pros:
- very minor change for the specSpec changes wise they are similar to #1.
This is different since the changes for this are trivial.
Quoted 4 lines
Quoted 2 lines
- work for virtualization (and it work even without dedicated mediation for some setups)
I am not aware where can it work without mediation. Do you know any specific kernel version where it actually works?
E.g current Linux driver did:
rc = pci_request_region(pci_dev, 0, "virtio-pci-legacy");
It doesn't differ from I/O with memory. It means if you had a "transitional" device with legacy MMIO BAR0, it just works.
Quoted 11 lines
Quoted 6 lines
- work for bare metal for some setups (without mediation) Cons:
- only work for some specific archs without SVQ
- BAR0 is requiredBoth are not limitation as they are mainly coming from the legacy side of things.
Quoted 2 lines
3) modern device mediation for legacy
Quoted 8 lines
Quoted 6 lines
Pros:
- no changes in the spec
Cons:
- require mediation layer in order to work in bare metal
- require datapath mediation like SVQ to work for virtualizationSpec change is still require for net and blk because modern device do not understand legacy, even with mediation layer.
That's fine and easy since we work on top of modern devices.
Quoted 1 line
FEATURE_1, RW cap via CVQ which is not really owned by the hypervisor.
Hypervisors can trap if they wish.
Quoted 1 line
A guest may be legacy or non legacy, so mediation shouldn't be always done.
Yes, so mediation can work only if we found it's a legacy driver.
Quoted 10 lines
Quoted 5 lines
Compared to method 2) the only advantages of method 1) is the flexibility of BAR0 but it has too many disadvantages. If we only care about virtualization, modern devices are sufficient. Then why bother for that?
So that a single stack which doesn't always have the knowledge of which driver version is running is guest can utilize it. Otherwise 1.x also end up doing mediation when guest driver = 1.x and device = transitional PCI VF.
I don't see how this can be solved in your proposal.
Quoted 3 lines
so (1) and (2) both are equivalent, one is more flexible, if you know more valid cases where BAR0 as MMIO can work
as_is, such option is open.
As said in previous threads, this has been used by several vendors for years.
E.g I have a handy transitional hardware virtio device that has:
Region 0: Memory at f5ff0000 (64-bit, prefetchable) [size=8K]
Region 2: Memory at f5fe0000 (64-bit, prefetchable) [size=4K]
Region 4: Memory at f5800000 (64-bit, prefetchable) [size=4M]And:
Capabilities: [64] Vendor Specific Information: VirtIO: CommonCfg
BAR=0 offset=00000888 size=00000078
Capabilities: [74] Vendor Specific Information: VirtIO: Notify
BAR=0 offset=00001800 size=00000020 multiplier=00000000
Capabilities: [88] Vendor Specific Information: VirtIO: ISR
BAR=0 offset=00000820 size=00000020
Capabilities: [98] Vendor Specific Information: VirtIO: DeviceCfg
BAR=0 offset=00000840 size=00000020
Quoted 3 lines
We can draft the spec that MMIO BAR SHOULD be exposes in BAR0.
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 2 lines · Jason Wang
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
The proposed solution in this series enables it and avoid per field sw
interpretation and mediation in parsing values etc.
... except for reset, notifications, and maybe more down the road.
Quoted 13 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
I don't think it's possible. See the discussion about
ORDER_PLATFORMandACCESS_PLATFORMin previous threads.I have read the previous thread.
Hypervisor will be limiting to those platforms whereORDER_PLATFORMis not needed.Quoted 6 lines
Quoted 3 lines
So you introduce a bunch of new facilities that only work on some specific archs. This breaks the architecture independence of virtio since 1.0.
The defined spec for PCI device does not work today for transitional device for virtualization. Only works in limited PF case. Hence this update.
Quoted 5 lines
I fully understand the motivation. I just want to say
1) compare to the MMIO ar BAR0, this proposal doesn't provide much advantages
2) mediate on top of modern devices allows us to not worry about the device design which is hard for legacy
I begin to think so, too. When I proposed this it looked like just a single capability will be enough, without a lot of mess. But it seems that addressing this fully is getting more and more complex. The one thing we can't do in software is different header size for virtio net. For starters, let's add a capability to address that?
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 11 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, April 13, 2023 1:20 PMQuoted 3 lines · Jason Wang
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
The proposed solution in this series enables it and avoid per field sw
interpretation and mediation in parsing values etc.
... except for reset, notifications, and maybe more down the road.
Your AQ proposal addresses reset too.
Nothing extra for the notifications, as comes for free from the device side.
Quoted 22 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
I don't think it's possible. See the discussion about
ORDER_PLATFORMandACCESS_PLATFORMin previous threads.I have read the previous thread.
Hypervisor will be limiting to those platforms whereORDER_PLATFORMis not needed.
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
So you introduce a bunch of new facilities that only work on some specific archs. This breaks the architecture independence of virtio since 1.0.
The defined spec for PCI device does not work today for transitional device for virtualization. Only works in limited PF case. Hence this update.
Quoted 6 lines
I fully understand the motivation. I just want to say
1) compare to the MMIO ar BAR0, this proposal doesn't provide much advantages
2) mediate on top of modern devices allows us to not worry about the device design which is hard for legacy
Quoted 5 lines
I begin to think so, too. When I proposed this it looked like just a single capability will be enough, without a lot of mess. But it seems that addressing this fully is getting more and more complex.
The one thing we can't do in software is different header size for virtio net. For starters, let's add a capability to address that?
Hdr bit doesn't solve it because hypervisor is not involved in any trapping of feature bits, cvq or other vqs. It is unified code for 1.x and transitional in hypervisor.
We have two options to satisfy the requirements.
(partly taken/repeated from Jason's yday email).
1. AQ (solves reset) + notification for building non transitional device that support perform well and it is both backward and forward compat Pros:
a. efficient device reset.
b. efficient notifications from OS to device
c. device vendor doesn't need to build transitional configuration space.
d. works without any mediation in hv for 1.x and non 1.x for all non-legacy interfaces (vqs, config space, cvq, and future features). e. can work with non-Linux guest VMs too
Cons:
a. More AQ commands work in sw
b. Does not work for bare metal PFs
2. Allowing MMIO BAR0 on transitional device as SHOULD requirement with larger BAR size. Pros:
a. Can work with Linux bare-metal and Linux guest VMs as one of the wider uses case b. in-efficient device handling for notifications
c. Works without mediation like 1.d.
d. Also works without HV mediation.
Cons:
a. device reset implementation is very for the hw. b. requires transitional device to be built. c. Notification performance may suffer.
For Marvell and us #1 works well.
I am evaluating #2 and get back.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 48 lines · Parav Pandit
Quoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, April 13, 2023 1:20 PMQuoted 7 lines
Quoted 3 lines · Jason Wang
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
The proposed solution in this series enables it and avoid per field sw
interpretation and mediation in parsing values etc.
... except for reset, notifications, and maybe more down the road.
Your AQ proposal addresses reset too.
Nothing extra for the notifications, as comes for free from the device side.Quoted 22 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
I don't think it's possible. See the discussion about
ORDER_PLATFORMandACCESS_PLATFORMin previous threads.I have read the previous thread.
Hypervisor will be limiting to those platforms whereORDER_PLATFORMis not needed.
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
So you introduce a bunch of new facilities that only work on some specific archs. This breaks the architecture independence of virtio since 1.0.
The defined spec for PCI device does not work today for transitional device for virtualization. Only works in limited PF case. Hence this update.
Quoted 6 lines
I fully understand the motivation. I just want to say
1) compare to the MMIO ar BAR0, this proposal doesn't provide much advantages
2) mediate on top of modern devices allows us to not worry about the device design which is hard for legacyQuoted 5 lines
I begin to think so, too. When I proposed this it looked like just a single capability will be enough, without a lot of mess. But it seems that addressing this fully is getting more and more complex.
The one thing we can't do in software is different header size for virtio net. For starters, let's add a capability to address that?Hdr bit doesn't solve it because hypervisor is not involved in any trapping of feature bits, cvq or other vqs. It is unified code for 1.x and transitional in hypervisor.
We have two options to satisfy the requirements.
(partly taken/repeated from Jason's yday email).
Quoted 6 lines
1. AQ (solves reset) + notification for building non transitional device that support perform well and it is both backward and forward compat Pros:
a. efficient device reset.
b. efficient notifications from OS to device
c. device vendor doesn't need to build transitional configuration space.
d. works without any mediation in hv for 1.x and non 1.x for all non-legacy interfaces (vqs, config space, cvq, and future features).
Without mediation, how could you forward guest config access to admin virtqueue? Or you mean:
1) hypervisor medate for legacy
2) otherwise the modern BARs are assigned to the guest
For 2) as we discussed, we can't have such an assumption as
1) spec doesn't enforce the size of a specific structure
2) bing vendor locked thus a blocker for live migration as it mandate the layout for the guest, mediation layer is a must in this case to maintain cross vendor compatibility
Hypervisor needs to start from a mediation method and do BAR assignment only when possible.
Quoted 4 lines
e. can work with non-Linux guest VMs too
Cons:
a. More AQ commands work in sw
Note that this needs to be done on top of the transport virtqueue. And we need to carefully design the command sets since they could be mutually exclusive.
Thanks
Quoted 9 lines
b. Does not work for bare metal PFs
2. Allowing MMIO BAR0 on transitional device as SHOULD requirement with larger BAR size. Pros:
a. Can work with Linux bare-metal and Linux guest VMs as one of the wider uses case b. in-efficient device handling for notifications
c. Works without mediation like 1.d.
d. Also works without HV mediation.
Quoted 8 lines
Cons:
a. device reset implementation is very for the hw. b. requires transitional device to be built. c. Notification performance may suffer.For Marvell and us #1 works well.
I am evaluating #2 and get back.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 16 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 11:10 PMQuoted 11 lines
We have two options to satisfy the requirements.
(partly taken/repeated from Jason's yday email).1. AQ (solves reset) + notification for building non transitional device that support perform well and it is both backward and forward compat
Pros:
a. efficient device reset.
b. efficient notifications from OS to device c. device vendor doesn't need to build transitional configuration space.
d. works without any mediation in hv for 1.x and non 1.x for all non-legacy
Quoted 8 lines
interfaces (vqs, config space, cvq, and future features).
Without mediation, how could you forward guest config access to admin virtqueue? Or you mean:
1) hypervisor medate for legacy
2) otherwise the modern BARs are assigned to the guest
Right.
Quoted 3 lines
For 2) as we discussed, we can't have such an assumption as
1) spec doesn't enforce the size of a specific structure
Spec will be extended in coming time.
Quoted 4 lines
2) bing vendor locked thus a blocker for live migration as it mandate the layout for the guest, mediation layer is a must in this case to maintain cross vendor compatibility
With PCI VF will have compatibility check and also vendor recommendations.
Quoted 3 lines
Hypervisor needs to start from a mediation method and do BAR assignment only when possible.
Not necessarily.
Quoted 7 lines
Quoted 2 lines
Cons:
a. More AQ commands work in swNote that this needs to be done on top of the transport virtqueue. And we need to carefully design the command sets since they could be mutually exclusive.
Not sure what more to expect out of transport virtqueue compared to AQ. I didn’t follow, which part could be mutually exclusive?
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 25 lines · Parav Pandit
Quoted 17 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 11:10 PMQuoted 11 lines
We have two options to satisfy the requirements.
(partly taken/repeated from Jason's yday email).1. AQ (solves reset) + notification for building non transitional device that support perform well and it is both backward and forward compat
Pros:
a. efficient device reset.
b. efficient notifications from OS to device c. device vendor doesn't need to build transitional configuration space.
d. works without any mediation in hv for 1.x and non 1.x for all non-legacyQuoted 8 lines
interfaces (vqs, config space, cvq, and future features).
Without mediation, how could you forward guest config access to admin virtqueue? Or you mean:
1) hypervisor medate for legacy
2) otherwise the modern BARs are assigned to the guest
Quoted 6 lines
Right.
Quoted 3 lines
For 2) as we discussed, we can't have such an assumption as
1) spec doesn't enforce the size of a specific structure
Spec will be extended in coming time.
It's too late to do any new restriction without introducing a flag. Mandating size may easily end up with a architecte specific solution.
Quoted 6 lines
Quoted 5 lines
2) bing vendor locked thus a blocker for live migration as it mandate the layout for the guest, mediation layer is a must in this case to maintain cross vendor compatibility
With PCI VF will have compatibility check and also vendor recommendations.
I'm not sure what type of recommendations you want.
We've already had:
1) features
2) config
And what you proposed is to allow the management to know the exact hardware layout in order to check the compatibility? And the management needs to evolve as new structures are added. This complicates the work of management's furtherly which I'm not sure it can work.
Quoted 9 lines
Quoted 4 lines
Hypervisor needs to start from a mediation method and do BAR assignment only when possible.
Not necessarily.
Quoted 3 lines
Quoted 2 lines
Cons:
a. More AQ commands work in sw
Quoted 6 lines
Quoted 4 lines
Note that this needs to be done on top of the transport virtqueue. And we need to carefully design the command sets since they could be mutually exclusive.
Not sure what more to expect out of transport virtqueue compared to AQ. I didn’t follow, which part could be mutually exclusive?
Transport VQ allows a modern device to be transported via adminq.
And you want to add commands to transport for legacy devices.
Can a driver use both the modern transport commands as well as the legacy transport commands?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 9 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 11:38 PMQuoted 2 lines
Quoted 1 line
1) spec doesn't enforce the size of a specific structure
Spec will be extended in coming time.
It's too late to do any new restriction without introducing a flag.
We are really diverging from the topic.
I don’t think it is late. The work in this area of PCI VF has not even begun fully.
Quoted 2 lines
Mandating size may easily end up with a architecte specific solution.
Unlikely. Other standard device types are also expanding this way.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
2) bing vendor locked thus a blocker for live migration as it mandate the layout for the guest, mediation layer is a must in this case to maintain cross vendor compatibility
Quoted 9 lines
Quoted 1 line
With PCI VF will have compatibility check and also vendor recommendations.
I'm not sure what type of recommendations you want.
We've already had:
1) features
2) config
Those cover the large part.
Apart from it some of the PCI device layout compat checks will be covered too.
Quoted 3 lines
And what you proposed is to allow the management to know the exact hardware layout in order to check the compatibility? And the management needs to evolve as new structures are added.
Mostly not mgmt stack may not need to evolve a lot.
Because most layouts should be growing within the device context and not at the PCI capabilities etc area.
And even if it does, its fine as large part of it standard PCI spec definitions.
Quoted 3 lines
This complicates the work of
management's furtherly which I'm not sure it can work.
Well, once we work towards it, it can work. :)
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Hypervisor needs to start from a mediation method and do BAR assignment only when possible.
Not necessarily.
Quoted 3 lines
Quoted 2 lines
Cons:
a. More AQ commands work in sw
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Note that this needs to be done on top of the transport virtqueue. And we need to carefully design the command sets since they could be mutually exclusive.
Not sure what more to expect out of transport virtqueue compared to AQ. I didn’t follow, which part could be mutually exclusive?
Transport VQ allows a modern device to be transported via adminq.
May be for devices it can work. Hypervisor mediation with CC on horizon for new capabilities is being reduced. So we don’t see transport vq may not be path forward.
Quoted 2 lines
And you want to add commands to transport for legacy devices.
Yes only legacy emulation who do not care about hypervisor mediation.
Quoted 2 lines
Can a driver use both the modern transport commands as well as the legacy transport commands?
Hard to answer, I likely do not understand as driver namespace is unclear. Let me try.
A modern driver in guest VM accessing a transitional device has its own transport vq for say config space RW.
This transport queue can directly reach to the device without hypervisor mediation, - yes.
Same device if accessed via some legacy guest VM driver, it will gets its config space accessed via transport VQ (AVQ) of the hypervisor PF AQ.
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 11 lines · Parav Pandit
Quoted 9 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 11:38 PMQuoted 2 lines
Quoted 1 line
1) spec doesn't enforce the size of a specific structure
Spec will be extended in coming time.
It's too late to do any new restriction without introducing a flag.
We are really diverging from the topic.
I don’t think it is late. The work in this area of PCI VF has not even begun fully.
I think Jason means that any new feature needs some kind of approach for compatibility, given a huge installed base, a flag day where all old drivers stop working on new devices does not look acceptable to him.
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
In reply to Parav PanditQuoted 6 lines · Parav Pandit
Quoted 5 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 11:38 PM
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
1) spec doesn't enforce the size of a specific structure
Spec will be extended in coming time.
It's too late to do any new restriction without introducing a flag.
We are really diverging from the topic.
I don’t think it is late. The work in this area of PCI VF has not even begun fully.
I meant it needs a new feature flag.
Quoted 4 lines
Quoted 3 lines
Mandating size may easily end up with a architecte specific solution.
Unlikely. Other standard device types are also expanding this way.
I think we are talking about software technologies instead of device design here.
For devices it works.But for hypervisor, it needs to deal with the size that doesn't match arch's page size.
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
2) bing vendor locked thus a blocker for live migration as it mandate the layout for the guest, mediation layer is a must in this case to maintain cross vendor compatibility
With PCI VF will have compatibility check and also vendor recommendations.
Quoted 8 lines
Quoted 7 lines
I'm not sure what type of recommendations you want.
We've already had:
1) features
2) configThose cover the large part.
I meant you can't have recommendations in features and config. What's more, assuming you have two generations of device
gen1: features x,y
gen2: features x,y,z
You won't be able to do migration between gen1 and gen2 without mediation. Such technologies have been used by cpu features for years. I am not sure why it became a problem for you.
Quoted 9 lines
Apart from it some of the PCI device layout compat checks will be covered too.
Quoted 3 lines
And what you proposed is to allow the management to know the exact hardware layout in order to check the compatibility? And the management needs to evolve as new structures are added.
Mostly not mgmt stack may not need to evolve a lot.
Because most layouts should be growing within the device context and not at the PCI capabilities etc area.And even if it does, its fine as large part of it standard PCI spec definitions.
So as mentioned in another thread, this is a PCI specific solution:
1) feature and config are basic virtio facility
2) capability is not but specific to PCI transport
Checking PCI capability layout in the virtio management is a layer violation which can't work for future transport like SIOV or adminq. Management should only see virtio device otherwise the solution becomes transport specific.
Quoted 27 lines
Quoted 4 lines
This complicates the work of
management's furtherly which I'm not sure it can work.Well, once we work towards it, it can work. :)
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Hypervisor needs to start from a mediation method and do BAR assignment only when possible.
Not necessarily.
Quoted 3 lines
Quoted 2 lines
Cons:
a. More AQ commands work in swQuoted 9 lines
Quoted 6 lines
Quoted 4 lines
Note that this needs to be done on top of the transport virtqueue. And we need to carefully design the command sets since they could be mutually exclusive.
Not sure what more to expect out of transport virtqueue compared to AQ. I didn’t follow, which part could be mutually exclusive?
Transport VQ allows a modern device to be transported via adminq.
May be for devices it can work. Hypervisor mediation with CC on horizon for new capabilities is being reduced. So we don’t see transport vq may not be path forward.
Quoted 7 lines
Quoted 2 lines
And you want to add commands to transport for legacy devices.
Yes only legacy emulation who do not care about hypervisor mediation.
Quoted 2 lines
Can a driver use both the modern transport commands as well as the legacy transport commands?
Hard to answer, I likely do not understand as driver namespace is unclear.
Things might be simplified if we use separate queues for admin, transport and legacy.
Quoted 5 lines
Let me try.
A modern driver in guest VM accessing a transitional device has its own transport vq for say config space RW.
This transport queue can directly reach to the device without hypervisor mediation, - yes.
Same device if accessed via some legacy guest VM driver, it will gets its config space accessed via transport VQ (AVQ) of the hypervisor PF AQ.
Not only the config space, but we can revisit those issues when we agree to use adminq (or other like PASID which is even more flexible).
Thanks
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 12 lines
From: Jason Wang <[email protected]>
Sent: Sunday, April 16, 2023 11:23 PMQuoted 6 lines · Parav Pandit
Quoted 5 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 11:38 PM
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
1) spec doesn't enforce the size of a specific structure
Spec will be extended in coming time.
It's too late to do any new restriction without introducing a flag.
We are really diverging from the topic.
I don’t think it is late. The work in this area of PCI VF has not even begun fully.I meant it needs a new feature flag.
Ok.
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Mandating size may easily end up with a architecte specific solution.
Unlikely. Other standard device types are also expanding this way.
I think we are talking about software technologies instead of device design here.
Isn't the size of BAR and its cap_len exposed by the device?
Quoted 3 lines
For devices it works.But for hypervisor, it needs to deal with the size that doesn't match arch's page size.
PCI BAR size of the VF can learn the system page size being different for x86 (4K) and arm (64K). PCI transport seems to support it.
PCI PF on bare-metal has to understand the highest page size anyway if for some reason bare-metal host wants to map this PF to the VM.
A hypevisor mediating and emulating needs to learn the system page size anyway. If underlying device page size is smaller, hypevisor may end up mediating it.
Quoted 1 line
I meant you can't have recommendations in features and config.
Sure. There is none.
Quoted 7 lines
What's more,
assuming you have two generations of devicegen1: features x,y
gen2: features x,y,zYou won't be able to do migration between gen1 and gen2 without mediation.
Gen1 can easily migrate to gen2, because gen1 has smaller subset than gen2. When gen2 device is composed, feature z is disabled.
Gen2 to gen1 migration can do software-based migration anyway or through mediation.
But because gen2 may need to migrate to gen1, hence gen2 to gen2 migration also should be done through mediation, doesn’t make sense to me.
Quoted 11 lines
Such technologies have been used by cpu features for years. I am not sure why it became a problem for you.
Quoted 1 line
Apart from it some of the PCI device layout compat checks will be covered
too.
Quoted 6 lines
Quoted 4 lines
And what you proposed is to allow the management to know the exact hardware layout in order to check the compatibility? And the management needs to evolve as new structures are added.
Mostly not mgmt stack may not need to evolve a lot.
Because most layouts should be growing within the device context and not at
Quoted 9 lines
the PCI capabilities etc area.
Quoted 2 lines
And even if it does, its fine as large part of it standard PCI spec definitions.
So as mentioned in another thread, this is a PCI specific solution:
1) feature and config are basic virtio facility
2) capability is not but specific to PCI transport
So any LM solution will have transport specific checks and virtio level checks.
Quoted 2 lines
Checking PCI capability layout in the virtio management is a layer violation which can't work for future transport like SIOV or adminq.
Virtio management that will have transport level checks is not a violation. SIOV will define its own transport anyway. Not to mix with ccw/mmio or pci.
Quoted 3 lines
Management should only see virtio device otherwise the solution becomes transport specific.
Solution needs to cover transport as well as transport is integral part of the virtio spec. Each transport layer will implement feature/config/cap in its own way.
Quoted 30 lines
Quoted 19 lines
Quoted 4 lines
This complicates the work of
management's furtherly which I'm not sure it can work.Well, once we work towards it, it can work. :)
Quoted 13 lines
Quoted 13 lines
Quoted 4 lines
Hypervisor needs to start from a mediation method and do BAR assignment only when possible.
Not necessarily.
Quoted 7 lines
Quoted 2 lines
Cons:
a. More AQ commands work in swNote that this needs to be done on top of the transport virtqueue. And we need to carefully design the command sets since they could be mutually exclusive.
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
Not sure what more to expect out of transport virtqueue compared to AQ. I didn’t follow, which part could be mutually exclusive?
Transport VQ allows a modern device to be transported via adminq.
May be for devices it can work. Hypervisor mediation with CC on horizon for
new capabilities is being reduced.
Quoted 4 lines
So we don’t see transport vq may not be path forward.
Quoted 2 lines
And you want to add commands to transport for legacy devices.
Quoted 9 lines
Quoted 5 lines
Yes only legacy emulation who do not care about hypervisor mediation.
Quoted 2 lines
Can a driver use both the modern transport commands as well as the legacy transport commands?
Hard to answer, I likely do not understand as driver namespace is unclear.
Things might be simplified if we use separate queues for admin, transport and legacy.
Do you mean say we have three AQs, AQ_1, AQ_2, and AQ_3;AQ_1 of the PF used by admin work as SIOV device create, SRIOV MSIX configuration. AQ_2 of the PF used for transporting legacy config access of the PCI VF AQ_3 of the PF for some transport work.
If yes, sounds find to me.
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 9 lines · Parav Pandit
Quoted 3 lines
Things might be simplified if we use separate queues for admin, transport and legacy.
Do you mean say we have three AQs,
AQ_1,AQ_2, andAQ_3;AQ_1of the PF used by admin work as SIOV device create, SRIOV MSIX configuration.AQ_2of the PF used for transporting legacy config access of the PCI VFAQ_3of the PF for some transport work.If yes, sounds find to me.
Latest proposal simply leaves the split between AQs up to the driver. Seems the most flexible.
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 10 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, April 17, 2023 4:27 PMQuoted 5 lines · Parav Pandit
Quoted 3 lines
Things might be simplified if we use separate queues for admin, transport and legacy.
Do you mean say we have three AQs,
AQ_1,AQ_2, andAQ_3;AQ_1of the PF used by admin work as SIOV device create, SRIOV MSIXconfiguration.
Quoted 8 lines
Quoted 5 lines
AQ_2of the PF used for transporting legacy config access of the PCI VFAQ_3of the PF for some transport work.If yes, sounds find to me.
Latest proposal simply leaves the split between AQs up to the driver. Seems the most flexible.
Yes. It is. Different opcode range and multiple AQs enable to do so.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 15 lines · Parav Pandit
Quoted 15 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, April 17, 2023 4:27 PMQuoted 5 lines · Parav Pandit
Quoted 3 lines
Things might be simplified if we use separate queues for admin, transport and legacy.
Do you mean say we have three AQs,
AQ_1,AQ_2, andAQ_3;AQ_1of the PF used by admin work as SIOV device create, SRIOV MSIXconfiguration.
Quoted 4 lines
AQ_2of the PF used for transporting legacy config access of the PCI VFAQ_3of the PF for some transport work.
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
If yes, sounds find to me.
Latest proposal simply leaves the split between AQs up to the driver. Seems the most flexible.
Yes. It is. Different opcode range and multiple AQs enable to do so.
Right, so it would be some facility that makes the transport commands of modern and legacy are mutually exclusive.
Thanks
Quoted 8 lines
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Quoted 9 lines
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 13 lines
From: Jason Wang <[email protected]>
Sent: Monday, April 17, 2023 8:37 PMQuoted 8 lines
Quoted 8 lines
Quoted 3 lines
Do you mean say we have three AQs,
AQ_1,AQ_2, andAQ_3;AQ_1of the PF used by admin work as SIOV device create, SRIOV MSIXconfiguration.
Quoted 4 lines
AQ_2of the PF used for transporting legacy config access of the PCI VFAQ_3of the PF for some transport work.
Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
If yes, sounds find to me.
Latest proposal simply leaves the split between AQs up to the driver. Seems the most flexible.
Yes. It is. Different opcode range and multiple AQs enable to do so.
Right, so it would be some facility that makes the transport commands of modern and legacy are mutually exclusive.
Ok. I didn’t follow the mutual exclusion part.
If a device has exposed legacy interface it will have to transport legacy access via its PF. Same device can be transitional, and its 1.x interface doesn’t need to through this transport channel of PF, right?
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 17 lines · Parav Pandit
Quoted 17 lines
From: Jason Wang <[email protected]>
Sent: Monday, April 17, 2023 8:37 PMQuoted 12 lines
Quoted 12 lines
Quoted 3 lines
Do you mean say we have three AQs,
AQ_1,AQ_2, andAQ_3;AQ_1of the PF used by admin work as SIOV device create, SRIOV MSIXconfiguration.
Quoted 5 lines
AQ_2of the PF used for transporting legacy config access of the PCI VFAQ_3of the PF for some transport work.If yes, sounds find to me.
Latest proposal simply leaves the split between AQs up to the driver. Seems the most flexible.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Yes. It is. Different opcode range and multiple AQs enable to do so.
Right, so it would be some facility that makes the transport commands of modern and legacy are mutually exclusive.
Ok. I didn’t follow the mutual exclusion part.
If a device has exposed legacy interface it will have to transport legacy access via its PF. Same device can be transitional, and its 1.x interface doesn’t need to through this transport channel of PF, right?
I think in any case, using device through two transports at the same time shouldn't be legal.
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 6 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, April 18, 2023 7:58 AMI think in any case, using device through two transports at the same time shouldn't be legal.
PCI is the transport.
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 8 lines · Parav Pandit
Quoted 6 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, April 18, 2023 7:58 AMI think in any case, using device through two transports at the same time shouldn't be legal.
PCI is the transport.
... and AQ can be a transport too :)
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 11 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, April 18, 2023 8:31 AMQuoted 5 lines
Quoted 3 lines
I think in any case, using device through two transports at the same time shouldn't be legal.
PCI is the transport.
... and AQ can be a transport too :)
AQ is on top of the PCI transport. :)
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
In reply to Parav PanditQuoted 24 lines · Parav Pandit
Quoted 13 lines
From: Jason Wang <[email protected]>
Sent: Sunday, April 16, 2023 11:23 PMQuoted 6 lines · Parav Pandit
Quoted 5 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 11:38 PMQuoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
1) spec doesn't enforce the size of a specific structure
Spec will be extended in coming time.
It's too late to do any new restriction without introducing a flag.
We are really diverging from the topic.
I don’t think it is late. The work in this area of PCI VF has not even begun fully.I meant it needs a new feature flag.
Ok.
Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
Mandating size may easily end up with a architecte specific solution.
Unlikely. Other standard device types are also expanding this way.
I think we are talking about software technologies instead of device design here.
Isn't the size of BAR and its
cap_lenexposed by the device?
Somehow, it's more about how the hypervisor is going to use this, memory mapped or trapping. For either case, the hypervisor needs to have virtio knowledge in order to finish this.
Quoted 6 lines
Quoted 4 lines
For devices it works.But for hypervisor, it needs to deal with the size that doesn't match arch's page size.
PCI BAR size of the VF can learn the system page size being different for x86 (4K) and arm (64K). PCI transport seems to support it.
Yes this is for SR-IOV but not for other cases. We could invent new facilities for sure but the hypervisor can not have this assumption.
Quoted 5 lines
PCI PF on bare-metal has to understand the highest page size anyway if for some reason bare-metal host wants to map this PF to the VM.
A hypevisor mediating and emulating needs to learn the system page size anyway. If underlying device page size is smaller, hypevisor may end up mediating it.
Exactly. So what I want to say is, for whatever case, a hypervisor needs to have virtio knowledge in order to achieve these.
Quoted 7 lines
Quoted 2 lines
I meant you can't have recommendations in features and config.
Sure. There is none.
Quoted 3 lines
What's more,
assuming you have two generations of device
Quoted 6 lines
Quoted 4 lines
gen1: features x,y
gen2: features x,y,zYou won't be able to do migration between gen1 and gen2 without mediation.
Gen1 can easily migrate to gen2, because gen1 has smaller subset than gen2. When gen2 device is composed, feature z is disabled.
Sure, but this requires a lot of features that do not exist in the spec. E.g it assumes the device could be composed on demand which seems to fit the idea of transport virtqueue. So it adds dependencies for migration where a simple mediation could be used to solve this without bothering the spec.
Quoted 3 lines
Gen2 to gen1 migration can do software-based migration anyway or through mediation.
But because gen2 may need to migrate to gen1, hence gen2 to gen2 migration also should be done through mediation, doesn’t make sense to me.
It really depends on the design:
1) if you want to expose any features that is done by admin virtqueue to a guest, mediation is a must (e.g if you want do live migration for L1)
2) mediation is a must for the idea of transport virtqueue
Quoted 14 lines
Quoted 14 lines
Such technologies have been used by cpu features for years. I am not sure why it became a problem for you.
Quoted 1 line
Apart from it some of the PCI device layout compat checks will be covered
too.
Quoted 6 lines
Quoted 4 lines
And what you proposed is to allow the management to know the exact hardware layout in order to check the compatibility? And the management needs to evolve as new structures are added.
Mostly not mgmt stack may not need to evolve a lot.
Because most layouts should be growing within the device context and not atthe PCI capabilities etc area.
Quoted 1 line
Quoted 8 lines
Quoted 7 lines
Quoted 1 line
And even if it does, its fine as large part of it standard PCI spec definitions.
So as mentioned in another thread, this is a PCI specific solution:
1) feature and config are basic virtio facility
2) capability is not but specific to PCI transportSo any LM solution will have transport specific checks and virtio level checks.
So here's the model that is used by Qemu currently:
1) Device is emulated, it's the charge of the libvirt to launch Qemu and present a stable ABI for guests.
2) Datapath doesn't need to care about the hardware details since the hardware layout is invisible from guest
You can see, it's more than sufficient for libvirt to check features/config space, it doesn't need to care about the hardware BAR layout. Migration is much easier in this way. And we can use transport other than PCI in the guest in this case for live migration.
Quoted 11 lines
Quoted 3 lines
Checking PCI capability layout in the virtio management is a layer violation which can't work for future transport like SIOV or adminq.
Virtio management that will have transport level checks is not a violation. SIOV will define its own transport anyway. Not to mix with ccw/mmio or pci.
Quoted 3 lines
Management should only see virtio device otherwise the solution becomes transport specific.
Solution needs to cover transport as well as transport is integral part of the virtio spec. Each transport layer will implement feature/config/cap in its own way.
If we can avoid those hardware details to be checked, we should not go for that. It's a great ease of the management layer.
Thanks
Quoted 40 lines
Quoted 31 lines
Quoted 20 lines
Quoted 5 lines
This complicates the work of
management's furtherly which I'm not sure it can work.Well, once we work towards it, it can work. :)
Quoted 13 lines
Quoted 13 lines
Quoted 4 lines
Hypervisor needs to start from a mediation method and do BAR assignment only when possible.
Not necessarily.
Quoted 7 lines
Quoted 2 lines
Cons:
a. More AQ commands work in swNote that this needs to be done on top of the transport virtqueue. And we need to carefully design the command sets since they could be mutually exclusive.
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
Not sure what more to expect out of transport virtqueue compared to AQ. I didn’t follow, which part could be mutually exclusive?
Transport VQ allows a modern device to be transported via adminq.
May be for devices it can work. Hypervisor mediation with CC on horizon for
new capabilities is being reduced.
Quoted 4 lines
So we don’t see transport vq may not be path forward.
Quoted 2 lines
And you want to add commands to transport for legacy devices.
Quoted 9 lines
Quoted 5 lines
Yes only legacy emulation who do not care about hypervisor mediation.
Quoted 2 lines
Can a driver use both the modern transport commands as well as the legacy transport commands?
Hard to answer, I likely do not understand as driver namespace is unclear.
Things might be simplified if we use separate queues for admin, transport and legacy.
Quoted 6 lines
Do you mean say we have three AQs,
AQ_1,AQ_2, andAQ_3;AQ_1of the PF used by admin work as SIOV device create, SRIOV MSIX configuration.AQ_2of the PF used for transporting legacy config access of the PCI VFAQ_3of the PF for some transport work.If yes, sounds find to me.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 11 lines
From: Jason Wang <[email protected]>
Sent: Monday, April 17, 2023 9:02 PMQuoted 1 line
Isn't the size of BAR and its
cap_lenexposed by the device?Somehow, it's more about how the hypervisor is going to use this, memory mapped or trapping. For either case, the hypervisor needs to have virtio knowledge in order to finish this.
Ok.
Quoted 7 lines
Quoted 1 line
PCI BAR size of the VF can learn the system page size being different for x86
(4K) and arm (64K).
Quoted 1 line
PCI transport seems to support it.
Yes this is for SR-IOV but not for other cases. We could invent new facilities for sure but the hypervisor can not have this assumption.
Yeah, its not assumption.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
assuming you have two generations of device
gen1: features x,y
gen2: features x,y,z
Quoted 8 lines
Quoted 1 line
Quoted 1 line
You won't be able to do migration between gen1 and gen2 without
mediation.
Quoted 2 lines
Gen1 can easily migrate to gen2, because gen1 has smaller subset than gen2. When gen2 device is composed, feature z is disabled.
Sure, but this requires a lot of features that do not exist in the spec. E.g it assumes the device could be composed on demand which seems to fit the idea of transport virtqueue.
I don’t see how transport vq is related.
A device could be composed as PCI VF, PCI SIOV or something else. Underlying transport will tell how it is composed.
May be underlying transport is a transport VQ, but that is not the only transport.
Quoted 3 lines
So it adds dependencies for migration where a simple mediation could be used to solve this without bothering the spec.
Mediation of PF and hypervisor is not encouraged anymore as we move towards the CC.
So may be some system will do, but as we have the PCI VFs, there is clear need for non-mediated 1.x devices for such guest VMs. For legacy kernel mediation is acceptable as there is no CC infrastructure in place on older systems.
Quoted 4 lines
Quoted 2 lines
Gen2 to gen1 migration can do software-based migration anyway or through
mediation.
Quoted 1 line
But because gen2 may need to migrate to gen1, hence gen2 to gen2 migration
Quoted 9 lines
also should be done through mediation, doesn’t make sense to me.
It really depends on the design:
1) if you want to expose any features that is done by admin virtqueue to a guest, mediation is a must (e.g if you want do live migration for L1)
2) mediation is a must for the idea of transport virtqueue
Yes. So both transport options are there.
A PCI VF that doesn’t legacy baggage will be just fine without a mediation.
For some reason, if one wants to have mediation, may be there is some option of such new transport. But such transport cannot be the only transport.
Quoted 14 lines
Quoted 6 lines
Quoted 5 lines
So as mentioned in another thread, this is a PCI specific solution:
1) feature and config are basic virtio facility
2) capability is not but specific to PCI transportSo any LM solution will have transport specific checks and virtio level checks.
So here's the model that is used by Qemu currently:
1) Device is emulated, it's the charge of the libvirt to launch Qemu and present a stable ABI for guests.
2) Datapath doesn't need to care about the hardware details since the hardware layout is invisible from guest
Quoted 5 lines
You can see, it's more than sufficient for libvirt to check features/config space, it doesn't need to care about the hardware BAR layout. Migration is much easier in this way. And we can use transport other than PCI in the guest in this case for live migration.
Sure works in some use cases.
But it is not the only way to operate it as I explained above where there is requirement to not have mediation for non_legacy interface.
Quoted 6 lines
Quoted 1 line
Solution needs to cover transport as well as transport is integral part of the
virtio spec.
Quoted 1 line
Each transport layer will implement feature/config/cap in its own way.
If we can avoid those hardware details to be checked, we should not go for that. It's a great ease of the management layer.
Those are mainly RO checks and cheap too. It largely does not involved in the LM or data path flow either.
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
In reply to Jason WangQuoted 5 lines · Jason Wang
Quoted 2 lines
For LM BAR length and number should be same between two PCI VFs. But its orthogonal to this point. Such checks will be done anyway.
Quoted the wrong sections, I think it should be:
Quoted 9 lines
"
length MAY include padding, or fields unused by the driver, or future extensions. Note: 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 MAY limit the mapped structure size to e.g. 4KBytes (thus ignoring parts of structure after the first 4KBytes) to allow forward compatibility with such devices without loss of functionality and without wasting resources. "
yes. This is the one.
Quoted 3 lines
If it's a transitional device but not placed at BAR0, it might have side effects for Linux drivers which assumes BAR0 for legacy.
True. Transitional can be at BAR0.
Quoted 6 lines
I don't see how easy it could be a non transitional device:
"
Devices or drivers with no legacy compatibility are referred to as non-transitional devices and drivers, respectively.
"
Michael has suggested rewording of the text. It is anyway new text so lets park it aside for now. It is mostly tweaking the text.
Quoted 8 lines
Quoted 8 lines
device can expose this optional capability and its attached MMIO region.
Spec changes are similar to #2.
Quoted 4 lines
- non trivial spec changes which ends up of the tricky cases that tries to workaround legacy to fit for a hardware implementation
- work only for the case of virtualization with the help of meditation, can't work for bare metal
Quoted 6 lines
Quoted 2 lines
For bare-metal PFs usually thin hypervisors are used that does very minimal setup. But I agree that bare-metal is relatively less important.
This is not what I understand. I know several vendors that are using virtio devices for bare metal.
I was saying the case for legacy bare metal is less of a problem because PCIe does not limit functionality, perf is still limited due to IOBAR.
Quoted 18 lines
Quoted 10 lines
Quoted 3 lines
- only work for some specific archs without SVQ
That is the legacy limitation that we don't worry about.
Quoted 4 lines
2) allow BAR0 to be MMIO for transitional device
Pros:
- very minor change for the specSpec changes wise they are similar to #1.
This is different since the changes for this are trivial.
Quoted 4 lines
Quoted 2 lines
- work for virtualization (and it work even without dedicated mediation for some setups)
I am not aware where can it work without mediation. Do you know any specific kernel version where it actually works?
Quoted 7 lines
E.g current Linux driver did:
rc =
pci_request_region(pci_dev, 0, "virtio-pci-legacy");It doesn't differ from I/O with memory. It means if you had a "transitional" device with legacy MMIO BAR0, it just works.
Thanks to the abstract PCI API in Linux.
Quoted 16 lines
Quoted 16 lines
Quoted 5 lines
- work for bare metal for some setups (without mediation) Cons:
- only work for some specific archs without SVQ
- BAR0 is requiredBoth are not limitation as they are mainly coming from the legacy side of things.
Quoted 8 lines
3) modern device mediation for legacy
Pros:
- no changes in the spec
Cons:
- require mediation layer in order to work in bare metal
- require datapath mediation like SVQ to work for virtualization
Quoted 9 lines
Quoted 2 lines
Spec change is still require for net and blk because modern device do not understand legacy, even with mediation layer.
That's fine and easy since we work on top of modern devices.
Quoted 1 line
FEATURE_1, RW cap via CVQ which is not really owned by the hypervisor.Hypervisors can trap if they wish.
Trapping non legacy accessing for 1.x doesn't make sense.
Quoted 4 lines
Quoted 1 line
A guest may be legacy or non legacy, so mediation shouldn't be always done.
Yes, so mediation can work only if we found it's a legacy driver.
Mediation will be done only for legacy accesses without cvq, rest will go as-is without any cvq and other mediation.
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Compared to method 2) the only advantages of method 1) is the flexibility of BAR0 but it has too many disadvantages. If we only care about virtualization, modern devices are sufficient. Then why bother for that?
Quoted 7 lines
Quoted 4 lines
So that a single stack which doesn't always have the knowledge of which driver version is running is guest can utilize it. Otherwise 1.x also end up doing mediation when guest driver = 1.x and device = transitional PCI VF.
I don't see how this can be solved in your proposal.
This proposal only traps the legacy accesses and doesnt require other giant framework.
I think we can make the BAR0 work for transitional with spec change and with optional notification region. I am evaluating further.
Quoted 14 lines
Quoted 3 lines
so (1) and (2) both are equivalent, one is more flexible, if you know more valid cases where BAR0 as MMIO can work
as_is, such option is open.As said in previous threads, this has been used by several vendors for years.
E.g I have a handy transitional hardware virtio device that has:
Region 0: Memory at f5ff0000 (64-bit, prefetchable) [size=8K] Region 2: Memory at f5fe0000 (64-bit, prefetchable) [size=4K] Region 4: Memory at f5800000 (64-bit, prefetchable) [size=4M]And:
Quoted 12 lines
Capabilities: [64] Vendor Specific Information: VirtIO: CommonCfg
BAR=0 offset=00000888 size=00000078
Capabilities: [74] Vendor Specific Information: VirtIO: Notify
BAR=0 offset=00001800 size=00000020 multiplier=00000000
Capabilities: [88] Vendor Specific Information: VirtIO: ISR
BAR=0 offset=00000820 size=00000020
Capabilities: [98] Vendor Specific Information: VirtIO: DeviceCfg
BAR=0 offset=00000840 size=00000020Quoted 3 lines
We can draft the spec that MMIO BAR SHOULD be exposes in BAR0.
Yes, above one.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 7 lines · Parav Pandit
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
- work for virtualization (and it work even without dedicated mediation for some setups)
I am not aware where can it work without mediation. Do you know any specific kernel version where it actually works?
E.g current Linux driver did:
Quoted 7 lines
Quoted 5 lines
rc =
pci_request_region(pci_dev, 0, "virtio-pci-legacy");It doesn't differ from I/O with memory. It means if you had a "transitional" device with legacy MMIO BAR0, it just works.
Thanks to the abstract PCI API in Linux.
Right. I do however at least see the point of what Jason is proposing, which is to enable some legacy guests without mediation in software.
This thing ... you move some code to the card and reduce the amount of virtio knowledge in software but do not eliminate it completely. Seems kind of pointless. Minimal hardware changes make more sense to me, I'd say. Talking about that, what is a minimal hardware change to allow a vdpa based solution?
I think that's VIRTIO_NET_F_LEGACY_HEADER, right?
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 7 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, April 13, 2023 5:02 PMThis thing ... you move some code to the card and reduce the amount of virtio knowledge in software but do not eliminate it completely.
Sure. Practically there is no knowledge other than transporting like a vxlan encapsulating, here its AQ.
Quoted 4 lines
Seems kind of pointless. Minimal hardware changes make more sense to me, I'd say. Talking about that, what is a minimal hardware change to allow a vdpa based solution?
I think that'sVIRTIO_NET_F_LEGACY_HEADER, right?
The main requirement/point is that there is virito PCI VF that to be mapped to the guest VM. Hence, there is no vdpa type of hypervisor layer exists in this use case.
This same VF need to be transitional as the guest kernel may not be known.
hence sometimes vdpa sometime regular 1.x VF is not an option.
Hence for next few years, transitional VF will be plugged in into the guest VM when user is using the PCI VF devices.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 14 lines · Parav Pandit
Quoted 8 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, April 13, 2023 5:02 PMThis thing ... you move some code to the card and reduce the amount of virtio knowledge in software but do not eliminate it completely.
Sure. Practically there is no knowledge other than transporting like a vxlan encapsulating, here its AQ.
Quoted 4 lines
Seems kind of pointless. Minimal hardware changes make more sense to me, I'd say. Talking about that, what is a minimal hardware change to allow a vdpa based solution?
I think that'sVIRTIO_NET_F_LEGACY_HEADER, right?
I think it is. It would be much easier if we do this.
Quoted 3 lines
The main requirement/point is that there is virito PCI VF that to be mapped to the guest VM. Hence, there is no vdpa type of hypervisor layer exists in this use case.
It's about mediation which is a must for things like legacy. If there's a way that helps the vendor to get rid of the tricky legacy completely, then why not?
Quoted 4 lines
This same VF need to be transitional as the guest kernel may not be known.
hence sometimes vdpa sometime regular 1.x VF is not an option.
Hence for next few years, transitional VF will be plugged in into the guest VM when user is using the PCI VF devices.
I'm not sure I get this. With VIRTIO_NET_F_LEGACY_HEADER, we don't need mediation for datapath. For the control path, mediation is a must for legacy and it's very easy to keep it work for modern, what's wrong with that?
Thanks
Quoted 8 lines
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Quoted 9 lines
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 7 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 10:37 PMI'm not sure I get this. With
VIRTIO_NET_F_LEGACY_HEADER, we don't need mediation for datapath. For the control path, mediation is a must for legacy and it's very easy to keep it work for modern, what's wrong with that?
There is virtio PCI VF.
The user who attaches this VF to the VM, it doesn’t know if its guest is to run legacy driver or 1.x Hence hypervisor doesn’t want to run special stack when guest may (likely) be 1.x and device also supports 1.x.
Therefore, MMIO BAR 0 emulation is better solution in this use case without any mediation.
The current specification claim that transitional device "works", hence it is fine to extend BAR0 to be of MMIO type instead of IO type.
In some other cases control path or additional other mediation can be done.
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 8 lines · Parav Pandit
Quoted 7 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 10:37 PMI'm not sure I get this. With
VIRTIO_NET_F_LEGACY_HEADER, we don't need mediation for datapath. For the control path, mediation is a must for legacy and it's very easy to keep it work for modern, what's wrong with that?
Quoted 8 lines
There is virtio PCI VF.
The user who attaches this VF to the VM, it doesn’t know if its guest is to run legacy driver or 1.x Hence hypervisor doesn’t want to run special stack when guest may (likely) be 1.x and device also supports 1.x.Therefore, MMIO BAR 0 emulation is better solution in this use case without any mediation.
The current specification claim that transitional device "works", hence it is fine to extend BAR0 to be of MMIO type instead of IO type.In some other cases control path or additional other mediation can be done.
Do you refer to the trick Jason proposed where BAR0 is memory but otherwise matches legacy BAR0 exactly? Is this your preferred solution at this point then?
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 6 lines
From: [email protected] <[email protected] open.org> On Behalf Of Michael S. Tsirkin
Sent: Friday, April 14, 2023 2:57 AMDo you refer to the trick Jason proposed where BAR0 is memory but otherwise matches legacy BAR0 exactly? Is this your preferred solution at this point then?
We look at it again.
Above solution can work reliably only for a very small number of PF and that too with very special hardware circuitry due to the reset flow.
Therefore, for virtualization below interface is preferred.
a. For transitional device legacy configuration register transport over AQ, Notification to utilize transitional device notification area of the BAR.
b. Non legacy interface of transitional and non-transitional PCI device to access direct PCI device without mediation.
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 4 lines · Parav Pandit
Quoted 3 lines
From: [email protected] <[email protected] open.org> On Behalf Of Michael S. Tsirkin
Sent: Friday, April 14, 2023 2:57 AM
Quoted 8 lines
Quoted 2 lines
Do you refer to the trick Jason proposed where BAR0 is memory but otherwise matches legacy BAR0 exactly? Is this your preferred solution at this point then?
We look at it again.
Above solution can work reliably only for a very small number of PF and that too with very special hardware circuitry due to the reset flow.Therefore, for virtualization below interface is preferred.
a. For transitional device legacy configuration register transport over AQ,
I don't get what this has to do with transitional ...
Quoted 1 line
Notification to utilize transitional device notification area of the BAR.
The vq transport does something like this, no?
Quoted 1 line
b. Non legacy interface of transitional and non-transitional PCI device to access direct PCI device without mediation.
So VF can either be accessed through AQ of PF, or through direct mapping?
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 16 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, April 16, 2023 4:44 PMQuoted 7 lines · Parav Pandit
Quoted 7 lines
From: [email protected] <[email protected] open.org> On Behalf Of Michael S. Tsirkin
Sent: Friday, April 14, 2023 2:57 AMDo you refer to the trick Jason proposed where BAR0 is memory but otherwise matches legacy BAR0 exactly? Is this your preferred solution at
this point then?
Quoted 3 lines
We look at it again.
Above solution can work reliably only for a very small number of PF and that
Quoted 8 lines
too with very special hardware circuitry due to the reset flow.
Quoted 4 lines
Therefore, for virtualization below interface is preferred. a. For transitional device legacy configuration register transport over AQ,
I don't get what this has to do with transitional ...
Typically, in current wordings, transitional is the device that supports legacy interface. So, it doesn't have to be for the transitional.
I just wanted to highlight that a PCI VF device with its parent PCI PF device can transport the legacy interface commands.
Quoted 4 lines
Quoted 1 line
Notification to utilize transitional device notification area of the BAR.
The vq transport does something like this, no?
Notifications over a queuing interface unlikely can be a performant interface because one is configuration task and other is data path task.
Quoted 4 lines
Quoted 1 line
b. Non legacy interface of transitional and non-transitional PCI device to
access direct PCI device without mediation.
So VF can either be accessed through AQ of PF, or through direct mapping?
Right. VF to access legacy registers using AQ of PF and continue non-legacy registers using direct mapping as done today.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 28 lines · Parav Pandit
Quoted 17 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, April 16, 2023 4:44 PMQuoted 7 lines · Parav Pandit
Quoted 7 lines
From: [email protected] <[email protected] open.org> On Behalf Of Michael S. Tsirkin
Sent: Friday, April 14, 2023 2:57 AMDo you refer to the trick Jason proposed where BAR0 is memory but otherwise matches legacy BAR0 exactly? Is this your preferred solution at
this point then?
Quoted 3 lines
We look at it again.
Above solution can work reliably only for a very small number of PF and thatQuoted 8 lines
too with very special hardware circuitry due to the reset flow.
Quoted 4 lines
Therefore, for virtualization below interface is preferred. a. For transitional device legacy configuration register transport over AQ,
I don't get what this has to do with transitional ...
Typically, in current wordings, transitional is the device that supports legacy interface. So, it doesn't have to be for the transitional.
Quoted 7 lines
I just wanted to highlight that a PCI VF device with its parent PCI PF device can transport the legacy interface commands.
Quoted 4 lines
Quoted 1 line
Notification to utilize transitional device notification area of the BAR.
The vq transport does something like this, no?
Notifications over a queuing interface unlikely can be a performant interface because one is configuration task and other is data path task.
Note that current transport virtqueue only allows the notification via MMIO. It introduces a command to get the address of the notification area.
Thanks
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
b. Non legacy interface of transitional and non-transitional PCI device to
access direct PCI device without mediation.
So VF can either be accessed through AQ of PF, or through direct mapping?
Right. VF to access legacy registers using AQ of PF and continue non-legacy registers using direct mapping as done today.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 8 lines
From: Jason Wang <[email protected]>
Sent: Monday, April 17, 2023 9:09 PMNote that current transport virtqueue only allows the notification via MMIO. It introduces a command to get the address of the notification area.
Notifications via MMIO is the obvious choice. Command is also fine to convey that.
I haven’t seen the transport VQ proposal. Do you have pointer to it?
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
In reply to Jason WangQuoted 9 lines · Jason Wang
Quoted 8 lines · Parav Pandit
Quoted 8 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Thursday, April 13, 2023 5:02 PMThis thing ... you move some code to the card and reduce the amount of virtio knowledge in software but do not eliminate it completely.
Quoted 8 lines
Quoted 6 lines
Sure. Practically there is no knowledge other than transporting like a vxlan encapsulating, here its AQ.
Quoted 4 lines
Seems kind of pointless. Minimal hardware changes make more sense to me, I'd say. Talking about that, what is a minimal hardware change to allow a vdpa based solution?
I think that'sVIRTIO_NET_F_LEGACY_HEADER, right?I think it is. It would be much easier if we do this.
It does not look like Parav is interested in this approach but if you like it feel free to propose it.
Quoted 13 lines
Quoted 3 lines
The main requirement/point is that there is virito PCI VF that to be mapped to the guest VM. Hence, there is no vdpa type of hypervisor layer exists in this use case.
It's about mediation which is a must for things like legacy. If there's a way that helps the vendor to get rid of the tricky legacy completely, then why not?
Quoted 4 lines
This same VF need to be transitional as the guest kernel may not be known.
hence sometimes vdpa sometime regular 1.x VF is not an option.
Hence for next few years, transitional VF will be plugged in into the guest VM when user is using the PCI VF devices.
Quoted 14 lines
I'm not sure I get this. With
VIRTIO_NET_F_LEGACY_HEADER, we don't need mediation for datapath. For the control path, mediation is a must for legacy and it's very easy to keep it work for modern, what's wrong with that?Thanks
Quoted 7 lines
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
In reply to Parav PanditQuoted 73 lines · Parav Pandit
Quoted 5 lines · Jason Wang
Quoted 2 lines
For LM BAR length and number should be same between two PCI VFs. But its orthogonal to this point. Such checks will be done anyway.
Quoted the wrong sections, I think it should be:
Quoted 9 lines
"
length MAY include padding, or fields unused by the driver, or future extensions. Note: 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 MAY limit the mapped structure size to e.g. 4KBytes (thus ignoring parts of structure after the first 4KBytes) to allow forward compatibility with such devices without loss of functionality and without wasting resources. "yes. This is the one.
Quoted 3 lines
If it's a transitional device but not placed at BAR0, it might have side effects for Linux drivers which assumes BAR0 for legacy.
True. Transitional can be at BAR0.
Quoted 6 lines
I don't see how easy it could be a non transitional device:
"
Devices or drivers with no legacy compatibility are referred to as non-transitional devices and drivers, respectively.
"Michael has suggested rewording of the text. It is anyway new text so lets park it aside for now. It is mostly tweaking the text.
Quoted 8 lines
Quoted 8 lines
device can expose this optional capability and its attached MMIO region.
Spec changes are similar to #2.
Quoted 4 lines
- non trivial spec changes which ends up of the tricky cases that tries to workaround legacy to fit for a hardware implementation
- work only for the case of virtualization with the help of meditation, can't work for bare metalQuoted 6 lines
Quoted 2 lines
For bare-metal PFs usually thin hypervisors are used that does very minimal setup. But I agree that bare-metal is relatively less important.
This is not what I understand. I know several vendors that are using virtio devices for bare metal.
I was saying the case for legacy bare metal is less of a problem because PCIe does not limit functionality, perf is still limited due to IOBAR.
Quoted 20 lines
Quoted 10 lines
Quoted 3 lines
- only work for some specific archs without SVQ
That is the legacy limitation that we don't worry about.
Quoted 4 lines
2) allow BAR0 to be MMIO for transitional device
Pros:
- very minor change for the specSpec changes wise they are similar to #1.
This is different since the changes for this are trivial.
Quoted 4 lines
Quoted 2 lines
- work for virtualization (and it work even without dedicated mediation for some setups)
I am not aware where can it work without mediation. Do you know any specific kernel version where it actually works?
E.g current Linux driver did:
Quoted 7 lines
Quoted 5 lines
rc =
pci_request_region(pci_dev, 0, "virtio-pci-legacy");It doesn't differ from I/O with memory. It means if you had a "transitional" device with legacy MMIO BAR0, it just works.
Thanks to the abstract PCI API in Linux.
And this (legacy MMIO bar) has been supported by DPDK as well for a while.
Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Quoted 6 lines
- work for bare metal for some setups (without mediation) Cons:
- only work for some specific archs without SVQ
- BAR0 is requiredBoth are not limitation as they are mainly coming from the legacy side of things.
Quoted 8 lines
3) modern device mediation for legacy
Pros:
- no changes in the spec
Cons:
- require mediation layer in order to work in bare metal
- require datapath mediation like SVQ to work for virtualizationSpec change is still require for net and blk because modern device do not understand legacy, even with mediation layer.
Quoted 7 lines
Quoted 6 lines
That's fine and easy since we work on top of modern devices.
Quoted 1 line
FEATURE_1, RW cap via CVQ which is not really owned by the hypervisor.Hypervisors can trap if they wish.
Trapping non legacy accessing for 1.x doesn't make sense.
Actually not, I think I've mentioned the reason for several times:
It's a must for ABI and migration compatibility:
1) The offset is not necessarily a page boundary
2) The length is not necessarily times of a PAGE_SIZE
3) PAGE_SIZE varies among different archs
4) Two vendors may have two different layout for the structure
Thanks
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 6 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 11:09 PM
Quoted 8 lines
Actually not, I think I've mentioned the reason for several times:
It's a must for ABI and migration compatibility:
1) The offset is not necessarily a page boundary
2) The length is not necessarily times of aPAGE_SIZE
3)PAGE_SIZEvaries among different archs
4) Two vendors may have two different layout for the structure
Migration compatibility check and device composition work will start for regular PCI VF in virtio. Two vendors will had some level of programmability as well to make this happen.
It is orthogonal topic.
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 11 lines · Parav Pandit
Quoted 11 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 11:09 PMActually not, I think I've mentioned the reason for several times:
It's a must for ABI and migration compatibility:
Quoted 8 lines
Quoted 4 lines
1) The offset is not necessarily a page boundary
2) The length is not necessarily times of aPAGE_SIZE
3)PAGE_SIZEvaries among different archs
4) Two vendors may have two different layout for the structureMigration compatibility check and device composition work will start for regular PCI VF in virtio. Two vendors will had some level of programmability as well to make this happen.
It is orthogonal topic.
Actually not, having new blockers for live migration will complicate the solution in the future.
And 1) 2) 3) can happen even if we don't care about migration compatibility, no?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 13 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 11:18 PMQuoted 8 lines
Quoted 7 lines
It's a must for ABI and migration compatibility:
1) The offset is not necessarily a page boundary
2) The length is not necessarily times of aPAGE_SIZE
3)PAGE_SIZEvaries among different archs
4) Two vendors may have two different layout for the structure
Quoted 9 lines
Quoted 1 line
Migration compatibility check and device composition work will start for
regular PCI VF in virtio.
Quoted 1 line
Two vendors will had some level of programmability as well to make this
happen.
Quoted 1 line
It is orthogonal topic.
Actually not, having new blockers for live migration will complicate the solution in the future.
It is not a blocker, its just another flexible field that hw vendors will align to a common way to configure.
Just to make sure this is the BAR0 size, right?
Quoted 2 lines
And 1) 2) 3) can happen even if we don't care about migration compatibility, no?
I guess one we have spec definition, it wont be a problem.
Re: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
Quoted 18 lines · Parav Pandit
Quoted 18 lines
From: Jason Wang <[email protected]>
Sent: Thursday, April 13, 2023 11:18 PMQuoted 9 lines
Quoted 7 lines
It's a must for ABI and migration compatibility:
1) The offset is not necessarily a page boundary
2) The length is not necessarily times of aPAGE_SIZE
3)PAGE_SIZEvaries among different archs
4) Two vendors may have two different layout for the structureMigration compatibility check and device composition work will start for
regular PCI VF in virtio.
Quoted 1 line
Two vendors will had some level of programmability as well to make this
happen.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
It is orthogonal topic.
Actually not, having new blockers for live migration will complicate the solution in the future.
It is not a blocker, its just another flexible field that hw vendors will align to a common way to configure.
Just to make sure this is the BAR0 size, right?
We're discussing "if mediating 1.x device is a must" as I reply to what you said:
"
Trapping non legacy accessing for 1.x doesn't make sense. "
Quoted 5 lines
Quoted 3 lines
And 1) 2) 3) can happen even if we don't care about migration compatibility, no?
I guess one we have spec definition, it wont be a problem.
How can you assign a cap length 4K to a guest assuming 8K as page size?
Thanks
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
In reply to Jason WangQuoted 10 lines
From: Jason Wang <[email protected]>
Sent: Tuesday, April 11, 2023 5:02 AMQuoted 2 lines
The point of the capability is to allow using modern device ID so such guests will not even try to bind.
It means a mediation layer is required to use. Then it's not an issue for this simple relaxing any more?
It is desired to for the best performance because the notification 2B is sandwitched by legacy in middle of the configuration registers. So like described in patch-10, a mediation layer will be able to use dedicated notification region.
Secondly, PCI has only effectively 3 BARs.
It is better to reuse one of the existing BAR when possible for the device depending on the features it offered. So better not to hard code to BAR0 always.
Quoted 3 lines
An advantage of such relaxing is that, for the legacy drivers like an ancient Linux version that can already do MMIO access to legacy BAR it can work without any mediation.
May be, such MMIO BAR mapping to user space will need page aligned BAR instead of 32B or 64B (You asked about 4K in other thread).
It is unlikely performant due to intermixing of notification and config registers.
So letting it driven by notification region is better, may be some device can map to the same notification register in middle of the config area.
[virtio-comment] Re: [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers
In reply to Parav PanditQuoted 71 lines · Parav Pandit
Legacy virtio configuration registers and adjacent device configuration registers are located somewhere in a memory BAR.
A new capability supplies the location of these registers which a driver can use to map I/O access to legacy memory mapped registers.
This gives the ability to locate legacy registers in either the existing memory BAR or as completely new BAR at BAR 0.
A below example diagram attempts to depicts it in an existing memory BAR.
+------------------------------+ |Transitional | |MMR SRIOV VF | | | ++---------------+ | ||dev_id = | | ||{0x10f9-0x10ff}| | |+---------------+ | | | ++--------------------+ | || PCIe ext cap = 0xB | | || cfg_type = 10 | | || offset = 0x1000 | | || bar = A {0..5}| | |+--|-----------------+ | | | | | | | | | +-------------------+ | | | | Memory BAR = A | | | | | | | | +------>+--------------+ | | | | |legacy virtio | | | | | |+ dev cfg | | | | | |registers | | | | | +--------------+ | | | +-----------------+ | | +------------------------------+Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>--- transport-pci.tex | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-)transport-pci.tex +3
-0@@ -168,6 +168,7 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option \item ISR Status \item Device-specific configuration (optional) \item PCI configuration access +\item Legacy memory mapped configuration registers (optional) \end{itemize} Each structure can be mapped by a Base Address register (BAR) belonging to@@ -228,6 +229,8 @@ \subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport Option #define VIRTIO_PCI_CAP_SHARED_MEMORY_CFG 8 /* Vendor-specific data */ #define VIRTIO_PCI_CAP_VENDOR_CFG 9 +/* Legacy configuration registers capability */ +#define VIRTIO_PCI_CAP_LEGACY_MMR_CFG 10 \end{lstlisting} Any other value is reserved for future use.@@ -682,6 +685,18 @@ \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport Configuration Space / Legacy Interface: Device Configuration
transport-pci.tex \subsubsection{Common configuration structure layout}\label{sec:Virtio Transport · line 695
Quoted 10 lines
transport-pci.tex +8
-0Space}~\nameref{sec:Basic Facilities of a Virtio Device / Device Configuration Space / Legacy Interface: Device Configuration Space} for workarounds. +\paragraph{Transitional MMR Interface: A Note on Configuration Registers} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Common configuration structure layout / Transitional MMR Interface: A Note on Configuration Registers} + +The transitional MMR device MUST present legacy virtio registers +consisting of legacy common configuration registers followed by +legacy device specific configuration registers described in section +\ref{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Common configuration structure layout / Legacy Interfaces: A Note on Configuration Registers} +in a memory region PCI BAR.
So considering common legacy registers. How exactly is INT#x handled? It's required for old guests since they fail over to that when MSI-X fails for some reason.
Quoted 35 lines
transport-pci.tex +20
-2+ +The transitional MMR device MUST provide the location of the +legacy virtio configuration registers using a legacy memory mapped +registers capability described in section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Transitional MMR Interface: Legacy Memory Mapped Configuration Registers Capability}. \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification capability}@@ -956,9 +971,23 @@ \subsubsection{PCI configuration access capability}\label{sec:Virtio Transport O specified by some other Virtio Structure PCI Capability of type other than \field{VIRTIO_PCI_CAP_PCI_CFG}. +\subsubsection{Transitional MMR Interface: Legacy Memory Mapped Configuration Registers Capability} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Transitional MMR Interface: Legacy Memory Mapped Configuration Registers Capability} + +The optional VIRTIO_PCI_CAP_LEGACY_MMR_CFG capability defines +the location of the legacy virtio configuration registers +followed by legacy device specific configuration registers in +the memory region BAR for the transitional MMR device. + +The \field{cap.offset} MUST be 4-byte aligned. +The \field{cap.offset} SHOULD be 4KBytes aligned and +\field{cap.length} SHOULD be 4KBytes. + +The transitional MMR device MUST present a legacy configuration +memory mapped registers capability using \field{virtio_pcie_ext_cap}. + \subsubsection{Legacy Interface: A Note on Feature Bits} -\label{sec:Virtio Transport Options / Virtio Over PCI Bus / -Virtio Structure PCI Capabilities / Legacy Interface: A Note on Feature Bits} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Legacy Interface: A Note on Feature Bits} Only Feature Bits 0 to 31 are accessible through the Legacy Interface. When used through the Legacy Interface,Signature · 1 line
2.26.2
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
PATCH 10/11 transport-pci: Use driver notification PCI capability
In reply to Parav PanditPCI devices support memory BAR regions for performant driver notifications using the notification capability. Enable transitional MMR devices to use it in simpler manner.
--- transport-pci.tex | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
transport-pci.tex +28 -0
@@ -763,6 +763,34 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options cap.length >= queue_notify_off * notify_off_multiplier + 4 \end{lstlisting} +\paragraph{Transitional MMR Interface: A note on Notification Capability} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Notification capability / Transitional MMR Interface} + +The transitional MMR device benefits from receiving driver +notifications at the Queue Notification address offered using +the notification capability, rather than via the memory mapped +legacy QueueNotify configuration register. + +Transitional MMR device uses same Queue Notification address +within a BAR for all virtqueues: +\begin{lstlisting} +cap.offset +\end{lstlisting} + +The transitional MMR device MUST support Queue Notification +address within a BAR for all virtqueues at: +\begin{lstlisting} +cap.offset +\end{lstlisting} + +The transitional MMR driver that wants to use driver +notifications offered using notification capability MUST use +same Queue Notification address within a BAR for all virtqueues at: + +\begin{lstlisting} +cap.offset +\end{lstlisting} + \subsubsection{ISR status capability}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / ISR status capability} The VIRTIO_PCI_CAP_ISR_CFG capability
Signature · 6 lines
2.26.2 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH 10/11] transport-pci: Use driver notification PCI capability
Quoted 39 lines · Parav Pandit
PCI devices support memory BAR regions for performant driver notifications using the notification capability. Enable transitional MMR devices to use it in simpler manner.
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>--- transport-pci.tex | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)transport-pci.tex +21
-0@@ -763,6 +763,34 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options cap.length >= queue_notify_off * notify_off_multiplier + 4 \end{lstlisting} +\paragraph{Transitional MMR Interface: A note on Notification Capability} +\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities / Notification capability / Transitional MMR Interface} + +The transitional MMR device benefits from receiving driver +notifications at the Queue Notification address offered using +the notification capability, rather than via the memory mapped +legacy QueueNotify configuration register. + +Transitional MMR device uses same Queue Notification address +within a BAR for all virtqueues: +\begin{lstlisting} +cap.offset +\end{lstlisting} + +The transitional MMR device MUST support Queue Notification +address within a BAR for all virtqueues at: +\begin{lstlisting} +cap.offset +\end{lstlisting} + +The transitional MMR driver that wants to use driver
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 796
Quoted 10 lines
transport-pci.tex +7
-0+notifications offered using notification capability MUST use +same Queue Notification address within a BAR for all virtqueues at: + +\begin{lstlisting} +cap.offset +\end{lstlisting} + \subsubsection{ISR status capability}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / ISR status capability} The VIRTIO_PCI_CAP_ISR_CFG capability
Why? What exactly is going on here? legacy drivers will not do this.
Quoted 2 lines
Signature · 1 line
2.26.2
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH 10/11] transport-pci: Use driver notification PCI capability
Quoted 47 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, April 12, 2023 12:31 AMQuoted 41 lines · Parav Pandit
PCI devices support memory BAR regions for performant driver notifications using the notification capability. Enable transitional MMR devices to use it in simpler manner.
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>--- transport-pci.tex | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)transport-pci.tex index renamed from transport-pci.tex +0
-055a6aa0..4fd9898 100644
transport-pci.tex +0
-0@@ -763,6 +763,34 @@ \subsubsection{Notification structurelayout}\label{sec:Virtio Transport Options cap.length >=
queue_notify_off*notify_off_multiplier+ 4 \end{lstlisting}+\paragraph{Transitional MMR Interface: A note on Notification
transport-pci.tex +22
-0+Capability} \label{sec:Virtio Transport Options / Virtio Over PCI Bus +/ Virtio Structure PCI Capabilities / Notification capability / +Transitional MMR Interface} + +The transitional MMR device benefits from receiving driver +notifications at the Queue Notification address offered using the +notification capability, rather than via the memory mapped legacy +QueueNotify configuration register. + +Transitional MMR device uses same Queue Notification address within a +BAR for all virtqueues: +\begin{lstlisting} +cap.offset +\end{lstlisting} + +The transitional MMR device MUST support Queue Notification address +within a BAR for all virtqueues at: +\begin{lstlisting} +cap.offset +\end{lstlisting} + +The transitional MMR driver that wants to use driver notifications
Quoted 8 lines
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 779
Quoted 7 lines
transport-pci.tex +7
-0+offered using notification capability MUST use same Queue +Notification address within a BAR for all virtqueues at: + +\begin{lstlisting} +cap.offset +\end{lstlisting} +Why? What exactly is going on here? legacy drivers will not do this.
Legacy driver does in the q notify register that was sandwitched in between of slow configuration registers.
This is the notification offset for the hypervisor driver to perform the notification on behalf of the guest driver so that the acceleration available for the non-transitional device can be utilized here as well.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 10/11] transport-pci: Use driver notification PCI capability
Quoted 56 lines · Parav Pandit
Quoted 47 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, April 12, 2023 12:31 AMQuoted 41 lines · Parav Pandit
PCI devices support memory BAR regions for performant driver notifications using the notification capability. Enable transitional MMR devices to use it in simpler manner.
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>--- transport-pci.tex | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)transport-pci.tex index renamed from transport-pci.tex +0
-055a6aa0..4fd9898 100644
transport-pci.tex +0
-0@@ -763,6 +763,34 @@ \subsubsection{Notification structurelayout}\label{sec:Virtio Transport Options cap.length >=
queue_notify_off*notify_off_multiplier+ 4 \end{lstlisting}+\paragraph{Transitional MMR Interface: A note on Notification
transport-pci.tex +22
-0+Capability} \label{sec:Virtio Transport Options / Virtio Over PCI Bus +/ Virtio Structure PCI Capabilities / Notification capability / +Transitional MMR Interface} + +The transitional MMR device benefits from receiving driver +notifications at the Queue Notification address offered using the +notification capability, rather than via the memory mapped legacy +QueueNotify configuration register. + +Transitional MMR device uses same Queue Notification address within a +BAR for all virtqueues: +\begin{lstlisting} +cap.offset +\end{lstlisting} + +The transitional MMR device MUST support Queue Notification address +within a BAR for all virtqueues at: +\begin{lstlisting} +cap.offset +\end{lstlisting} + +The transitional MMR driver that wants to use driver notificationsQuoted 8 lines
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 779
Quoted 7 lines
transport-pci.tex +7
-0+offered using notification capability MUST use same Queue +Notification address within a BAR for all virtqueues at: + +\begin{lstlisting} +cap.offset +\end{lstlisting} +Why? What exactly is going on here? legacy drivers will not do this.
Quoted 2 lines
Legacy driver does in the q notify register that was sandwitched in between of slow configuration registers.
This is the notification offset for the hypervisor driver to perform the notification on behalf of the guest driver so that the acceleration available for the non-transitional device can be utilized here as well.
I don't get it. What acceleration? for guests you need a separate page so card can be mapped directly while config causes an exit. But hypervisor can access any register without vmexits.
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH 10/11] transport-pci: Use driver notification PCI capability
Quoted 66 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, April 12, 2023 12:43 AM
To: Parav Pandit <[email protected]>
Cc: [email protected]; [email protected]; virtio- [email protected]; Shahaf Shuler <[email protected]>; Satananda Burla <[email protected]>
Subject: Re: [PATCH 10/11] transport-pci: Use driver notification PCI capabilityQuoted 56 lines · Parav Pandit
Quoted 47 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, April 12, 2023 12:31 AMQuoted 41 lines · Parav Pandit
PCI devices support memory BAR regions for performant driver notifications using the notification capability. Enable transitional MMR devices to use it in simpler manner.
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>--- transport-pci.tex | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)transport-pci.tex index renamed from transport-pci.tex +0
-055a6aa0..4fd9898 100644
transport-pci.tex +0
-0@@ -763,6 +763,34 @@ \subsubsection{Notification structurelayout}\label{sec:Virtio Transport Options cap.length >=
queue_notify_off*notify_off_multiplier+ 4 \end{lstlisting}+\paragraph{Transitional MMR Interface: A note on Notification
transport-pci.tex +22
-0+Capability} \label{sec:Virtio Transport Options / Virtio Over PCI +Bus / Virtio Structure PCI Capabilities / Notification capability +/ Transitional MMR Interface} + +The transitional MMR device benefits from receiving driver +notifications at the Queue Notification address offered using the +notification capability, rather than via the memory mapped legacy +QueueNotify configuration register. + +Transitional MMR device uses same Queue Notification address +within a BAR for all virtqueues: +\begin{lstlisting} +cap.offset +\end{lstlisting} + +The transitional MMR device MUST support Queue Notification +address within a BAR for all virtqueues at: +\begin{lstlisting} +cap.offset +\end{lstlisting} + +The transitional MMR driver that wants to use driverQuoted 8 lines
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 779
Quoted 7 lines
transport-pci.tex +7
-0+notifications offered using notification capability MUST use same +Queue Notification address within a BAR for all virtqueues at: + +\begin{lstlisting} +cap.offset +\end{lstlisting} +Why? What exactly is going on here? legacy drivers will not do this.
Quoted 1 line
Legacy driver does in the q notify register that was sandwitched in between
Quoted 8 lines
of slow configuration registers.
Quoted 1 line
This is the notification offset for the hypervisor driver to perform the
notification on behalf of the guest driver so that the acceleration available for the non-transitional device can be utilized here as well.
I don't get it. What acceleration? for guests you need a separate page so card can be mapped directly while config causes an exit. But hypervisor can access any register without vmexits.
Typically when guest VM writes to IOBAR q notification register, a vmexit occurs.
On that occurrence, hypervisor driver forwards the q notification using the q notification region which is defined by struct virtio_pci_notify_cap.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
[virtio-comment] Re: [PATCH 10/11] transport-pci: Use driver notification PCI capability
Quoted 71 lines · Parav Pandit
Quoted 71 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, April 12, 2023 12:43 AM
To: Parav Pandit <[email protected]>
Cc: [email protected]; [email protected]; virtio- [email protected]; Shahaf Shuler <[email protected]>; Satananda Burla <[email protected]>
Subject: Re: [PATCH 10/11] transport-pci: Use driver notification PCI capabilityQuoted 56 lines · Parav Pandit
Quoted 47 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, April 12, 2023 12:31 AMQuoted 41 lines · Parav Pandit
PCI devices support memory BAR regions for performant driver notifications using the notification capability. Enable transitional MMR devices to use it in simpler manner.
Co-developed-by Satananda Burla <[email protected]>Signed-off-by Parav Pandit <[email protected]>--- transport-pci.tex | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)transport-pci.tex index renamed from transport-pci.tex +0
-055a6aa0..4fd9898 100644
transport-pci.tex +0
-0@@ -763,6 +763,34 @@ \subsubsection{Notification structurelayout}\label{sec:Virtio Transport Options cap.length >=
queue_notify_off*notify_off_multiplier+ 4 \end{lstlisting}+\paragraph{Transitional MMR Interface: A note on Notification
transport-pci.tex +22
-0+Capability} \label{sec:Virtio Transport Options / Virtio Over PCI +Bus / Virtio Structure PCI Capabilities / Notification capability +/ Transitional MMR Interface} + +The transitional MMR device benefits from receiving driver +notifications at the Queue Notification address offered using the +notification capability, rather than via the memory mapped legacy +QueueNotify configuration register. + +Transitional MMR device uses same Queue Notification address +within a BAR for all virtqueues: +\begin{lstlisting} +cap.offset +\end{lstlisting} + +The transitional MMR device MUST support Queue Notification +address within a BAR for all virtqueues at: +\begin{lstlisting} +cap.offset +\end{lstlisting} + +The transitional MMR driver that wants to use driverQuoted 8 lines
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 779
Quoted 7 lines
transport-pci.tex +7
-0+notifications offered using notification capability MUST use same +Queue Notification address within a BAR for all virtqueues at: + +\begin{lstlisting} +cap.offset +\end{lstlisting} +Why? What exactly is going on here? legacy drivers will not do this.
Quoted 1 line
Legacy driver does in the q notify register that was sandwitched in between
of slow configuration registers.
Quoted 1 line
This is the notification offset for the hypervisor driver to perform the
notification on behalf of the guest driver so that the acceleration available for the non-transitional device can be utilized here as well.
Quoted 6 lines
Quoted 3 lines
I don't get it. What acceleration? for guests you need a separate page so card can be mapped directly while config causes an exit. But hypervisor can access any register without vmexits.
Typically when guest VM writes to IOBAR q notification register, a vmexit occurs.
On that occurrence, hypervisor driver forwards the q notification using the q notification region which is defined by structvirtio_pci_notify_cap.
What is wrong with forwarding it on the legacy window?
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 10/11] transport-pci: Use driver notification PCI capability
Quoted 9 lines
From: [email protected] <[email protected] open.org> On Behalf Of Michael S. Tsirkin
Quoted 1 line
On that occurrence, hypervisor driver forwards the q notification using the q
notification region which is defined by struct
virtio_pci_notify_cap.What is wrong with forwarding it on the legacy window?
Legacy window is configuration registers.
One has sandwitched q notification register in middle of all the config registers.
Such registers do not start the VQ data path engines.
1.x spec has done the right thing to have dedicated notification region which something an actual pci hw can implement.
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Re: [virtio-comment] Re: [PATCH 10/11] transport-pci: Use driver notification PCI capability
Quoted 5 lines · Parav Pandit
Quoted 4 lines
From: [email protected] <[email protected] open.org> On Behalf Of Michael S. Tsirkin
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
On that occurrence, hypervisor driver forwards the q notification using the q
notification region which is defined by struct
virtio_pci_notify_cap.What is wrong with forwarding it on the legacy window?
Legacy window is configuration registers.
One has sandwitched q notification register in middle of all the config registers.
Such registers do not start the VQ data path engines.
1.x spec has done the right thing to have dedicated notification region which something an actual pci hw can implement.
okay so.. in fact it turns out existing hardware is not really happy to emulate legacy. it does not really fit that well. so maybe we should stop propagating the legacy interface to modern hardware then.
Add the legacy net header size feature and be done with it.
Signature · 18 lines
MST This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
RE: [virtio-comment] Re: [PATCH 10/11] transport-pci: Use driver notification PCI capability
Quoted 5 lines
From: [email protected] <[email protected] open.org> On Behalf Of Michael S. Tsirkin
Quoted 8 lines
Quoted 2 lines
Such registers do not start the VQ data path engines.
1.x spec has done the right thing to have dedicated notification region whichsomething an actual pci hw can implement.
okay so.. in fact it turns out existing hardware is not really happy to emulate legacy. it does not really fit that well.
so maybe we should stop propagating the legacy interface to modern hardware then.
It is not about current hw, utilize what hw has to offer and utilize what sw has to offer. The key efficiency is coming by reusing what 1.x has already to offer.
Quoted 1 line
Add the legacy net header size feature and be done with it.
Hypervisor need to mediate and participate in all life cycle of the device.
One wants to run the block device too. Current proposal with other changes we discussed cover wider case.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [virtio-comment] Re: [PATCH 10/11] transport-pci: Use driver notification PCI capability
Quoted 7 lines · Parav Pandit
Quoted 7 lines
From: [email protected] <[email protected] open.org> On Behalf Of Michael S. Tsirkin
Quoted 2 lines
Such registers do not start the VQ data path engines.
1.x spec has done the right thing to have dedicated notification region which
Quoted 8 lines
Quoted 6 lines
something an actual pci hw can implement.
okay so.. in fact it turns out existing hardware is not really happy to emulate legacy. it does not really fit that well.
so maybe we should stop propagating the legacy interface to modern hardware then.It is not about current hw, utilize what hw has to offer and utilize what sw has to offer. The key efficiency is coming by reusing what 1.x has already to offer.
Just ... no. Either run 0.X or 1.X. This mix opens a ton of corner cases. NOTIFICATION_DATA is just off the top of my head, there's more for sure. It's a can of worms we won't be able to close.
Quoted 4 lines
Quoted 1 line
Add the legacy net header size feature and be done with it.
Hypervisor need to mediate and participate in all life cycle of the device.
One wants to run the block device too. Current proposal with other changes we discussed cover wider case.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]