admin: Introduce legacy registers access using AQ
v6 cover admin: Introduce legacy registers access using AQ
This short series introduces legacy registers access commands for the owner group member PCI PF to access the legacy registers of the member VFs.
If in future any SIOV devices to support legacy registers, they can be easily supported using same commands by using the group member identifiers of the future SIOV devices.
More details as overview, motivation, use case are further described below.
Patch summary:
--------------
patch-1 split rows of admin opcode tables by a line patch-2 adds administrative virtuqueue commands patch-3 adds its conformance section and links
It uses the newly introduced administrative virtqueue facility with 4 new commands which uses the existing virtio_admin_cmd.
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 an admin virtqueue of the group owner PCI PF.
Two new admin virtqueue commands are added which read/write PCI VF registers.
Software usage example:
-----------------------
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 | |
| +--------------+ +-----------------+ |
| |
+------+-------------------------+-----------+
| |
| Driver notification
| |
| |
+----+------------+ +----+------------+
| +-----+ | | PCI VF device A |
| | AQ |-------------+---->+-------------+ |
| +-----+ | | | | legacy regs | |
| PCI PF device | | | +-------------+ |
+-----------------+ | +-----------------+
|
| +----+------------+
| | PCI VF device N |
+---->+-------------+ |
| | legacy regs | |
| +-------------+ |
+-----------------+2. Virtio pci driver to bind to the listed device id and use it in the host.
3. Use it in a light weight hypervisor to run bare-metal OS.
Please review.
Alternatives considered:
========================
1. Exposing BAR0 as MMIO BAR that follows legacy registers template Pros:
a. Kind of works with legacy drivers as some of them have used API
which is agnostic to MMIO vs IOBAR.
b. Does not require hypervisor intervantion
Cons:
a. Device reset is extremely hard to implement in device at scale as
driver does not wait for device reset completion
b. Device register width related problems persist that hypervisor if
wishes, it cannot be fixed.
2. Accessing VF registers by tunneling it through new legacy PCI capability Pros:
a. Self contained, but cannot work with future PCI SIOV devices Cons:
a. Equally slow as AQ access
b. Still requires new capability for notification access
c. Requires hardware to build low level registers access which is not worth
for long term future
3. Accessing VF notification region using new PF BAR
Cons:
a. Requires hardware to build new PCI steering logic per PF to forward
notification from the PF to VF, requires double the amount of logic compared to today
b. Requires very large additional PF BAR whose size must be max_Vfs * BAR size.
4. Trapping CVQ, configuration region, LEGACY_HDR
Cons:
a. This does not fullfil the very basic requirement to not trap the
1.x objects (configuration registers, vqs)
b. Requires feature negotiations mediation in hypervisor software c. Requires constant device type specific knowledge in hypervisor driver
(Does not scale for 30+ device types)
conclusion for picking AQ approach:
==================================
1. Overall AQ based access is simpler to implement with combination of best from software and device so that legacy registers do not get baked in the device hardware
2. AQ allows hypervisor software to intercept legacy registers and make corrections if needed
3. Provides trade-off between performance, device complexity vs spec, while still maintaining passthrough mode for the VFs with minimal hypervisor intercepts only for legacy registers access
4. AQ mechanism is designed for accessing other member devices registers as noted in AQ submission, it utilizes the existing infrastructure over other alternatives.
5. Uses existing driver notification region similar to legacy notification saves hardware resources
---
changelog:v5->v6:
- fixed previous missed abbreviation of LCC and LD
- added text for the PCI capability for the group member device v4->v5:
- split pci transport and generic command section to new patch
- removed multiple references to the VF
- written the description of the command as generic with member
and group device terminology
- reflected many section names to remove VF
- 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 configv3->v4:
- moved noted to the conformance section details in next patch
- removed queue notify address query AQ command on Michael's suggestion, though it is fine. Instead replaced with extending virtio_pci_notify_cap to indicate that legacy queue notifications can be done on the notification location
- fixed spelling errors
- replaced administrative virtqueue to administration virtqueue
- moved legacy interface normative references to legacy conformance sectionv2->v3:
- added new patch to split raws of admin vq opcode table
- adddressed Jason and Michael's comment to split single register access command to common config and device specific commands.
- dropped the suggetion to introduce enable/disable command as
admin command cap bit already covers it.
- added other alternative design considered and discussed in detail in v0, v1 and v2 v1->v2:
- addressed comments from Michael
- added theory of operation
- grammar corrections
- removed group fields description from individual commands as
it is already present in generic section
- added endianness normative for legacy device registers region
- renamed the file to drop vf and add legacy prefix
- added overview in commit log
- renamed subsection to reflect commandv0->v1:
- addressed comments, suggesetions and ideas from Michael Tsirkin and Jason Wang
- far more simpler design than MMR access
- removed complexities of MMR device ids
- removed complexities of MMR registers and extended capabilities
- dropped adding new extended capabilities because if if they are added, a pci device still needs to have existing capabilities
in the legacy configuration space and hypervisor driver do not
need to access them
Parav Pandit (4):
admin: Split opcode table rows with a line
admin: Fix section numbering
admin: Add group member legacy register access commands
transport-pci: Introduce group legacy group member config region
access
admin-cmds-legacy-access.tex | 138 ++++++++++++++++++++++++++++++++++ admin.tex | 18 ++++- conformance.tex | 5 ++ transport-pci-legacy-regs.tex | 48 ++++++++++++ transport-pci.tex | 20 +++++ 5 files changed, 226 insertions(+), 3 deletions(-) create mode 100644 admin-cmds-legacy-access.tex create mode 100644 transport-pci-legacy-regs.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 v6 1/4 admin: Split opcode table rows with a line
Currently all opcode appears to be in a single row. Separate them with a line similar to other tables.
---
changelog:v2->v3:
- new patch
--- admin.tex | 2 ++ 1 file changed, 2 insertions(+)
admin.tex +2 -0
@@ -114,7 +114,9 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti opcode & Name & Command Description \\ \hline \hline 0x0000 & VIRTIO_ADMIN_CMD_LIST_QUERY & Provides to driver list of commands supported for this group type \\ +\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} \\ \hline 0x8000 - 0xFFFF & - & Reserved for future commands (possibly using a different structure) \\
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 v6 4/4 transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditThis patch links how in a PCI transport a group owner can access group member (PCI VFs) legacy registers using a legacy registers access commands using administration virtqueue infrastructure.
Additionally it extend the PCI notification capability through which a PCI VF device indicates to the driver which PCI BAR region to be used for driver notifications.
---
changelog:v5->v6:
- aligned pci capability to 4B as required by PCI spec
- added text for the PCI capability for the group member device v4->v5:
- split pci transport and generic command section to new patch
- removed multiple references to the VF
- written the description of the command as generic with member and group device terminology
- reflected many section names to remove VFv3->v4:
- moved noted to the conformance section details in next patch
- removed queue notify address query AQ command on Michael's suggestion, though it is fine. Instead replaced with extending virtio_pci_notify_cap to indicate that legacy queue notifications can be done on the notification location.
- fixed spelling errors.
- replaced administrative virtqueue to administration virtqueue
- added queue notification capability register to indicate legacy q notification supportedv2->v3:
- adddressed Jason and Michael's comment to split single register access command to common config and device specific commands.
- dropped the suggetion to introduce enable/disable command as admin command cap bit already covers it.v1->v2:
- addressed comments from Michael
- added theory of operation
- grammar corrections
- removed group fields description from individual commands as it is already present in generic section
- added endianness normative for legacy device registers region
- renamed the file to drop vf and add legacy prefix
- added overview in commit log
- renamed subsection to reflect command
--- conformance.tex | 3 +++ transport-pci-legacy-regs.tex | 48 +++++++++++++++++++++++++++++++++++ transport-pci.tex | 20 +++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 transport-pci-legacy-regs.tex
conformance.tex +3 -0
@@ -267,6 +267,9 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} \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 / 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{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: Group Member Device Legacy Configuration Access} +\item Section \ref{drivernormative:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: Group Member Device Legacy Configuration Access} +\item Section \ref{par:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Legacy Interfaces: Notification capability} \item Section \ref{sec:Virtio Transport Options / Virtio Over MMIO / Legacy interface} \item Section \ref{sec:Virtio Transport Options / Virtio over channel I/O / Device Initialization / Setting the Virtio Revision / Legacy Interfaces: A Note on Setting the Virtio Revision} \item Section \ref{sec:Virtio Transport Options / Virtio over channel I/O / Device Initialization / Configuring a Virtqueue / Legacy Interface: A Note on Configuring a Virtqueue}
transport-pci-legacy-regs.tex new file +48 -0
48 lines not on this page · raw message
transport-pci.tex +20 -0
@@ -541,6 +541,8 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options struct virtio_pci_notify_cap { struct virtio_pci_cap cap; le32 notify_off_multiplier; /* Multiplier for queue_notify_off. */ + u8 legacy_q_notify_supported; + u8 reserved[3]; }; \end{lstlisting}
@@ -560,6 +562,14 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options the same Queue Notify address for all queues. \end{note} +\field{legacy_q_notify_supported} when set to 1, indicates that the device +supports legacy queue notifications at this notification location. Legacy Queue +Notification address is derived within a BAR for a virtqueue: + +\begin{lstlisting} + cap.offset +\end{lstlisting} + \devicenormative{\paragraph}{Notification capability}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification capability} The device MUST present at least one notification capability.
@@ -596,6 +606,14 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options cap.length >= queue_notify_off * notify_off_multiplier + 4 \end{lstlisting} +\paragraph{Legacy Interfaces: Notification capability}\label{par:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Legacy Interfaces: Notification capability} + +The device SHOULD set \field{legacy_q_notify_supported} when the device +notification location supports legacy driver notifications. + +The driver in the hypervisor MAY use notification location for accessing +legacy queue notify address when the device supports it. + \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
@@ -1212,3 +1230,5 @@ \subsubsection{Driver Handling Interrupts}\label{sec:Virtio Transport Options / re-examine the configuration space to see what changed. \end{itemize} \end{itemize} + +\input{transport-pci-legacy-regs.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 v6 3/4 admin: Add group member legacy register access commands
In reply to Parav PanditIntroduce group member legacy common configuration and legacy device configuration access read/write commands.
Group member legacy registers access commands enable group owner driver software 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 an admin virtqueue 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:v5->v6:
- fixed previous missed abbreviation of LCC and LD v4->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-access.tex | 138 +++++++++++++++++++++++++++++++++++ admin.tex | 12 ++- conformance.tex | 2 + 3 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 admin-cmds-legacy-access.tex
admin-cmds-legacy-access.tex new file +138 -0
@@ -0,0 +1,138 @@ +\subsubsection{Legacy Interfaces: legacy configuration access commands}\label{sec:Basic Facilities of a Virtio Device / Device groups / Group +administration commands / Legacy Interfaces: legacy configuration access commands} + +The group owner device can optionally enable the driver to access its member devices legacy common +configuration and device configuration region using following listed +administrative commands: + +\begin{enumerate} +\item Legacy Common Configuration Region Write Command +\item Legacy common Configuration Region Read Command +\item Legacy Device Configuration Region Write Command +\item Legacy Device Configuration Region Read Command +\end{enumerate} + +\paragraph{Legacy Common Configuration Region Write Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group +administration commands / Legacy Interfaces: legacy configuration access commands / Legacy Common Configuration Region Write Command} + +This command writes in a legacy common configuration region of a group member device. +This command follows \field{struct virtio_admin_cmd}. +This command uses following structure for \field{command_specific_data}: + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_common_cfg_wr_data { + u8 offset; /* Starting byte offset of the common configuration region to write */ + u8 region_data[]; +}; +\end{lstlisting} + +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE. +The driver sets valid \field{offset} and associated \field{region_data} bytes to +write to the common configuration region. + +This command does not have any command specific result. + +\paragraph{Legacy Common Configuration Region Read Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interfaces: legacy configuration access commands / Legacy Common Configuration Region Read Command} + +This command reads from a legacy common configuration region of a group member device. +This command follows \field{struct virtio_admin_cmd}. +This command uses following listed structure for \field{command_specific_data}: + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_common_cfg_rd_data { + u8 offset; /* Starting byte offset of the common configuration region to read */ +}; +\end{lstlisting} + +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ. + +The driver sets valid \field{offset} of the region from where to read +\field{region_data}. + +When command completes successfully, \field{command_specific_result} +uses following listed structure: + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_common_cfg_rd_result { + u8 region_data[]; +}; +\end{lstlisting} + +\paragraph{Legacy Device Configuration Region Write Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interfaces: legacy configuration access commands / Legacy Device Configuration Region Write Command} + +This command writes in a legacy device configuration registers of a group member device. +This command follows \field{struct virtio_admin_cmd}. +This command uses following structure for \field{command_specific_data}: + +\begin{lstlisting} +struct virtio_admin_cmd_ld_reg_wr_data { + u8 offset; /* Starting byte offset of the device configuration region to write */ + u8 region_data[]; +}; +\end{lstlisting} + +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LEGACY_DEV_REG_WRITE. +The driver sets valid \field{offset} and associated \field{region_data} bytes to +the device configuration region. + +This command does not have any command specific result. + +\paragraph{Legacy Device Registers Read Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interfaces: legacy configuration access commands / Legacy Device Configuration Region Read Command} + +This command reads from a legacy device configuration region of a group member device. +This command follows \field{struct virtio_admin_cmd}. + +This command uses following listed structure for \field{command_specific_data}: + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_dev_cfg_rd_data { + u8 offset; /* Starting byte offset of the device configuration region to read */ +}; +\end{lstlisting} + +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LEGACY_DEV_REG_READ. +The driver sets valid \field{offset} of the device configurationi region from +where to read \field{region_data}. + +When command completes successfully, \field{command_specific_result} +uses following listed structure: + +\begin{lstlisting} +struct virtio_admin_cmd_ld_reg_rd_result { + u8 region_data[]; +}; +\end{lstlisting} + +\devicenormative{\paragraph}{Legacy Interfaces: legacy configuration access commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interfaces: legacy configuration access commands} + +If the group owner device supports legacy registers access for its group members, +the device MUST set all corresponding bits for commands +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 in +the command result of VIRTIO_ADMIN_CMD_LIST_QUERY in +\field{device_admin_cmd_opcodes}. + +The device MUST encode and decode legacy device specific registers using +little-endian format. + +The device MUST fail VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ commands for the invalid offset +which is outside the legacy common configuration register's address range. + +The device MUST fail VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands for the invalid offset +which is outside the legacy device specific register's address range. + +\drivernormative{\paragraph}{Legacy Interfaces: legacy configuration access commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interfaces: legacy configuration access commands} + +The driver MUST encode and decode legacy device specific registers using +little-endian format. + +The driver SHOULD send VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ commands with a valid offset which +is in the legacy common configuration region address range. + +The driver SHOULD send commands VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ with a valid offset which is in the legacy +device specific configuration region address range.
admin.tex +11 -1
@@ -117,7 +117,15 @@ \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 & Write legacy common configuration region of a member device \\ +\hline +0x0003 & VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ & Read legacy common configuration region of a member device \\ +\hline +0x0004 & VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE & Write legacy device configuration region of a member device \\ +\hline +0x0005 & VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ & Read legacy device configuration region of a member device \\ +\hline +0x0006 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd} \\ \hline 0x8000 - 0xFFFF & - & Reserved for future commands (possibly using a different structure) \\ \hline
@@ -286,6 +294,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-access.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 Interfaces: legacy configuration access commands} +\item Section \ref{drivernormative:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interfaces: legacy configuration access commands} \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]
PATCH v6 2/4 admin: Fix section numbering
In reply to Parav PanditRequirements are put one additional level down. Fix it.
---
changelog:v4->v5:
- new patch
--- admin.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
admin.tex +2 -2
@@ -286,7 +286,7 @@ \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. -\devicenormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} +\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 \field{group_member_id}, and if any of these has an invalid or
@@ -378,7 +378,7 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti \field{VF Enable} refer to registers within the SR-IOV Extended Capability as specified by \hyperref[intro:PCIe]{[PCIe]}. -\drivernormative{\paragraph}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} +\drivernormative{\subsubsection}{Group administration commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands} The driver MAY discover whether device supports a specific group type by issuing VIRTIO_ADMIN_CMD_LIST_QUERY with the matching
Signature · 6 lines
2.26.2 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Hi Michael,
Quoted 6 lines
From: Parav Pandit <[email protected]>
Sent: Tuesday, June 13, 2023 1:30 PMThis short series introduces legacy registers access commands for the owner group member PCI PF to access the legacy registers of the member VFs.
[..]
Quoted 13 lines
Signed-off-by Parav Pandit <[email protected]>---
changelog:v5->v6:
- fixed previous missed abbreviation of LCC and LD
- added text for the PCI capability for the group member devicev4->v5:
- split pci transport and generic command section to new patch
- removed multiple references to the VF
- written the description of the command as generic with member and group device terminology
Quoted 8 lines
- reflected many section names to remove VF
- 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
Do you have any further comments?
I would like to raise for the vote now as this is in oven for several months now and users need this in 1.3 spec. If there are any editorial fixes, I can fix them now with v7 or
if they are small, I can fix them during the voting wait period like how we completed AQ fixes. Please let me know.
Quoted 33 lines · Parav Pandit
Hi Michael,
Quoted 6 lines
From: Parav Pandit <[email protected]>
Sent: Tuesday, June 13, 2023 1:30 PMThis short series introduces legacy registers access commands for the owner group member PCI PF to access the legacy registers of the member VFs.
[..]
Quoted 13 lines
Signed-off-by Parav Pandit <[email protected]>---
changelog:v5->v6:
- fixed previous missed abbreviation of LCC and LD
- added text for the PCI capability for the group member devicev4->v5:
- split pci transport and generic command section to new patch
- removed multiple references to the VF
- written the description of the command as generic with member and group device terminologyQuoted 8 lines
- reflected many section names to remove VF
- 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
Quoted 5 lines
Do you have any further comments?
I would like to raise for the vote now as this is in oven for several months now and users need this in 1.3 spec. If there are any editorial fixes, I can fix them now with v7 or
if they are small, I can fix them during the voting wait period like how we completed AQ fixes. Please let me know.
Just back from travel. I remember having comments, will send in a day or two. I don't think we are talking about editorial things though.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 7 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 11:19 AMJust back from travel. I remember having comments, will send in a day or two. I don't think we are talking about editorial things though.
Let me know what are those new one those were not asked in v4.
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 v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditQuoted 10 lines · Parav Pandit
This patch links how in a PCI transport a group owner can access group member (PCI VFs) legacy registers using a legacy registers access commands using administration virtqueue infrastructure.
Additionally it extend the PCI notification capability through which a PCI VF device indicates to the driver which PCI BAR region to be used for driver notifications.
I'd love to just put this stuff in a separate tex document and just link there from the generic thing.
Or if it's too hard, please create new sections for this stuff. But in this case each of these sections has to start with repeating the description when things apply. E.g. "when using legacy interface" when using commands "A B C to access" etc etc.
I wrote a bunch of comments below.
Quoted 64 lines
---
changelog:v5->v6:
- aligned pci capability to 4B as required by PCI spec
- added text for the PCI capability for the group member devicev4->v5:
- split pci transport and generic command section to new patch
- removed multiple references to the VF
- written the description of the command as generic with member and group device terminology
- reflected many section names to remove VFv3->v4:
- moved noted to the conformance section details in next patch
- removed queue notify address query AQ command on Michael's suggestion, though it is fine. Instead replaced with extendingvirtio_pci_notify_capto indicate that legacy queue notifications can be done on the notification location.
- fixed spelling errors.
- replaced administrative virtqueue to administration virtqueue
- added queue notification capability register to indicate legacy q notification supportedv2->v3:
- adddressed Jason and Michael's comment to split single register access command to common config and device specific commands.
- dropped the suggetion to introduce enable/disable command as admin command cap bit already covers it.v1->v2:
- addressed comments from Michael
- added theory of operation
- grammar corrections
- removed group fields description from individual commands as it is already present in generic section
- added endianness normative for legacy device registers region
- renamed the file to drop vf and add legacy prefix- added overview in commit log
- renamed subsection to reflect command--- conformance.tex | 3 +++ transport-pci-legacy-regs.tex | 48 +++++++++++++++++++++++++++++++++++ transport-pci.tex | 20 +++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 transport-pci-legacy-regs.texconformance.tex +3
-0@@ -267,6 +267,9 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets} \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 / 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{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: Group Member Device Legacy Configuration Access} +\item Section \ref{drivernormative:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: Group Member Device Legacy Configuration Access} +\item Section \ref{par:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Legacy Interfaces: Notification capability} \item Section \ref{sec:Virtio Transport Options / Virtio Over MMIO / Legacy interface} \item Section \ref{sec:Virtio Transport Options / Virtio over channel I/O / Device Initialization / Setting the Virtio Revision / Legacy Interfaces: A Note on Setting the Virtio Revision} \item Section \ref{sec:Virtio Transport Options / Virtio over channel I/O / Device Initialization / Configuring a Virtqueue / Legacy Interface: A Note on Configuring a Virtqueue}transport-pci-legacy-regs.tex new file +0
-0
transport-pci-legacy-regs.tex line 6
Quoted 6 lines
transport-pci-legacy-regs.tex new file +6
-0@@ -0,0 +1,48 @@ +\subsection{Legacy Interfaces: Group member device Configuration Region Access}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: Group Member Device Configuration Region Access} + +As described in PCIe base specification \hyperref[intro:PCIe]{[PCIe]} PCI VFs +do not support the I/O space BAR. Due to this limitation, a PCI VF hardware +device that supports legacy interfaces cannot be attached as passthrough +device to the guest virtual machine.
That's not the only reason. Let's keep things generic and start by saying something like "Some configurations with a need to support legacy drivers can not implement a transitional device. For example .... ".
transport-pci-legacy-regs.tex
Quoted 3 lines
transport-pci-legacy-regs.tex new file +3
-0+ +To have a transitional or legacy virtio device in the guest virtual machine, +a PCI PF device as a group owner may
may -> can outside conformance statements.
Quoted 1 line
support accessing its group member
Pls keep it generic. A group owner ....
transport-pci-legacy-regs.tex
Quoted 5 lines
transport-pci-legacy-regs.tex new file +5
-0+device's legacy configuration region using the group administration commands +listed at \ref{sec:Basic Facilities of a Virtio Device / Device groups / Group +administration commands / Legacy Interfaces: legacy configuration access commands}. +These legacy configuration access commands are transported via the +administration virtqueue.
are these called legacy configuration access commands then? why do you introduce this term? it does not look like it's used anywhere else.
I would prefer it if you just use the term "legacy interface" it is well defined and widely used in the spec.
again leave virtqueue out of it pls we'll have other ways down the road. what matters is that they are transferred to a group member by sending legacy configuration access commands to the group owner.
Quoted 2 lines
This mechanism enables minimal involvement of the
+hypervisor software only for the purpose of the legacy configuration region access.
Leave marketing out of it pls, kill last sentence.
transport-pci-legacy-regs.tex
Quoted 3 lines
transport-pci-legacy-regs.tex new file +3
-0+ +When a guest virtual machine requests legacy configuration and device +specific regions
wait so now it's legacy configuration and device specific regions and these two are distinct?
Quoted 2 lines
of group member device, a hypervisor software accesses +it using an administration virtqueue
please talk of administration commands. virtqueue does not matter at all.
Quoted 1 line
on behalf of the guest virtual machine.
To put it in our terms, something like this:
when a legacy driver accesses a member device of a group using the
legacy interface, a modern driver can intercept the access and forward it to the owner device.
transport-pci-legacy-regs.tex line 22
Quoted 3 lines
transport-pci-legacy-regs.tex new file +3
-0+ +Even though virtqueue driver notifications can be communicated through +administration virtqueue, if the group member device support such
supports?
transport-pci-legacy-regs.tex line 24
Quoted 2 lines
transport-pci-legacy-regs.tex new file +2
-0+notifications using a memory-mapped operation, such driver notifications +are sent using a group member device defined notification region.
what does "are sent" imply here? is there a matching conformance statement? who sends them?
transport-pci-legacy-regs.tex
Quoted 2 lines
transport-pci-legacy-regs.tex new file +2
-0+ +The group owner device
this is the 1st you mention any group or its owner.
Quoted 1 line
should not expose PCI BAR0
Not PCI BAR0. That is in header. You mean VF BAR0.
transport-pci-legacy-regs.tex line 28
Quoted 3 lines
for the group member
transport-pci-legacy-regs.tex new file +2
-0+devices when it prefers to support legacy interface for legacy configuration +access using its group owner.
don't use should outside conformance
I think this specific case actually should be more specific. Something like:
- For PCI SRIOV groups, when group owner device implements commands A,B,C the group owner's VF BAR 0 is hardwired to 0
in its PCI SRIOV capability.
transport-pci-legacy-regs.tex
Quoted 2 lines
transport-pci-legacy-regs.tex new file +2
-0+This facilitates hypervisor software to operate with least amount of +complexities
complexity is its own plural
Quoted 4 lines
to emulate the legacy interface I/O space BAR and passthrough
transport-pci-legacy-regs.tex new file +3
-0+other PCI BARs and PCI device capabilities to the guest virtual machine +without any translation. +
transport-pci-legacy-regs.tex line 43
Quoted 10 lines
transport-pci-legacy-regs.tex new file +10
-0+The group member device should not expose PCI BAR0 in various PCI capabilities. + +\devicenormative{\subsubsection}{Legacy Interfaces Requirements: Group Member Device Legacy Configuration Access}{Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: Group Member Device Legacy Configuration Access} + +When a PCI SR-IOV group 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 commands, the group owner device SHOULD +NOT expose PCI BAR0 in the SR-IOV Extended capability. This is to facilitate the +software to emulate I/O region BAR0 for supporting the legacy interface.
not PCI BAR0 - VF BAR0. Check the PCI spec
you can not "not expose it". if you want to
register can be "unimplemented".
Base Address registers are hardwired to zero
But it is better to be specific on what should happen. hardwire VF BAR0 to 0, right?
transport-pci-legacy-regs.tex line 48
Quoted 5 lines
transport-pci-legacy-regs.tex new file +5
-0+ +\drivernormative{\subsubsection}{Legacy Interfaces Requirements: Group Member Device Legacy Configuration Access}{Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: Group Member Device Legacy Configuration Access} + +The driver SHOULD NOT emulate I/O region BAR0 if a device group member exposes +a PCI BAR0.
what does "emulate" mean here? which driver it is?
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 544
Quoted 9 lines
transport-pci.tex +1
-0@@ -541,6 +541,8 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options struct virtio_pci_notify_cap { struct virtio_pci_cap cap; le32 notify_off_multiplier; /* Multiplier for queue_notify_off. */ + u8 legacy_q_notify_supported;
I am still mulling whether VIRTIO_PCI_CAP_NOTIFY_CFG would be better.
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 545
Quoted 1 line
transport-pci.tex +1
-0+ u8 reserved[3];
align with spaces pls.
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 565
Quoted 8 lines
transport-pci.tex +1
-0}; \end{lstlisting}@@ -560,6 +562,14 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options the same Queue Notify address for all queues. \end{note} +\field{legacy_q_notify_supported} when set to 1,
Do you mean something like:
When \field{legacy_q_notify_supported} this indicates that ...
Quoted 2 lines
indicates that the device
+supports legacy queue notifications at this notification location.
And what location? this refers to what? the location described by this capability maybe?
More specifically, assume a transitional device (with an IO BAR as normal). Does presence of this flag in the capability imply we can use a legacy queue but use this notification with this capability?
I worry that if we allow that, it opens floodgates of people who are too lazy to upgrade to 1.0 but just hack
this notification in there.
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 574
Quoted 10 lines
Legacy Queue
transport-pci.tex +6
-0+Notification address is derived within a BAR for a virtqueue: + +\begin{lstlisting} + cap.offset +\end{lstlisting} + \devicenormative{\paragraph}{Notification capability}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification capability} The device MUST present at least one notification capability.
I don't get what this is saying. I *think* you really mean is that queue_notify_off is 0.
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 611
Quoted 7 lines
transport-pci.tex +3
-0@@ -596,6 +606,14 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options cap.length >= queue_notify_off * notify_off_multiplier + 4 \end{lstlisting} +\paragraph{Legacy Interfaces: Notification capability}\label{par:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Legacy Interfaces: Notification capability} + +The device SHOULD set \field{legacy_q_notify_supported}
why SHOULD and not MUST here - if driver checks for it then it won't work without no?
Quoted 2 lines
when the device
+notification location supports legacy driver notifications.
legacy driver notifications is ambigous.
what you want here and elsewhere is something like "when used through a legacy interface, device supports driver
Quoted 15 lines
transport-pci.tex +6
-0+ +The driver in the hypervisor MAY use notification location for accessing +legacy queue notify address when the device supports it. + \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@@ -1212,3 +1230,5 @@ \subsubsection{Driver Handling Interrupts}\label{sec:Virtio Transport Options / re-examine the configuration space to see what changed. \end{itemize} \end{itemize} + +\input{transport-pci-legacy-regs.tex}Signature · 1 line
2.26.2
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH v6 3/4] admin: Add group member legacy register access commands
In reply to Parav PanditQuoted 121 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 software 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 an admin virtqueue 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.
Signed-off-by Parav Pandit <[email protected]>---
changelog:v5->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-access.tex | 138 +++++++++++++++++++++++++++++++++++ admin.tex | 12 ++- conformance.tex | 2 + 3 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 admin-cmds-legacy-access.texadmin-cmds-legacy-access.tex new file +0
-0
admin-cmds-legacy-access.tex line 2
Quoted 2 lines
admin-cmds-legacy-access.tex new file +2
-0@@ -0,0 +1,138 @@ +\subsubsection{Legacy Interfaces: legacy configuration access commands}\label{sec:Basic Facilities of a Virtio Device / Device groups / Group +administration commands / Legacy Interfaces: legacy configuration access commands}
I think this is where all the theory of operation text should go.
admin-cmds-legacy-access.tex
Quoted 3 lines
admin-cmds-legacy-access.tex new file +3
-0+ +The group owner device can optionally enable the driver to access its member devices legacy common +configuration and device configuration region
we can just say "the legacy interface of member
devices"
Quoted 1 line
using following listed
using the following
Quoted 1 line
+administrative commands:
administration not administrative
Quoted 184 lines
admin-cmds-legacy-access.tex new file +132
-0+ +\begin{enumerate} +\item Legacy Common Configuration Region Write Command +\item Legacy common Configuration Region Read Command +\item Legacy Device Configuration Region Write Command +\item Legacy Device Configuration Region Read Command +\end{enumerate} + +\paragraph{Legacy Common Configuration Region Write Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group +administration commands / Legacy Interfaces: legacy configuration access commands / Legacy Common Configuration Region Write Command} + +This command writes in a legacy common configuration region of a group member device. +This command follows \field{struct virtio_admin_cmd}. +This command uses following structure for \field{command_specific_data}: + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_common_cfg_wr_data { + u8 offset; /* Starting byte offset of the common configuration region to write */ + u8 region_data[]; +}; +\end{lstlisting} + +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE. +The driver sets valid \field{offset} and associated \field{region_data} bytes to +write to the common configuration region. + +This command does not have any command specific result. + +\paragraph{Legacy Common Configuration Region Read Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interfaces: legacy configuration access commands / Legacy Common Configuration Region Read Command} + +This command reads from a legacy common configuration region of a group member device. +This command follows \field{struct virtio_admin_cmd}. +This command uses following listed structure for \field{command_specific_data}: + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_common_cfg_rd_data { + u8 offset; /* Starting byte offset of the common configuration region to read */ +}; +\end{lstlisting} + +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ. + +The driver sets valid \field{offset} of the region from where to read +\field{region_data}. + +When command completes successfully, \field{command_specific_result} +uses following listed structure: + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_common_cfg_rd_result { + u8 region_data[]; +}; +\end{lstlisting} + +\paragraph{Legacy Device Configuration Region Write Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interfaces: legacy configuration access commands / Legacy Device Configuration Region Write Command} + +This command writes in a legacy device configuration registers of a group member device. +This command follows \field{struct virtio_admin_cmd}. +This command uses following structure for \field{command_specific_data}: + +\begin{lstlisting} +struct virtio_admin_cmd_ld_reg_wr_data { + u8 offset; /* Starting byte offset of the device configuration region to write */ + u8 region_data[]; +}; +\end{lstlisting} + +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LEGACY_DEV_REG_WRITE. +The driver sets valid \field{offset} and associated \field{region_data} bytes to +the device configuration region. + +This command does not have any command specific result. + +\paragraph{Legacy Device Registers Read Command}\label{par:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interfaces: legacy configuration access commands / Legacy Device Configuration Region Read Command} + +This command reads from a legacy device configuration region of a group member device. +This command follows \field{struct virtio_admin_cmd}. + +This command uses following listed structure for \field{command_specific_data}: + +\begin{lstlisting} +struct virtio_admin_cmd_legacy_dev_cfg_rd_data { + u8 offset; /* Starting byte offset of the device configuration region to read */ +}; +\end{lstlisting} + +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LEGACY_DEV_REG_READ. +The driver sets valid \field{offset} of the device configurationi region from +where to read \field{region_data}. + +When command completes successfully, \field{command_specific_result} +uses following listed structure: + +\begin{lstlisting} +struct virtio_admin_cmd_ld_reg_rd_result { + u8 region_data[]; +}; +\end{lstlisting} + +\devicenormative{\paragraph}{Legacy Interfaces: legacy configuration access commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interfaces: legacy configuration access commands} + +If the group owner device supports legacy registers access for its group members, +the device MUST set all corresponding bits for commands +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 in +the command result of VIRTIO_ADMIN_CMD_LIST_QUERY in +\field{device_admin_cmd_opcodes}. + +The device MUST encode and decode legacy device specific registers using +little-endian format. + +The device MUST fail VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ commands for the invalid offset +which is outside the legacy common configuration register's address range. + +The device MUST fail VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE, +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ commands for the invalid offset +which is outside the legacy device specific register's address range. + +\drivernormative{\paragraph}{Legacy Interfaces: legacy configuration access commands}{Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interfaces: legacy configuration access commands} + +The driver MUST encode and decode legacy device specific registers using +little-endian format. + +The driver SHOULD send VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ commands with a valid offset which +is in the legacy common configuration region address range. + +The driver SHOULD send commands VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE and +VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ with a valid offset which is in the legacy +device specific configuration region address range.admin.tex +11
-1@@ -117,7 +117,15 @@ \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 & Write legacy common configuration region of a member device \\ +\hline +0x0003 & VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ & Read legacy common configuration region of a member device \\ +\hline +0x0004 & VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE & Write legacy device configuration region of a member device \\ +\hline +0x0005 & VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ & Read legacy device configuration region of a member device \\ +\hline +0x0006 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd} \\ \hline 0x8000 - 0xFFFF & - & Reserved for future commands (possibly using a different structure) \\ \hline@@ -286,6 +294,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-access.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 Interfaces: legacy configuration access commands} +\item Section \ref{drivernormative:Basic Facilities of a Virtio Device / Device groups / Group administration commands / Legacy Interfaces: legacy configuration access commands} \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 · 1 line
2.26.2
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 7 lines · Parav Pandit
This short series introduces legacy registers access commands for the owner group member PCI PF to access the legacy registers of the member VFs.
If in future any SIOV devices to support legacy registers, they can be easily supported using same commands by using the group member identifiers of the future SIOV devices.
Quoted 8 lines
More details as overview, motivation, use case are further described below.
Patch summary:
--------------
patch-1 split rows of admin opcode tables by a line patch-2 adds administrative virtuqueue commands patch-3 adds its conformance section and links
numbering seems to have changed?
Quoted 209 lines
It uses the newly introduced administrative virtqueue facility with 4 new commands which uses the existing
virtio_admin_cmd.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 an admin virtqueue of the group owner PCI PF.Two new admin virtqueue commands are added which read/write PCI VF registers.
Software usage example:
-----------------------
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 | | | +--------------+ +-----------------+ | | | +------+-------------------------+-----------+ | | | Driver notification | | | | +----+------------+ +----+------------+ | +-----+ | | PCI VF device A | | | AQ |-------------+---->+-------------+ | | +-----+ | | | | legacy regs | | | PCI PF device | | | +-------------+ | +-----------------+ | +-----------------+ | | +----+------------+ | | PCI VF device N | +---->+-------------+ | | | legacy regs | | | +-------------+ | +-----------------+2. Virtio pci driver to bind to the listed device id and use it in the host.
3. Use it in a light weight hypervisor to run bare-metal OS.
Please review.
Alternatives considered:
========================
1. Exposing BAR0 as MMIO BAR that follows legacy registers template Pros:
a. Kind of works with legacy drivers as some of them have used API
which is agnostic to MMIO vs IOBAR.
b. Does not require hypervisor intervantion
Cons:
a. Device reset is extremely hard to implement in device at scale as
driver does not wait for device reset completion
b. Device register width related problems persist that hypervisor if
wishes, it cannot be fixed.2. Accessing VF registers by tunneling it through new legacy PCI capability Pros:
a. Self contained, but cannot work with future PCI SIOV devices Cons:
a. Equally slow as AQ access
b. Still requires new capability for notification access
c. Requires hardware to build low level registers access which is not worth
for long term future3. Accessing VF notification region using new PF BAR
Cons:
a. Requires hardware to build new PCI steering logic per PF to forward
notification from the PF to VF, requires double the amount of logic compared to today
b. Requires very large additional PF BAR whose size must bemax_Vfs* BAR size.4. Trapping CVQ, configuration region,
LEGACY_HDR
Cons:
a. This does not fullfil the very basic requirement to not trap the
1.x objects (configuration registers, vqs)
b. Requires feature negotiations mediation in hypervisor software c. Requires constant device type specific knowledge in hypervisor driver
(Does not scale for 30+ device types)conclusion for picking AQ approach:
==================================
1. Overall AQ based access is simpler to implement with combination of best from software and device so that legacy registers do not get baked in the device hardware
2. AQ allows hypervisor software to intercept legacy registers and make corrections if needed
3. Provides trade-off between performance, device complexity vs spec, while still maintaining passthrough mode for the VFs with minimal hypervisor intercepts only for legacy registers access
4. AQ mechanism is designed for accessing other member devices registers as noted in AQ submission, it utilizes the existing infrastructure over other alternatives.
5. Uses existing driver notification region similar to legacy notification saves hardware resourcesSigned-off-by Parav Pandit <[email protected]>---
changelog:v5->v6:
- fixed previous missed abbreviation of LCC and LD
- added text for the PCI capability for the group member devicev4->v5:
- split pci transport and generic command section to new patch
- removed multiple references to the VF
- written the description of the command as generic with member
and group device terminology
- reflected many section names to remove VF
- 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 configv3->v4:
- moved noted to the conformance section details in next patch
- removed queue notify address query AQ command on Michael's suggestion, though it is fine. Instead replaced with extendingvirtio_pci_notify_capto indicate that legacy queue notifications can be done on the notification location
- fixed spelling errors
- replaced administrative virtqueue to administration virtqueue
- moved legacy interface normative references to legacy conformance sectionv2->v3:
- added new patch to split raws of admin vq opcode table
- adddressed Jason and Michael's comment to split single register access command to common config and device specific commands.
- dropped the suggetion to introduce enable/disable command as
admin command cap bit already covers it.
- added other alternative design considered and discussed in detail in v0, v1 and v2v1->v2:
- addressed comments from Michael
- added theory of operation
- grammar corrections
- removed group fields description from individual commands as
it is already present in generic section
- added endianness normative for legacy device registers region
- renamed the file to drop vf and add legacy prefix
- added overview in commit log
- renamed subsection to reflect commandv0->v1:
- addressed comments, suggesetions and ideas from Michael Tsirkin and Jason Wang
- far more simpler design than MMR access
- removed complexities of MMR device ids
- removed complexities of MMR registers and extended capabilities
- dropped adding new extended capabilities because if if they are added, a pci device still needs to have existing capabilities
in the legacy configuration space and hypervisor driver do not
need to access themParav Pandit (4):
admin: Split opcode table rows with a line
admin: Fix section numbering
admin: Add group member legacy register access commands
transport-pci: Introduce group legacy group member config region
access
Quoted 11 lines
admin-cmds-legacy-access.tex | 138 ++++++++++++++++++++++++++++++++++ admin.tex | 18 ++++- conformance.tex | 5 ++ transport-pci-legacy-regs.tex | 48 ++++++++++++ transport-pci.tex | 20 +++++ 5 files changed, 226 insertions(+), 3 deletions(-) create mode 100644 admin-cmds-legacy-access.tex create mode 100644 transport-pci-legacy-regs.texSignature · 1 line
2.26.2
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH v6 3/4] admin: Add group member legacy register access commands
In reply to Michael S. TsirkinQuoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 12:21 PM
Quoted 13 lines
admin-cmds-legacy-access.tex line 4
Quoted 10 lines
(quoted diff) +0
-0b/admin-cmds-legacy-access.tex new file mode 100644 index 0000000..89a4f49
admin-cmds-legacy-access.tex new file +4
-0@@ -0,0 +1,138 @@ +\subsubsection{Legacy Interfaces: legacy configuration access +commands}\label{sec:Basic Facilities of a Virtio Device / Device +groups / Group administration commands / Legacy Interfaces: legacy +configuration access commands}I think this is where all the theory of operation text should go.
This is where most of the theory of operation is documented which is agnostic of the transport. PCI specific things are left in pci transport section.
Quoted 7 lines
admin-cmds-legacy-access.tex line 8
Quoted 4 lines
admin-cmds-legacy-access.tex new file +4
-0+ +The group owner device can optionally enable the driver to access its +member devices legacy common configuration and device configuration +regionwe can just say "the legacy interface of member devices"
What is the harm in telling explicitly what is currently supported, specially when it theory of operation description section.
Quoted 8 lines
Quoted 1 line
using following listed
using the following
Quoted 1 line
+administrative commands:
administration not administrative
Ack.
[virtio-comment] Re: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditQuoted 16 lines · Parav Pandit
transport-pci.tex +3
-0@@ -541,6 +541,8 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options struct virtio_pci_notify_cap { struct virtio_pci_cap cap; le32 notify_off_multiplier; /* Multiplier for queue_notify_off. */ + u8 legacy_q_notify_supported; + u8 reserved[3]; }; \end{lstlisting}@@ -560,6 +562,14 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options the same Queue Notify address for all queues. \end{note} +\field{legacy_q_notify_supported} when set to 1, indicates that the device
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 575
Quoted 10 lines
transport-pci.tex +7
-0+supports legacy queue notifications at this notification location. Legacy Queue +Notification address is derived within a BAR for a virtqueue: + +\begin{lstlisting} + cap.offset +\end{lstlisting} + \devicenormative{\paragraph}{Notification capability}{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification capability} The device MUST present at least one notification capability.
I was hoping that we can avoid touching transport-pci.tex completely, this is why I wanted to reuse VIRTIO_PCI_CAP_NOTIFY_CFG.
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
Quoted 20 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 12:38 PMReview
Quoted 4 lines
+\field{legacy_q_notify_supported} when set to 1, indicates that the
(quoted diff) +2
-0+device supports legacy queue notifications at this notification +location. Legacy Queue Notification address is derived within a BAR for avirtqueue:
Quoted 7 lines
transport-pci.tex +5
-0+ +\begin{lstlisting} + cap.offset +\end{lstlisting} + \devicenormative{\paragraph}{Notification capability}{VirtioTransport Options / Virtio Over PCI Bus / PCI Device Layout / Notification
capability} The device MUST present at least one notification capability.
Quoted 1 line
Quoted 2 lines
I was hoping that we can avoid touching transport-pci.tex completely, this is why I wanted to reuse
VIRTIO_PCI_CAP_NOTIFY_CFG.
It is reused, but it doesnt come for free. Do you want to re-consider AQ notify query command? Or continue as proposed in v6?
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 v6 3/4] admin: Add group member legacy register access commands
In reply to Parav PanditQuoted 18 lines · Parav Pandit
Quoted 5 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 12:21 PMQuoted 13 lines
admin-cmds-legacy-access.tex line 4
Quoted 10 lines
(quoted diff) +0
-0b/admin-cmds-legacy-access.tex new file mode 100644 index 0000000..89a4f49
admin-cmds-legacy-access.tex new file +4
-0@@ -0,0 +1,138 @@ +\subsubsection{Legacy Interfaces: legacy configuration access +commands}\label{sec:Basic Facilities of a Virtio Device / Device +groups / Group administration commands / Legacy Interfaces: legacy +configuration access commands}I think this is where all the theory of operation text should go.
Quoted 2 lines
This is where most of the theory of operation is documented which is agnostic of the transport. PCI specific things are left in pci transport section.
what I am saying is that it's cleaner here at least for now.
Quoted 8 lines
Quoted 7 lines
admin-cmds-legacy-access.tex line 8
Quoted 4 lines
admin-cmds-legacy-access.tex new file +4
-0+ +The group owner device can optionally enable the driver to access its +member devices legacy common configuration and device configuration +regionwe can just say "the legacy interface of member devices"
What is the harm in telling explicitly what is currently supported, specially when it theory of operation description section.
The harm is that
- making things generic on the 1st try is the only stick we have as contributors always push to make their solutions as specific to their needs as possible
- people are lazy and they will copy text and then
I get to repeat this argument all over again.
If you want to also have a type specific text, be my guest "specifically, for an SRIOV type" ....
Quoted 9 lines
Quoted 8 lines
Quoted 1 line
using following listed
using the following
Quoted 1 line
+administrative commands:
administration not administrative
Ack.
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 v6 3/4] admin: Add group member legacy register access commands
Quoted 8 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 12:40 PMQuoted 4 lines
Quoted 3 lines
we can just say "the legacy interface of member devices"
What is the harm in telling explicitly what is currently supported, specially
Quoted 9 lines
when it theory of operation description section.
The harm is that
- making things generic on the 1st try is the only stick we have
as contributors always push to make their solutions as
specific to their needs as possible
- people are lazy and they will copy text and then I get to repeat this argument all over again.
The "legacy interface of member device" is a vague term. As implementer, reader I don't understand what that means. The commands clearly communicate the scope.
Quoted 3 lines
If you want to also have a type specific text, be my guest "specifically, for an SRIOV type" ....
SRIOV in generic section doesn't make sense. It is covered in the pci transport section.
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 2 lines
using following listed
using the following
Quoted 1 line
+administrative commands:
administration not administrative
Ack.
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 v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav Pandittransport-pci-legacy-regs.tex line 24
Quoted 4 lines · Parav Pandit
transport-pci-legacy-regs.tex new file +4
-0+Even though virtqueue driver notifications can be communicated through +administration virtqueue, if the group member device support such +notifications using a memory-mapped operation, such driver notifications +are sent using a group member device defined notification region.
I still feel we should support sending notifications to owner at least optionally. For example:
\begin{lstlisting}
struct virtio_pci_owner_legacy_notify_cap {
struct virtio_pci_cap cap;
le32 notify_off_multiplier; /* Multiplier for member id. */
};
\end{lstlisting}
\field{notify_off_multiplier} is combined with the \field{member id} to derive an address within a BAR.
\begin{lstlisting}
cap.offset + member_id * notify_off_multiplier
\end{lstlisting}
We also need, as part of theory of operation, text that reads something like "accessing the member device legacy interface using one of XYZ commands has the same effect as accessing it using the legacy interface".
Also, do all VFs support legacy interface with these commands or none at all?
Also these devices will use non-transitional ID but they in fact do have a legacy interface so using this definition they are transitional devices. Maybe we need to add
when we describe the device ID text like "non transitional devices and transitional devices utilizing commands XYZ" ...?
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH v6 3/4] admin: Add group member legacy register access commands
In reply to Parav PanditQuoted 18 lines · Parav Pandit
Quoted 8 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 12:40 PMQuoted 4 lines
Quoted 3 lines
we can just say "the legacy interface of member devices"
What is the harm in telling explicitly what is currently supported, specially
Quoted 9 lines
when it theory of operation description section.
The harm is that
- making things generic on the 1st try is the only stick we have
as contributors always push to make their solutions as
specific to their needs as possible
- people are lazy and they will copy text and then I get to repeat this argument all over again.
Quoted 2 lines
The "legacy interface of member device" is a vague term. As implementer, reader I don't understand what that means. The commands clearly communicate the scope.
Add this as an example then.
Quoted 4 lines
Quoted 3 lines
If you want to also have a type specific text, be my guest "specifically, for an SRIOV type" ....
SRIOV in generic section doesn't make sense. It is covered in the pci transport section.
When it's convenient to you you argue that it's clearer, when it's not you want it generic. Just mention it quickly and link to the specific text in the new section.
Look the only reason I personally am even entertaining this over objections of several members is that this stuff has the potentional to be well contained. That's the only argument, otherwise individual features like _F_LEGACY_MAC would win hands down - this is how we always did it. If you are intent on spreading this all over the spec we'll need to rethink the whole approach.
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 2 lines
using following listed
using the following
Quoted 1 line
+administrative commands:
administration not administrative
Ack.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [virtio-dev] Re: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Michael S. TsirkinQuoted 7 lines
From: [email protected] <[email protected]> On Behalf Of Michael S. Tsirkin
Sent: Monday, June 19, 2023 1:04 PMOn Tue, Jun 13, 2023 at 08:30:15PM +0300, Parav Pandit wrote:
Quoted 9 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+Even though virtqueue driver notifications can be communicated +through administration virtqueue, if the group member device support +such notifications using a memory-mapped operation, such driver +notifications are sent using a group member device defined notificationregion.
I still feel we should support sending notifications to owner at least optionally. For example:
Let's not please keep discussing this yet again.
I won't be able to.
We have captured this alternative already in the cover letter in the alternatives section.
This optional capability can be added when there is a _real_ implementation by some hw.
Quoted 9 lines
\begin{lstlisting}
struct virtio_pci_owner_legacy_notify_cap { struct virtio_pci_cap cap; le32 notify_off_multiplier; /* Multiplier for member id. */ }; \end{lstlisting}\field{notify_off_multiplier} is combined with the \field{member id} to derive an address within a BAR.
Quoted 9 lines
\begin{lstlisting}
cap.offset + member_id * notify_off_multiplier \end{lstlisting}We also need, as part of theory of operation, text that reads something like "accessing the member device legacy interface using one of XYZ commands has the same effect as accessing it using the legacy interface".
Ack. I will add this.
Quoted 4 lines
Also, do all VFs support legacy interface with these commands or none at all?
Right.
Quoted 5 lines
Also these devices will use non-transitional ID but they in fact do have a legacy interface so using this definition they are transitional devices. Maybe we need to add when we describe the device ID text like "non transitional devices and transitional devices utilizing commands XYZ" ...?
Transitional device has specific meaning, I am not sure we should muddy 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/
[virtio-comment] Re: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditQuoted 20 lines · Parav Pandit
Quoted 20 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 12:38 PMReview
Quoted 4 lines
+\field{legacy_q_notify_supported} when set to 1, indicates that the
(quoted diff) +2
-0+device supports legacy queue notifications at this notification +location. Legacy Queue Notification address is derived within a BAR for avirtqueue:
Quoted 7 lines
transport-pci.tex +5
-0+ +\begin{lstlisting} + cap.offset +\end{lstlisting} + \devicenormative{\paragraph}{Notification capability}{VirtioTransport Options / Virtio Over PCI Bus / PCI Device Layout / Notification
capability} The device MUST present at least one notification capability.
Quoted 1 line
Quoted 6 lines
Quoted 2 lines
I was hoping that we can avoid touching transport-pci.tex completely, this is why I wanted to reuse
VIRTIO_PCI_CAP_NOTIFY_CFG.It is reused, but it doesnt come for free. Do you want to re-consider AQ notify query command? Or continue as proposed in v6?
If we can't just make it come for free then maybe VIRTIO_PCI_CAP_LEGACY_NOTIFY_CFG is better, we can just list the number in the common section and then link to the description in the new section.
I also feel we want ability to have such a capability in the owner too. Would prefer including it now though I guess we can add it as an extension.
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [virtio-dev] Re: [PATCH v6 3/4] admin: Add group member legacy register access commands
In reply to Michael S. TsirkinQuoted 6 lines
From: [email protected] <[email protected]> On Behalf Of Michael S. Tsirkin
Sent: Monday, June 19, 2023 1:11 PM
Quoted 6 lines
Quoted 1 line
The "legacy interface of member device" is a vague term. As implementer,
reader I don't understand what that means.
Quoted 1 line
The commands clearly communicate the scope.
Add this as an example then.
I don't know what this means.
The section speaks for itself.
We currently have,
Section 2.12.1 as "Group administration commands".
Under this I added,
2.12.1.1 -> Legacy interface: legacy configuration access commands"
Above is no different than
"3.1.2 Legacy Interface: Device Initialization"
Tomorrow,
2.12.1.2 -> features config commands
2.12.1.3 ->
Quoted 9 lines
Quoted 4 lines
Quoted 3 lines
If you want to also have a type specific text, be my guest "specifically, for an SRIOV type" ....
SRIOV in generic section doesn't make sense. It is covered in the pci transport
section.
When it's convenient to you you argue that it's clearer, when it's not you want it generic. Just mention it quickly and link to the specific text in the new section.
If you reviewer makes point "it is suggestion".
If patch proposer makes a point its "argue" is not good way to discuss. So can you please avoid quoting "arguing".
It is not my convenience.
In the spec transport specific parts are not added.
Hence, I said SR-IOV in generic to be avoided. It is better kept in the pci transport section.
Quoted 3 lines
If you are intent on
spreading this all over the spec we'll need to rethink the whole approach.
Where is this spread all over?
In v5 it was self contained mainly in pci transport section. You asked to split to generic and pci.
Fine, I split to two.
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] Re: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditQuoted 49 lines · Parav Pandit
Quoted 7 lines
From: [email protected] <[email protected]> On Behalf Of Michael S. Tsirkin
Sent: Monday, June 19, 2023 1:04 PMOn Tue, Jun 13, 2023 at 08:30:15PM +0300, Parav Pandit wrote:
Quoted 9 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+Even though virtqueue driver notifications can be communicated +through administration virtqueue, if the group member device support +such notifications using a memory-mapped operation, such driver +notifications are sent using a group member device defined notificationregion.
I still feel we should support sending notifications to owner at least optionally. For example:
Let's not please keep discussing this yet again.
I won't be able to.
We have captured this alternative already in the cover letter in the alternatives section.This optional capability can be added when there is a _real_ implementation by some hw.
Quoted 9 lines
\begin{lstlisting}
struct virtio_pci_owner_legacy_notify_cap { struct virtio_pci_cap cap; le32 notify_off_multiplier; /* Multiplier for member id. */ }; \end{lstlisting}\field{notify_off_multiplier} is combined with the \field{member id} to derive an address within a BAR.
Quoted 9 lines
\begin{lstlisting}
cap.offset + member_id * notify_off_multiplier \end{lstlisting}We also need, as part of theory of operation, text that reads something like "accessing the member device legacy interface using one of XYZ commands has the same effect as accessing it using the legacy interface".
Ack. I will add this.
Quoted 4 lines
Also, do all VFs support legacy interface with these commands or none at all?
Right.
Quoted 1 line
Quoted 6 lines
Quoted 4 lines
Also these devices will use non-transitional ID but they in fact do have a legacy interface so using this definition they are transitional devices. Maybe we need to add when we describe the device ID text like "non transitional devices and transitional devices utilizing commands XYZ" ...?
Transitional device has specific meaning, I am not sure we should muddy it.
To simplify transition from these earlier draft interfaces, a device MAY implement:
\begin{description}
\item[Transitional Device]
a device supporting both drivers conforming to this specification, and allowing legacy drivers.
\end{description}
I agree it can be read this way. The issue is a lot of text in the spec just assumes that "has legacy interface == transitional device".
For example:
When using the legacy interface the driver MAY access
the device-specific configuration region using any width accesses, and a transitional device MUST present driver with the same results as when accessed using the ``natural'' access method (i.e. 32-bit accesses for 32-bit fields, etc).
If we break the assumption we need to audit the spec for this assumption and again, I really would rather not.
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Michael S. TsirkinQuoted 4 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 1:20 PM
Quoted 9 lines
Quoted 3 lines
It is reused, but it doesnt come for free. Do you want to re-consider AQ notify query command? Or continue as proposed in v6?
If we can't just make it come for free then maybe
VIRTIO_PCI_CAP_LEGACY_NOTIFY_CFGis better, we can just list the number in the common section and then link to the description in the new section.
How is it better? It requires burning more bytes.
Is it better because it is self contained?
Quoted 2 lines
I also feel we want ability to have such a capability in the owner too. Would prefer including it now though I guess we can add it as an extension.
Re-opening the past discussion.. amazing. :)
Why? How is it different and better than querying over AQ? I see the AQ is better than group owner and group member specific 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: [virtio-dev] Re: [PATCH v6 3/4] admin: Add group member legacy register access commands
In reply to Parav PanditQuoted 31 lines · Parav Pandit
Quoted 6 lines
From: [email protected] <[email protected]> On Behalf Of Michael S. Tsirkin
Sent: Monday, June 19, 2023 1:11 PMQuoted 6 lines
Quoted 1 line
The "legacy interface of member device" is a vague term. As implementer,
reader I don't understand what that means.
Quoted 1 line
The commands clearly communicate the scope.
Add this as an example then.
I don't know what this means.
The section speaks for itself.
We currently have,Section 2.12.1 as "Group administration commands".
Under this I added,
2.12.1.1 -> Legacy interface: legacy configuration access commands"Above is no different than
"3.1.2 Legacy Interface: Device Initialization"Tomorrow,
2.12.1.2 -> features config commands
2.12.1.3 ->Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
If you want to also have a type specific text, be my guest "specifically, for an SRIOV type" ....
SRIOV in generic section doesn't make sense. It is covered in the pci transport
Quoted 8 lines
Quoted 5 lines
section.
When it's convenient to you you argue that it's clearer, when it's not you want it generic. Just mention it quickly and link to the specific text in the new section.
If you reviewer makes point "it is suggestion".
If patch proposer makes a point its "argue" is not good way to discuss. So can you please avoid quoting "arguing".
To argue
verb: give reasons or cite evidence in support of an idea, action, or theory, typically with the aim of persuading others to share one's view.
Quoted 5 lines
It is not my convenience.
In the spec transport specific parts are not added.
Hence, I said SR-IOV in generic to be avoided. It is better kept in the pci transport section.
Quoted 7 lines
Quoted 3 lines
If you are intent on
spreading this all over the spec we'll need to rethink the whole approach.Where is this spread all over?
In v5 it was self contained mainly in pci transport section. You asked to split to generic and pci.
Fine, I split to two.
OK I see, I guess I wasn't clear. I was talking about as much as possible using terms "owner" "member" "commands" "member_id" and so on, such that the commands apply as generally as possible.
From that POV this needs a bit more work I think we can make more things generic.
But I am looking for a way to keep this stuff as self contained as possible. I don't much care whether the new tex is
under pci and admin command section just lists commands and links there, or it is under admin and then pci section links 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] Re: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Michael S. TsirkinQuoted 38 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 1:26 PMQuoted 4 lines
Quoted 4 lines
Also these devices will use non-transitional ID but they in fact do have a legacy interface so using this definition they are transitional devices. Maybe we need to add when we describe the device ID text like "non transitional devices and transitional devices utilizing
commands XYZ" ...?
Quoted 2 lines
Transitional device has specific meaning, I am not sure we should muddy it.
To simplify transition from these earlier draft interfaces, a device MAY implement:
\begin{description}
\item[Transitional Device]
a device supporting both drivers conforming to this specification, and allowing legacy drivers.
\end{description}I agree it can be read this way. The issue is a lot of text in the spec just assumes that "has legacy interface == transitional device".
For example:
When using the legacy interface the driver MAY access the device-specific configuration region using any width accesses, and a transitional device MUST present driver with the same results as when accessed using the ``natural'' access method (i.e.
32-bit accesses for 32-bit fields, etc).
Quoted 2 lines
If we break the assumption we need to audit the spec for this assumption and again, I really would rather not.
We are not breaking the assumption. Above listed requirement is already captured in the legacy interface conformance section. So I am not sure what extra to write here.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditQuoted 9 lines · Parav Pandit
Quoted 9 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 1:20 PMQuoted 3 lines
It is reused, but it doesnt come for free. Do you want to re-consider AQ notify query command? Or continue as proposed in v6?
Quoted 6 lines
Quoted 4 lines
If we can't just make it come for free then maybe
VIRTIO_PCI_CAP_LEGACY_NOTIFY_CFGis better, we can just list the number in the common section and then link to the description in the new section.How is it better? It requires burning more bytes.
Is it better because it is self contained?
Mostly yes. But it also adds a bit more flexibility, right? I thought avoiding touching transport-pci is worth less flexibility but if we can't avoid that...
Quoted 4 lines
Quoted 2 lines
I also feel we want ability to have such a capability in the owner too. Would prefer including it now though I guess we can add it as an extension.
Re-opening the past discussion.. amazing. :)
OK fair enough.. I guess both of us are not 100% happy but it's a compromize for now. And maybe we'll add one of AQ and / or PF cap down the road.
Quoted 1 line
Why? How is it different and better than querying over AQ?
Wait a second let me clarify. I am talking about notification in the PCI BAR of the PF. *Not* offset in PF capability but in the VF BAR.
Quoted 1 line
I see the AQ is better than group owner and group member specific 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: [virtio-dev] Re: [PATCH v6 3/4] admin: Add group member legacy register access commands
In reply to Michael S. TsirkinQuoted 8 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 1:33 PMBut I am looking for a way to keep this stuff as self contained as possible. I don't much care whether the new tex is under pci and admin command section just lists commands and links there, or it is under admin and then pci section links there.
Yes. On it to move things to the generic admin section.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Michael S. TsirkinQuoted 8 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 1:38 PMQuoted 3 lines
Quoted 3 lines
If we can't just make it come for free then maybe
VIRTIO_PCI_CAP_LEGACY_NOTIFY_CFGis better, we can just list the number in the common section and then link to the description in the new
Quoted 9 lines
section.
Quoted 3 lines
Quoted 1 line
How is it better? It requires burning more bytes.
Is it better because it is self contained?Mostly yes. But it also adds a bit more flexibility, right?
I thought avoiding touching transport-pci is worth less flexibility but if we can't avoid that...
That flexibility is better gained via AQ instead of introducing new extended capability on the VF.
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
I also feel we want ability to have such a capability in the owner too. Would prefer including it now though I guess we can add it as an extension.
Re-opening the past discussion.. amazing. :)
Quoted 8 lines
OK fair enough.. I guess both of us are not 100% happy but it's a compromize for now. And maybe we'll add one of AQ and / or PF cap down the road.
Quoted 1 line
Why? How is it different and better than querying over AQ?
Wait a second let me clarify. I am talking about notification in the PCI BAR of the PF. *Not* offset in PF capability but in the VF BAR.
Ok. question remains the same, why not discover such notification capability it over the AQ command?
AQ command on the PF is self-contained and extendible without baking things in very low level hw centric pci capabilities, which are hard to get rid of it.
Quoted 3 lines
Quoted 2 lines
I see the AQ is better than group owner and group member specific 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: [virtio-dev] Re: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditQuoted 38 lines · Parav Pandit
Quoted 38 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 1:26 PMQuoted 4 lines
Quoted 4 lines
Also these devices will use non-transitional ID but they in fact do have a legacy interface so using this definition they are transitional devices. Maybe we need to add when we describe the device ID text like "non transitional devices and transitional devices utilizing
commands XYZ" ...?
Quoted 2 lines
Transitional device has specific meaning, I am not sure we should muddy it.
To simplify transition from these earlier draft interfaces, a device MAY implement:
\begin{description}
\item[Transitional Device]
a device supporting both drivers conforming to this specification, and allowing legacy drivers.
\end{description}I agree it can be read this way. The issue is a lot of text in the spec just assumes that "has legacy interface == transitional device".
For example:
When using the legacy interface the driver MAY access the device-specific configuration region using any width accesses, and a transitional device MUST present driver with the same results as when accessed using the ``natural'' access method (i.e.
32-bit accesses for 32-bit fields, etc).
Quoted 6 lines
Quoted 2 lines
If we break the assumption we need to audit the spec for this assumption and again, I really would rather not.
We are not breaking the assumption. Above listed requirement is already captured in the legacy interface conformance section. So I am not sure what extra to write here.
Hmm not sure what's unclear. I can try to explain the issue again.
These devices have a legacy interface yes?
So they should be transitional to avoid breaking assumption.
But they are not *exactly*
in that they don't have a transitional device ID.
At least the device id section needs extra text
then to explain this?
Or do you just want to make them have transitional ID?
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] Re: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditQuoted 28 lines · Parav Pandit
Quoted 8 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 1:38 PMQuoted 3 lines
Quoted 3 lines
If we can't just make it come for free then maybe
VIRTIO_PCI_CAP_LEGACY_NOTIFY_CFGis better, we can just list the number in the common section and then link to the description in the newQuoted 9 lines
section.
Quoted 3 lines
Quoted 1 line
How is it better? It requires burning more bytes.
Is it better because it is self contained?Mostly yes. But it also adds a bit more flexibility, right?
I thought avoiding touching transport-pci is worth less flexibility but if we can't avoid that...That flexibility is better gained via AQ instead of introducing new extended capability on the VF.
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
I also feel we want ability to have such a capability in the owner too. Would prefer including it now though I guess we can add it as an extension.
Re-opening the past discussion.. amazing. :)
OK fair enough.. I guess both of us are not 100% happy but it's a compromize for now. And maybe we'll add one of AQ and / or PF cap down the road.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Why? How is it different and better than querying over AQ?
Wait a second let me clarify. I am talking about notification in the PCI BAR of the PF. *Not* offset in PF capability but in the VF BAR.
Ok. question remains the same, why not discover such notification capability it over the AQ command?
AQ command on the PF is self-contained and extendible without baking things in very low level hw centric pci capabilities, which are hard to get rid of it.
I worry about systems where there's value in having VF driver map memory without talking to PF driver.
Current VF capability is kind of ok I guess ...
If you want admin command to query then it would need
to map in PF memory.
I understand two concerns with this:
- you worry that this forces ordering requirements - it's true and I don't know of a good fix. So if possible use VF BAR by preference?
- you worry about wasting physical memory space
this we can fix by sticking VF# in the kick.
As an alternative, if we can make the new command able to communicate offset in PCI BAR or in VF BAR or both then I think that's also an acceptable compromize:
drivers that have trouble mapping VF BAR after querying PF can just map PF BAR. WDYT?
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
I see the AQ is better than group owner and group member specific 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 v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditQuoted 10 lines · Parav Pandit
Quoted 10 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 1:38 PMQuoted 3 lines
Quoted 3 lines
If we can't just make it come for free then maybe
VIRTIO_PCI_CAP_LEGACY_NOTIFY_CFGis better, we can just list the number in the common section and then link to the description in the newsection.
Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
How is it better? It requires burning more bytes.
Is it better because it is self contained?Mostly yes. But it also adds a bit more flexibility, right?
I thought avoiding touching transport-pci is worth less flexibility but if we can't avoid that...That flexibility is better gained via AQ instead of introducing new extended capability on the VF.
To be frank for e.g. transport vq we'll need to do it with admin command (can we stop saying AQ please? it's a habit that carries over when you write spec later. I know AC is a weird abbreviation though ;) )
So yes, if we can find a way to make everyone happy with admin commands then it is better, for 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/
[virtio-comment] RE: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Michael S. TsirkinQuoted 9 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 1:58 PMQuoted 1 line
AQ command on the PF is self-contained and extendible without baking things
in very low level hw centric pci capabilities, which are hard to get rid of it.
I worry about systems where there's value in having VF driver map memory without talking to PF driver.
Such driver will not be able to use AQ legacy commands anyway. When such driver arrive, someone, somehow will build self contained device. And hence, adding such pci capability in that future makes sense.
We don't need to do it now.
Quoted 2 lines
Current VF capability is kind of ok I guess ...
Already proposed one?
Quoted 1 line
If you want admin command to query then it would need to map in PF memory.
No need.
It is similar to rest of the configuration access commands.
Quoted 8 lines
I understand two concerns with this:
- you worry that this forces ordering requirements - it's true and I don't know of a good fix. So if possible use VF BAR by preference?
- you worry about wasting physical memory space
this we can fix by sticking VF# in the kick.As an alternative, if we can make the new command able to communicate offset in PCI BAR or in VF BAR or both then I think that's also an acceptable
A new command proposed was for VF BAR that member driver can ask to its group owner driver (like rest of the config commands).
A future command can tell for the PF BAR if needed and some device wants to do such extra implementation.
Quoted 3 lines
compromize:
drivers that have trouble mapping VF BAR after querying PF can just map PF BAR. WDYT?
PF BAR for notification can be done later when there is some device who really have the limitation and wants to do that. We don't see that additional need as driver notifications are present on the VF already as listed in the alternative.
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 v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Michael S. TsirkinQuoted 4 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 2:01 PM
Quoted 8 lines
Quoted 1 line
That flexibility is better gained via AQ instead of introducing new extended
capability on the VF.
To be frank for e.g. transport vq we'll need to do it with admin command (can we stop saying AQ please? it's a habit that carries over when you write spec later. I know AC is a weird abbreviation though
;) )
Yes, this was mentioned already, but you ignored or missed in past, not sure why.
Yes, admin command.
And yes lets please stop calling the transport vq as well, as it is not going to "transport everything". It is also just bunch of commands... this was discussed in a thread with Jason and want to park that discussion at later point.
Quoted 2 lines
So yes, if we can find a way to make everyone happy with admin commands then it is better, for sure.
From device side we are ok with Admin command to query the notification offset in the VF BAR. So far you had the concern with admin command for query.
Let me know how you want to proceed as we have both the options proposed now. So in v7 I want to write the final option that you don't need to re-think on.
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 v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Michael S. TsirkinQuoted 4 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 12:17 PM
Quoted 9 lines
I'd love to just put this stuff in a separate tex document and just link there from the generic thing.
Or if it's too hard, please create new sections for this stuff. But in this case each of these sections has to start with repeating the description when things apply. E.g. "when using legacy interface"
when using commands "A B C to access" etc etc.I wrote a bunch of comments below.
I will stick to them as most things are taken out to generic section anyway in patch 3. Only PCI transport part stays here.
I will move some more text to generic section.
Quoted 9 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+As described in PCIe base specification \hyperref[intro:PCIe]{[PCIe]} +PCI VFs do not support the I/O space BAR. Due to this limitation, a +PCI VF hardware device that supports legacy interfaces cannot be +attached as passthrough device to the guest virtual machine.That's not the only reason. Let's keep things generic and start by saying something like "Some configurations with a need to support legacy drivers can not implement a transitional device. For example .... ".
I will avoid For example part and move this to generic section.
Quoted 6 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+ +To have a transitional or legacy virtio device in the guest virtual +machine, a PCI PF device as a group owner maymay -> can outside conformance statements.
Ack.
Quoted 4 lines
Quoted 1 line
support accessing its group member
Pls keep it generic. A group owner ....
Ack
Quoted 11 lines
Review
Quoted 4 lines
(quoted diff) +3
-0+device's legacy configuration region using the group administration +commands listed at \ref{sec:Basic Facilities of a Virtio Device / +Device groups / Group administration commands / Legacy Interfaces: legacyconfiguration access commands}.
Review
Quoted 2 lines
(quoted diff) +2
-0+These legacy configuration access commands are transported via the +administration virtqueue.are these called legacy configuration access commands then?
why do you introduce this term? it does not look like it's used anywhere else.
It is used and referred PCI section " Legacy Interfaces: Group member device Configuration Region Access".
Quoted 4 lines
I would prefer it if you just use the term "legacy interface" it is well defined and widely used in the spec.
It is "legacy interface", with suffix for group member config access. In future, there may be a section for other things than config access.
Quoted 4 lines
again leave virtqueue out of it pls we'll have other ways down the road. what matters is that they are transferred to a group member by sending legacy configuration access commands to the group owner.
Ack.
It is theory of operation, not a normative.
Tomorrow if other than aq exists, one will write as "AQ or xyz"..
But fine to me to reduce changes from 216 to less lines. :)
Quoted 7 lines
Quoted 3 lines
This mechanism enables minimal involvement of the
+hypervisor software only for the purpose of the legacy configuration regionaccess.
Leave marketing out of it pls, kill last sentence.
Huh, I don't see theory of operation and scope of the hypervisor as marketing at all. I will remove as it makes this patch shorter.
Quoted 9 lines
transport-pci-legacy-regs.tex
Quoted 5 lines
transport-pci-legacy-regs.tex new file +3
-0+ +When a guest virtual machine requests legacy configuration and device +specific regionswait so now it's legacy configuration and device specific regions and these two are distinct?
Quoted 5 lines
Quoted 2 lines
of group member device, a hypervisor software accesses +it using an administration virtqueue
please talk of administration commands. virtqueue does not matter at all.
Ack.
Quoted 10 lines
Quoted 1 line
on behalf of the guest virtual machine.
To put it in our terms, something like this:
when a legacy driver accesses a member device of a group using the
legacy interface, a modern driver can intercept the access and forward it to the owner device.
I will not mention "modern driver" as it has zero reference in spec and don't want to bring Linux terms here. "the driver can intercept" is enough.
Quoted 9 lines
Review
Quoted 6 lines
(quoted diff) +4
-0+ +Even though virtqueue driver notifications can be communicated +through administration virtqueue, if the group member device support +suchsupports?
Ack.
Quoted 7 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+notifications using a memory-mapped operation, such driver +notifications are sent using a group member device defined notificationregion.
what does "are sent" imply here? is there a matching conformance statement? who sends them?
It has the same meaning as "Driver notifications" section first line has.
Isnt it implicit that driver notifications are sent by driver based on "Driver notifications" section?
Quoted 9 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ +The group owner devicethis is the 1st you mention any group or its owner.
Quoted 1 line
should not expose PCI BAR0
Not PCI BAR0. That is in header. You mean VF BAR0.
I will rewrite it as,
The group owner device should not expose PCI BAR0 in the PCI SR-IOV extended capability for the group member PCI VF devices when it prefers to support legacy interface for legacy configuration access using this group owner.
Quoted 6 lines
Review
Quoted 3 lines
for the group member
(quoted diff) +2
-0+devices when it prefers to support legacy interface for legacy +configuration access using its group owner.don't use should outside conformance
What should be used instead of "should"?
Quoted 8 lines
I think this specific case actually should be more specific. Something like:
- For PCI SRIOV groups, when group owner device implements commands A,B,C the group owner's VF BAR 0 is hardwired to 0
in its PCI SRIOV capability.
I wrote it slightly differently above.
Quoted 28 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+This facilitates hypervisor software to operate with least amount of +complexitiescomplexity is its own plural
Review
Quoted 5 lines
to emulate the legacy interface I/O space BAR and passthrough
(quoted diff) +4
-0+other PCI BARs and PCI device capabilities to the guest virtual +machine without any translation. + +The group member device should not expose PCI BAR0 in various PCIcapabilities.
Review
Quoted 11 lines
(quoted diff) +11
-0+ +\devicenormative{\subsubsection}{Legacy Interfaces Requirements: +Group Member Device Legacy Configuration Access}{Virtio Transport +Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: Group +Member Device Legacy Configuration Access} + +When a PCI SR-IOV group 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 commands, the groupowner
Review
Quoted 2 lines
(quoted diff) +2
-0+device SHOULD NOT expose PCI BAR0 in the SR-IOV Extended capability. +This is to facilitate the software to emulate I/O region BAR0 for supportingthe legacy interface.
Quoted 7 lines
not PCI BAR0 - VF BAR0. Check the PCI spec you can not "not expose it". if you want to register can be "unimplemented".
Base Address registers are hardwired to zeroBut it is better to be specific on what should happen. hardwire VF BAR0 to 0, right?
Hardwire to zero and not expose is same thing to me.
Quoted 12 lines
Review
Quoted 9 lines
(quoted diff) +8
-0+ +\drivernormative{\subsubsection}{Legacy Interfaces Requirements: +Group Member Device Legacy Configuration Access}{Virtio Transport +Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: Group +Member Device Legacy Configuration Access} + +The driver SHOULD NOT emulate I/O region BAR0 if a device group +member exposes a PCI BAR0.what does "emulate" mean here? which driver it is?
I will add the line to theory of operation, but I recollect "emulate" line came from you.
Quoted 14 lines
Quoted 10 lines
transport-pci.tex index renamed from transport-pci.tex +0
-0a5c6719..3647485 100644
transport-pci.tex +0
-0@@ -541,6 +541,8 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options struct virtio_pci_notify_cap { struct virtio_pci_cap cap; le32 notify_off_multiplier; /* Multiplier for
queue_notify_off. */
+ u8legacy_q_notify_supported;I am still mulling whether
VIRTIO_PCI_CAP_NOTIFY_CFGwould be better.
Quoted 5 lines
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 545
Quoted 1 line
transport-pci.tex +1
-0+ u8 reserved[3];align with spaces pls.
Ack.
Quoted 7 lines
Quoted 6 lines
};
\end{lstlisting}transport-pci.tex +0
-0@@ -560,6 +562,14 @@ \subsubsection{Notification structurelayout}\label{sec:Virtio Transport Options the same Queue Notify address for
all queues.
Quoted 8 lines
Quoted 3 lines
\end{note}
+\field{legacy_q_notify_supported} when set to 1,
Do you mean something like:
When \field{legacy_q_notify_supported} this indicates that ...
Yes will fix.
Quoted 6 lines
Quoted 2 lines
indicates that the device
+supports legacy queue notifications at this notification location.And what location? this refers to what? the location described by this capability maybe?
Ack.
Quoted 4 lines
More specifically, assume a transitional device (with an IO BAR as normal). Does presence of this flag in the capability imply we can use a legacy queue but use this notification with this capability?
I don't know how this combination can be even possible by the device other than a buggy software who will do both.
Quoted 3 lines
I worry that if we allow that, it opens floodgates of people who are too lazy to upgrade to 1.0 but just hack this notification in there.
Don't understand the concern.
If a device has transitional device, it is 1.0 device supporting legacy with IOBAR and newer interface. So...
Quoted 16 lines
Quoted 12 lines
Legacy Queue
transport-pci.tex +6
-0+Notification address is derived within a BAR for a virtqueue: + +\begin{lstlisting} + cap.offset +\end{lstlisting} + \devicenormative{\paragraph}{Notification capability}{VirtioQuoted 1 line
Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification
capability} The device MUST present at least one notification capability.
Quoted 1 line
Quoted 3 lines
I don't get what this is saying. I *think* you really mean is that
queue_notify_offis 0.
Please refer to the current notification address definition.
Above is written in similar way where it doesnt need to describe queue_notify_off.
Quoted 5 lines
Quoted 5 lines
transport-pci.tex +0
-0@@ -596,6 +606,14 @@ \subsubsection{Notification structurelayout}\label{sec:Virtio Transport Options cap.length >=
queue_notify_off*notify_off_multiplier+ 4 \end{lstlisting}
Quoted 9 lines
transport-pci.tex
Quoted 5 lines
+\paragraph{Legacy Interfaces: Notification
transport-pci.tex +4
-0+capability}\label{par:Virtio Transport Options / Virtio Over PCI Bus +/ PCI Device Layout / Legacy Interfaces: Notification capability} + +The device SHOULD set \field{legacy_q_notify_supported}why SHOULD and not MUST here - if driver checks for it then it won't work without no?
If device doesn't want to support queue notifications, it has ability to set to 0.
Quoted 7 lines
Quoted 2 lines
when the device
+notification location supports legacy driver notifications.legacy driver notifications is ambigous.
what you want here and elsewhere is something like "when used through a legacy interface, device supports driver
Ack.
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] Re: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Michael S. TsirkinQuoted 7 lines
From: [email protected] <[email protected]> On Behalf Of Michael S. Tsirkin
Sent: Monday, June 19, 2023 1:46 PMThese devices have a legacy interface yes?
Yes. partially.
Quoted 6 lines
So they should be transitional to avoid breaking assumption.
But they are not *exactly*
in that they don't have a transitional device ID.
Right. They do not have transitional device ID.
Quoted 2 lines
At least the device id section needs extra text then to explain this?
We don't modify any of the transitional device attributes.
In respective conformance section, it is described what requirements of legacy interface to follow.
Quoted 1 line
Or do you just want to make them have transitional ID?
Don't want to do that.
Non transitional device id with the extension is just 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: [virtio-dev] Re: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
Quoted 9 lines · Parav Pandit
Quoted 7 lines
From: [email protected] <[email protected]> On Behalf Of Michael S. Tsirkin
Sent: Monday, June 19, 2023 1:46 PMThese devices have a legacy interface yes?
Yes. partially.
Quoted 7 lines
Quoted 6 lines
So they should be transitional to avoid breaking assumption.
But they are not *exactly*
in that they don't have a transitional device ID.Right. They do not have transitional device ID.
I was trying to think whether we need a conformance statement stating so. I guess this is up to the device?
Then let's make it clear. Something like:
For the SR-IOV group type,
the owner device supporting legacy configuration access commands [assuming this is the term - do we define it somewhere? or just list the commands]
MAY follow the rules for the PCI Device ID, Revision ID and Subsystem Device ID for the non-transitional devices documented in
{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}
or do you want to make it a SHOULD?
Quoted 7 lines
Quoted 2 lines
At least the device id section needs extra text then to explain this?
We don't modify any of the transitional device attributes.
In respective conformance section, it is described what requirements of legacy interface to follow.Quoted 1 line
Or do you just want to make them have transitional ID?
Don't want to do that.
Non transitional device id with the extension is just fine.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditMichael,
Quoted 19 lines
From: Parav Pandit <[email protected]>
Sent: Monday, June 19, 2023 2:07 PM
We don't need to do it now.Quoted 2 lines
Current VF capability is kind of ok I guess ...
Already proposed one?
Quoted 1 line
If you want admin command to query then it would need to map in PF
memory.
No need.
It is similar to rest of the configuration access commands.Quoted 6 lines
I understand two concerns with this:
- you worry that this forces ordering requirements - it's true and I don't know of a good fix. So if possible use VF BAR by preference?
- you worry about wasting physical memory space
this we can fix by sticking VF# in the kick.
Quoted 7 lines
Quoted 3 lines
As an alternative, if we can make the new command able to communicate offset in PCI BAR or in VF BAR or both then I think that's also an acceptable
A new command proposed was for VF BAR that member driver can ask to its group owner driver (like rest of the config commands).
Are you ok with the admin command to query the notification address of the member device bar?
I presented both the proposals.
We need to conclude this now without keep flipping between two from version to version.
a. v3 with admin command
pros:
1. self-contained via AQ for rest of the control path operations.
2. Can work with future siov device who may want to support legacy
3. Doesn't bake things in low level pci capabilities which is hard to get rid of
4. Able to add new command or new response if some device wants to support this on PF (very unlikely)
b. and v6 with capability extension.
Cons:
1. Does not have above advantages
Pros:
1. Uses existing PCI capability for the extension
Quoted 11 lines
A future command can tell for the PF BAR if needed and some device wants to do such extra implementation.
Quoted 3 lines
compromize:
drivers that have trouble mapping VF BAR after querying PF can just map PF BAR. WDYT?PF BAR for notification can be done later when there is some device who really have the limitation and wants to do that.
We don't see that additional need as driver notifications are present on the VF already as listed in the alternative.
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] Re: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Michael S. TsirkinQuoted 23 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, June 20, 2023 6:22 AMQuoted 9 lines · Parav Pandit
Quoted 7 lines
From: [email protected] <[email protected]> On Behalf Of Michael S. Tsirkin
Sent: Monday, June 19, 2023 1:46 PMThese devices have a legacy interface yes?
Yes. partially.
Quoted 7 lines
Quoted 6 lines
So they should be transitional to avoid breaking assumption.
But they are not *exactly*
in that they don't have a transitional device ID.Right. They do not have transitional device ID.
Quoted 7 lines
I was trying to think whether we need a conformance statement stating so. I guess this is up to the device?
Then let's make it clear. Something like:
For the SR-IOV group type,
the owner device supporting legacy configuration access commands [assuming this is the term - do we define it somewhere? or just list the commands]
This term is largely defined as section name currently.
Quoted 7 lines
MAY follow the rules for the PCI Device ID, Revision ID and Subsystem Device ID for the non-transitional devices documented in
{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}or do you want to make it a SHOULD?
SHOULD seems fine to me as one cannot build PCI VF hw practically with IOBAR anyway. So better to extended above line as,
For the SR-IOV group type, the owner device ... and member device SHOULD fllow the rules for...
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
At least the device id section needs extra text then to explain this?
We don't modify any of the transitional device attributes. In respective conformance section, it is described what requirements of
legacy interface to follow.
Quoted 3 lines
Quoted 1 line
Or do you just want to make them have transitional ID?
Don't want to do that.
Non transitional device id with the extension is just 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: [virtio-dev] Re: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
Quoted 23 lines · Parav Pandit
Quoted 23 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Tuesday, June 20, 2023 6:22 AMQuoted 16 lines · Parav Pandit
Quoted 7 lines
From: [email protected] <[email protected]> On Behalf Of Michael S. Tsirkin
Sent: Monday, June 19, 2023 1:46 PMThese devices have a legacy interface yes?
Yes. partially.
Quoted 6 lines
So they should be transitional to avoid breaking assumption.
But they are not *exactly*
in that they don't have a transitional device ID.Right. They do not have transitional device ID.
Quoted 8 lines
Quoted 7 lines
I was trying to think whether we need a conformance statement stating so. I guess this is up to the device?
Then let's make it clear. Something like:
For the SR-IOV group type,
the owner device supporting legacy configuration access commands [assuming this is the term - do we define it somewhere? or just list the commands]This term is largely defined as section name currently.
Right. A sentence saying "the following legacy configuration access commands allow access to the legacy interface of a member device through the owner device ..." at the beginning of the section might be a good idea.
Quoted 11 lines
Quoted 7 lines
MAY follow the rules for the PCI Device ID, Revision ID and Subsystem Device ID for the non-transitional devices documented in
{Virtio Transport Options / Virtio Over PCI Bus / PCI Device Discovery}or do you want to make it a SHOULD?
SHOULD seems fine to me as one cannot build PCI VF hw practically with IOBAR anyway. So better to extended above line as,
For the SR-IOV group type, the owner device ... and member device SHOULD fllow the rules for...
ok
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
At least the device id section needs extra text then to explain this?
We don't modify any of the transitional device attributes. In respective conformance section, it is described what requirements of
legacy interface to follow.
Quoted 3 lines
Quoted 1 line
Or do you just want to make them have transitional ID?
Don't want to do that.
Non transitional device id with the extension is just 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 v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditQuoted 41 lines
From: Parav Pandit
Sent: Tuesday, June 20, 2023 10:12 AMMichael,
Quoted 19 lines
From: Parav Pandit <[email protected]>
Sent: Monday, June 19, 2023 2:07 PM
We don't need to do it now.Quoted 2 lines
Current VF capability is kind of ok I guess ...
Already proposed one?
Quoted 1 line
If you want admin command to query then it would need to map in PF
memory.
No need.
It is similar to rest of the configuration access commands.Quoted 6 lines
I understand two concerns with this:
- you worry that this forces ordering requirements - it's true and I don't know of a good fix. So if possible use VF BAR by preference?
- you worry about wasting physical memory space
this we can fix by sticking VF# in the kick.Quoted 7 lines
Quoted 3 lines
As an alternative, if we can make the new command able to communicate offset in PCI BAR or in VF BAR or both then I think that's also an acceptable
A new command proposed was for VF BAR that member driver can ask to its group owner driver (like rest of the config commands).
Are you ok with the admin command to query the notification address of the member device bar?
I presented both the proposals.
We need to conclude this now without keep flipping between two from version to version.
Quoted 8 lines
a. v3 with admin command
pros:
1. self-contained via AQ for rest of the control path operations.
2. Can work with future siov device who may want to support legacy 3. Doesn't bake things in low level pci capabilities which is hard to get rid of 4. Able to add new command or new response if some device wants to support this on PF (very unlikely)
Given that this has more pros and no objection to it, I will revise v7 today with query admin command like v3.
Quoted 4 lines
b. and v6 with capability extension.
Cons:
1. Does not have above advantages
Quoted 15 lines
Pros:
1. Uses existing PCI capability for the extensionQuoted 11 lines
A future command can tell for the PF BAR if needed and some device wants to do such extra implementation.
Quoted 3 lines
compromize:
drivers that have trouble mapping VF BAR after querying PF can just map PF BAR. WDYT?PF BAR for notification can be done later when there is some device who really have the limitation and wants to do that.
We don't see that additional need as driver notifications are present on the VF already as listed in the alternative.
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 v6 4/4] transport-pci: Introduce group legacy group member config region access
Quoted 49 lines · Parav Pandit
Quoted 41 lines
From: Parav Pandit
Sent: Tuesday, June 20, 2023 10:12 AMMichael,
Quoted 19 lines
From: Parav Pandit <[email protected]>
Sent: Monday, June 19, 2023 2:07 PM
We don't need to do it now.Quoted 2 lines
Current VF capability is kind of ok I guess ...
Already proposed one?
Quoted 1 line
If you want admin command to query then it would need to map in PF
memory.
No need.
It is similar to rest of the configuration access commands.Quoted 6 lines
I understand two concerns with this:
- you worry that this forces ordering requirements - it's true and I don't know of a good fix. So if possible use VF BAR by preference?
- you worry about wasting physical memory space
this we can fix by sticking VF# in the kick.Quoted 7 lines
Quoted 3 lines
As an alternative, if we can make the new command able to communicate offset in PCI BAR or in VF BAR or both then I think that's also an acceptable
A new command proposed was for VF BAR that member driver can ask to its group owner driver (like rest of the config commands).
Are you ok with the admin command to query the notification address of the member device bar?
I presented both the proposals.
We need to conclude this now without keep flipping between two from version to version.Quoted 8 lines
a. v3 with admin command
pros:
1. self-contained via AQ for rest of the control path operations.
2. Can work with future siov device who may want to support legacy 3. Doesn't bake things in low level pci capabilities which is hard to get rid of 4. Able to add new command or new response if some device wants to support this on PF (very unlikely)
Quoted 2 lines
Given that this has more pros and no objection to it, I will revise v7 today with query admin command like v3.
Not like v3 please. If you want to re-open this:
First I think we need multiple offsets just like notification capaiblity, sorted by priority. Second I think we need ability to report offset within owner not member.
So please add ability to report multiple offsets, and add e.g. a flags field, with bits for owner, member.
Quoted 11 lines
Quoted 11 lines
b. and v6 with capability extension.
Cons:
1. Does not have above advantagesPros:
1. Uses existing PCI capability for the extensionQuoted 3 lines
A future command can tell for the PF BAR if needed and some device wants to do such extra implementation.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
compromize:
drivers that have trouble mapping VF BAR after querying PF can just map PF BAR. WDYT?PF BAR for notification can be done later when there is some device who really have the limitation and wants to do that.
We don't see that additional need as driver notifications are present on the VF already as listed in the alternative.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
[virtio-comment] RE: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
Quoted 8 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, June 21, 2023 11:56 AMNot like v3 please. If you want to re-open this:
Quoted 6 lines
First I think we need multiple offsets just like notification capaiblity, sorted by priority. Second I think we need ability to report offset within owner not member.
So please add ability to report multiple offsets, and add e.g. a flags field, with bits for owner, member.
What are these multiple offsets for?
Do you mean two offsets? One for owner and one for member? Both bits are optional. Do you agree?
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 v6 4/4] transport-pci: Introduce group legacy group member config region access
Quoted 8 lines · Parav Pandit
Quoted 8 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, June 21, 2023 11:56 AMNot like v3 please. If you want to re-open this:
Quoted 8 lines
Quoted 6 lines
First I think we need multiple offsets just like notification capaiblity, sorted by priority. Second I think we need ability to report offset within owner not member.
So please add ability to report multiple offsets, and add e.g. a flags field, with bits for owner, member.
What are these multiple offsets for?
Different BARs. For example, IO versus memory. Yes I know VFs don't support IO but PFs do. prefetch vs non-prefetch might matter too (non-prefetch is mostly limited to 32 bit).
Quoted 2 lines
Do you mean two offsets? One for owner and one for member? Both bits are optional. Do you agree?
I agree that everything should be optional sure. Let's not limit it to two though. There could be multiple BARs or whatever. We have ability to pass buffers of arbitrary length and device reports the length. Maybe have a SHOULD recommending not more than 10 of these (1 for each possible PCI BAR one for each possible VF BAR).
This is to match the functionality that notification capability has.
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.
Quoted 8 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 v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditQuoted 1 line · Parav Pandit
And yes lets please stop calling the transport vq as well, as it is not going to "transport everything".
Good point, this transport is actually virtio over admin commands. admin transport for short?
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 v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Parav PanditQuoted 101 lines · Parav Pandit
Quoted 4 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Monday, June 19, 2023 12:17 PMQuoted 9 lines
I'd love to just put this stuff in a separate tex document and just link there from the generic thing.
Or if it's too hard, please create new sections for this stuff. But in this case each of these sections has to start with repeating the description when things apply. E.g. "when using legacy interface"
when using commands "A B C to access" etc etc.I wrote a bunch of comments below.
I will stick to them as most things are taken out to generic section anyway in patch 3. Only PCI transport part stays here.
I will move some more text to generic section.Quoted 9 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+As described in PCIe base specification \hyperref[intro:PCIe]{[PCIe]} +PCI VFs do not support the I/O space BAR. Due to this limitation, a +PCI VF hardware device that supports legacy interfaces cannot be +attached as passthrough device to the guest virtual machine.That's not the only reason. Let's keep things generic and start by saying something like "Some configurations with a need to support legacy drivers can not implement a transitional device. For example .... ".
I will avoid For example part and move this to generic section.
Quoted 6 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+ +To have a transitional or legacy virtio device in the guest virtual +machine, a PCI PF device as a group owner maymay -> can outside conformance statements.
Ack.
Quoted 4 lines
Quoted 1 line
support accessing its group member
Pls keep it generic. A group owner ....
Ack
Quoted 11 lines
Review
Quoted 4 lines
(quoted diff) +3
-0+device's legacy configuration region using the group administration +commands listed at \ref{sec:Basic Facilities of a Virtio Device / +Device groups / Group administration commands / Legacy Interfaces: legacyconfiguration access commands}.
Review
Quoted 2 lines
(quoted diff) +2
-0+These legacy configuration access commands are transported via the +administration virtqueue.are these called legacy configuration access commands then?
why do you introduce this term? it does not look like it's used anywhere else.It is used and referred PCI section " Legacy Interfaces: Group member device Configuration Region Access".
Quoted 4 lines
I would prefer it if you just use the term "legacy interface" it is well defined and widely used in the spec.
It is "legacy interface", with suffix for group member config access. In future, there may be a section for other things than config access.
Quoted 4 lines
again leave virtqueue out of it pls we'll have other ways down the road. what matters is that they are transferred to a group member by sending legacy configuration access commands to the group owner.
Ack.
It is theory of operation, not a normative.
Tomorrow if other than aq exists, one will write as "AQ or xyz"..But fine to me to reduce changes from 216 to less lines. :)
Quoted 7 lines
Quoted 3 lines
This mechanism enables minimal involvement of the
+hypervisor software only for the purpose of the legacy configuration regionaccess.
Leave marketing out of it pls, kill last sentence.
Huh, I don't see theory of operation and scope of the hypervisor as marketing at all. I will remove as it makes this patch shorter.
Quoted 9 lines
transport-pci-legacy-regs.tex
Quoted 5 lines
transport-pci-legacy-regs.tex new file +3
-0+ +When a guest virtual machine requests legacy configuration and device +specific regionswait so now it's legacy configuration and device specific regions and these two are distinct?
Quoted 5 lines
Quoted 2 lines
of group member device, a hypervisor software accesses +it using an administration virtqueue
please talk of administration commands. virtqueue does not matter at all.
Ack.
Quoted 4 lines
Quoted 1 line
on behalf of the guest virtual machine.
Quoted 8 lines
Quoted 6 lines
To put it in our terms, something like this:
when a legacy driver accesses a member device of a group using the
legacy interface, a modern driver can intercept the access and forward it to the owner device.I will not mention "modern driver" as it has zero reference in spec and don't want to bring Linux terms here. "the driver can intercept" is enough.
Good point but since you say "a legacy driver" then "the driver" seems to refer to exactly that. How about:
when a legacy member device driver accesses a member device of a group using the
legacy interface, an owner device driver can intercept the access and forward it to the owner device.
Quoted 27 lines
Quoted 10 lines
Review
Quoted 7 lines
(quoted diff) +4
-0+ +Even though virtqueue driver notifications can be communicated +through administration virtqueue, if the group member device support +suchsupports?
Ack.
Quoted 7 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+notifications using a memory-mapped operation, such driver +notifications are sent using a group member device defined notificationregion.
what does "are sent" imply here? is there a matching conformance statement? who sends them?
It has the same meaning as "Driver notifications" section first line has.
Isnt it implicit that driver notifications are sent by driver based on "Driver notifications" section?Quoted 5 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ +The group owner devicethis is the 1st you mention any group or its owner.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
should not expose PCI BAR0
Not PCI BAR0. That is in header. You mean VF BAR0.
I will rewrite it as,
The group owner device should not expose PCI BAR0 in the PCI SR-IOV extended capability for the group member PCI VF devices when it prefers to support legacy interface for legacy configuration access using this group owner.
This seems to ignore all my comments.
Quoted 7 lines
Quoted 6 lines
Review
Quoted 3 lines
for the group member
(quoted diff) +2
-0+devices when it prefers to support legacy interface for legacy +configuration access using its group owner.don't use should outside conformance
What should be used instead of "should"?
Depends on context, generally we just say what it does. E.g. "VF BAR0 is hardwired to zero".
Quoted 9 lines
Quoted 8 lines
I think this specific case actually should be more specific. Something like:
- For PCI SRIOV groups, when group owner device implements commands A,B,C the group owner's VF BAR 0 is hardwired to 0
in its PCI SRIOV capability.I wrote it slightly differently above.
I don't see why what you wrote is any better than what you had to be frank. You are coming up with our own terminology instead of just using what's in the SR IOV spec. Please don't.
Quoted 28 lines
Quoted 28 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+This facilitates hypervisor software to operate with least amount of +complexitiescomplexity is its own plural
Review
Quoted 5 lines
to emulate the legacy interface I/O space BAR and passthrough
(quoted diff) +4
-0+other PCI BARs and PCI device capabilities to the guest virtual +machine without any translation. + +The group member device should not expose PCI BAR0 in various PCIcapabilities.
Review
Quoted 11 lines
(quoted diff) +11
-0+ +\devicenormative{\subsubsection}{Legacy Interfaces Requirements: +Group Member Device Legacy Configuration Access}{Virtio Transport +Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: Group +Member Device Legacy Configuration Access} + +When a PCI SR-IOV group 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 commands, the groupowner
Review
Quoted 2 lines
(quoted diff) +2
-0+device SHOULD NOT expose PCI BAR0 in the SR-IOV Extended capability. +This is to facilitate the software to emulate I/O region BAR0 for supportingthe legacy interface.
Quoted 8 lines
Quoted 7 lines
not PCI BAR0 - VF BAR0. Check the PCI spec you can not "not expose it". if you want to register can be "unimplemented".
Base Address registers are hardwired to zeroBut it is better to be specific on what should happen. hardwire VF BAR0 to 0, right?
Hardwire to zero and not expose is same thing to me.
Maybe, though previously you said it just means not put any capabilities there. More importantly I don't see expose or not expose anywhere in the PCI or SRIOV spec. When spec wants to say how not to have a given BAR it says exactly hardwired to zero.
Quoted 12 lines
Quoted 12 lines
Review
Quoted 9 lines
(quoted diff) +8
-0+ +\drivernormative{\subsubsection}{Legacy Interfaces Requirements: +Group Member Device Legacy Configuration Access}{Virtio Transport +Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: Group +Member Device Legacy Configuration Access} + +The driver SHOULD NOT emulate I/O region BAR0 if a device group +member exposes a PCI BAR0.what does "emulate" mean here? which driver it is?
Quoted 1 line
I will add the line to theory of operation, but I recollect "emulate" line came from you.
I generally am fine with using this term but we need to then define it before use.
This specific thing I would just drop.
Instead of wasting time just say device MUST hardwire VF BAR0 to zero as opposed to SHOULD, and we do not need to worry about how drivers recover. If they want to they will validate, if they don't then they won't.
Quoted 50 lines
Quoted 14 lines
Quoted 10 lines
transport-pci.tex index renamed from transport-pci.tex +0
-0a5c6719..3647485 100644
transport-pci.tex +0
-0@@ -541,6 +541,8 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options struct virtio_pci_notify_cap { struct virtio_pci_cap cap; le32 notify_off_multiplier; /* Multiplier for
queue_notify_off. */
+ u8legacy_q_notify_supported;I am still mulling whether
VIRTIO_PCI_CAP_NOTIFY_CFGwould be better.Quoted 5 lines
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 545
Quoted 1 line
transport-pci.tex +1
-0+ u8 reserved[3];align with spaces pls.
Ack.
Quoted 7 lines
Quoted 6 lines
};
\end{lstlisting}transport-pci.tex +0
-0@@ -560,6 +562,14 @@ \subsubsection{Notification structurelayout}\label{sec:Virtio Transport Options the same Queue Notify address for
all queues.
Quoted 8 lines
Quoted 3 lines
\end{note}
+\field{legacy_q_notify_supported} when set to 1,
Do you mean something like:
When \field{legacy_q_notify_supported} this indicates that ...Yes will fix.
Quoted 6 lines
Quoted 2 lines
indicates that the device
+supports legacy queue notifications at this notification location.And what location? this refers to what? the location described by this capability maybe?
Ack.
Quoted 4 lines
More specifically, assume a transitional device (with an IO BAR as normal). Does presence of this flag in the capability imply we can use a legacy queue but use this notification with this capability?
Quoted 8 lines
I don't know how this combination can be even possible by the device other than a buggy software who will do both.
Quoted 3 lines
I worry that if we allow that, it opens floodgates of people who are too lazy to upgrade to 1.0 but just hack this notification in there.
Don't understand the concern.
If a device has transitional device, it is 1.0 device supporting legacy with IOBAR and newer interface. So...
if we are switching to admin commands for this, then let's not argue about it.
Quoted 53 lines
Quoted 16 lines
Quoted 12 lines
Legacy Queue
transport-pci.tex +6
-0+Notification address is derived within a BAR for a virtqueue: + +\begin{lstlisting} + cap.offset +\end{lstlisting} + \devicenormative{\paragraph}{Notification capability}{VirtioQuoted 1 line
Transport Options / Virtio Over PCI Bus / PCI Device Layout / Notification
capability} The device MUST present at least one notification capability.
Quoted 1 line
Quoted 3 lines
I don't get what this is saying. I *think* you really mean is that
queue_notify_offis 0.Please refer to the current notification address definition.
Above is written in similar way where it doesnt need to describequeue_notify_off.Quoted 5 lines
Quoted 5 lines
transport-pci.tex +0
-0@@ -596,6 +606,14 @@ \subsubsection{Notification structurelayout}\label{sec:Virtio Transport Options cap.length >=
queue_notify_off*notify_off_multiplier+ 4 \end{lstlisting}Quoted 9 lines
transport-pci.tex
Quoted 5 lines
+\paragraph{Legacy Interfaces: Notification
transport-pci.tex +4
-0+capability}\label{par:Virtio Transport Options / Virtio Over PCI Bus +/ PCI Device Layout / Legacy Interfaces: Notification capability} + +The device SHOULD set \field{legacy_q_notify_supported}why SHOULD and not MUST here - if driver checks for it then it won't work without no?
If device doesn't want to support queue notifications, it has ability to set to 0.
Quoted 7 lines
Quoted 2 lines
when the device
+notification location supports legacy driver notifications.legacy driver notifications is ambigous.
what you want here and elsewhere is something like "when used through a legacy interface, device supports driverAck.
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 8 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 v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Michael S. TsirkinQuoted 17 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, June 21, 2023 3:43 PMQuoted 12 lines · Parav Pandit
Quoted 12 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, June 21, 2023 11:56 AMNot like v3 please. If you want to re-open this:
First I think we need multiple offsets just like notification capaiblity, sorted by priority. Second I think we need ability to report offset within owner not member.
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
So please add ability to report multiple offsets, and add e.g. a flags field, with bits for owner, member.
What are these multiple offsets for?
Different BARs. For example, IO versus memory. Yes I know VFs don't support IO but PFs do. prefetch vs non-prefetch might matter too (non-prefetch is mostly limited to 32 bit).
BAR type and its prefetch attributes are told by the PCI anyway so no duplication here anyway. For owner and member I get it.
Quoted 4 lines
Quoted 3 lines
Do you mean two offsets? One for owner and one for member? Both bits are optional. Do you agree?
Quoted 8 lines
I agree that everything should be optional sure. Let's not limit it to two though. There could be multiple BARs or whatever. We have ability to pass buffers of arbitrary length and device reports the length.
Maybe have a SHOULD recommending not more than 10 of these (1 for each possible PCI BAR one for each possible VF BAR).This is to match the functionality that notification capability has.
A device can expose multiple offsets within the single bar to a count of 100 entries; Also allowed in the notification capability.
(I don't see why any sane device would do that anyway)
So I will avoid such extra restrictions and limit the scope of this patch to be minimal to have arbitrary number of BAR entries limited by the command result length.
Quoted 9 lines
Quoted 9 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 10 lines
Quoted 10 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 v6 4/4] transport-pci: Introduce group legacy group member config region access
Quoted 20 lines · Parav Pandit
Quoted 20 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, June 21, 2023 3:43 PMQuoted 15 lines · Parav Pandit
Quoted 14 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, June 21, 2023 11:56 AMNot like v3 please. If you want to re-open this:
First I think we need multiple offsets just like notification capaiblity, sorted by priority. Second I think we need ability to report offset within owner not member.
So please add ability to report multiple offsets, and add e.g. a flags field, with bits for owner, member.
Quoted 7 lines
Quoted 6 lines
Quoted 1 line
What are these multiple offsets for?
Different BARs. For example, IO versus memory. Yes I know VFs don't support IO but PFs do. prefetch vs non-prefetch might matter too (non-prefetch is mostly limited to 32 bit).
BAR type and its prefetch attributes are told by the PCI anyway so no duplication here anyway.
yes they are! But for example, software PF device might prefer notification in IO BAR if that can be mapped. If not - use MMIO.
Quoted 11 lines
For owner and member I get it.
Quoted 10 lines
Quoted 3 lines
Do you mean two offsets? One for owner and one for member? Both bits are optional. Do you agree?
I agree that everything should be optional sure. Let's not limit it to two though. There could be multiple BARs or whatever. We have ability to pass buffers of arbitrary length and device reports the length.
Maybe have a SHOULD recommending not more than 10 of these (1 for each possible PCI BAR one for each possible VF BAR).
Quoted 5 lines
Quoted 2 lines
This is to match the functionality that notification capability has.
A device can expose multiple offsets within the single bar to a count of 100 entries; Also allowed in the notification capability.
(I don't see why any sane device would do that anyway)
Me neither.
Quoted 1 line
So I will avoid such extra restrictions and limit the scope of this patch to be minimal to have arbitrary number of BAR entries limited by the command result length.
That sounds OK.
Quoted 9 lines
Quoted 9 lines
Quoted 9 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 10 lines
Quoted 10 lines
Quoted 10 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 v6 4/4] transport-pci: Introduce group legacy group member config region access
In reply to Michael S. TsirkinQuoted 4 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, June 21, 2023 4:06 PM
[..]
Quoted 14 lines
Quoted 7 lines
Quoted 6 lines
To put it in our terms, something like this:
when a legacy driver accesses a member device of a group using the
legacy interface, a modern driver can intercept the access and forward it to the owner device.I will not mention "modern driver" as it has zero reference in spec and don't
want to bring Linux terms here.
Quoted 1 line
"the driver can intercept" is enough.
Good point but since you say "a legacy driver" then "the driver" seems to refer to exactly that. How about:
Review
Quoted 4 lines
(quoted diff) +0
-0when a legacy member device driver accesses a member device of a group using the legacy interface, an owner device driver can intercept the access and forward it to the owner device.
Above is not correct.
We have 3 drivers in picture.
1. guest driver
2. hypervisor level member device driver
3. group owner device driver
Trying to write without introducing guest and hypervisor term,
A group owner device driver provides the service to access member device's configuration region. A member device driver avail this service when it wants to access the member device's configuration region.
Quoted 9 lines
Quoted 4 lines
I will rewrite it as,
The group owner device should not expose PCI BAR0 in the PCI SR-IOV extended capability for the group member PCI VF devices when it prefers to
support legacy interface for legacy configuration access using this group owner.
This seems to ignore all my comments.
I replied after that, probably missed in exchanges.
How about:
The group owner device MUST hardwire PCI BAR0 in the PCI SR-IOV extended capability for the group member PCI VF devices when it supports legacy configuration access commands.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Review
Quoted 5 lines
for the group member
(quoted diff) +2
-0+devices when it prefers to support legacy interface for legacy +configuration access using its group owner.don't use should outside conformance
Quoted 5 lines
Quoted 1 line
What should be used instead of "should"?
Depends on context, generally we just say what it does. E.g. "VF BAR0 is hardwired to zero".
Ok.
Quoted 52 lines
Quoted 11 lines
Quoted 10 lines
I think this specific case actually should be more specific. Something like:
- For PCI SRIOV groups, when group owner device implements commands A,B,C the group owner's VF BAR 0 is hardwired to 0
in its PCI SRIOV capability.I wrote it slightly differently above.
I don't see why what you wrote is any better than what you had to be frank. You are coming up with our own terminology instead of just using what's in the SR IOV spec. Please don't.
Quoted 36 lines
Quoted 36 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+This facilitates hypervisor software to operate with least amount +of complexitiescomplexity is its own plural
Review
Quoted 5 lines
to emulate the legacy interface I/O space BAR and passthrough
(quoted diff) +4
-0+other PCI BARs and PCI device capabilities to the guest virtual +machine without any translation. + +The group member device should not expose PCI BAR0 in various PCIcapabilities.
Review
Quoted 11 lines
(quoted diff) +11
-0+ +\devicenormative{\subsubsection}{Legacy Interfaces Requirements: +Group Member Device Legacy Configuration Access}{Virtio Transport +Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: +Group Member Device Legacy Configuration Access} + +When a PCI SR-IOV group 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 commands, the groupowner
Review
Quoted 3 lines
(quoted diff) +3
-0+device SHOULD NOT expose PCI BAR0 in the SR-IOV Extended capability. +This is to facilitate the software to emulate I/O region BAR0 for +supportingthe legacy interface.
not PCI BAR0 - VF BAR0. Check the PCI spec you can not "not expose it". if you want to register can be "unimplemented". Base Address registers are hardwired to zero
But it is better to be specific on what should happen. hardwire VF BAR0 to 0, right?
Quoted 7 lines
Quoted 1 line
Hardwire to zero and not expose is same thing to me.
Maybe, though previously you said it just means not put any capabilities there. More importantly I don't see expose or not expose anywhere in the PCI or SRIOV spec. When spec wants to say how not to have a given BAR it says exactly hardwired to zero.
Hardwired to zero is fine, done above now.
Quoted 15 lines
Quoted 12 lines
Quoted 12 lines
Review
Quoted 9 lines
(quoted diff) +8
-0+ +\drivernormative{\subsubsection}{Legacy Interfaces Requirements: +Group Member Device Legacy Configuration Access}{Virtio Transport +Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: +Group Member Device Legacy Configuration Access} + +The driver SHOULD NOT emulate I/O region BAR0 if a device group +member exposes a PCI BAR0.what does "emulate" mean here? which driver it is?
Quoted 1 line
I will add the line to theory of operation, but I recollect "emulate" line came
from you.
Quoted 9 lines
I generally am fine with using this term but we need to then define it before use.
This specific thing I would just drop.
Instead of wasting time just say device MUST hardwire VF BAR0 to zero as opposed to SHOULD, and we do not need to worry about how drivers recover. If they want to they will validate, if they don't then they won't.
This limitation seems fine to me.
Will drop.
Quoted 58 lines
Quoted 46 lines
Quoted 15 lines
Quoted 11 lines
transport-pci.tex index renamed from transport-pci.tex +0
-0a5c6719..3647485 100644
transport-pci.tex +0
-0@@ -541,6 +541,8 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options struct virtio_pci_notify_cap { struct virtio_pci_cap cap; le32 notify_off_multiplier; /* Multiplier for
queue_notify_off. */
+ u8legacy_q_notify_supported;I am still mulling whether
VIRTIO_PCI_CAP_NOTIFY_CFGwould be better.Quoted 5 lines
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 545
Quoted 1 line
transport-pci.tex +1
-0+ u8 reserved[3];align with spaces pls.
Ack.
Quoted 8 lines
Quoted 7 lines
};
\end{lstlisting}transport-pci.tex +0
-0@@ -560,6 +562,14 @@ \subsubsection{Notification structurelayout}\label{sec:Virtio Transport Options the same Queue Notify address for
all queues.
Quoted 8 lines
Quoted 3 lines
\end{note}
+\field{legacy_q_notify_supported} when set to 1,
Do you mean something like:
When \field{legacy_q_notify_supported} this indicates that ...Yes will fix.
Quoted 6 lines
Quoted 2 lines
indicates that the device
+supports legacy queue notifications at this notification location.And what location? this refers to what? the location described by this capability maybe?
Quoted 7 lines
Ack.
Quoted 4 lines
More specifically, assume a transitional device (with an IO BAR as normal). Does presence of this flag in the capability imply we can use a legacy queue but use this notification with this capability?
I don't know how this combination can be even possible by the device other
than a buggy software who will do both.
Quoted 4 lines
Quoted 4 lines
I worry that if we allow that, it opens floodgates of people who are too lazy to upgrade to 1.0 but just hack this notification in there.
Quoted 8 lines
Quoted 2 lines
Don't understand the concern.
If a device has transitional device, it is 1.0 device supporting legacy withIOBAR and newer interface.
Quoted 1 line
So...
if we are switching to admin commands for this, then let's not argue about it.
Ok.
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 v6 4/4] transport-pci: Introduce group legacy group member config region access
Quoted 12 lines · Parav Pandit
Quoted 4 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, June 21, 2023 4:06 PM[..]
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
To put it in our terms, something like this:
when a legacy driver accesses a member device of a group using the
legacy interface, a modern driver can intercept the access and forward it to the owner device.
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
I will not mention "modern driver" as it has zero reference in spec and don't
want to bring Linux terms here.
Quoted 1 line
"the driver can intercept" is enough.
Maybe a (non legacy) driver can intercept? Would that be acceptable? Just to clarify the confusion above.
Quoted 9 lines
Review
Quoted 9 lines
Good point but since you say "a legacy driver" then "the driver" seems to refer to exactly that. How about:
(quoted diff) +0
-0when a legacy member device driver accesses a member device of a group using the legacy interface, an owner device driver can intercept the access and forward it to the owner device.
Quoted 4 lines
Above is not correct.
We have 3 drivers in picture.
1. guest driver
this is legacy driver, so easy
Quoted 1 line
2. hypervisor level member device driver
this is just for notifications, optionally, yes?
Quoted 6 lines
3. group owner device driver
Trying to write without introducing guest and hypervisor term,
A group owner device driver provides the service to access member device's configuration region. A member device driver avail this service when it wants to access the member device's configuration region.
I agree, it's getting complicated.
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
I will rewrite it as,
The group owner device should not expose PCI BAR0 in the PCI SR-IOV extended capability for the group member PCI VF devices when it prefers to
support legacy interface for legacy configuration access using this group owner.
Quoted 7 lines
Quoted 2 lines
This seems to ignore all my comments.
I replied after that, probably missed in exchanges.
How about:
The group owner device MUST hardwire PCI BAR0 in the PCI SR-IOV extended capability for the group member PCI VF devices when it supports legacy configuration access commands.
better but it's not a PCI BAR0. let's add link to sriov spec, and name it VF BAR0 same as in that spec.
Quoted 163 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Review
Quoted 5 lines
for the group member
(quoted diff) +2
-0+devices when it prefers to support legacy interface for legacy +configuration access using its group owner.don't use should outside conformance
Quoted 5 lines
Quoted 1 line
What should be used instead of "should"?
Depends on context, generally we just say what it does. E.g. "VF BAR0 is hardwired to zero".
Ok.
Quoted 52 lines
Quoted 11 lines
Quoted 10 lines
I think this specific case actually should be more specific. Something like:
- For PCI SRIOV groups, when group owner device implements commands A,B,C the group owner's VF BAR 0 is hardwired to 0
in its PCI SRIOV capability.I wrote it slightly differently above.
I don't see why what you wrote is any better than what you had to be frank. You are coming up with our own terminology instead of just using what's in the SR IOV spec. Please don't.
Quoted 36 lines
Quoted 36 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+This facilitates hypervisor software to operate with least amount +of complexitiescomplexity is its own plural
Review
Quoted 5 lines
to emulate the legacy interface I/O space BAR and passthrough
(quoted diff) +4
-0+other PCI BARs and PCI device capabilities to the guest virtual +machine without any translation. + +The group member device should not expose PCI BAR0 in various PCIcapabilities.
Review
Quoted 11 lines
(quoted diff) +11
-0+ +\devicenormative{\subsubsection}{Legacy Interfaces Requirements: +Group Member Device Legacy Configuration Access}{Virtio Transport +Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: +Group Member Device Legacy Configuration Access} + +When a PCI SR-IOV group 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 commands, the groupowner
Review
Quoted 3 lines
(quoted diff) +3
-0+device SHOULD NOT expose PCI BAR0 in the SR-IOV Extended capability. +This is to facilitate the software to emulate I/O region BAR0 for +supportingthe legacy interface.
not PCI BAR0 - VF BAR0. Check the PCI spec you can not "not expose it". if you want to register can be "unimplemented". Base Address registers are hardwired to zero
But it is better to be specific on what should happen. hardwire VF BAR0 to 0, right?
Quoted 7 lines
Quoted 1 line
Hardwire to zero and not expose is same thing to me.
Maybe, though previously you said it just means not put any capabilities there. More importantly I don't see expose or not expose anywhere in the PCI or SRIOV spec. When spec wants to say how not to have a given BAR it says exactly hardwired to zero.
Hardwired to zero is fine, done above now.
Quoted 15 lines
Quoted 12 lines
Quoted 12 lines
Review
Quoted 9 lines
(quoted diff) +8
-0+ +\drivernormative{\subsubsection}{Legacy Interfaces Requirements: +Group Member Device Legacy Configuration Access}{Virtio Transport +Options / Virtio Over PCI Bus / Legacy Interfaces Requirements: +Group Member Device Legacy Configuration Access} + +The driver SHOULD NOT emulate I/O region BAR0 if a device group +member exposes a PCI BAR0.what does "emulate" mean here? which driver it is?
Quoted 1 line
I will add the line to theory of operation, but I recollect "emulate" line came
from you.
Quoted 9 lines
I generally am fine with using this term but we need to then define it before use.
This specific thing I would just drop.
Instead of wasting time just say device MUST hardwire VF BAR0 to zero as opposed to SHOULD, and we do not need to worry about how drivers recover. If they want to they will validate, if they don't then they won't.
This limitation seems fine to me.
Will drop.Quoted 60 lines
Quoted 46 lines
Quoted 15 lines
Quoted 11 lines
transport-pci.tex index renamed from transport-pci.tex +0
-0a5c6719..3647485 100644
transport-pci.tex +0
-0@@ -541,6 +541,8 @@ \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options struct virtio_pci_notify_cap { struct virtio_pci_cap cap; le32 notify_off_multiplier; /* Multiplier for
queue_notify_off. */
+ u8legacy_q_notify_supported;I am still mulling whether
VIRTIO_PCI_CAP_NOTIFY_CFGwould be better.Quoted 5 lines
transport-pci.tex \subsubsection{Notification structure layout}\label{sec:Virtio Transport Options · line 545
Quoted 1 line
transport-pci.tex +1
-0+ u8 reserved[3];align with spaces pls.
Ack.
Quoted 8 lines
Quoted 7 lines
};
\end{lstlisting}transport-pci.tex +0
-0@@ -560,6 +562,14 @@ \subsubsection{Notification structurelayout}\label{sec:Virtio Transport Options the same Queue Notify address for
all queues.
Quoted 8 lines
Quoted 3 lines
\end{note}
+\field{legacy_q_notify_supported} when set to 1,
Do you mean something like:
When \field{legacy_q_notify_supported} this indicates that ...Yes will fix.
Quoted 6 lines
Quoted 2 lines
indicates that the device
+supports legacy queue notifications at this notification location.And what location? this refers to what? the location described by this capability maybe?
Quoted 7 lines
Ack.
Quoted 4 lines
More specifically, assume a transitional device (with an IO BAR as normal). Does presence of this flag in the capability imply we can use a legacy queue but use this notification with this capability?
I don't know how this combination can be even possible by the device other
than a buggy software who will do both.
Quoted 6 lines
Quoted 4 lines
I worry that if we allow that, it opens floodgates of people who are too lazy to upgrade to 1.0 but just hack this notification in there.
Don't understand the concern.
If a device has transitional device, it is 1.0 device supporting legacy with
Quoted 7 lines
Quoted 6 lines
IOBAR and newer interface.
Quoted 1 line
So...
if we are switching to admin commands for this, then let's not argue about it.
Ok.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
RE: [virtio-comment] RE: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region access
Quoted 25 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, June 21, 2023 4:31 PM
To: Parav Pandit <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Yishai Hadas <[email protected]>; Maor Gottlieb <[email protected]>; Shahaf Shuler <[email protected]>
Subject: Re: [virtio-comment] RE: [PATCH v6 4/4] transport-pci: Introduce group legacy group member config region accessQuoted 12 lines · Parav Pandit
Quoted 4 lines
From: Michael S. Tsirkin <[email protected]>
Sent: Wednesday, June 21, 2023 4:06 PM[..]
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
To put it in our terms, something like this:
when a legacy driver accesses a member device of a group using the
legacy interface, a modern driver can intercept the access and forward it to the owner device.
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
I will not mention "modern driver" as it has zero reference in spec and don't
want to bring Linux terms here.
Quoted 1 line
"the driver can intercept" is enough.
Maybe a (non legacy) driver can intercept? Would that be acceptable? Just to clarify the confusion above.
Non legacy driver wording is fine.
Quoted 7 lines
Quoted 7 lines
Review
Quoted 5 lines
(quoted diff) +0
-0when a legacy member device driver accesses a member device of a group using the legacy interface, an owner device driver can intercept the access and forward it to the owner device.Above is not correct.
Quoted 9 lines
Quoted 2 lines
We have 3 drivers in picture.
1. guest driverthis is legacy driver, so easy
Quoted 1 line
2. hypervisor level member device driver
this is just for notifications, optionally, yes?
For notifications (optionally) and for configuration region access.
Quoted 27 lines
Quoted 6 lines
3. group owner device driver
Trying to write without introducing guest and hypervisor term,
A group owner device driver provides the service to access member device's
configuration region.
Quoted 1 line
A member device driver avail this service when it wants to access the member
device's configuration region.
I agree, it's getting complicated.
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
I will rewrite it as,
The group owner device should not expose PCI BAR0 in the PCI SR-IOV extended capability for the group member PCI VF devices when it prefers to
support legacy interface for legacy configuration access using this group
owner.
Quoted 6 lines
Quoted 4 lines
This seems to ignore all my comments.
I replied after that, probably missed in exchanges.
Quoted 9 lines
Quoted 2 lines
How about:
The group owner device MUST hardwire PCI BAR0 in the PCI SR-IOV extendedcapability for the group member PCI VF devices when it supports legacy configuration access commands.
Quoted 1 line
better but it's not a PCI BAR0. let's add link to sriov spec, and name it VF BAR0 same as in that spec.
Yes, VF BAR0, will correct 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/