admin: Add group member legacy register access commands
PATCH v13 1/1 admin: Add group member legacy register access commands
Introduce group member legacy common configuration and legacy device configuration access read/write commands.
Group member legacy registers access commands enable group owner driver to access legacy registers on behalf of the guest virtual machine.
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 virtio 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. Currently it 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.
Overview:
=========
Above usecase requirements is solved by PCI PF group owner accessing its group member PCI VFs legacy registers using the administration commands of the group owner PCI PF.
Two types of administration commands are added which read/write PCI VF registers.
Software usage example:
=======================
1. One 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 BAR to AQ | | Other vfio | |
| |rd/wr mapper& | | functionalities | |
| | forwarder | | | |
| +--------------+ +-----------------+ |
| |
+------+-------------------------+-----------+
| |
Config region |
access Driver notifications
| |
+----+------------+ +----+------------+
| +-----+ | | PCI VF device A |
| | AQ |-------------+---->+-------------+ |
| +-----+ | | | | legacy regs | |
| PCI PF device | | | +-------------+ |
+-----------------+ | +-----------------+
|
| +----+------------+
| | PCI VF device N |
+---->+-------------+ |
| | legacy regs | |
| +-------------+ |
+-----------------+2. Continue to use the virtio pci driver to bind to the listed device id and use it as in the host.
3. Use it in a light weight hypervisor to run bare-metal OS.
---
changelog:v12->v13:
- added article
- add hyphen between little and endian
- mentioned vq index depth of 16-bit
- rewrote alternative approach line
- mention vq index, length and endianness in mmio description
- fixed padding bytes size from 7 to 6 bytes
- rewrote bar field description
- offset alignment text added
- added text to ignore reserved notification entries
- device and driver conformance lines added for notification info command fields
- dropped group member prefix to the driver
- reworded text for flags requirements
- reworded to say all driver notifications in conformance
- itemize conformance entries under command to ease reading v11->v12:
- added missing article the at few places
- rewrote group_member_id statements like other existing
commands which is cleaner and shorter
- added length and alignment lines to multiple commands
- rewrote fast path to separate dedicated mechanism
- rewrote example and description para for legacy notification command
- made separate paragraph for the notify info command
- dropped citation to virtio pci capabilities for member device
- notification region changed to notification address throughout
- added description to all the fields of the info struct
- avoided union in spirit of keeping all for pci
- used single listing
- moved description to end which was in between two structs
- added 4 entry and preference description
- added conformance line for notification via mmio works same way as admin commandv10->v11:
- replaced tab with white spaces in read structure
- included pci fields along side other generic fields to avoid indirection
- merged pci conformance section
- avoid using definite in starting introduction
- replace 'all of the' with 'any of the'
- changed drivers notification normative to indicate use of NOTIFY_INFO command
- renamed NOTIFY_QUERY to NOTIFY_INFO name
- merged 4th patch with 3rd
- added normative line for notify_info command
- reworded notification region command description to be more verbose
- merged flags and owner field to indicate end of listv9->v10:
- added white space at end of line
- addressed below comments from Cornelia
- added missing articles
- reworded description for notification query command
- grammar fixes
- addressed below comments from Michael
- added description for member group id setting
- reworded device and driver conformance statements
- opcode table description updated
- fixed label for device read command
- length alignment restriction text added
- data length described for read write commands
- notification description added and refined
- reworded text around command specific result and data field usage v8->v9:
- add missing articles in notify query command
- replaced 'this notification' with 'such a notification'
- addressed below comments from Michael
- dropped 'Region' from the commands
- added 7 reserved pad bytes in config write commands
- rewrote from 'use following structure' to 'field' has the following struct..
- dropped mentioning to follow struct virtio_admin_cmd.
- added note about command limited to only sriov group type for now
- rewrote the description little differentlyv7->v8:
- remove empty line at the end of file
- removed white space at the end
- addressed comments from Michael add link to pci
- renamed region to region_data
- made region_data width to be 16 bytes to cover for 8 bytes offset
- moved generic notification region related normative from pci to generic sectionv6->v7:
- changed administrative to administration
- renamed admin-access.tex to admin-interface.tex
- large rewrite ad generic admin commands instead of pci
- added theory of operation section
- added driver notification region query commandv5->v6:
- fixed previous missed abbreviation of LCC and LDv4->v5:
- split from pci transport specific patch
- split conformance to transport and generic sections
- written the description of the command as generic with member
and group device terminology
- reflected many section names to remove VF
- rename fields from register to region
- avoided abbreviation for legacy, device and config
--- admin-cmds-legacy-interface.tex | 363 ++++++++++++++++++++++++++++++++ admin.tex | 14 +- conformance.tex | 2 + 3 files changed, 378 insertions(+), 1 deletion(-) create mode 100644 admin-cmds-legacy-interface.tex
admin-cmds-legacy-interface.tex new file +363 -0
@@ -0,0 +1,363 @@ +\subsubsection{Legacy Interfaces}\label{sec:Basic Facilities of a Virtio Device / Device groups / Group +administration commands / Legacy Interface} + +In some systems, there is a need to support utilizing a legacy driver with +a device that does not directly support the legacy interface. In such scenarios, +a group owner device can provide the legacy interface functionality for the +group member devices. The driver of the owner device can then access the legacy +interface of a member device on behalf of the legacy member device driver. + +For example, with the SR-IOV group type, group members (VFs) can not present +the legacy interface in an I/O BAR in BAR0 as expected by the legacy pci driver. +If the legacy driver is running inside a virtual machine, the hypervisor +executing the virtual machine can present a virtual device with an I/O BAR in +BAR0. The hypervisor intercepts the legacy driver accesses to this I/O BAR and +forwards them to the group owner device (PF) using group administration commands. + +The following commands support such a legacy interface functionality: + +\begin{enumerate} +\item Legacy Common Configuration Write Command +\item Legacy Common Configuration Read Command +\item Legacy Device Configuration Write Command +\item Legacy Device Configuration Read Command +\end{enumerate} + +These commands are currently only defined for the SR-IOV group type and +have, generally, the same effect as member device accesses through a legacy +interface listed in section \ref{sec:Virtio Transport Options / Virtio Over PCI +Bus / PCI Device Layout / Legacy Interfaces: A Note on PCI Device Layout} except +that little-endian format is assumed unconditionally. + +\paragraph{Legacy Common Configuration Write Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group +administration commands / Legacy Interface / Legacy Common Configuration Write Command} + +This command has the same effect as writing into the virtio common configuration +structure through the legacy interface. The \field{command_specific_data} is in +the format \field{struct virtio_admin_cmd_legacy_common_cfg_wr_data} describing +the access to be performed. + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_common_cfg_wr_data { + u8 offset; /* Starting byte offset within the common configuration structure to write */ + u8 reserved[7]; + u8 data[]; +}; +\end{lstlisting} + +For the command VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, \field{opcode} +is set to 0x2. +The \field{group_member_id} refers to the member device to be accessed. +The \field{offset} refers to the offset to write within the virtio common +configuration structure, and excluding the device-specific configuration. +The length of the data to write is simply the length of \field{data}. + +No length or alignment restrictions are placed on the value of the +\field{offset} and the length of the \field{data}, except that the resulting +access refers to a single field and is completely within the virtio common +configuration structure, excluding the device-specific configuration. + +This command has no command specific result. + +\paragraph{Legacy Common Configuration Read Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface / Legacy Common Configuration Read Command} + +This command has the same effect as reading from the virtio common configuration +structure through the legacy interface. The \field{command_specific_data} is in +the format \field{struct virtio_admin_cmd_legacy_common_cfg_rd_data} describing +the access to be performed. + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_common_cfg_rd_data { + u8 offset; /* Starting byte offset within the common configuration structure to read */ +}; +\end{lstlisting} + +For the command VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, \field{opcode} +is set to 0x3. +The \field{group_member_id} refers to the member device to be accessed. +The \field{offset} refers to the offset to read from the virtio common +configuration structure, and excluding the device-specific configuration. + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_common_cfg_rd_result { + u8 data[]; +}; +\end{lstlisting} + +No length or alignment restrictions are placed on the value of the +\field{offset} and the length of the \field{data}, except that the resulting +access refers to a single field and is completely within the virtio common +configuration structure, excluding the device-specific configuration. + +When the command completes successfully, \field{command_specific_result} +is in the format of \field{struct virtio_admin_cmd_legacy_common_cfg_rd_result} +returned by the device. The length of the data read is simply the length of +\field{data}. + +\paragraph{Legacy Device Configuration Write Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface / Legacy Device Configuration Write Command} + +This command has the same effect as writing into the virtio device-specific +configuration through the legacy interface. The \field{command_specific_data} is in +the format \field{struct virtio_admin_cmd_legacy_dev_reg_wr_data} describing +the access to be performed. + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_dev_reg_wr_data { + u8 offset; /* Starting byte offset within the device-specific configuration to write */ + u8 reserved[7]; + u8 data[]; +}; +\end{lstlisting} + +For the command VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE, \field{opcode} +is set to 0x4. +The \field{group_member_id} refers to the member device to be accessed. +The \field{offset} refers to the offset to write within the virtio +device-specific configuration. The length of the data to write is simply +the length of \field{data}. + +No length or alignment restrictions are placed on the value of the +\field{offset} and the length of the \field{data}, except that the resulting +access refers to a single field and is completely within the device-specific +configuration. + +This command has no command specific result. + +\paragraph{Legacy Device Configuration Read Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface / Legacy Device Configuration Read Command} + +This command has the same effect as reading from the virtio device-specific +configuration through the legacy interface. The \field{command_specific_data} is in +the format \field{struct virtio_admin_cmd_legacy_common_cfg_rd_data} describing +the access to be performed. + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_dev_cfg_rd_data { + u8 offset; /* Starting byte offset within the device-specific configuration to read */ +}; +\end{lstlisting} + +For the command VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ, \field{opcode} +is set to 0x5. +The \field{group_member_id} refers to the member device to be accessed. +The \field{offset} refers to the offset to read from the virtio device-specific +configuration. + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_dev_reg_rd_result { + u8 data[]; +}; +\end{lstlisting} + +No length or alignment restrictions are placed on the value of the +\field{offset} and the length of the \field{data}, except that the resulting +access refers to a single field and is completely within the device-specific +configuration. + +When the command completes successfully, \field{command_specific_result} is in +the format of \field{struct virtio_admin_cmd_legacy_dev_reg_rd_result} +returned by the device. + +The length of the data read is simply the length of \field{data}. + +\paragraph{Legacy Driver Notification}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface / Legacy Driver Notifications} + +The driver of the owner device can send a driver notification to the member +device operated using the legacy interface by executing +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE with the \field{offset} matching +\field{Queue Notify} and the \field{data} containing a 16-bit virtqueue index to +be notified. + +However, as VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE is also used for slow path +configuration a separate dedicated mechanism for sending such driver +notifications to the member device can be made available by the owner device. +For the SR-IOV group type, the optional command +VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO addresses this need by returning to the +driver one or more addresses which can be used to send such driver +notifications. The notification address returned can be of either the owner +device or the member device. + +In this alternative approach, driver notifications are sent by +writing a 16-bit virtqueue index to be notified, in the little-endian +format, to the notification address returned by +the VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO command. + +Any driver notification sent through the notification address has the same effect +as if it was sent using the VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE command with +the \field{offset} matching \field{Queue Notify}. + +This command is only defined for the SR-IOV group type. + +For the command VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, \field{opcode} +is set to 0x6. +The \field{group_member_id} refers to the member device to be accessed. +This command does not use \field{command_specific_data}. + +When the device supports VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO command, the group +owner device hardwires VF BAR0 to zero in the SR-IOV Extended capability. + +\begin{lstlisting} +struct virtio_pci_legacy_notify_info { + u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */ + u8 bar; /* BAR of the member or the owner device */ + u8 padding[6]; + le64 offset; /* Offset within bar. */ +}; + +struct virtio_admin_cmd_legacy_notify_info_result { + struct virtio_pci_legacy_notify_info entries[4]; +}; +\end{lstlisting} + +The \field{flags} value of 0x1 indicates that the notification address is of +the owner device, value of 0x2 indicates that the notification address is of +the member device, the value of 0 indicates that all the entries starting from +that entry are invalid entries in \field{entries}. All other values in +\field{flags} are reserved. The driver skips the entries whose \field{flag} +contains reserved value. + +The \field{bar} values 0x1 to 0x5 specifies a Base Address register (BAR), +when the \field{flags} is 0x1, \field{bar} specifies the Base Address Registers +in the PCI header of the owner device, when the \field{flags} is 0x2, +\field{bar} specifies the VF BARn registers in the SR-IOV Extended Capability +of the device. + +The \field{offset} indicates the notification address relative to the base +address associated with the BAR indicated in \field{bar}. This value +is 2-byte aligned. + +When the command completes successfully, \field{command_specific_result} is in +the format of \field{struct virtio_admin_cmd_legacy_notify_info_result}. The +device can supply up to 4 entries each with a different notification +address. In this case, any of the entries can be used by the driver. The order +of the entries serves as a preference hint to the driver. The driver is expected +to utilize the entries placed earlier in the array to the later ones. The driver is +also expected to ignore reserved entries. + +\devicenormative{\paragraph}{Legacy Interface}{Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface} + +A device MUST either support all of, or none of +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands. + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, +the device MUST decode and encode (respectively) the value of the +\field{data} using the little-endian format. + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ commands, +the device MUST fail the command when the value of the +\field{offset} and the length of the \field{data} does not refer to a +single field or is not completely within the virtio common configuration +excluding the device-specific configuration. + +For VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, +the device MUST fail the command when the value of the +\field{offset} and the length of the \field{data} does not refer to a +single field or is not completely within the virtio device-specific +configuration. + +The command VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE MUST have the same effect +as writing into the virtio common configuration structure through the legacy +interface. + +The command VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ MUST have the same effect as +reading from the virtio common configuration structure through the legacy +interface. + +The command VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE MUST have the same effect as +writing into the virtio device-specific configuration through the legacy +interface. + +The command VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ MUST have the same effect as +reading from the virtio device-specific configuration through the legacy +interface. + +For the SR-IOV group type, when the owner device supports +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO +commands, +\begin{itemize} +\item the owner device and the group member device SHOULD follow the rules +for the PCI Revision ID and Subsystem Device ID of the non-transitional devices +documented in section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}. + +\item the owner device SHOULD follow the rules for the PCI Device ID of the non-transitional +devices documented in section +\ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}. + +\item any driver notification received by the device at any of the notification +address supplied in the command result of +VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO MUST function as if the device received +the notification through VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE +command at an offset \field{offset} matching \field{Queue Notify}. +\end{itemize} + +If the device supports VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO command, +\begin{itemize} +\item the device MUST also support all of VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands. + +\item in the command result of VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, the last +\field{struct virtio_pci_legacy_notify_info} entry MUST have \field{flags} of +zero. + +\item in the command result of VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, valid +entries MUST have a \field{bar} which is not hardwired to zero. + +\item in the command result of VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, valid +entries MUST have an \field{offset} aligned to 2-byte. + +\item the device MAY support VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO with entries +of the owner device or the member device or both of them. + +\item for the SR-IOV group type, the group owner device MUST hardwire VF BAR0 +to zero in the SR-IOV Extended capability. +\end{itemize} + +\drivernormative{\paragraph}{Legacy Interface}{Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface} + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, +the driver MUST encode and decode (respectively) the value of the \field{data} +using the little-endian format. + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ commands, +the driver SHOULD set \field{offset} and the length of the \field{data} +to refer to a single field within the virtio common configuration structure +excluding the device-specific configuration. + +For VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, +the driver SHOULD set \field{offset} and the length of the \field{data} +to refer to a single field within device specific configuration. + +If VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO command is supported, the driver +SHOULD use the notification address to send all driver notifications to the +device. + +If within \field{struct virtio_admin_cmd_legacy_notify_info_result} returned by +VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, the \field{flags} value +for a specific \field{struct virtio_pci_legacy_notify_info} entry is 0x0, the +driver MUST ignore this entry and all the following \field{entries}. The driver +MUST additionally validate, for each entry, that +\begin{itemize} +\item the \field{flags} is either 0x0, 0x1 or 0x2 +\item the \field{bar} corresponds to a valid BAR of either the owner or the +member device, depending on the \field{flags} +\item the \field{offset} is 2-byte aligned and corresponds to an address +within the BAR specified by the \field{bar} +on \field{flags} +\end{itemize}, any entry which does not meet these constraints MUST be ignored +by the driver.
admin.tex +13 -1
@@ -117,7 +117,17 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti \hline 0x0001 & VIRTIO_ADMIN_CMD_LIST_USE & Provides to device list of commands used for this group type \\ \hline -0x0002 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd} \\ +0x0002 & VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE & Writes into the legacy common configuration structure \\ +\hline +0x0003 & VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ & Reads from the legacy common configuration structure \\ +\hline +0x0004 & VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE & Writes into the legacy device configuration structure \\ +\hline +0x0005 & VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ & Reads into the legacy device configuration structure \\ +\hline +0x0006 & VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO & Query the notification region information \\ +\hline +0x0007 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd} \\ \hline 0x8000 - 0xFFFF & - & Reserved for future commands (possibly using a different structure) \\ \hline
@@ -286,6 +296,8 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti supporting multiple group types, the list of supported commands might differ between different group types. +\input{admin-cmds-legacy-interface.tex} + \devicenormative{\subsubsection}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} The device MUST validate \field{opcode}, \field{group_type} and
conformance.tex +2 -0
@@ -260,6 +260,8 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} \item Section \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Legacy Interfaces: A Note on Virtqueue Layout} \item Section \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Legacy Interfaces: A Note on Virtqueue Endianness} \item Section \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Message Framing / Legacy Interface: Message Framing} +\item Section \ref{devicenormative:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface} +\item Section \ref{drivernormative:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface} \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}
Signature · 6 lines
2.26.2 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 88 lines · Parav Pandit
Introduce group member legacy common configuration and legacy device configuration access read/write commands.
Group member legacy registers access commands enable group owner driver to access legacy registers on behalf of the guest virtual machine.
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 virtio 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. Currently it 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.Overview:
=========
Above usecase requirements is solved by PCI PF group owner accessing its group member PCI VFs legacy registers using the administration commands of the group owner PCI PF.Two types of administration commands are added which read/write PCI VF registers.
Software usage example:
=======================1. One 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 BAR to AQ | | Other vfio | | | |rd/wr mapper& | | functionalities | | | | forwarder | | | | | +--------------+ +-----------------+ | | | +------+-------------------------+-----------+ | | Config region | access Driver notifications | | +----+------------+ +----+------------+ | +-----+ | | PCI VF device A | | | AQ |-------------+---->+-------------+ | | +-----+ | | | | legacy regs | | | PCI PF device | | | +-------------+ | +-----------------+ | +-----------------+ | | +----+------------+ | | PCI VF device N | +---->+-------------+ | | | legacy regs | | | +-------------+ | +-----------------+
Quoted 7 lines
2. Continue to use the virtio pci driver to bind to the listed device id and use it as in the host.
3. Use it in a light weight hypervisor to run bare-metal OS.
Ugh. I have a feeling you are rewriting what I wrote so we keep doing more and more review rounds. I would prefer it if I could just comment instead of rewriting - that's really going way beyond normal review - but that seems to get us nowhere so here we are. But given this, if you don't want to use what I wrote then please comment.
Quoted 317 lines
---
changelog:v12->v13:
- added article
- add hyphen between little and endian
- mentioned vq index depth of 16-bit
- rewrote alternative approach line
- mention vq index, length and endianness in mmio description
- fixed padding bytes size from 7 to 6 bytes
- rewrote bar field description
- offset alignment text added
- added text to ignore reserved notification entries
- device and driver conformance lines added for notification info command fields
- dropped group member prefix to the driver
- reworded text for flags requirements
- reworded to say all driver notifications in conformance
- itemize conformance entries under command to ease readingv11->v12:
- added missing article the at few places
- rewrotegroup_member_idstatements like other existing
commands which is cleaner and shorter
- added length and alignment lines to multiple commands
- rewrote fast path to separate dedicated mechanism
- rewrote example and description para for legacy notification command
- made separate paragraph for the notify info command
- dropped citation to virtio pci capabilities for member device
- notification region changed to notification address throughout
- added description to all the fields of the info struct
- avoided union in spirit of keeping all for pci
- used single listing
- moved description to end which was in between two structs
- added 4 entry and preference description
- added conformance line for notification via mmio works same way as admin commandv10->v11:
- replaced tab with white spaces in read structure
- included pci fields along side other generic fields to avoid indirection
- merged pci conformance section
- avoid using definite in starting introduction
- replace 'all of the' with 'any of the'
- changed drivers notification normative to indicate use ofNOTIFY_INFOcommand
- renamedNOTIFY_QUERYtoNOTIFY_INFOname
- merged 4th patch with 3rd
- added normative line fornotify_infocommand
- reworded notification region command description to be more verbose
- merged flags and owner field to indicate end of listv9->v10:
- added white space at end of line
- addressed below comments from Cornelia
- added missing articles
- reworded description for notification query command
- grammar fixes
- addressed below comments from Michael
- added description for member group id setting
- reworded device and driver conformance statements
- opcode table description updated
- fixed label for device read command
- length alignment restriction text added
- data length described for read write commands
- notification description added and refined
- reworded text around command specific result and data field usagev8->v9:
- add missing articles in notify query command
- replaced 'this notification' with 'such a notification'
- addressed below comments from Michael
- dropped 'Region' from the commands
- added 7 reserved pad bytes in config write commands
- rewrote from 'use following structure' to 'field' has the following struct..
- dropped mentioning to follow structvirtio_admin_cmd.
- added note about command limited to only sriov group type for now
- rewrote the description little differentlyv7->v8:
- remove empty line at the end of file
- removed white space at the end
- addressed comments from Michael add link to pci
- renamed region toregion_data
- maderegion_datawidth to be 16 bytes to cover for 8 bytes offset
- moved generic notification region related normative from pci to generic sectionv6->v7:
- changed administrative to administration
- renamed admin-access.tex to admin-interface.tex
- large rewrite ad generic admin commands instead of pci
- added theory of operation section
- added driver notification region query commandv5->v6:
- fixed previous missed abbreviation of LCC and LDv4->v5:
- split from pci transport specific patch
- split conformance to transport and generic sections
- written the description of the command as generic with member
and group device terminology
- reflected many section names to remove VF
- rename fields from register to region
- avoided abbreviation for legacy, device and config--- admin-cmds-legacy-interface.tex | 363 ++++++++++++++++++++++++++++++++ admin.tex | 14 +- conformance.tex | 2 + 3 files changed, 378 insertions(+), 1 deletion(-) create mode 100644 admin-cmds-legacy-interface.texadmin-cmds-legacy-interface.tex new file +206
-0@@ -0,0 +1,363 @@ +\subsubsection{Legacy Interfaces}\label{sec:Basic Facilities of a Virtio Device / Device groups / Group +administration commands / Legacy Interface} + +In some systems, there is a need to support utilizing a legacy driver with +a device that does not directly support the legacy interface. In such scenarios, +a group owner device can provide the legacy interface functionality for the +group member devices. The driver of the owner device can then access the legacy +interface of a member device on behalf of the legacy member device driver. + +For example, with the SR-IOV group type, group members (VFs) can not present +the legacy interface in an I/O BAR in BAR0 as expected by the legacy pci driver. +If the legacy driver is running inside a virtual machine, the hypervisor +executing the virtual machine can present a virtual device with an I/O BAR in +BAR0. The hypervisor intercepts the legacy driver accesses to this I/O BAR and +forwards them to the group owner device (PF) using group administration commands. + +The following commands support such a legacy interface functionality: + +\begin{enumerate} +\item Legacy Common Configuration Write Command +\item Legacy Common Configuration Read Command +\item Legacy Device Configuration Write Command +\item Legacy Device Configuration Read Command +\end{enumerate} + +These commands are currently only defined for the SR-IOV group type and +have, generally, the same effect as member device accesses through a legacy +interface listed in section \ref{sec:Virtio Transport Options / Virtio Over PCI +Bus / PCI Device Layout / Legacy Interfaces: A Note on PCI Device Layout} except +that little-endian format is assumed unconditionally. + +\paragraph{Legacy Common Configuration Write Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group +administration commands / Legacy Interface / Legacy Common Configuration Write Command} + +This command has the same effect as writing into the virtio common configuration +structure through the legacy interface. The \field{command_specific_data} is in +the format \field{struct virtio_admin_cmd_legacy_common_cfg_wr_data} describing +the access to be performed. + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_common_cfg_wr_data { + u8 offset; /* Starting byte offset within the common configuration structure to write */ + u8 reserved[7]; + u8 data[]; +}; +\end{lstlisting} + +For the command VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, \field{opcode} +is set to 0x2. +The \field{group_member_id} refers to the member device to be accessed. +The \field{offset} refers to the offset to write within the virtio common +configuration structure, and excluding the device-specific configuration. +The length of the data to write is simply the length of \field{data}. + +No length or alignment restrictions are placed on the value of the +\field{offset} and the length of the \field{data}, except that the resulting +access refers to a single field and is completely within the virtio common +configuration structure, excluding the device-specific configuration. + +This command has no command specific result. + +\paragraph{Legacy Common Configuration Read Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface / Legacy Common Configuration Read Command} + +This command has the same effect as reading from the virtio common configuration +structure through the legacy interface. The \field{command_specific_data} is in +the format \field{struct virtio_admin_cmd_legacy_common_cfg_rd_data} describing +the access to be performed. + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_common_cfg_rd_data { + u8 offset; /* Starting byte offset within the common configuration structure to read */ +}; +\end{lstlisting} + +For the command VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, \field{opcode} +is set to 0x3. +The \field{group_member_id} refers to the member device to be accessed. +The \field{offset} refers to the offset to read from the virtio common +configuration structure, and excluding the device-specific configuration. + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_common_cfg_rd_result { + u8 data[]; +}; +\end{lstlisting} + +No length or alignment restrictions are placed on the value of the +\field{offset} and the length of the \field{data}, except that the resulting +access refers to a single field and is completely within the virtio common +configuration structure, excluding the device-specific configuration. + +When the command completes successfully, \field{command_specific_result} +is in the format of \field{struct virtio_admin_cmd_legacy_common_cfg_rd_result} +returned by the device. The length of the data read is simply the length of +\field{data}. + +\paragraph{Legacy Device Configuration Write Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface / Legacy Device Configuration Write Command} + +This command has the same effect as writing into the virtio device-specific +configuration through the legacy interface. The \field{command_specific_data} is in +the format \field{struct virtio_admin_cmd_legacy_dev_reg_wr_data} describing +the access to be performed. + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_dev_reg_wr_data { + u8 offset; /* Starting byte offset within the device-specific configuration to write */ + u8 reserved[7]; + u8 data[]; +}; +\end{lstlisting} + +For the command VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE, \field{opcode} +is set to 0x4. +The \field{group_member_id} refers to the member device to be accessed. +The \field{offset} refers to the offset to write within the virtio +device-specific configuration. The length of the data to write is simply +the length of \field{data}. + +No length or alignment restrictions are placed on the value of the +\field{offset} and the length of the \field{data}, except that the resulting +access refers to a single field and is completely within the device-specific +configuration. + +This command has no command specific result. + +\paragraph{Legacy Device Configuration Read Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface / Legacy Device Configuration Read Command} + +This command has the same effect as reading from the virtio device-specific +configuration through the legacy interface. The \field{command_specific_data} is in +the format \field{struct virtio_admin_cmd_legacy_common_cfg_rd_data} describing +the access to be performed. + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_dev_cfg_rd_data { + u8 offset; /* Starting byte offset within the device-specific configuration to read */ +}; +\end{lstlisting} + +For the command VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ, \field{opcode} +is set to 0x5. +The \field{group_member_id} refers to the member device to be accessed. +The \field{offset} refers to the offset to read from the virtio device-specific +configuration. + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_dev_reg_rd_result { + u8 data[]; +}; +\end{lstlisting} + +No length or alignment restrictions are placed on the value of the +\field{offset} and the length of the \field{data}, except that the resulting +access refers to a single field and is completely within the device-specific +configuration. + +When the command completes successfully, \field{command_specific_result} is in +the format of \field{struct virtio_admin_cmd_legacy_dev_reg_rd_result} +returned by the device. + +The length of the data read is simply the length of \field{data}. + +\paragraph{Legacy Driver Notification}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface / Legacy Driver Notifications} + +The driver of the owner device can send a driver notification to the member +device operated using the legacy interface by executing +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE with the \field{offset} matching +\field{Queue Notify} and the \field{data} containing a 16-bit virtqueue index to +be notified. + +However, as VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE is also used for slow path +configuration a separate dedicated mechanism for sending such driver +notifications to the member device can be made available by the owner device. +For the SR-IOV group type, the optional command +VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO addresses this need by returning to the +driver one or more addresses which can be used to send such driver +notifications. The notification address returned can be of either the owner +device or the member device. + +In this alternative approach, driver notifications are sent by +writing a 16-bit virtqueue index to be notified, in the little-endian +format, to the notification address returned by +the VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO command. + +Any driver notification sent through the notification address has the same effect +as if it was sent using the VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE command with +the \field{offset} matching \field{Queue Notify}. + +This command is only defined for the SR-IOV group type. + +For the command VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, \field{opcode} +is set to 0x6. +The \field{group_member_id} refers to the member device to be accessed. +This command does not use \field{command_specific_data}. + +When the device supports VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO command, the group +owner device hardwires VF BAR0 to zero in the SR-IOV Extended capability. + +\begin{lstlisting} +struct virtio_pci_legacy_notify_info { + u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */ + u8 bar; /* BAR of the member or the owner device */ + u8 padding[6]; + le64 offset; /* Offset within bar. */ +}; + +struct virtio_admin_cmd_legacy_notify_info_result {
admin-cmds-legacy-interface.tex line 216
Quoted 10 lines
admin-cmds-legacy-interface.tex new file +10
-0+ struct virtio_pci_legacy_notify_info entries[4]; +}; +\end{lstlisting} + +The \field{flags} value of 0x1 indicates that the notification address is of +the owner device, value of 0x2 indicates that the notification address is of +the member device, the value of 0 indicates that all the entries starting from +that entry are invalid entries in \field{entries}. All other values in +\field{flags} are reserved. The driver skips the entries whose \field{flag} +contains reserved value.
contain reserved values.
admin-cmds-legacy-interface.tex line 218
Quoted 2 lines
admin-cmds-legacy-interface.tex new file +2
-0+ +The \field{bar} values 0x1 to 0x5 specifies a Base Address register (BAR),
specify
admin-cmds-legacy-interface.tex line 219
Quoted 1 line
admin-cmds-legacy-interface.tex new file +1
-0+when the \field{flags} is 0x1, \field{bar} specifies the Base Address Registers
one of the Base Address Registers
admin-cmds-legacy-interface.tex line 222
Quoted 3 lines
admin-cmds-legacy-interface.tex new file +3
-0+in the PCI header of the owner device, when the \field{flags} is 0x2, +\field{bar} specifies the VF BARn registers in the SR-IOV Extended Capability +of the device.
These attempts to clarify only confused.
Problem with this is that VF BARn is not valled "Base Address register" you also did not capitalize "r" here. And also VF BARn in the capability actually refers to VF0 only. Others are calculated from that.
This is why I wrote what I wrote in the previous review.
admin-cmds-legacy-interface.tex line 225
Quoted 3 lines
admin-cmds-legacy-interface.tex new file +3
-0+ +The \field{offset} indicates the notification address relative to the base +address associated with the BAR indicated in \field{bar}. This value
let's not invent the new term base address. Just
"relative to the BAR" should be enough.
admin-cmds-legacy-interface.tex line 234
Quoted 9 lines
admin-cmds-legacy-interface.tex new file +9
-0+is 2-byte aligned. + +When the command completes successfully, \field{command_specific_result} is in +the format of \field{struct virtio_admin_cmd_legacy_notify_info_result}. The +device can supply up to 4 entries each with a different notification +address. In this case, any of the entries can be used by the driver. The order +of the entries serves as a preference hint to the driver. The driver is expected +to utilize the entries placed earlier in the array to the later ones. The driver is +also expected to ignore reserved entries.
You need to document end of list too.
I wrote all of this in my previous review. Donnu why you decided to rewrite yet again but here we are.
Quoted 119 lines
admin-cmds-legacy-interface.tex new file +119
-0+ +\devicenormative{\paragraph}{Legacy Interface}{Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface} + +A device MUST either support all of, or none of +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands. + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, +the device MUST decode and encode (respectively) the value of the +\field{data} using the little-endian format. + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ commands, +the device MUST fail the command when the value of the +\field{offset} and the length of the \field{data} does not refer to a +single field or is not completely within the virtio common configuration +excluding the device-specific configuration. + +For VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, +the device MUST fail the command when the value of the +\field{offset} and the length of the \field{data} does not refer to a +single field or is not completely within the virtio device-specific +configuration. + +The command VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE MUST have the same effect +as writing into the virtio common configuration structure through the legacy +interface. + +The command VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ MUST have the same effect as +reading from the virtio common configuration structure through the legacy +interface. + +The command VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE MUST have the same effect as +writing into the virtio device-specific configuration through the legacy +interface. + +The command VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ MUST have the same effect as +reading from the virtio device-specific configuration through the legacy +interface. + +For the SR-IOV group type, when the owner device supports +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO +commands, +\begin{itemize} +\item the owner device and the group member device SHOULD follow the rules +for the PCI Revision ID and Subsystem Device ID of the non-transitional devices +documented in section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}. + +\item the owner device SHOULD follow the rules for the PCI Device ID of the non-transitional +devices documented in section +\ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}. + +\item any driver notification received by the device at any of the notification +address supplied in the command result of +VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO MUST function as if the device received +the notification through VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE +command at an offset \field{offset} matching \field{Queue Notify}. +\end{itemize} + +If the device supports VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO command, +\begin{itemize} +\item the device MUST also support all of VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands. + +\item in the command result of VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, the last +\field{struct virtio_pci_legacy_notify_info} entry MUST have \field{flags} of +zero. + +\item in the command result of VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, valid +entries MUST have a \field{bar} which is not hardwired to zero. + +\item in the command result of VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, valid +entries MUST have an \field{offset} aligned to 2-byte. + +\item the device MAY support VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO with entries +of the owner device or the member device or both of them. + +\item for the SR-IOV group type, the group owner device MUST hardwire VF BAR0 +to zero in the SR-IOV Extended capability. +\end{itemize} + +\drivernormative{\paragraph}{Legacy Interface}{Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface} + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, +the driver MUST encode and decode (respectively) the value of the \field{data} +using the little-endian format. + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ commands, +the driver SHOULD set \field{offset} and the length of the \field{data} +to refer to a single field within the virtio common configuration structure +excluding the device-specific configuration. + +For VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, +the driver SHOULD set \field{offset} and the length of the \field{data} +to refer to a single field within device specific configuration. + +If VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO command is supported, the driver +SHOULD use the notification address to send all driver notifications to the +device. + +If within \field{struct virtio_admin_cmd_legacy_notify_info_result} returned by +VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, the \field{flags} value +for a specific \field{struct virtio_pci_legacy_notify_info} entry is 0x0, the +driver MUST ignore this entry and all the following \field{entries}. The driver
admin-cmds-legacy-interface.tex line 363
Quoted 10 lines
admin-cmds-legacy-interface.tex new file +10
-0+MUST additionally validate, for each entry, that +\begin{itemize} +\item the \field{flags} is either 0x0, 0x1 or 0x2 +\item the \field{bar} corresponds to a valid BAR of either the owner or the +member device, depending on the \field{flags} +\item the \field{offset} is 2-byte aligned and corresponds to an address +within the BAR specified by the \field{bar} +on \field{flags} +\end{itemize}, any entry which does not meet these constraints MUST be ignored +by the driver.
Wait a second.
- end of list not documented - we want conformance statements
- for end of list I am guessing other fields do not matter
- entries after end of list also do not matter?
Quoted 52 lines
admin.tex +13
-1@@ -117,7 +117,17 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti \hline 0x0001 & VIRTIO_ADMIN_CMD_LIST_USE & Provides to device list of commands used for this group type \\ \hline -0x0002 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd} \\ +0x0002 & VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE & Writes into the legacy common configuration structure \\ +\hline +0x0003 & VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ & Reads from the legacy common configuration structure \\ +\hline +0x0004 & VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE & Writes into the legacy device configuration structure \\ +\hline +0x0005 & VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ & Reads into the legacy device configuration structure \\ +\hline +0x0006 & VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO & Query the notification region information \\ +\hline +0x0007 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd} \\ \hline 0x8000 - 0xFFFF & - & Reserved for future commands (possibly using a different structure) \\ \hline@@ -286,6 +296,8 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti supporting multiple group types, the list of supported commands might differ between different group types. +\input{admin-cmds-legacy-interface.tex} + \devicenormative{\subsubsection}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} The device MUST validate \field{opcode}, \field{group_type} andconformance.tex +2
-0@@ -260,6 +260,8 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} \item Section \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Legacy Interfaces: A Note on Virtqueue Layout} \item Section \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Legacy Interfaces: A Note on Virtqueue Endianness} \item Section \ref{sec:Basic Facilities of a Virtio Device / Virtqueues / Message Framing / Legacy Interface: Message Framing} +\item Section \ref{devicenormative:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface} +\item Section \ref{drivernormative:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface} \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}Signature · 6 lines
2.26.2 --------------------------------------------------------------------- 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]
Quoted 12 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, July 9, 2023 9:47 AMQuoted 2 lines
Ugh. I have a feeling you are rewriting what I wrote so we keep doing more and more review rounds. I would prefer it if I could just comment instead of rewriting - that's really going way beyond normal review - but that seems to get us nowhere so here we are. But given this, if you don't want to use what I wrote then please comment.
Please see inline, why some parts are rewritten.
Only two lines to my knowledge are rewritten because you wrote,
" when the \field{flags} is 0x2 this is specified by the VF BARn"
Above "this is specified" was confusing to read.
It meant to me as that "this" refers to "bar".
So it interpreted to me as
"when flags is 0x2, bar is specified by the Base Address Registers in the PCI ...".
Here bar is not specified, bar specifies which register of which device to refer to.
What we wanted to say that,
"bar" field here points to (specifies) the Base Address Registers in the PCI ...
So that part was rewritten.
Quoted 11 lines
Quoted 11 lines
---
changelog:v12->v13:
- added article
- add hyphen between little and endian
- mentioned vq index depth of 16-bit
- rewrote alternative approach line
- mention vq index, length and endianness in mmio description
- fixed padding bytes size from 7 to 6 bytes
- rewrote bar field description
Quoted 8 lines
Quoted 8 lines
- offset alignment text added
- added text to ignore reserved notification entries
- device and driver conformance lines added for notification info command fields
- dropped group member prefix to the driver
- reworded text for flags requirements
- reworded to say all driver notifications in conformance
- itemize conformance entries under command to ease reading
Most of above comments were addressed as_is as you wrote of asked to write.
[..]
Quoted 12 lines
Review
Quoted 10 lines
(quoted diff) +10
-0+struct virtio_admin_cmd_legacy_notify_info_result { + struct virtio_pci_legacy_notify_info entries[4]; }; +\end{lstlisting} + +The \field{flags} value of 0x1 indicates that the notification +address is of the owner device, value of 0x2 indicates that the +notification address is of the member device, the value of 0 +indicates that all the entries starting from that entry are invalid +entries in \field{entries}. All other values in \field{flags} are +reserved. The driver skips the entries whose \field{flag} contains reservedvalue.
Quoted 2 lines
contain reserved values.
Will fix this.
Quoted 6 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+ +The \field{bar} values 0x1 to 0x5 specifies a Base Address register +(BAR),specify
Will fix this.
Quoted 10 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+when the \field{flags} is 0x1, \field{bar} specifies the Base Address +Registersone of the Base Address Registers
Review
Quoted 3 lines
(quoted diff) +3
-0+in the PCI header of the owner device, when the \field{flags} is 0x2, +\field{bar} specifies the VF BARn registers in the SR-IOV Extended +Capability of the device.
Will fix this.
Quoted 7 lines
These attempts to clarify only confused.
Problem with this is that VF BARn is not valled "Base Address register" you also did not capitalize "r" here. And also VF BARn in the capability actually refers to VF0 only. Others are calculated from that.This is why I wrote what I wrote in the previous review.
It is confusing, but I will take it as_is.
Quoted 9 lines
Review
Quoted 6 lines
(quoted diff) +4
-0+ +The \field{offset} indicates the notification address relative to the +base address associated with the BAR indicated in \field{bar}. This +valuelet's not invent the new term base address. Just "relative to the BAR" should be enough.
Will fix it.
Quoted 13 lines
Review
Quoted 10 lines
(quoted diff) +9
-0+is 2-byte aligned. + +When the command completes successfully, +\field{command_specific_result} is in the format of \field{struct +virtio_admin_cmd_legacy_notify_info_result}. The device can supply up +to 4 entries each with a different notification address. In this +case, any of the entries can be used by the driver. The order of the +entries serves as a preference hint to the driver. The driver is +expected to utilize the entries placed earlier in the array to the later ones.The driver is also expected to ignore reserved entries.
Quoted 2 lines
You need to document end of list too.
End of list is described where the flag values 0,1,2 are described. Should we duplicate here?
Quoted 3 lines
I wrote all of this in my previous review. Donnu why you decided to rewrite yet again but here we are.
I rechecked.
I didn’t find rewrite for above lines in [1].
You rewrote the conformance section.
[1] https://lists.oasis-open.org/archives/virtio-comment/202307/msg00125.html
Quoted 4 lines
Quoted 4 lines
(quoted diff) +4
-0+If within \field{struct virtio_admin_cmd_legacy_notify_info_result} +returned by VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, the \field{flags} +value for a specific \field{struct virtio_pci_legacy_notify_info} +entry is 0x0, the driver MUST ignore this entry and all the following
Quoted 9 lines
Review
Quoted 8 lines
+\field{entries}. The driver MUST additionally validate, for each
(quoted diff) +7
-0+entry, that \begin{itemize} \item the \field{flags} is either 0x0, +0x1 or 0x2 \item the \field{bar} corresponds to a valid BAR of either +the owner or the member device, depending on the \field{flags} \item +the \field{offset} is 2-byte aligned and corresponds to an address +within the BAR specified by the \field{bar} on \field{flags} +\end{itemize}, any entry which does not meet these constraints MUST +be ignored by the driver.
I didn’t rewrite this fully.
You were missing the word "ignore" after MUST in [2], so I added it.
[2] https://lists.oasis-open.org/archives/virtio-comment/202307/msg00125.html
I added normative which you didn’t write, but you gave comments for offset, alignment. I added those.
Secondly you had comment after your rewrite as:
"and MUST ignore an entry if any of these constraints are violated; this is to allow for future extensions."
Such multi-line single sentence is hard to read.
Hence, I added, "," and slightly reworded as "any entry which does not ".
I missed the end of list conformance line, sorry about it. Adding it.
Quoted 5 lines
Wait a second.
- end of list not documented - we want conformance statements
- for end of list I am guessing other fields do not matter
- entries after end of list also do not matter?
We added the description for end of list where the actual flags value is described. Missed in conformance. Will add it.
On Fri, Jul 07 2023, Parav Pandit <[email protected]> wrote:
(...)
Quoted 1 line
+When the device supports
VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFOcommand, the group
s/supports/supports the/
Quoted 1 line
+owner device hardwires VF BAR0 to zero in the SR-IOV Extended capability.
(...)
admin-cmds-legacy-interface.tex line 244
Quoted 9 lines
+\devicenormative{\paragraph}{Legacy Interface}{Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface}
admin-cmds-legacy-interface.tex new file +8
-0+ +A device MUST either support all of, or none of +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands. + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE,
s/For/For the/
admin-cmds-legacy-interface.tex line 251
Quoted 7 lines
admin-cmds-legacy-interface.tex new file +7
-0+VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, +the device MUST decode and encode (respectively) the value of the +\field{data} using the little-endian format. + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE and
s/For/For the/
admin-cmds-legacy-interface.tex line 254
Quoted 3 lines
admin-cmds-legacy-interface.tex new file +3
-0+VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ commands, +the device MUST fail the command when the value of the +\field{offset} and the length of the \field{data} does not refer to a
"do not", I think?
admin-cmds-legacy-interface.tex line 258
Quoted 4 lines
admin-cmds-legacy-interface.tex new file +4
-0+single field or is not completely within the virtio common configuration +excluding the device-specific configuration. + +For VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and
s/For/For the/
admin-cmds-legacy-interface.tex line 254
Quoted 3 lines
admin-cmds-legacy-interface.tex new file +3
-0+VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, +the device MUST fail the command when the value of the +\field{offset} and the length of the \field{data} does not refer to a
"do not"?
Quoted 31 lines
admin-cmds-legacy-interface.tex new file +31
-0+single field or is not completely within the virtio device-specific +configuration. + +The command VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE MUST have the same effect +as writing into the virtio common configuration structure through the legacy +interface. + +The command VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ MUST have the same effect as +reading from the virtio common configuration structure through the legacy +interface. + +The command VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE MUST have the same effect as +writing into the virtio device-specific configuration through the legacy +interface. + +The command VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ MUST have the same effect as +reading from the virtio device-specific configuration through the legacy +interface. + +For the SR-IOV group type, when the owner device supports +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO +commands, +\begin{itemize} +\item the owner device and the group member device SHOULD follow the rules +for the PCI Revision ID and Subsystem Device ID of the non-transitional devices +documented in section \ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}. + +\item the owner device SHOULD follow the rules for the PCI Device ID of the non-transitional +devices documented in section
admin-cmds-legacy-interface.tex line 302
Quoted 10 lines
admin-cmds-legacy-interface.tex new file +10
-0+\ref{sec:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}. + +\item any driver notification received by the device at any of the notification +address supplied in the command result of +VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO MUST function as if the device received +the notification through VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE +command at an offset \field{offset} matching \field{Queue Notify}. +\end{itemize} + +If the device supports VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO command,
s/support/supports the/
Quoted 16 lines
+\begin{itemize}
+\item the device MUST also support all ofVIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE,admin-cmds-legacy-interface.tex new file +14
-0+VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands. + +\item in the command result of VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, the last +\field{struct virtio_pci_legacy_notify_info} entry MUST have \field{flags} of +zero. + +\item in the command result of VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, valid +entries MUST have a \field{bar} which is not hardwired to zero. + +\item in the command result of VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, valid +entries MUST have an \field{offset} aligned to 2-byte. +
admin-cmds-legacy-interface.tex line 328
Quoted 10 lines
admin-cmds-legacy-interface.tex new file +10
-0+\item the device MAY support VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO with entries +of the owner device or the member device or both of them. + +\item for the SR-IOV group type, the group owner device MUST hardwire VF BAR0 +to zero in the SR-IOV Extended capability. +\end{itemize} + +\drivernormative{\paragraph}{Legacy Interface}{Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interface} + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE,
s/For/For the/
admin-cmds-legacy-interface.tex line 335
Quoted 7 lines
admin-cmds-legacy-interface.tex new file +7
-0+VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, +the driver MUST encode and decode (respectively) the value of the \field{data} +using the little-endian format. + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE and
s/For/For the/
admin-cmds-legacy-interface.tex line 346
Quoted 11 lines
admin-cmds-legacy-interface.tex new file +11
-0+VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ commands, +the driver SHOULD set \field{offset} and the length of the \field{data} +to refer to a single field within the virtio common configuration structure +excluding the device-specific configuration. + +For VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, +the driver SHOULD set \field{offset} and the length of the \field{data} +to refer to a single field within device specific configuration. + +If VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO command is supported, the driver
s/If/If the/
admin-cmds-legacy-interface.tex line 348
Quoted 2 lines
admin-cmds-legacy-interface.tex new file +2
-0+SHOULD use the notification address to send all driver notifications to the +device.
(...)
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/
Quoted 184 lines
From: [email protected] <[email protected] open.org> On Behalf Of Cornelia Huck
Sent: Monday, July 10, 2023 5:38 AMOn Fri, Jul 07 2023, Parav Pandit <[email protected]> wrote:
(...)
Quoted 1 line
+When the device supports
VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFOcommand,
Quoted 1 line
+the group
s/supports/supports the/
Quoted 1 line
+owner device hardwires VF BAR0 to zero in the SR-IOV Extended capability.
(...)
admin-cmds-legacy-interface.tex line 244
Quoted 11 lines
+\devicenormative{\paragraph}{Legacy Interface}{Basic Facilities of a
admin-cmds-legacy-interface.tex new file +10
-0+Virtio Device / Device groups / Group administration commands / +Legacy Interface} + +A device MUST either support all of, or none of +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands. + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE,s/For/For the/
admin-cmds-legacy-interface.tex
Quoted 3 lines
admin-cmds-legacy-interface.tex new file +3
-0+VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, the deviceMUST decode
admin-cmds-legacy-interface.tex line 251
Quoted 4 lines
admin-cmds-legacy-interface.tex new file +4
-0+and encode (respectively) the value of the \field{data} using the +little-endian format. + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE ands/For/For the/
Quoted 1 line
+VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ commands, the
device MUST
Review
Quoted 2 lines
(quoted diff) +2
-0+fail the command when the value of the \field{offset} and the length +of the \field{data} does not refer to a"do not", I think?
admin-cmds-legacy-interface.tex line 258
Quoted 4 lines
admin-cmds-legacy-interface.tex new file +4
-0+single field or is not completely within the virtio common +configuration excluding the device-specific configuration. + +For VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE ands/For/For the/
Quoted 1 line
+VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, the device
MUST fail
Review
Quoted 2 lines
(quoted diff) +2
-0+the command when the value of the \field{offset} and the length of +the \field{data} does not refer to a"do not"?
admin-cmds-legacy-interface.tex
Quoted 4 lines
admin-cmds-legacy-interface.tex new file +4
-0+single field or is not completely within the virtio device-specific +configuration. + +The command VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE MUSThave the
Review
Quoted 4 lines
(quoted diff) +4
-0+same effect as writing into the virtio common configuration structure +through the legacy interface. + +The command VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ MUSThave the
Review
Quoted 4 lines
(quoted diff) +4
-0+same effect as reading from the virtio common configuration structure +through the legacy interface. + +The command VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE MUST havethe same
Review
Quoted 4 lines
(quoted diff) +4
-0+effect as writing into the virtio device-specific configuration +through the legacy interface. + +The command VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ MUST havethe same
Quoted 4 lines
(quoted diff) +4
-0+effect as reading from the virtio device-specific configuration +through the legacy interface. + +For the SR-IOV group type, when the owner device supportsReview
Quoted 10 lines
(quoted diff) +10
-0+VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO +commands, +\begin{itemize} +\item the owner device and the group member device SHOULD follow the +rules for the PCI Revision ID and Subsystem Device ID of the +non-transitional devices documented in section \ref{sec:Virtio TransportOptions / Virtio Over PCI Bus / PCI Device Discovery}.
Quoted 4 lines
(quoted diff) +4
-0+ +\item the owner device SHOULD follow the rules for the PCI Device ID +of the non-transitional devices documented in section \ref{sec:Virtio +Transport Options / Virtio Over PCI Bus / PCI Device Discovery}.Review
Quoted 10 lines
(quoted diff) +10
-0+ +\item any driver notification received by the device at any of the +notification address supplied in the command result of +VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO MUST function as if the device +received the notification through +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE +command at an offset \field{offset} matching \field{Queue Notify}. +\end{itemize} + +If the device supports VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFOcommand,
s/support/supports the/
admin-cmds-legacy-interface.tex
Quoted 8 lines
+\begin{itemize}
+\item the device MUST also support all ofadmin-cmds-legacy-interface.tex new file +6
-0+VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands. + +\item in the command result of
VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO,Review
Quoted 4 lines
(quoted diff) +4
-0+the last \field{struct virtio_pci_legacy_notify_info} entry MUST have +\field{flags} of zero. + +\item in the command result of
VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO,Review
Quoted 3 lines
(quoted diff) +3
-0+valid entries MUST have a \field{bar} which is not hardwired to zero. + +\item in the command result of
VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO,Review
Quoted 3 lines
(quoted diff) +3
-0+valid entries MUST have an \field{offset} aligned to 2-byte. + +\item the device MAY support VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFOwith
Review
Quoted 11 lines
(quoted diff) +11
-0+entries of the owner device or the member device or both of them. + +\item for the SR-IOV group type, the group owner device MUST hardwire +VF BAR0 to zero in the SR-IOV Extended capability. +\end{itemize} + +\drivernormative{\paragraph}{Legacy Interface}{Basic Facilities of a +Virtio Device / Device groups / Group administration commands / +Legacy Interface} + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE,s/For/For the/
admin-cmds-legacy-interface.tex
Quoted 3 lines
admin-cmds-legacy-interface.tex new file +3
-0+VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, the driver MUSTencode
admin-cmds-legacy-interface.tex line 251
Quoted 4 lines
admin-cmds-legacy-interface.tex new file +4
-0+and decode (respectively) the value of the \field{data} using the +little-endian format. + +For VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE ands/For/For the/
Quoted 1 line
+VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ commands, the driver
SHOULD
admin-cmds-legacy-interface.tex
Quoted 6 lines
admin-cmds-legacy-interface.tex new file +6
-0+set \field{offset} and the length of the \field{data} to refer to a +single field within the virtio common configuration structure +excluding the device-specific configuration. + +For VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands, the driverSHOULD set
Review
Quoted 5 lines
+\field{offset} and the length of the \field{data} to refer to a
(quoted diff) +4
-0+single field within device specific configuration. + +If VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO command is supported, the +drivers/If/If the/
Quoted 3 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+SHOULD use the notification address to send all driver notifications +to the device.
Will fix all above comments along with other comments from Michael in v14.
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/
Quoted 10 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, July 9, 2023 9:47 AMReview
Quoted 5 lines
(quoted diff) +5
-0+If within \field{struct virtio_admin_cmd_legacy_notify_info_result} +returned by VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, the \field{flags} +value for a specific \field{struct virtio_pci_legacy_notify_info} +entry is 0x0, the driver MUST ignore this entry and all the following +\field{entries}.
Please see above, it appears to me that it covers what you asked for, no? What is missing?
Quoted 13 lines
The driver MUST additionally validate, for each
Review
Quoted 7 lines
(quoted diff) +7
-0+entry, that \begin{itemize} \item the \field{flags} is either 0x0, +0x1 or 0x2 \item the \field{bar} corresponds to a valid BAR of either +the owner or the member device, depending on the \field{flags} \item +the \field{offset} is 2-byte aligned and corresponds to an address +within the BAR specified by the \field{bar} on \field{flags} +\end{itemize}, any entry which does not meet these constraints MUST +be ignored by the driver.Wait a second.
- end of list not documented - we want conformance statements
- for end of list I am guessing other fields do not matter
- entries after end of list also do not matter?
I reread the above driver conformance statement.
It already indicates what you asked.
Quoted 5 lines · Parav Pandit
Quoted 3 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, July 9, 2023 9:47 AM
Quoted 8 lines
Quoted 5 lines
Review
Quoted 5 lines
(quoted diff) +5
-0+If within \field{struct virtio_admin_cmd_legacy_notify_info_result} +returned by VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, the \field{flags} +value for a specific \field{struct virtio_pci_legacy_notify_info} +entry is 0x0, the driver MUST ignore this entry and all the following +\field{entries}.Please see above, it appears to me that it covers what you asked for, no? What is missing?
Oh, my bad. I agree. following stresses this a bit more:
is 0x0, then the driver MUST ignore this entry as well as all the following \field{entries} until the end of the structure.
Quoted 14 lines
Quoted 13 lines
The driver MUST additionally validate, for each
Review
Quoted 7 lines
(quoted diff) +7
-0+entry, that \begin{itemize} \item the \field{flags} is either 0x0, +0x1 or 0x2 \item the \field{bar} corresponds to a valid BAR of either +the owner or the member device, depending on the \field{flags} \item +the \field{offset} is 2-byte aligned and corresponds to an address +within the BAR specified by the \field{bar} on \field{flags} +\end{itemize}, any entry which does not meet these constraints MUST +be ignored by the driver.Wait a second.
- end of list not documented - we want conformance statements
- for end of list I am guessing other fields do not matter
- entries after end of list also do not matter?
Quoted 2 lines
I reread the above driver conformance statement.
It already indicates what you asked.
So the above two do not contradict. They kind of seem to since 1st one says ignore second says validate, until you look closely and see that the result of validation is to ignore.
I suggest we clarify it's other entries not each entry:
MUST ignore this entry and all the following \field{entries}.
Additionally, for all other entries, the driver MUST validate that \begin{itemize} \item the \field{flags} is either 0x1 or 0x2 ....
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 49 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, July 10, 2023 11:17 AMQuoted 4 lines
Quoted 2 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Sunday, July 9, 2023 9:47 AMQuoted 9 lines
Quoted 6 lines
Review
Quoted 6 lines
(quoted diff) +6
-0+If within \field{struct +virtio_admin_cmd_legacy_notify_info_result} +returned by VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO, the +\field{flags} value for a specific \field{struct +virtio_pci_legacy_notify_info} entry is 0x0, the driver MUST +ignore this entry and all the following \field{entries}.Please see above, it appears to me that it covers what you asked for, no? What is missing?
Oh, my bad. I agree. following stresses this a bit more:
is
0x0, then the driver MUST ignore this entry as well as all the following \field{entries} until the end of the structure.Quoted 15 lines
Quoted 14 lines
The driver MUST additionally validate, for each
Review
Quoted 8 lines
(quoted diff) +8
-0+entry, that \begin{itemize} \item the \field{flags} is either +0x0, +0x1 or 0x2 \item the \field{bar} corresponds to a valid BAR of +either the owner or the member device, depending on the +\field{flags} \item the \field{offset} is 2-byte aligned and +corresponds to an address within the BAR specified by the +\field{bar} on \field{flags} \end{itemize}, any entry which does +not meet these constraints MUST be ignored by the driver.Wait a second.
- end of list not documented - we want conformance statements
- for end of list I am guessing other fields do not matter
- entries after end of list also do not matter?Quoted 2 lines
I reread the above driver conformance statement.
It already indicates what you asked.So the above two do not contradict. They kind of seem to since 1st one says ignore second says validate, until you look closely and see that the result of validation is to ignore.
I suggest we clarify it's other entries not each entry:
Quoted 5 lines
MUST ignore this entry and all the following \field{entries}.
Additionally, for all other entries, the driver MUST validate that \begin{itemize} \item the \field{flags} is either
0x1or0x2....
Sounds good. Revising it.
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/