All of lore.kernel.org
 help / color / mirror / Atom feed
* [virtio-dev] [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-02 20:36 ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-02 20:36 UTC (permalink / raw)
  To: mst, virtio-dev, cohuck, david.edmondson
  Cc: sburla, jasowang, yishaih, maorg, virtio-comment, shahafs, 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.

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

This short series is on top of latest work [1] from Michael.
It uses the newly introduced administrative virtqueue facility with 3 new
commands which uses the existing virtio_admin_cmd.

[1] https://lists.oasis-open.org/archives/virtio-comment/202305/msg00112.html

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 can be 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.

The third command suggested by Jason queries the VF device's driver
notification region.

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 as native device 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 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 reset completion
b. Device register width related problems persist that hypervisor if
   wishes, cannot fix it.

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

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.

Fixes: https://github.com/oasis-tcs/virtio-spec/issues/167
Signed-off-by: Parav Pandit <parav@nvidia.com>

---
changelog:
v2->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 command

v0->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 (3):
  admin: Split opcode table rows with a line
  transport-pci: Introduce legacy registers access commands
  transport-pci: Add legacy register access conformance section

 admin.tex                     |  14 ++-
 conformance.tex               |   2 +
 transport-pci-legacy-regs.tex | 189 ++++++++++++++++++++++++++++++++++
 transport-pci.tex             |   2 +
 4 files changed, 206 insertions(+), 1 deletion(-)
 create mode 100644 transport-pci-legacy-regs.tex

-- 
2.26.2


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-02 20:36 ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-02 20:36 UTC (permalink / raw)
  To: mst, virtio-dev, cohuck, david.edmondson
  Cc: sburla, jasowang, yishaih, maorg, virtio-comment, shahafs, 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.

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

This short series is on top of latest work [1] from Michael.
It uses the newly introduced administrative virtqueue facility with 3 new
commands which uses the existing virtio_admin_cmd.

[1] https://lists.oasis-open.org/archives/virtio-comment/202305/msg00112.html

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 can be 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.

The third command suggested by Jason queries the VF device's driver
notification region.

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 as native device 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 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 reset completion
b. Device register width related problems persist that hypervisor if
   wishes, cannot fix it.

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

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.

Fixes: https://github.com/oasis-tcs/virtio-spec/issues/167
Signed-off-by: Parav Pandit <parav@nvidia.com>

---
changelog:
v2->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 command

v0->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 (3):
  admin: Split opcode table rows with a line
  transport-pci: Introduce legacy registers access commands
  transport-pci: Add legacy register access conformance section

 admin.tex                     |  14 ++-
 conformance.tex               |   2 +
 transport-pci-legacy-regs.tex | 189 ++++++++++++++++++++++++++++++++++
 transport-pci.tex             |   2 +
 4 files changed, 206 insertions(+), 1 deletion(-)
 create mode 100644 transport-pci-legacy-regs.tex

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] [PATCH v3 1/3] admin: Split opcode table rows with a line
  2023-06-02 20:36 ` [virtio-comment] " Parav Pandit
@ 2023-06-02 20:36   ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-02 20:36 UTC (permalink / raw)
  To: mst, virtio-dev, cohuck, david.edmondson
  Cc: sburla, jasowang, yishaih, maorg, virtio-comment, shahafs, Parav Pandit

Currently all opcode appears to be in a single row.
Separate them with a line similar to other tables.

Signed-off-by: Parav Pandit <parav@nvidia.com>
---
changelog:
v2->v3:
- new patch
---
 admin.tex | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/admin.tex b/admin.tex
index 2efd4d7..e51f9e6 100644
--- a/admin.tex
+++ b/admin.tex
@@ -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)    \\
-- 
2.26.2


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply related	[flat|nested] 164+ messages in thread

* [virtio-comment] [PATCH v3 1/3] admin: Split opcode table rows with a line
@ 2023-06-02 20:36   ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-02 20:36 UTC (permalink / raw)
  To: mst, virtio-dev, cohuck, david.edmondson
  Cc: sburla, jasowang, yishaih, maorg, virtio-comment, shahafs, Parav Pandit

Currently all opcode appears to be in a single row.
Separate them with a line similar to other tables.

Signed-off-by: Parav Pandit <parav@nvidia.com>
---
changelog:
v2->v3:
- new patch
---
 admin.tex | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/admin.tex b/admin.tex
index 2efd4d7..e51f9e6 100644
--- a/admin.tex
+++ b/admin.tex
@@ -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)    \\
-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply related	[flat|nested] 164+ messages in thread

* [virtio-dev] [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-02 20:36 ` [virtio-comment] " Parav Pandit
@ 2023-06-02 20:36   ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-02 20:36 UTC (permalink / raw)
  To: mst, virtio-dev, cohuck, david.edmondson
  Cc: sburla, jasowang, yishaih, maorg, virtio-comment, shahafs, Parav Pandit

This patch 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.

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 can be 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.

The third command suggested by Jason queries the VF device's driver
notification region.

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 notifications
       |                         |
  +----+------------+       +----+------------+
  | +-----+         |       | 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 as native device in the host.

3. Use it in a light weight hypervisor to run bare-metal OS.

Please review.

Fixes: https://github.com/oasis-tcs/virtio-spec/issues/167
Signed-off-by: Parav Pandit <parav@nvidia.com>
---
changelog:
v2->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
---
 admin.tex                     |  12 ++-
 transport-pci-legacy-regs.tex | 153 ++++++++++++++++++++++++++++++++++
 transport-pci.tex             |   2 +
 3 files changed, 166 insertions(+), 1 deletion(-)
 create mode 100644 transport-pci-legacy-regs.tex

diff --git a/admin.tex b/admin.tex
index e51f9e6..5bcde98 100644
--- a/admin.tex
+++ b/admin.tex
@@ -117,7 +117,17 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti
 \hline
 0x0001 & VIRTIO_ADMIN_CMD_LIST_USE & Provides to device list of commands used for this group type \\
 \hline
-0x0002 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd}    \\
+0x0002 & VIRTIO_ADMIN_CMD_LCC_REG_WRITE & Write legacy common configuration registers of a member device    \\
+\hline
+0x0003 & VIRTIO_ADMIN_CMD_LCC_REG_READ & Read legacy common configuration registers of a member device    \\
+\hline
+0x0004 & VIRTIO_ADMIN_CMD_LD_REG_WRITE & Write legacy device registers of a member device    \\
+\hline
+0x0005 & VIRTIO_ADMIN_CMD_LD_REG_READ & Read legacy device registers of a member device    \\
+\hline
+0x0006 & VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY & Read the queue notification offset for legacy interface \\
+\hline
+0x0007 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd}    \\
 \hline
 0x8000 - 0xFFFF & - & Reserved for future commands (possibly using a different structure)    \\
 \hline
diff --git a/transport-pci-legacy-regs.tex b/transport-pci-legacy-regs.tex
new file mode 100644
index 0000000..948ac73
--- /dev/null
+++ b/transport-pci-legacy-regs.tex
@@ -0,0 +1,153 @@
+\subsection{Legacy Interfaces: SR-IOV VFs Registers Access}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access}
+
+As described in PCIe base specification \hyperref[intro:PCIe]{[PCIe]} PCI VFs
+do not support the I/O space BAR. A PCI VF hardware device that can support
+legacy interfaces cannot be passthrough to the guest virtual machine
+due to this limitation. To have a transitional virtio device in the guest
+virtual machine, a PCI PF device as a group owner may support accessing its
+group member PCI VF device's legacy registers using an administrative
+virtqueue. This enables minimal intervention in the hypervisor only for
+the purpose of legacy registers access.
+
+A hypervisor software accesses the legacy configuration and device specific
+registers requested by the guest virtual machine using an administrative
+virtqueue. Even though virtqueue driver notifications can be communicated
+through administrative virtqueue, if the PCI PF and VF devices support such
+notifications using a memory-mapped operation, such driver notifications
+are sent using a device defined notification region.
+
+The group owner PCI PF device can optionally enable the driver to access
+its member PCI VFs devices legacy common configuration and device configuration
+registers using an administration virtqueue. Such a PCI PF device supports
+the following commands:
+
+\begin{enumerate}
+\item Legacy Common Configuration Registers Write Command
+\item Legacy common Configuration Registers Read Command
+\item Legacy Device Specific registers Write Command
+\item Legacy Device Specific registers Read Command
+\item Legacy Queue Notify Offset Query Command
+\end{enumerate}
+
+\subsubsection{Legacy Common Configuration Registers Write Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Write Command}
+
+The Legacy Common Configuration Registers Write Command follows
+\field{struct virtio_admin_cmd}.
+This command writes legacy common configuration registers of a member VF device.
+The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LCC_REG_WRITE.
+
+The command VIRTIO_ADMIN_CMD_LCC_REG_WRITE uses following structure for
+\field{command_specific_data}:
+
+\begin{lstlisting}
+struct virtio_admin_cmd_lcc_reg_wr_data {
+	u8 offset; /* Starting byte offset of the common configuration register(s) to write */
+	u8 register[];
+};
+\end{lstlisting}
+
+This command does not have any command specific result.
+
+\subsubsection{Legacy Common Configuration Registers Read Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Read Command}
+
+The Legacy Common Configuration Registers Read Command follows \field{struct virtio_admin_cmd}.
+This command reads legacy common configuration registers of a member VF device.
+The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LCC_REG_READ.
+
+The command VIRTIO_ADMIN_CMD_LCC_REG_READ uses following listed structure for
+\field{command_specific_data}:
+
+\begin{lstlisting}
+struct virtio_admin_cmd_lcc_reg_rd_data {
+	u8 offset; /* Starting byte offset of the register to read */
+};
+\end{lstlisting}
+
+When command completes successfully, \field{command_specific_result}
+uses following listed structure:
+
+\begin{lstlisting}
+struct virtio_admin_cmd_lcc_reg_rd_result {
+	u8 registers[];
+};
+\end{lstlisting}
+
+
+\subsubsection{Legacy Device Registers Write Command}\label{sec:Virtio Transport
+Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Device Registers Write Command}
+
+The Legacy Device Registers Write Command follows \field{struct virtio_admin_cmd}.
+This command writes legacy device registers of a member VF device.
+The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LD_REG_WRITE.
+
+The command VIRTIO_ADMIN_CMD_LD_REG_WRITE 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 register(s) to write */
+	u8 register[];
+};
+\end{lstlisting}
+
+This command does not have any command specific result.
+
+\subsubsection{Legacy Device Registers Read Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Read Command}
+
+The Legacy Device Registers Read Command follows \field{struct virtio_admin_cmd}.
+This command reads legacy device specific registers of a member VF device.
+The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LD_REG_READ.
+
+The command VIRTIO_ADMIN_CMD_LD_REG_READ uses following listed structure for
+\field{command_specific_data}:
+
+\begin{lstlisting}
+struct virtio_admin_cmd_ld_reg_rd_data {
+	u8 offset; /* Starting byte offset of the register to read */
+};
+\end{lstlisting}
+
+When command completes successfully, \field{command_specific_result}
+uses following listed structure:
+
+\begin{lstlisting}
+struct virtio_admin_cmd_ld_reg_rd_result {
+	u8 registers[];
+};
+\end{lstlisting}
+
+\subsubsection{Legacy Queue Notify Offset Query Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Queue Notify Offset Query Command}
+
+This command returns the notify offset of the member VF for virtqueue
+driver notifications. This command follows \field{struct virtio_admin_cmd}.
+The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY.
+There is no command specific data for this command.
+
+When command completes successfully, \field{command_specific_result}
+uses following listed structure:
+
+\begin{lstlisting}
+struct virtio_admin_cmd_lq_notify_query_result {
+	u8 bar; /* PCI BAR number of the member VF */
+	u8 reserved[7];
+	le64 offset; /* Byte offset within the BAR */
+};
+\end{lstlisting}
+
+The driver that may use the driver notifications region of the VF device
+returned in this result likely attain higher performance or the drier may use
+the VIRTIO_ADMIN_CMD_LREG_WRITE command.
+
+\begin{note}
+The device and driver must encode and decode legacy device specific registers
+using little endian format. Per PCI VF device level big endian format support
+is left for the future.
+\end{note}
+
+\begin{note}
+The PCI VF device should not use PCI BAR 0 when it prefers to support
+legacy interface registers access using its group owner PF. This enables
+hypervisor software to operate with least complexities to compose a legacy
+interface I/O space BAR and passthrough other PCI BARs and PCI device
+capabilities to the guest virtual machine without any translation.
+\end{note}
diff --git a/transport-pci.tex b/transport-pci.tex
index a5c6719..72c78f6 100644
--- a/transport-pci.tex
+++ b/transport-pci.tex
@@ -1212,3 +1212,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}
-- 
2.26.2


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply related	[flat|nested] 164+ messages in thread

* [virtio-comment] [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-02 20:36   ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-02 20:36 UTC (permalink / raw)
  To: mst, virtio-dev, cohuck, david.edmondson
  Cc: sburla, jasowang, yishaih, maorg, virtio-comment, shahafs, Parav Pandit

This patch 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.

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 can be 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.

The third command suggested by Jason queries the VF device's driver
notification region.

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 notifications
       |                         |
  +----+------------+       +----+------------+
  | +-----+         |       | 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 as native device in the host.

3. Use it in a light weight hypervisor to run bare-metal OS.

Please review.

Fixes: https://github.com/oasis-tcs/virtio-spec/issues/167
Signed-off-by: Parav Pandit <parav@nvidia.com>
---
changelog:
v2->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
---
 admin.tex                     |  12 ++-
 transport-pci-legacy-regs.tex | 153 ++++++++++++++++++++++++++++++++++
 transport-pci.tex             |   2 +
 3 files changed, 166 insertions(+), 1 deletion(-)
 create mode 100644 transport-pci-legacy-regs.tex

diff --git a/admin.tex b/admin.tex
index e51f9e6..5bcde98 100644
--- a/admin.tex
+++ b/admin.tex
@@ -117,7 +117,17 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti
 \hline
 0x0001 & VIRTIO_ADMIN_CMD_LIST_USE & Provides to device list of commands used for this group type \\
 \hline
-0x0002 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd}    \\
+0x0002 & VIRTIO_ADMIN_CMD_LCC_REG_WRITE & Write legacy common configuration registers of a member device    \\
+\hline
+0x0003 & VIRTIO_ADMIN_CMD_LCC_REG_READ & Read legacy common configuration registers of a member device    \\
+\hline
+0x0004 & VIRTIO_ADMIN_CMD_LD_REG_WRITE & Write legacy device registers of a member device    \\
+\hline
+0x0005 & VIRTIO_ADMIN_CMD_LD_REG_READ & Read legacy device registers of a member device    \\
+\hline
+0x0006 & VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY & Read the queue notification offset for legacy interface \\
+\hline
+0x0007 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd}    \\
 \hline
 0x8000 - 0xFFFF & - & Reserved for future commands (possibly using a different structure)    \\
 \hline
diff --git a/transport-pci-legacy-regs.tex b/transport-pci-legacy-regs.tex
new file mode 100644
index 0000000..948ac73
--- /dev/null
+++ b/transport-pci-legacy-regs.tex
@@ -0,0 +1,153 @@
+\subsection{Legacy Interfaces: SR-IOV VFs Registers Access}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access}
+
+As described in PCIe base specification \hyperref[intro:PCIe]{[PCIe]} PCI VFs
+do not support the I/O space BAR. A PCI VF hardware device that can support
+legacy interfaces cannot be passthrough to the guest virtual machine
+due to this limitation. To have a transitional virtio device in the guest
+virtual machine, a PCI PF device as a group owner may support accessing its
+group member PCI VF device's legacy registers using an administrative
+virtqueue. This enables minimal intervention in the hypervisor only for
+the purpose of legacy registers access.
+
+A hypervisor software accesses the legacy configuration and device specific
+registers requested by the guest virtual machine using an administrative
+virtqueue. Even though virtqueue driver notifications can be communicated
+through administrative virtqueue, if the PCI PF and VF devices support such
+notifications using a memory-mapped operation, such driver notifications
+are sent using a device defined notification region.
+
+The group owner PCI PF device can optionally enable the driver to access
+its member PCI VFs devices legacy common configuration and device configuration
+registers using an administration virtqueue. Such a PCI PF device supports
+the following commands:
+
+\begin{enumerate}
+\item Legacy Common Configuration Registers Write Command
+\item Legacy common Configuration Registers Read Command
+\item Legacy Device Specific registers Write Command
+\item Legacy Device Specific registers Read Command
+\item Legacy Queue Notify Offset Query Command
+\end{enumerate}
+
+\subsubsection{Legacy Common Configuration Registers Write Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Write Command}
+
+The Legacy Common Configuration Registers Write Command follows
+\field{struct virtio_admin_cmd}.
+This command writes legacy common configuration registers of a member VF device.
+The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LCC_REG_WRITE.
+
+The command VIRTIO_ADMIN_CMD_LCC_REG_WRITE uses following structure for
+\field{command_specific_data}:
+
+\begin{lstlisting}
+struct virtio_admin_cmd_lcc_reg_wr_data {
+	u8 offset; /* Starting byte offset of the common configuration register(s) to write */
+	u8 register[];
+};
+\end{lstlisting}
+
+This command does not have any command specific result.
+
+\subsubsection{Legacy Common Configuration Registers Read Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Read Command}
+
+The Legacy Common Configuration Registers Read Command follows \field{struct virtio_admin_cmd}.
+This command reads legacy common configuration registers of a member VF device.
+The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LCC_REG_READ.
+
+The command VIRTIO_ADMIN_CMD_LCC_REG_READ uses following listed structure for
+\field{command_specific_data}:
+
+\begin{lstlisting}
+struct virtio_admin_cmd_lcc_reg_rd_data {
+	u8 offset; /* Starting byte offset of the register to read */
+};
+\end{lstlisting}
+
+When command completes successfully, \field{command_specific_result}
+uses following listed structure:
+
+\begin{lstlisting}
+struct virtio_admin_cmd_lcc_reg_rd_result {
+	u8 registers[];
+};
+\end{lstlisting}
+
+
+\subsubsection{Legacy Device Registers Write Command}\label{sec:Virtio Transport
+Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Device Registers Write Command}
+
+The Legacy Device Registers Write Command follows \field{struct virtio_admin_cmd}.
+This command writes legacy device registers of a member VF device.
+The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LD_REG_WRITE.
+
+The command VIRTIO_ADMIN_CMD_LD_REG_WRITE 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 register(s) to write */
+	u8 register[];
+};
+\end{lstlisting}
+
+This command does not have any command specific result.
+
+\subsubsection{Legacy Device Registers Read Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Read Command}
+
+The Legacy Device Registers Read Command follows \field{struct virtio_admin_cmd}.
+This command reads legacy device specific registers of a member VF device.
+The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LD_REG_READ.
+
+The command VIRTIO_ADMIN_CMD_LD_REG_READ uses following listed structure for
+\field{command_specific_data}:
+
+\begin{lstlisting}
+struct virtio_admin_cmd_ld_reg_rd_data {
+	u8 offset; /* Starting byte offset of the register to read */
+};
+\end{lstlisting}
+
+When command completes successfully, \field{command_specific_result}
+uses following listed structure:
+
+\begin{lstlisting}
+struct virtio_admin_cmd_ld_reg_rd_result {
+	u8 registers[];
+};
+\end{lstlisting}
+
+\subsubsection{Legacy Queue Notify Offset Query Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Queue Notify Offset Query Command}
+
+This command returns the notify offset of the member VF for virtqueue
+driver notifications. This command follows \field{struct virtio_admin_cmd}.
+The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY.
+There is no command specific data for this command.
+
+When command completes successfully, \field{command_specific_result}
+uses following listed structure:
+
+\begin{lstlisting}
+struct virtio_admin_cmd_lq_notify_query_result {
+	u8 bar; /* PCI BAR number of the member VF */
+	u8 reserved[7];
+	le64 offset; /* Byte offset within the BAR */
+};
+\end{lstlisting}
+
+The driver that may use the driver notifications region of the VF device
+returned in this result likely attain higher performance or the drier may use
+the VIRTIO_ADMIN_CMD_LREG_WRITE command.
+
+\begin{note}
+The device and driver must encode and decode legacy device specific registers
+using little endian format. Per PCI VF device level big endian format support
+is left for the future.
+\end{note}
+
+\begin{note}
+The PCI VF device should not use PCI BAR 0 when it prefers to support
+legacy interface registers access using its group owner PF. This enables
+hypervisor software to operate with least complexities to compose a legacy
+interface I/O space BAR and passthrough other PCI BARs and PCI device
+capabilities to the guest virtual machine without any translation.
+\end{note}
diff --git a/transport-pci.tex b/transport-pci.tex
index a5c6719..72c78f6 100644
--- a/transport-pci.tex
+++ b/transport-pci.tex
@@ -1212,3 +1212,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}
-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply related	[flat|nested] 164+ messages in thread

* [virtio-dev] [PATCH v3 3/3] transport-pci: Add legacy register access conformance section
  2023-06-02 20:36 ` [virtio-comment] " Parav Pandit
@ 2023-06-02 20:36   ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-02 20:36 UTC (permalink / raw)
  To: mst, virtio-dev, cohuck, david.edmondson
  Cc: sburla, jasowang, yishaih, maorg, virtio-comment, shahafs, Parav Pandit

Add device and driver conformanace section for legacy registers access
commands interface.

Fixes: https://github.com/oasis-tcs/virtio-spec/issues/167
Signed-off-by: Parav Pandit <parav@nvidia.com>

---
changelog:
v2->v3:
- added normative lines for two additional commands
---
 conformance.tex               |  2 ++
 transport-pci-legacy-regs.tex | 38 ++++++++++++++++++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/conformance.tex b/conformance.tex
index 01ccd69..3f2d49e 100644
--- a/conformance.tex
+++ b/conformance.tex
@@ -109,6 +109,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{drivernormative:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / PCI configuration access capability}
 \item \ref{drivernormative:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Device Initialization / MSI-X Vector Configuration}
 \item \ref{drivernormative:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Notification of Device Configuration Changes}
+\item \ref{drivernormative:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access}
 \end{itemize}
 
 \conformance{\subsection}{MMIO Driver Conformance}\label{sec:Conformance / Driver Conformance / MMIO Driver Conformance}
@@ -194,6 +195,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Device Initialization / MSI-X Vector Configuration}
 \item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Used Buffer Notifications}
 \item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Notification of Device Configuration Changes}
+\item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access}
 \end{itemize}
 
 \conformance{\subsection}{MMIO Device Conformance}\label{sec:Conformance / Device Conformance / MMIO Device Conformance}
diff --git a/transport-pci-legacy-regs.tex b/transport-pci-legacy-regs.tex
index 948ac73..f3dbf45 100644
--- a/transport-pci-legacy-regs.tex
+++ b/transport-pci-legacy-regs.tex
@@ -136,7 +136,7 @@ \subsubsection{Legacy Queue Notify Offset Query Command}\label{sec:Virtio Transp
 
 The driver that may use the driver notifications region of the VF device
 returned in this result likely attain higher performance or the drier may use
-the VIRTIO_ADMIN_CMD_LREG_WRITE command.
+the VIRTIO_ADMIN_CMD_LCC_REG_WRITE command.
 
 \begin{note}
 The device and driver must encode and decode legacy device specific registers
@@ -151,3 +151,39 @@ \subsubsection{Legacy Queue Notify Offset Query Command}\label{sec:Virtio Transp
 interface I/O space BAR and passthrough other PCI BARs and PCI device
 capabilities to the guest virtual machine without any translation.
 \end{note}
+
+\devicenormative{\paragraph}{SR-IOV VFs Legacy Registers Access}{Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access}
+
+If the PCI PF device supports legacy registers access for its group members,
+the device MUST set all corresponding bits for commands VIRTIO_ADMIN_CMD_LCC_REG_WRITE,
+VIRTIO_ADMIN_CMD_LCC_REG_READ, VIRTIO_ADMIN_CMD_LD_REG_WRITE,
+VIRTIO_ADMIN_CMD_LD_REG_READ and VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY in
+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_LCC_REG_WRITE, VIRTIO_ADMIN_CMD_LCC_REG_READ
+commands for the invalid offset which is outside the legacy common configuration 
+register's address range.
+
+The device MUST fail VIRTIO_ADMIN_CMD_LD_REG_WRITE, VIRTIO_ADMIN_CMD_LD_REG_READ
+commands for the invalid offset which is outside the legacy device specific
+register's address range.
+
+The PCI VF device SHOULD NOT use PCI BAR 0 when it prefers to support
+legacy interface registers access.
+
+\drivernormative{\paragraph}{SR-IOV VFs Legacy Registers Access}{Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access}
+
+The driver MUST encode and decode legacy device specific registers using
+little-endian format.
+
+The driver SHOULD send commands VIRTIO_ADMIN_CMD_LCC_REG_WRITE and
+VIRTIO_ADMIN_CMD_LCC_REG_READ with a valid offset which is in the legacy
+common configuration registers address range.
+
+The driver SHOULD send commands VIRTIO_ADMIN_CMD_LD_REG_WRITE and
+VIRTIO_ADMIN_CMD_LD_REG_READ with a valid offset which is in the legacy
+device specific registers address range.
-- 
2.26.2


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply related	[flat|nested] 164+ messages in thread

* [virtio-comment] [PATCH v3 3/3] transport-pci: Add legacy register access conformance section
@ 2023-06-02 20:36   ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-02 20:36 UTC (permalink / raw)
  To: mst, virtio-dev, cohuck, david.edmondson
  Cc: sburla, jasowang, yishaih, maorg, virtio-comment, shahafs, Parav Pandit

Add device and driver conformanace section for legacy registers access
commands interface.

Fixes: https://github.com/oasis-tcs/virtio-spec/issues/167
Signed-off-by: Parav Pandit <parav@nvidia.com>

---
changelog:
v2->v3:
- added normative lines for two additional commands
---
 conformance.tex               |  2 ++
 transport-pci-legacy-regs.tex | 38 ++++++++++++++++++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/conformance.tex b/conformance.tex
index 01ccd69..3f2d49e 100644
--- a/conformance.tex
+++ b/conformance.tex
@@ -109,6 +109,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{drivernormative:Virtio Transport Options / Virtio Over PCI Bus / PCI Device Layout / PCI configuration access capability}
 \item \ref{drivernormative:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Device Initialization / MSI-X Vector Configuration}
 \item \ref{drivernormative:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Notification of Device Configuration Changes}
+\item \ref{drivernormative:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access}
 \end{itemize}
 
 \conformance{\subsection}{MMIO Driver Conformance}\label{sec:Conformance / Driver Conformance / MMIO Driver Conformance}
@@ -194,6 +195,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Device Initialization / MSI-X Vector Configuration}
 \item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Used Buffer Notifications}
 \item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Notification of Device Configuration Changes}
+\item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access}
 \end{itemize}
 
 \conformance{\subsection}{MMIO Device Conformance}\label{sec:Conformance / Device Conformance / MMIO Device Conformance}
diff --git a/transport-pci-legacy-regs.tex b/transport-pci-legacy-regs.tex
index 948ac73..f3dbf45 100644
--- a/transport-pci-legacy-regs.tex
+++ b/transport-pci-legacy-regs.tex
@@ -136,7 +136,7 @@ \subsubsection{Legacy Queue Notify Offset Query Command}\label{sec:Virtio Transp
 
 The driver that may use the driver notifications region of the VF device
 returned in this result likely attain higher performance or the drier may use
-the VIRTIO_ADMIN_CMD_LREG_WRITE command.
+the VIRTIO_ADMIN_CMD_LCC_REG_WRITE command.
 
 \begin{note}
 The device and driver must encode and decode legacy device specific registers
@@ -151,3 +151,39 @@ \subsubsection{Legacy Queue Notify Offset Query Command}\label{sec:Virtio Transp
 interface I/O space BAR and passthrough other PCI BARs and PCI device
 capabilities to the guest virtual machine without any translation.
 \end{note}
+
+\devicenormative{\paragraph}{SR-IOV VFs Legacy Registers Access}{Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access}
+
+If the PCI PF device supports legacy registers access for its group members,
+the device MUST set all corresponding bits for commands VIRTIO_ADMIN_CMD_LCC_REG_WRITE,
+VIRTIO_ADMIN_CMD_LCC_REG_READ, VIRTIO_ADMIN_CMD_LD_REG_WRITE,
+VIRTIO_ADMIN_CMD_LD_REG_READ and VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY in
+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_LCC_REG_WRITE, VIRTIO_ADMIN_CMD_LCC_REG_READ
+commands for the invalid offset which is outside the legacy common configuration 
+register's address range.
+
+The device MUST fail VIRTIO_ADMIN_CMD_LD_REG_WRITE, VIRTIO_ADMIN_CMD_LD_REG_READ
+commands for the invalid offset which is outside the legacy device specific
+register's address range.
+
+The PCI VF device SHOULD NOT use PCI BAR 0 when it prefers to support
+legacy interface registers access.
+
+\drivernormative{\paragraph}{SR-IOV VFs Legacy Registers Access}{Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access}
+
+The driver MUST encode and decode legacy device specific registers using
+little-endian format.
+
+The driver SHOULD send commands VIRTIO_ADMIN_CMD_LCC_REG_WRITE and
+VIRTIO_ADMIN_CMD_LCC_REG_READ with a valid offset which is in the legacy
+common configuration registers address range.
+
+The driver SHOULD send commands VIRTIO_ADMIN_CMD_LD_REG_WRITE and
+VIRTIO_ADMIN_CMD_LD_REG_READ with a valid offset which is in the legacy
+device specific registers address range.
-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply related	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-02 20:36   ` [virtio-comment] " Parav Pandit
@ 2023-06-04 13:22     ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 13:22 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang, yishaih,
	maorg, virtio-comment, shahafs

On Fri, Jun 02, 2023 at 11:36:03PM +0300, Parav Pandit wrote:
> +\subsubsection{Legacy Device Registers Read Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Read Command}
> +
> +The Legacy Device Registers Read Command follows \field{struct virtio_admin_cmd}.
> +This command reads legacy device specific registers of a member VF device.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LD_REG_READ.
> +
> +The command VIRTIO_ADMIN_CMD_LD_REG_READ uses following listed structure for
> +\field{command_specific_data}:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_ld_reg_rd_data {
> +	u8 offset; /* Starting byte offset of the register to read */
> +};
> +\end{lstlisting}
> +
> +When command completes successfully, \field{command_specific_result}
> +uses following listed structure:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_ld_reg_rd_result {
> +	u8 registers[];
> +};
> +\end{lstlisting}
> +
> +\subsubsection{Legacy Queue Notify Offset Query Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Queue Notify Offset Query Command}
> +
> +This command returns the notify offset of the member VF for virtqueue
> +driver notifications. This command follows \field{struct virtio_admin_cmd}.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY.
> +There is no command specific data for this command.
> +
> +When command completes successfully, \field{command_specific_result}
> +uses following listed structure:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_lq_notify_query_result {
> +	u8 bar; /* PCI BAR number of the member VF */
> +	u8 reserved[7];
> +	le64 offset; /* Byte offset within the BAR */
> +};
> +\end{lstlisting}
> +
> +The driver that may use the driver notifications region of the VF device
> +returned in this result likely attain higher performance or the drier may use
> +the VIRTIO_ADMIN_CMD_LREG_WRITE command.

Obtain I guess ... but how? There's no explanation.


> +
> +\begin{note}
> +The device and driver must encode and decode legacy device specific registers
> +using little endian format. Per PCI VF device level big endian format support
> +is left for the future.
> +\end{note}
> +
> +\begin{note}
> +The PCI VF device should not use PCI BAR 0 when it prefers to support
> +legacy interface registers access using its group owner PF. This enables
> +hypervisor software to operate with least complexities to compose a legacy
> +interface I/O space BAR and passthrough other PCI BARs and PCI device
> +capabilities to the guest virtual machine without any translation.
> +\end{note}

Is this related to this last command somehow? what does it mean
for PCI VF device to use a BAR? not use a BAR? Prefer what to what?

> -- 
> 2.26.2


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-04 13:22     ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 13:22 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang, yishaih,
	maorg, virtio-comment, shahafs

On Fri, Jun 02, 2023 at 11:36:03PM +0300, Parav Pandit wrote:
> +\subsubsection{Legacy Device Registers Read Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Read Command}
> +
> +The Legacy Device Registers Read Command follows \field{struct virtio_admin_cmd}.
> +This command reads legacy device specific registers of a member VF device.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LD_REG_READ.
> +
> +The command VIRTIO_ADMIN_CMD_LD_REG_READ uses following listed structure for
> +\field{command_specific_data}:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_ld_reg_rd_data {
> +	u8 offset; /* Starting byte offset of the register to read */
> +};
> +\end{lstlisting}
> +
> +When command completes successfully, \field{command_specific_result}
> +uses following listed structure:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_ld_reg_rd_result {
> +	u8 registers[];
> +};
> +\end{lstlisting}
> +
> +\subsubsection{Legacy Queue Notify Offset Query Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Queue Notify Offset Query Command}
> +
> +This command returns the notify offset of the member VF for virtqueue
> +driver notifications. This command follows \field{struct virtio_admin_cmd}.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY.
> +There is no command specific data for this command.
> +
> +When command completes successfully, \field{command_specific_result}
> +uses following listed structure:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_lq_notify_query_result {
> +	u8 bar; /* PCI BAR number of the member VF */
> +	u8 reserved[7];
> +	le64 offset; /* Byte offset within the BAR */
> +};
> +\end{lstlisting}
> +
> +The driver that may use the driver notifications region of the VF device
> +returned in this result likely attain higher performance or the drier may use
> +the VIRTIO_ADMIN_CMD_LREG_WRITE command.

Obtain I guess ... but how? There's no explanation.


> +
> +\begin{note}
> +The device and driver must encode and decode legacy device specific registers
> +using little endian format. Per PCI VF device level big endian format support
> +is left for the future.
> +\end{note}
> +
> +\begin{note}
> +The PCI VF device should not use PCI BAR 0 when it prefers to support
> +legacy interface registers access using its group owner PF. This enables
> +hypervisor software to operate with least complexities to compose a legacy
> +interface I/O space BAR and passthrough other PCI BARs and PCI device
> +capabilities to the guest virtual machine without any translation.
> +\end{note}

Is this related to this last command somehow? what does it mean
for PCI VF device to use a BAR? not use a BAR? Prefer what to what?

> -- 
> 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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-02 20:36 ` [virtio-comment] " Parav Pandit
@ 2023-06-04 13:34   ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 13:34 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang, yishaih,
	maorg, virtio-comment, shahafs

On Fri, Jun 02, 2023 at 11:36:01PM +0300, Parav Pandit wrote:
> This short series introduces legacy registers access commands for the owner
> group member PCI PF to access the legacy registers of the member VFs.

Note that some work will be needed here to fix up grammar and spelling
mistakes.

> 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.

Yes, with the exception of
VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY - currently refers to VF BAR,
subfunctions do not have it.
Can we find a way to have it in the PF BAR instead?
E.g. the notification can include VF# + VQ#?
At least as an option?
If not can you add some info explaining why not?


> 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
> 
> This short series is on top of latest work [1] from Michael.
> It uses the newly introduced administrative virtqueue facility with 3 new
> commands which uses the existing virtio_admin_cmd.
> 
> [1] https://lists.oasis-open.org/archives/virtio-comment/202305/msg00112.html
> 
> 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 can be 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.
> 
> The third command suggested by Jason queries the VF device's driver
> notification region.
> 
> 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 as native device 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 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 reset completion
> b. Device register width related problems persist that hypervisor if
>    wishes, cannot fix it.
> 
> 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
> 
> 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.
> 
> Fixes: https://github.com/oasis-tcs/virtio-spec/issues/167
> Signed-off-by: Parav Pandit <parav@nvidia.com>
> 
> ---
> changelog:
> v2->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 command
> 
> v0->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 (3):
>   admin: Split opcode table rows with a line
>   transport-pci: Introduce legacy registers access commands
>   transport-pci: Add legacy register access conformance section
> 
>  admin.tex                     |  14 ++-
>  conformance.tex               |   2 +
>  transport-pci-legacy-regs.tex | 189 ++++++++++++++++++++++++++++++++++
>  transport-pci.tex             |   2 +
>  4 files changed, 206 insertions(+), 1 deletion(-)
>  create mode 100644 transport-pci-legacy-regs.tex
> 
> -- 
> 2.26.2


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-04 13:34   ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 13:34 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang, yishaih,
	maorg, virtio-comment, shahafs

On Fri, Jun 02, 2023 at 11:36:01PM +0300, Parav Pandit wrote:
> This short series introduces legacy registers access commands for the owner
> group member PCI PF to access the legacy registers of the member VFs.

Note that some work will be needed here to fix up grammar and spelling
mistakes.

> 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.

Yes, with the exception of
VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY - currently refers to VF BAR,
subfunctions do not have it.
Can we find a way to have it in the PF BAR instead?
E.g. the notification can include VF# + VQ#?
At least as an option?
If not can you add some info explaining why not?


> 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
> 
> This short series is on top of latest work [1] from Michael.
> It uses the newly introduced administrative virtqueue facility with 3 new
> commands which uses the existing virtio_admin_cmd.
> 
> [1] https://lists.oasis-open.org/archives/virtio-comment/202305/msg00112.html
> 
> 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 can be 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.
> 
> The third command suggested by Jason queries the VF device's driver
> notification region.
> 
> 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 as native device 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 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 reset completion
> b. Device register width related problems persist that hypervisor if
>    wishes, cannot fix it.
> 
> 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
> 
> 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.
> 
> Fixes: https://github.com/oasis-tcs/virtio-spec/issues/167
> Signed-off-by: Parav Pandit <parav@nvidia.com>
> 
> ---
> changelog:
> v2->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 command
> 
> v0->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 (3):
>   admin: Split opcode table rows with a line
>   transport-pci: Introduce legacy registers access commands
>   transport-pci: Add legacy register access conformance section
> 
>  admin.tex                     |  14 ++-
>  conformance.tex               |   2 +
>  transport-pci-legacy-regs.tex | 189 ++++++++++++++++++++++++++++++++++
>  transport-pci.tex             |   2 +
>  4 files changed, 206 insertions(+), 1 deletion(-)
>  create mode 100644 transport-pci-legacy-regs.tex
> 
> -- 
> 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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-04 13:34   ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-04 13:41     ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 13:41 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 9:34 AM
> 
> On Fri, Jun 02, 2023 at 11:36:01PM +0300, Parav Pandit wrote:
> > This short series introduces legacy registers access commands for the
> > owner group member PCI PF to access the legacy registers of the member VFs.
> 
> Note that some work will be needed here to fix up grammar and spelling
> mistakes.
>
I already verified using codespell but I guess it missed few.
If you have specific already identified, let me know.
If not I will run a different checker.
 
> > 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.
> 
> Yes, with the exception of
> VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY - currently refers to VF BAR,
> subfunctions do not have it.
A subfunction will also have its own BAR carved out from the PF BAR.
A subfunction definition will be as contains as possible.

> Can we find a way to have it in the PF BAR instead?
At subfution level also it will be a BAR number, which will map to the PF BAR.

> E.g. the notification can include VF# + VQ#?
> At least as an option?
No. we discussed this before to have each device on its own BAR. Hence no VF# in the doorbell.

> If not can you add some info explaining why not?
Yes, Good point.
I will add the commit log explanation that every VF has its own BAR hence it does not use PF BAR.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-04 13:41     ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 13:41 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 9:34 AM
> 
> On Fri, Jun 02, 2023 at 11:36:01PM +0300, Parav Pandit wrote:
> > This short series introduces legacy registers access commands for the
> > owner group member PCI PF to access the legacy registers of the member VFs.
> 
> Note that some work will be needed here to fix up grammar and spelling
> mistakes.
>
I already verified using codespell but I guess it missed few.
If you have specific already identified, let me know.
If not I will run a different checker.
 
> > 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.
> 
> Yes, with the exception of
> VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY - currently refers to VF BAR,
> subfunctions do not have it.
A subfunction will also have its own BAR carved out from the PF BAR.
A subfunction definition will be as contains as possible.

> Can we find a way to have it in the PF BAR instead?
At subfution level also it will be a BAR number, which will map to the PF BAR.

> E.g. the notification can include VF# + VQ#?
> At least as an option?
No. we discussed this before to have each device on its own BAR. Hence no VF# in the doorbell.

> If not can you add some info explaining why not?
Yes, Good point.
I will add the commit log explanation that every VF has its own BAR hence it does not use PF BAR.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-04 13:22     ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-04 13:51       ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 13:51 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 9:22 AM

> > +The driver that may use the driver notifications region of the VF
> > +device returned in this result likely attain higher performance or
> > +the drier may use the VIRTIO_ADMIN_CMD_LREG_WRITE command.
> 
> Obtain I guess ... but how? There's no explanation.
>
Do you suggest to rewrite, above as below?

The driver that MAY use the driver notifications region of the VF likely obtain higher performance.
The driver may use VIRTIO_ADMIN_CMD_LCC_REG_WRITE command for doorbell notifications.

> > +\begin{note}
> > +The PCI VF device should not use PCI BAR 0 when it prefers to support
> > +legacy interface registers access using its group owner PF. This
> > +enables hypervisor software to operate with least complexities to
> > +compose a legacy interface I/O space BAR and passthrough other PCI
> > +BARs and PCI device capabilities to the guest virtual machine without any
> translation.
> > +\end{note}
> 
> Is this related to this last command somehow? what does it mean for PCI VF
> device to use a BAR? not use a BAR? Prefer what to what?

This is no different than v2, not sure why to discuss this in v3.
But ok.

No. It is not related to last command.
What does a PCI Device use BAR for?
As described in the spec, it uses the BAR in struct virtio_pci_cap for exposing various things.

So it means that PCI VF should use other than PCI BAR 0 for various Virtio Structure PCI Capabilities that it exposes.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-04 13:51       ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 13:51 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 9:22 AM

> > +The driver that may use the driver notifications region of the VF
> > +device returned in this result likely attain higher performance or
> > +the drier may use the VIRTIO_ADMIN_CMD_LREG_WRITE command.
> 
> Obtain I guess ... but how? There's no explanation.
>
Do you suggest to rewrite, above as below?

The driver that MAY use the driver notifications region of the VF likely obtain higher performance.
The driver may use VIRTIO_ADMIN_CMD_LCC_REG_WRITE command for doorbell notifications.

> > +\begin{note}
> > +The PCI VF device should not use PCI BAR 0 when it prefers to support
> > +legacy interface registers access using its group owner PF. This
> > +enables hypervisor software to operate with least complexities to
> > +compose a legacy interface I/O space BAR and passthrough other PCI
> > +BARs and PCI device capabilities to the guest virtual machine without any
> translation.
> > +\end{note}
> 
> Is this related to this last command somehow? what does it mean for PCI VF
> device to use a BAR? not use a BAR? Prefer what to what?

This is no different than v2, not sure why to discuss this in v3.
But ok.

No. It is not related to last command.
What does a PCI Device use BAR for?
As described in the spec, it uses the BAR in struct virtio_pci_cap for exposing various things.

So it means that PCI VF should use other than PCI BAR 0 for various Virtio Structure PCI Capabilities that it exposes.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-04 13:41     ` [virtio-dev] " Parav Pandit
@ 2023-06-04 13:55       ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 13:55 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 01:41:54PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 9:34 AM
> > 
> > On Fri, Jun 02, 2023 at 11:36:01PM +0300, Parav Pandit wrote:
> > > This short series introduces legacy registers access commands for the
> > > owner group member PCI PF to access the legacy registers of the member VFs.
> > 
> > Note that some work will be needed here to fix up grammar and spelling
> > mistakes.
> >
> I already verified using codespell but I guess it missed few.
> If you have specific already identified, let me know.

I remember seeing something about a drier somewhere :)

> If not I will run a different checker.

Yea, pls check grammar too.

> > > 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.
> > 
> > Yes, with the exception of
> > VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY - currently refers to VF BAR,
> > subfunctions do not have it.
> A subfunction will also have its own BAR carved out from the PF BAR.
> A subfunction definition will be as contains as possible.
> 
> > Can we find a way to have it in the PF BAR instead?
> At subfution level also it will be a BAR number, which will map to the PF BAR.

exactly. why not support this for PF too?

> > E.g. the notification can include VF# + VQ#?
> > At least as an option?
> No. we discussed this before to have each device on its own BAR. Hence no VF# in the doorbell.

you said that you want it but without much in the way of
explanation. I'm still not convinced it's a workable interface. Will it help
if I get some feedback from windows driver team on the design?

> > If not can you add some info explaining why not?
> Yes, Good point.
> I will add the commit log explanation that every VF has its own BAR hence it does not use PF BAR.


-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-04 13:55       ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 13:55 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 01:41:54PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 9:34 AM
> > 
> > On Fri, Jun 02, 2023 at 11:36:01PM +0300, Parav Pandit wrote:
> > > This short series introduces legacy registers access commands for the
> > > owner group member PCI PF to access the legacy registers of the member VFs.
> > 
> > Note that some work will be needed here to fix up grammar and spelling
> > mistakes.
> >
> I already verified using codespell but I guess it missed few.
> If you have specific already identified, let me know.

I remember seeing something about a drier somewhere :)

> If not I will run a different checker.

Yea, pls check grammar too.

> > > 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.
> > 
> > Yes, with the exception of
> > VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY - currently refers to VF BAR,
> > subfunctions do not have it.
> A subfunction will also have its own BAR carved out from the PF BAR.
> A subfunction definition will be as contains as possible.
> 
> > Can we find a way to have it in the PF BAR instead?
> At subfution level also it will be a BAR number, which will map to the PF BAR.

exactly. why not support this for PF too?

> > E.g. the notification can include VF# + VQ#?
> > At least as an option?
> No. we discussed this before to have each device on its own BAR. Hence no VF# in the doorbell.

you said that you want it but without much in the way of
explanation. I'm still not convinced it's a workable interface. Will it help
if I get some feedback from windows driver team on the design?

> > If not can you add some info explaining why not?
> Yes, Good point.
> I will add the commit log explanation that every VF has its own BAR hence it does not use PF BAR.


-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-04 13:55       ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-04 14:10         ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 14:10 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 9:56 AM
> 
> On Sun, Jun 04, 2023 at 01:41:54PM +0000, Parav Pandit wrote:
> >
> >
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Sunday, June 4, 2023 9:34 AM
> > >
> > > On Fri, Jun 02, 2023 at 11:36:01PM +0300, Parav Pandit wrote:
> > > > This short series introduces legacy registers access commands for
> > > > the owner group member PCI PF to access the legacy registers of the
> member VFs.
> > >
> > > Note that some work will be needed here to fix up grammar and
> > > spelling mistakes.
> > >
> > I already verified using codespell but I guess it missed few.
> > If you have specific already identified, let me know.
> 
> I remember seeing something about a drier somewhere :)
>
Yes. I will fix it.
 
> > If not I will run a different checker.
> 
> Yea, pls check grammar too.
> 
Ok.

> > > > 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.
> > >
> > > Yes, with the exception of
> > > VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY - currently refers to VF BAR,
> > > subfunctions do not have it.
> > A subfunction will also have its own BAR carved out from the PF BAR.
> > A subfunction definition will be as contains as possible.
> >
> > > Can we find a way to have it in the PF BAR instead?
> > At subfution level also it will be a BAR number, which will map to the PF BAR.
> 
> exactly. why not support this for PF too?
> 
> > > E.g. the notification can include VF# + VQ#?
> > > At least as an option?
> > No. we discussed this before to have each device on its own BAR. Hence no
> VF# in the doorbell.
> 
> you said that you want it but without much in the way of explanation. I'm still
> not convinced it's a workable interface. 
You said "AQ is just fine" in v2, this is contradictory to what you write above.
We cannot progress with dual comments like this.

> Will it help if I get some feedback from
> windows driver team on the design?
>
May be. I am not sure, given that these drivers are not inbox, they are not in purview of the OS vendor.
And OS vendor improves the OS APIs in the future for new use cases.

Even the SR-IOV model in Windows is not elaborate as Linux AFAIK.
So I am not sure how much value add we will have.
But sure, better to have their view.
Will you please add them to the discussion here or I should check?

Did anyone use vdpa acceleration on Windows?
Do you have data points that someone wants VF acceleration on Windows hypervisor?
If you bring the use case, I would like to see there commitment to develop the code also and it will be great to have virtio there.


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-04 14:10         ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 14:10 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 9:56 AM
> 
> On Sun, Jun 04, 2023 at 01:41:54PM +0000, Parav Pandit wrote:
> >
> >
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Sunday, June 4, 2023 9:34 AM
> > >
> > > On Fri, Jun 02, 2023 at 11:36:01PM +0300, Parav Pandit wrote:
> > > > This short series introduces legacy registers access commands for
> > > > the owner group member PCI PF to access the legacy registers of the
> member VFs.
> > >
> > > Note that some work will be needed here to fix up grammar and
> > > spelling mistakes.
> > >
> > I already verified using codespell but I guess it missed few.
> > If you have specific already identified, let me know.
> 
> I remember seeing something about a drier somewhere :)
>
Yes. I will fix it.
 
> > If not I will run a different checker.
> 
> Yea, pls check grammar too.
> 
Ok.

> > > > 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.
> > >
> > > Yes, with the exception of
> > > VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY - currently refers to VF BAR,
> > > subfunctions do not have it.
> > A subfunction will also have its own BAR carved out from the PF BAR.
> > A subfunction definition will be as contains as possible.
> >
> > > Can we find a way to have it in the PF BAR instead?
> > At subfution level also it will be a BAR number, which will map to the PF BAR.
> 
> exactly. why not support this for PF too?
> 
> > > E.g. the notification can include VF# + VQ#?
> > > At least as an option?
> > No. we discussed this before to have each device on its own BAR. Hence no
> VF# in the doorbell.
> 
> you said that you want it but without much in the way of explanation. I'm still
> not convinced it's a workable interface. 
You said "AQ is just fine" in v2, this is contradictory to what you write above.
We cannot progress with dual comments like this.

> Will it help if I get some feedback from
> windows driver team on the design?
>
May be. I am not sure, given that these drivers are not inbox, they are not in purview of the OS vendor.
And OS vendor improves the OS APIs in the future for new use cases.

Even the SR-IOV model in Windows is not elaborate as Linux AFAIK.
So I am not sure how much value add we will have.
But sure, better to have their view.
Will you please add them to the discussion here or I should check?

Did anyone use vdpa acceleration on Windows?
Do you have data points that someone wants VF acceleration on Windows hypervisor?
If you bring the use case, I would like to see there commitment to develop the code also and it will be great to have virtio there.


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-04 13:51       ` [virtio-comment] " Parav Pandit
@ 2023-06-04 14:13         ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 14:13 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 01:51:20PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 9:22 AM
> 
> > > +The driver that may use the driver notifications region of the VF
> > > +device returned in this result likely attain higher performance or
> > > +the drier may use the VIRTIO_ADMIN_CMD_LREG_WRITE command.
> > 
> > Obtain I guess ... but how? There's no explanation.
> >
> Do you suggest to rewrite, above as below?
> 
> The driver that MAY use the driver notifications region of the VF likely obtain higher performance.
> The driver may use VIRTIO_ADMIN_CMD_LCC_REG_WRITE command for doorbell notifications.

No this does not address the issue that there is no description of how
this command is used just a hint at what it returns. So this gets us
some offset into some bar now what?  I am guessing writing vqn at this
offset into bar has the same effect as issuing
VIRTIO_ADMIN_CMD_LCC_REG_WRITE with offset 16 and data including the
vqn?


BTW all these may/must/should need to go into conformance section.

Generally the way we structure the spec is an explanation of
the theory of operation (mostly missing here)


> > > +\begin{note}
> > > +The PCI VF device should not use PCI BAR 0 when it prefers to support
> > > +legacy interface registers access using its group owner PF. This
> > > +enables hypervisor software to operate with least complexities to
> > > +compose a legacy interface I/O space BAR and passthrough other PCI
> > > +BARs and PCI device capabilities to the guest virtual machine without any
> > translation.
> > > +\end{note}
> > 
> > Is this related to this last command somehow? what does it mean for PCI VF
> > device to use a BAR? not use a BAR? Prefer what to what?
> 
> This is no different than v2, not sure why to discuss this in v3.

v2 had other issues so I missed this one.

> But ok.
> 
> No. It is not related to last command.
> What does a PCI Device use BAR for?

To reserve address space and know which addresses to claim.

Generally if I heard "not use BAR0" I would assume that the
meaning is that VF BAR0 in SRIOV expended capability
should be 0. However, that affects all VFs and not just
this VF so I don't really know what can it mean.

> As described in the spec, it uses the BAR in struct virtio_pci_cap for exposing various things.

Now I'm confused.
So do you mean the \field{bar} in virtio_pci_cap or PCI BAR?

> So it means that PCI VF should use other than PCI BAR 0 for various Virtio Structure PCI Capabilities that it exposes.

I suspect you then want to say "should not expose to driver
any structures inside it's BAR0"?
And does this include this new command you are adding or not?
It mentions bar too.  What about e.g. MSIX tables? Could there be other
capabilities referring to a BAR? How does hypervisor know
whether VF followed this rule (it's a should, not a hard rule after all)?


-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-04 14:13         ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 14:13 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 01:51:20PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 9:22 AM
> 
> > > +The driver that may use the driver notifications region of the VF
> > > +device returned in this result likely attain higher performance or
> > > +the drier may use the VIRTIO_ADMIN_CMD_LREG_WRITE command.
> > 
> > Obtain I guess ... but how? There's no explanation.
> >
> Do you suggest to rewrite, above as below?
> 
> The driver that MAY use the driver notifications region of the VF likely obtain higher performance.
> The driver may use VIRTIO_ADMIN_CMD_LCC_REG_WRITE command for doorbell notifications.

No this does not address the issue that there is no description of how
this command is used just a hint at what it returns. So this gets us
some offset into some bar now what?  I am guessing writing vqn at this
offset into bar has the same effect as issuing
VIRTIO_ADMIN_CMD_LCC_REG_WRITE with offset 16 and data including the
vqn?


BTW all these may/must/should need to go into conformance section.

Generally the way we structure the spec is an explanation of
the theory of operation (mostly missing here)


> > > +\begin{note}
> > > +The PCI VF device should not use PCI BAR 0 when it prefers to support
> > > +legacy interface registers access using its group owner PF. This
> > > +enables hypervisor software to operate with least complexities to
> > > +compose a legacy interface I/O space BAR and passthrough other PCI
> > > +BARs and PCI device capabilities to the guest virtual machine without any
> > translation.
> > > +\end{note}
> > 
> > Is this related to this last command somehow? what does it mean for PCI VF
> > device to use a BAR? not use a BAR? Prefer what to what?
> 
> This is no different than v2, not sure why to discuss this in v3.

v2 had other issues so I missed this one.

> But ok.
> 
> No. It is not related to last command.
> What does a PCI Device use BAR for?

To reserve address space and know which addresses to claim.

Generally if I heard "not use BAR0" I would assume that the
meaning is that VF BAR0 in SRIOV expended capability
should be 0. However, that affects all VFs and not just
this VF so I don't really know what can it mean.

> As described in the spec, it uses the BAR in struct virtio_pci_cap for exposing various things.

Now I'm confused.
So do you mean the \field{bar} in virtio_pci_cap or PCI BAR?

> So it means that PCI VF should use other than PCI BAR 0 for various Virtio Structure PCI Capabilities that it exposes.

I suspect you then want to say "should not expose to driver
any structures inside it's BAR0"?
And does this include this new command you are adding or not?
It mentions bar too.  What about e.g. MSIX tables? Could there be other
capabilities referring to a BAR? How does hypervisor know
whether VF followed this rule (it's a should, not a hard rule after all)?


-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-04 14:10         ` [virtio-comment] " Parav Pandit
@ 2023-06-04 14:23           ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 14:23 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 02:10:16PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 9:56 AM
> > 
> > On Sun, Jun 04, 2023 at 01:41:54PM +0000, Parav Pandit wrote:
> > >
> > >
> > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > Sent: Sunday, June 4, 2023 9:34 AM
> > > >
> > > > On Fri, Jun 02, 2023 at 11:36:01PM +0300, Parav Pandit wrote:
> > > > > This short series introduces legacy registers access commands for
> > > > > the owner group member PCI PF to access the legacy registers of the
> > member VFs.
> > > >
> > > > Note that some work will be needed here to fix up grammar and
> > > > spelling mistakes.
> > > >
> > > I already verified using codespell but I guess it missed few.
> > > If you have specific already identified, let me know.
> > 
> > I remember seeing something about a drier somewhere :)
> >
> Yes. I will fix it.
>  
> > > If not I will run a different checker.
> > 
> > Yea, pls check grammar too.
> > 
> Ok.
> 
> > > > > 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.
> > > >
> > > > Yes, with the exception of
> > > > VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY - currently refers to VF BAR,
> > > > subfunctions do not have it.
> > > A subfunction will also have its own BAR carved out from the PF BAR.
> > > A subfunction definition will be as contains as possible.
> > >
> > > > Can we find a way to have it in the PF BAR instead?
> > > At subfution level also it will be a BAR number, which will map to the PF BAR.
> > 
> > exactly. why not support this for PF too?
> > 
> > > > E.g. the notification can include VF# + VQ#?
> > > > At least as an option?
> > > No. we discussed this before to have each device on its own BAR. Hence no
> > VF# in the doorbell.

doorbell == available notification? yes in fact it's not
strictly needed since PF can use a different address for
each VF.


> > 
> > you said that you want it but without much in the way of explanation. I'm still
> > not convinced it's a workable interface. 
> You said "AQ is just fine" in v2, this is contradictory to what you write above.
> We cannot progress with dual comments like this.

I am talking about the idea of exposing legacy VQ notifications in the
PF BAR. To me it looks nicely symmetrical, all legacy emulation goes
through PF, and I think it simplifies a bunch of driver code moving some
complexity into hardware which is what you seem to be intent on?

> > Will it help if I get some feedback from
> > windows driver team on the design?
> >
> May be. I am not sure, given that these drivers are not inbox, they are not in purview of the OS vendor.

Exactly a reason we might not see new APIs?

> And OS vendor improves the OS APIs in the future for new use cases.
> 
> Even the SR-IOV model in Windows is not elaborate as Linux AFAIK.
> So I am not sure how much value add we will have.
> But sure, better to have their view.
> Will you please add them to the discussion here or I should check?

I don't think they are subscribed to the list, so I can't.
Will talk to them.

> Did anyone use vdpa acceleration on Windows?
> Do you have data points that someone wants VF acceleration on Windows hypervisor?
> If you bring the use case, I would like to see there commitment to develop the code also and it will be great to have virtio there.

We are talking about an interface that will be used tens of years from
now. If the interface is awkward to use on some platforms let's make it
easier not hide behind excuses of no demand to fix it as of last Friday.
Device vendors can choose not to support some platforms, that is their
decision. As a compromise, consider device exposing this both in a PF
and in a VF and let's allow driver to use what's most convenient?

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-04 14:23           ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 14:23 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 02:10:16PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 9:56 AM
> > 
> > On Sun, Jun 04, 2023 at 01:41:54PM +0000, Parav Pandit wrote:
> > >
> > >
> > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > Sent: Sunday, June 4, 2023 9:34 AM
> > > >
> > > > On Fri, Jun 02, 2023 at 11:36:01PM +0300, Parav Pandit wrote:
> > > > > This short series introduces legacy registers access commands for
> > > > > the owner group member PCI PF to access the legacy registers of the
> > member VFs.
> > > >
> > > > Note that some work will be needed here to fix up grammar and
> > > > spelling mistakes.
> > > >
> > > I already verified using codespell but I guess it missed few.
> > > If you have specific already identified, let me know.
> > 
> > I remember seeing something about a drier somewhere :)
> >
> Yes. I will fix it.
>  
> > > If not I will run a different checker.
> > 
> > Yea, pls check grammar too.
> > 
> Ok.
> 
> > > > > 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.
> > > >
> > > > Yes, with the exception of
> > > > VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY - currently refers to VF BAR,
> > > > subfunctions do not have it.
> > > A subfunction will also have its own BAR carved out from the PF BAR.
> > > A subfunction definition will be as contains as possible.
> > >
> > > > Can we find a way to have it in the PF BAR instead?
> > > At subfution level also it will be a BAR number, which will map to the PF BAR.
> > 
> > exactly. why not support this for PF too?
> > 
> > > > E.g. the notification can include VF# + VQ#?
> > > > At least as an option?
> > > No. we discussed this before to have each device on its own BAR. Hence no
> > VF# in the doorbell.

doorbell == available notification? yes in fact it's not
strictly needed since PF can use a different address for
each VF.


> > 
> > you said that you want it but without much in the way of explanation. I'm still
> > not convinced it's a workable interface. 
> You said "AQ is just fine" in v2, this is contradictory to what you write above.
> We cannot progress with dual comments like this.

I am talking about the idea of exposing legacy VQ notifications in the
PF BAR. To me it looks nicely symmetrical, all legacy emulation goes
through PF, and I think it simplifies a bunch of driver code moving some
complexity into hardware which is what you seem to be intent on?

> > Will it help if I get some feedback from
> > windows driver team on the design?
> >
> May be. I am not sure, given that these drivers are not inbox, they are not in purview of the OS vendor.

Exactly a reason we might not see new APIs?

> And OS vendor improves the OS APIs in the future for new use cases.
> 
> Even the SR-IOV model in Windows is not elaborate as Linux AFAIK.
> So I am not sure how much value add we will have.
> But sure, better to have their view.
> Will you please add them to the discussion here or I should check?

I don't think they are subscribed to the list, so I can't.
Will talk to them.

> Did anyone use vdpa acceleration on Windows?
> Do you have data points that someone wants VF acceleration on Windows hypervisor?
> If you bring the use case, I would like to see there commitment to develop the code also and it will be great to have virtio there.

We are talking about an interface that will be used tens of years from
now. If the interface is awkward to use on some platforms let's make it
easier not hide behind excuses of no demand to fix it as of last Friday.
Device vendors can choose not to support some platforms, that is their
decision. As a compromise, consider device exposing this both in a PF
and in a VF and let's allow driver to use what's most convenient?

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-04 14:13         ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-04 14:32           ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 14:32 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 10:14 AM
> 
> On Sun, Jun 04, 2023 at 01:51:20PM +0000, Parav Pandit wrote:
> >
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Sunday, June 4, 2023 9:22 AM
> >
> > > > +The driver that may use the driver notifications region of the VF
> > > > +device returned in this result likely attain higher performance
> > > > +or the drier may use the VIRTIO_ADMIN_CMD_LREG_WRITE command.
> > >
> > > Obtain I guess ... but how? There's no explanation.
> > >
> > Do you suggest to rewrite, above as below?
> >
> > The driver that MAY use the driver notifications region of the VF likely obtain
> higher performance.
> > The driver may use VIRTIO_ADMIN_CMD_LCC_REG_WRITE command for
> doorbell notifications.
> 
> No this does not address the issue that there is no description of how this
> command is used just a hint at what it returns. 

> So this gets us some offset into
> some bar now what?  
> I am guessing writing vqn at this offset into bar has the
> same effect as issuing VIRTIO_ADMIN_CMD_LCC_REG_WRITE with offset 16
> and data including the vqn?
> 
I can add the one line description that describes above. I take note for v4.

> 
> BTW all these may/must/should need to go into conformance section.
>
Conformance section for the AQ itself is missing. And I am aware to fix it post your v13 series.
 
> Generally the way we structure the spec is an explanation of the theory of
> operation (mostly missing here)
>
It is not any different from v2.
Theory of operation is not going to describe the whole driver design.
It is not likely the scope like any other section.
Section "Legacy Interfaces: SR-IOV VFs Registers Access" has theory of operation described and also in commit log.

This is like recent AQ patches and notification coalescing and more.

So if can pin point what exactly you want to see in theory of operation, it will be helpful.
Because for one person, 10 lines of theory is enough like how we have most of the spec, another wants 100 lines with pseudo code in appendix.

> v2 had other issues so I missed this one.
> 
> > But ok.
> >
> > No. It is not related to last command.
> > What does a PCI Device use BAR for?
> 
> To reserve address space and know which addresses to claim.
> 
> Generally if I heard "not use BAR0" I would assume that the meaning is that VF
> BAR0 in SRIOV expended capability should be 0. However, that affects all VFs
> and not just this VF so I don't really know what can it mean.
>
A PCI PF and VF device which wants to support legacy emulation should not expose BAR 0 in the struct virtio_pci_cap struct.
Instead it should use other BARs.

> > As described in the spec, it uses the BAR in struct virtio_pci_cap for exposing
> various things.
> 
> Now I'm confused.
> So do you mean the \field{bar} in virtio_pci_cap or PCI BAR?
>
Yes.
 
> > So it means that PCI VF should use other than PCI BAR 0 for various Virtio
> Structure PCI Capabilities that it exposes.
> 
> I suspect you then want to say "should not expose to driver any structures
> inside it's BAR0"?
Instead of bisecting at structure level, it is indicated on usage so that it doesn't need to bisect on "what about MSI-X".

> And does this include this new command you are adding or not?
> It mentions bar too.  What about e.g. MSIX tables? Could there be other
> capabilities referring to a BAR? 

> How does hypervisor know whether VF followed
> this rule (it's a should, not a hard rule after all)?
> 
It is not a MUST.
Hypervisor software using this VF very easily know this when VF is attached to the hypervisor driver by reading the capability.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-04 14:32           ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 14:32 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 10:14 AM
> 
> On Sun, Jun 04, 2023 at 01:51:20PM +0000, Parav Pandit wrote:
> >
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Sunday, June 4, 2023 9:22 AM
> >
> > > > +The driver that may use the driver notifications region of the VF
> > > > +device returned in this result likely attain higher performance
> > > > +or the drier may use the VIRTIO_ADMIN_CMD_LREG_WRITE command.
> > >
> > > Obtain I guess ... but how? There's no explanation.
> > >
> > Do you suggest to rewrite, above as below?
> >
> > The driver that MAY use the driver notifications region of the VF likely obtain
> higher performance.
> > The driver may use VIRTIO_ADMIN_CMD_LCC_REG_WRITE command for
> doorbell notifications.
> 
> No this does not address the issue that there is no description of how this
> command is used just a hint at what it returns. 

> So this gets us some offset into
> some bar now what?  
> I am guessing writing vqn at this offset into bar has the
> same effect as issuing VIRTIO_ADMIN_CMD_LCC_REG_WRITE with offset 16
> and data including the vqn?
> 
I can add the one line description that describes above. I take note for v4.

> 
> BTW all these may/must/should need to go into conformance section.
>
Conformance section for the AQ itself is missing. And I am aware to fix it post your v13 series.
 
> Generally the way we structure the spec is an explanation of the theory of
> operation (mostly missing here)
>
It is not any different from v2.
Theory of operation is not going to describe the whole driver design.
It is not likely the scope like any other section.
Section "Legacy Interfaces: SR-IOV VFs Registers Access" has theory of operation described and also in commit log.

This is like recent AQ patches and notification coalescing and more.

So if can pin point what exactly you want to see in theory of operation, it will be helpful.
Because for one person, 10 lines of theory is enough like how we have most of the spec, another wants 100 lines with pseudo code in appendix.

> v2 had other issues so I missed this one.
> 
> > But ok.
> >
> > No. It is not related to last command.
> > What does a PCI Device use BAR for?
> 
> To reserve address space and know which addresses to claim.
> 
> Generally if I heard "not use BAR0" I would assume that the meaning is that VF
> BAR0 in SRIOV expended capability should be 0. However, that affects all VFs
> and not just this VF so I don't really know what can it mean.
>
A PCI PF and VF device which wants to support legacy emulation should not expose BAR 0 in the struct virtio_pci_cap struct.
Instead it should use other BARs.

> > As described in the spec, it uses the BAR in struct virtio_pci_cap for exposing
> various things.
> 
> Now I'm confused.
> So do you mean the \field{bar} in virtio_pci_cap or PCI BAR?
>
Yes.
 
> > So it means that PCI VF should use other than PCI BAR 0 for various Virtio
> Structure PCI Capabilities that it exposes.
> 
> I suspect you then want to say "should not expose to driver any structures
> inside it's BAR0"?
Instead of bisecting at structure level, it is indicated on usage so that it doesn't need to bisect on "what about MSI-X".

> And does this include this new command you are adding or not?
> It mentions bar too.  What about e.g. MSIX tables? Could there be other
> capabilities referring to a BAR? 

> How does hypervisor know whether VF followed
> this rule (it's a should, not a hard rule after all)?
> 
It is not a MUST.
Hypervisor software using this VF very easily know this when VF is attached to the hypervisor driver by reading the capability.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-04 14:32           ` [virtio-comment] " Parav Pandit
@ 2023-06-04 14:41             ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 14:41 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 02:32:23PM +0000, Parav Pandit wrote:
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 10:14 AM
> > 
> > On Sun, Jun 04, 2023 at 01:51:20PM +0000, Parav Pandit wrote:
> > >
> > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > Sent: Sunday, June 4, 2023 9:22 AM
> > >
> > > > > +The driver that may use the driver notifications region of the VF
> > > > > +device returned in this result likely attain higher performance
> > > > > +or the drier may use the VIRTIO_ADMIN_CMD_LREG_WRITE command.
> > > >
> > > > Obtain I guess ... but how? There's no explanation.
> > > >
> > > Do you suggest to rewrite, above as below?
> > >
> > > The driver that MAY use the driver notifications region of the VF likely obtain
> > higher performance.
> > > The driver may use VIRTIO_ADMIN_CMD_LCC_REG_WRITE command for
> > doorbell notifications.
> > 
> > No this does not address the issue that there is no description of how this
> > command is used just a hint at what it returns. 
> 
> > So this gets us some offset into
> > some bar now what?  
> > I am guessing writing vqn at this offset into bar has the
> > same effect as issuing VIRTIO_ADMIN_CMD_LCC_REG_WRITE with offset 16
> > and data including the vqn?
> > 
> I can add the one line description that describes above. I take note for v4.
> 
> > 
> > BTW all these may/must/should need to go into conformance section.
> >
> Conformance section for the AQ itself is missing. And I am aware to fix it post your v13 series.

Hmm missing where? It was supposed to be added here:

commit bf1d6b0d24ae899d08c7cf24ed480cf5881c49ef
Author: Michael S. Tsirkin <mst@redhat.com>
Date:   Sun Nov 20 19:43:45 2022 -0500

    admin: conformance clauses

what did I miss?   


> > Generally the way we structure the spec is an explanation of the theory of
> > operation (mostly missing here)
> >
> It is not any different from v2.
> Theory of operation is not going to describe the whole driver design.
> It is not likely the scope like any other section.
> Section "Legacy Interfaces: SR-IOV VFs Registers Access" has theory of operation described and also in commit log.
> 
> This is like recent AQ patches and notification coalescing and more.
> 
> So if can pin point what exactly you want to see in theory of operation, it will be helpful.
> Because for one person, 10 lines of theory is enough like how we have most of the spec, another wants 100 lines with pseudo code in appendix.

yes but I think this assumes a bit much. you start by saying there's no
IO BAR. Okay, it's not even mandatory to give motivation, but can't
hurt. The next step is you describe a bunch of commands. Presumably
the reader will draw the conclusion that they replace an io bar?
But it's implicit, and that is not good.

So, I imagine we have a driver that translates legacy accesses
to AQ commands, yes? And it also somehow uses the extra
command to get an address and then translates notifications
to writes at that address? This kind of thing is what
I called a theory of operation.

A couple of paragraphs.



> > v2 had other issues so I missed this one.
> > 
> > > But ok.
> > >
> > > No. It is not related to last command.
> > > What does a PCI Device use BAR for?
> > 
> > To reserve address space and know which addresses to claim.
> > 
> > Generally if I heard "not use BAR0" I would assume that the meaning is that VF
> > BAR0 in SRIOV expended capability should be 0. However, that affects all VFs
> > and not just this VF so I don't really know what can it mean.
> >
> A PCI PF and VF device which wants to support legacy emulation should not expose BAR 0 in the struct virtio_pci_cap struct.
> Instead it should use other BARs.
> 
> > > As described in the spec, it uses the BAR in struct virtio_pci_cap for exposing
> > various things.
> > 
> > Now I'm confused.
> > So do you mean the \field{bar} in virtio_pci_cap or PCI BAR?
> >
> Yes.
> > > So it means that PCI VF should use other than PCI BAR 0 for various Virtio
> > Structure PCI Capabilities that it exposes.
> > 
> > I suspect you then want to say "should not expose to driver any structures
> > inside it's BAR0"?
> Instead of bisecting at structure level, it is indicated on usage so that it doesn't need to bisect on "what about MSI-X".

But what is the answer?

> > And does this include this new command you are adding or not?
> > It mentions bar too.  What about e.g. MSIX tables? Could there be other
> > capabilities referring to a BAR? 
> 

?

> > How does hypervisor know whether VF followed
> > this rule (it's a should, not a hard rule after all)?
> > 
> It is not a MUST.
> Hypervisor software using this VF very easily know this when VF is attached to the hypervisor driver by reading the capability.

which capability? E.g. there's a vendor specific capability we don't
even know what's in there. If you really want to save code in
the hypervisor this "should" is pretty useless.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-04 14:41             ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 14:41 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 02:32:23PM +0000, Parav Pandit wrote:
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 10:14 AM
> > 
> > On Sun, Jun 04, 2023 at 01:51:20PM +0000, Parav Pandit wrote:
> > >
> > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > Sent: Sunday, June 4, 2023 9:22 AM
> > >
> > > > > +The driver that may use the driver notifications region of the VF
> > > > > +device returned in this result likely attain higher performance
> > > > > +or the drier may use the VIRTIO_ADMIN_CMD_LREG_WRITE command.
> > > >
> > > > Obtain I guess ... but how? There's no explanation.
> > > >
> > > Do you suggest to rewrite, above as below?
> > >
> > > The driver that MAY use the driver notifications region of the VF likely obtain
> > higher performance.
> > > The driver may use VIRTIO_ADMIN_CMD_LCC_REG_WRITE command for
> > doorbell notifications.
> > 
> > No this does not address the issue that there is no description of how this
> > command is used just a hint at what it returns. 
> 
> > So this gets us some offset into
> > some bar now what?  
> > I am guessing writing vqn at this offset into bar has the
> > same effect as issuing VIRTIO_ADMIN_CMD_LCC_REG_WRITE with offset 16
> > and data including the vqn?
> > 
> I can add the one line description that describes above. I take note for v4.
> 
> > 
> > BTW all these may/must/should need to go into conformance section.
> >
> Conformance section for the AQ itself is missing. And I am aware to fix it post your v13 series.

Hmm missing where? It was supposed to be added here:

commit bf1d6b0d24ae899d08c7cf24ed480cf5881c49ef
Author: Michael S. Tsirkin <mst@redhat.com>
Date:   Sun Nov 20 19:43:45 2022 -0500

    admin: conformance clauses

what did I miss?   


> > Generally the way we structure the spec is an explanation of the theory of
> > operation (mostly missing here)
> >
> It is not any different from v2.
> Theory of operation is not going to describe the whole driver design.
> It is not likely the scope like any other section.
> Section "Legacy Interfaces: SR-IOV VFs Registers Access" has theory of operation described and also in commit log.
> 
> This is like recent AQ patches and notification coalescing and more.
> 
> So if can pin point what exactly you want to see in theory of operation, it will be helpful.
> Because for one person, 10 lines of theory is enough like how we have most of the spec, another wants 100 lines with pseudo code in appendix.

yes but I think this assumes a bit much. you start by saying there's no
IO BAR. Okay, it's not even mandatory to give motivation, but can't
hurt. The next step is you describe a bunch of commands. Presumably
the reader will draw the conclusion that they replace an io bar?
But it's implicit, and that is not good.

So, I imagine we have a driver that translates legacy accesses
to AQ commands, yes? And it also somehow uses the extra
command to get an address and then translates notifications
to writes at that address? This kind of thing is what
I called a theory of operation.

A couple of paragraphs.



> > v2 had other issues so I missed this one.
> > 
> > > But ok.
> > >
> > > No. It is not related to last command.
> > > What does a PCI Device use BAR for?
> > 
> > To reserve address space and know which addresses to claim.
> > 
> > Generally if I heard "not use BAR0" I would assume that the meaning is that VF
> > BAR0 in SRIOV expended capability should be 0. However, that affects all VFs
> > and not just this VF so I don't really know what can it mean.
> >
> A PCI PF and VF device which wants to support legacy emulation should not expose BAR 0 in the struct virtio_pci_cap struct.
> Instead it should use other BARs.
> 
> > > As described in the spec, it uses the BAR in struct virtio_pci_cap for exposing
> > various things.
> > 
> > Now I'm confused.
> > So do you mean the \field{bar} in virtio_pci_cap or PCI BAR?
> >
> Yes.
> > > So it means that PCI VF should use other than PCI BAR 0 for various Virtio
> > Structure PCI Capabilities that it exposes.
> > 
> > I suspect you then want to say "should not expose to driver any structures
> > inside it's BAR0"?
> Instead of bisecting at structure level, it is indicated on usage so that it doesn't need to bisect on "what about MSI-X".

But what is the answer?

> > And does this include this new command you are adding or not?
> > It mentions bar too.  What about e.g. MSIX tables? Could there be other
> > capabilities referring to a BAR? 
> 

?

> > How does hypervisor know whether VF followed
> > this rule (it's a should, not a hard rule after all)?
> > 
> It is not a MUST.
> Hypervisor software using this VF very easily know this when VF is attached to the hypervisor driver by reading the capability.

which capability? E.g. there's a vendor specific capability we don't
even know what's in there. If you really want to save code in
the hypervisor this "should" is pretty useless.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-04 14:23           ` [virtio-dev] " Michael S. Tsirkin
@ 2023-06-04 14:48             ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 14:48 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 10:23 AM

> > > > > E.g. the notification can include VF# + VQ#?
> > > > > At least as an option?
> > > > No. we discussed this before to have each device on its own BAR.
> > > > Hence no
> > > VF# in the doorbell.
> 
> doorbell == available notification? yes in fact it's not strictly needed since PF can
> use a different address for each VF.
> 
Sorry for doorbell terminology.
Yes, available buffer notification.

> 
> I am talking about the idea of exposing legacy VQ notifications in the PF BAR. To
> me it looks nicely symmetrical, all legacy emulation goes through PF, and I think
> it simplifies a bunch of driver code moving some complexity into hardware
> which is what you seem to be intent on?
> 
Symmetrical only looks fine in emails.
In real device, it doesn't. We also discussed this before.
I will capture this in alternatives section of v4.

Each VF has its own available buffer notification in hardware like 1.x.
We do not want to duplicate (and add) such functionality on the PF BAR hardware when it already exists on the VF.

> > > Will it help if I get some feedback from windows driver team on the
> > > design?
> > >
> > May be. I am not sure, given that these drivers are not inbox, they are not in
> purview of the OS vendor.
> 
> Exactly a reason we might not see new APIs?
> 
I don't know.

> > And OS vendor improves the OS APIs in the future for new use cases.
> >
> > Even the SR-IOV model in Windows is not elaborate as Linux AFAIK.
> > So I am not sure how much value add we will have.
> > But sure, better to have their view.
> > Will you please add them to the discussion here or I should check?
> 
> I don't think they are subscribed to the list, so I can't.
> Will talk to them.
> 
Ok.

> > Did anyone use vdpa acceleration on Windows?
> > Do you have data points that someone wants VF acceleration on Windows
> hypervisor?
> > If you bring the use case, I would like to see there commitment to develop the
> code also and it will be great to have virtio there.
> 
> We are talking about an interface that will be used tens of years from now. If the
> interface is awkward to use on some platforms let's make it easier not hide
> behind excuses of no demand to fix it as of last Friday.
It is not hiding.
The fact that virtio drivers are not inbox. I don't see an actual user by the OS vendor for the decade passed.

And, I do not anticipate use of legacy for tens of years from now.

It is not even a conclusion that it is awkward to use.
You are concluding that one OS may never want to evolve their kernel APIs.
I don't see it that way.
We have seen with two hypervisors evolving their kernel APIs and both have large deployments.

I am not pessimistic that 3rd OS vendor will not evolve.

> Device vendors can choose not to support some platforms, that is their
> decision. As a compromise, consider device exposing this both in a PF and in a
> VF and let's allow driver to use what's most convenient?
>
I also said yes, for this and you said "lets do one way".

So, when a 2nd OS vendor cannot use IPR scheme that they have, and they MUST have everything through ONLY VF, to support them, a HW vendor will build PCI device with VF legacy access registers stay in the VF.
And spec update will be done.

We really don't see this happening. So better to build a practical spec.

And if this was important, I am still puzzled why you say "Just AQ is fine" in v2 and why you wait for next 2 weeks for v3 to show up to raise the concern now contradicting your ACK.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-04 14:48             ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 14:48 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 10:23 AM

> > > > > E.g. the notification can include VF# + VQ#?
> > > > > At least as an option?
> > > > No. we discussed this before to have each device on its own BAR.
> > > > Hence no
> > > VF# in the doorbell.
> 
> doorbell == available notification? yes in fact it's not strictly needed since PF can
> use a different address for each VF.
> 
Sorry for doorbell terminology.
Yes, available buffer notification.

> 
> I am talking about the idea of exposing legacy VQ notifications in the PF BAR. To
> me it looks nicely symmetrical, all legacy emulation goes through PF, and I think
> it simplifies a bunch of driver code moving some complexity into hardware
> which is what you seem to be intent on?
> 
Symmetrical only looks fine in emails.
In real device, it doesn't. We also discussed this before.
I will capture this in alternatives section of v4.

Each VF has its own available buffer notification in hardware like 1.x.
We do not want to duplicate (and add) such functionality on the PF BAR hardware when it already exists on the VF.

> > > Will it help if I get some feedback from windows driver team on the
> > > design?
> > >
> > May be. I am not sure, given that these drivers are not inbox, they are not in
> purview of the OS vendor.
> 
> Exactly a reason we might not see new APIs?
> 
I don't know.

> > And OS vendor improves the OS APIs in the future for new use cases.
> >
> > Even the SR-IOV model in Windows is not elaborate as Linux AFAIK.
> > So I am not sure how much value add we will have.
> > But sure, better to have their view.
> > Will you please add them to the discussion here or I should check?
> 
> I don't think they are subscribed to the list, so I can't.
> Will talk to them.
> 
Ok.

> > Did anyone use vdpa acceleration on Windows?
> > Do you have data points that someone wants VF acceleration on Windows
> hypervisor?
> > If you bring the use case, I would like to see there commitment to develop the
> code also and it will be great to have virtio there.
> 
> We are talking about an interface that will be used tens of years from now. If the
> interface is awkward to use on some platforms let's make it easier not hide
> behind excuses of no demand to fix it as of last Friday.
It is not hiding.
The fact that virtio drivers are not inbox. I don't see an actual user by the OS vendor for the decade passed.

And, I do not anticipate use of legacy for tens of years from now.

It is not even a conclusion that it is awkward to use.
You are concluding that one OS may never want to evolve their kernel APIs.
I don't see it that way.
We have seen with two hypervisors evolving their kernel APIs and both have large deployments.

I am not pessimistic that 3rd OS vendor will not evolve.

> Device vendors can choose not to support some platforms, that is their
> decision. As a compromise, consider device exposing this both in a PF and in a
> VF and let's allow driver to use what's most convenient?
>
I also said yes, for this and you said "lets do one way".

So, when a 2nd OS vendor cannot use IPR scheme that they have, and they MUST have everything through ONLY VF, to support them, a HW vendor will build PCI device with VF legacy access registers stay in the VF.
And spec update will be done.

We really don't see this happening. So better to build a practical spec.

And if this was important, I am still puzzled why you say "Just AQ is fine" in v2 and why you wait for next 2 weeks for v3 to show up to raise the concern now contradicting your 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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-04 14:48             ` [virtio-comment] " Parav Pandit
@ 2023-06-04 14:53               ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 14:53 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 02:48:59PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 10:23 AM
> 
> > > > > > E.g. the notification can include VF# + VQ#?
> > > > > > At least as an option?
> > > > > No. we discussed this before to have each device on its own BAR.
> > > > > Hence no
> > > > VF# in the doorbell.
> > 
> > doorbell == available notification? yes in fact it's not strictly needed since PF can
> > use a different address for each VF.
> > 
> Sorry for doorbell terminology.
> Yes, available buffer notification.
> 
> > 
> > I am talking about the idea of exposing legacy VQ notifications in the PF BAR. To
> > me it looks nicely symmetrical, all legacy emulation goes through PF, and I think
> > it simplifies a bunch of driver code moving some complexity into hardware
> > which is what you seem to be intent on?
> > 
> Symmetrical only looks fine in emails.
> In real device, it doesn't. We also discussed this before.
> I will capture this in alternatives section of v4.
> 
> Each VF has its own available buffer notification in hardware like 1.x.
> We do not want to duplicate (and add) such functionality on the PF BAR hardware when it already exists on the VF.

yes but here we are talking about legacy notifications, not 1.x

> > > > Will it help if I get some feedback from windows driver team on the
> > > > design?
> > > >
> > > May be. I am not sure, given that these drivers are not inbox, they are not in
> > purview of the OS vendor.
> > 
> > Exactly a reason we might not see new APIs?
> > 
> I don't know.

Exactly.

> > > And OS vendor improves the OS APIs in the future for new use cases.
> > >
> > > Even the SR-IOV model in Windows is not elaborate as Linux AFAIK.
> > > So I am not sure how much value add we will have.
> > > But sure, better to have their view.
> > > Will you please add them to the discussion here or I should check?
> > 
> > I don't think they are subscribed to the list, so I can't.
> > Will talk to them.
> > 
> Ok.
> 
> > > Did anyone use vdpa acceleration on Windows?
> > > Do you have data points that someone wants VF acceleration on Windows
> > hypervisor?
> > > If you bring the use case, I would like to see there commitment to develop the
> > code also and it will be great to have virtio there.
> > 
> > We are talking about an interface that will be used tens of years from now. If the
> > interface is awkward to use on some platforms let's make it easier not hide
> > behind excuses of no demand to fix it as of last Friday.
> It is not hiding.
> The fact that virtio drivers are not inbox. I don't see an actual user by the OS vendor for the decade passed.

But why does it matter? There are a bunch of users of virtio, I know that.

> And, I do not anticipate use of legacy for tens of years from now.
> 
> It is not even a conclusion that it is awkward to use.
> You are concluding that one OS may never want to evolve their kernel APIs.

They might. That takes many years too.

> I don't see it that way.
> We have seen with two hypervisors evolving their kernel APIs and both have large deployments.
> 
> I am not pessimistic that 3rd OS vendor will not evolve.
> 
> > Device vendors can choose not to support some platforms, that is their
> > decision. As a compromise, consider device exposing this both in a PF and in a
> > VF and let's allow driver to use what's most convenient?
> >
> I also said yes, for this and you said "lets do one way".
> 
> So, when a 2nd OS vendor cannot use IPR scheme that they have, and they MUST have everything through ONLY VF, to support them, a HW vendor will build PCI device with VF legacy access registers stay in the VF.
> And spec update will be done.
> 
> We really don't see this happening. So better to build a practical spec.
> 
> And if this was important, I am still puzzled why you say "Just AQ is fine" in v2 and why you wait for next 2 weeks for v3 to show up to raise the concern now contradicting your ACK.

Because this is just AQ. All I am asking is that the BAR refers to PF,
same AQ command.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-04 14:53               ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 14:53 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 02:48:59PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 10:23 AM
> 
> > > > > > E.g. the notification can include VF# + VQ#?
> > > > > > At least as an option?
> > > > > No. we discussed this before to have each device on its own BAR.
> > > > > Hence no
> > > > VF# in the doorbell.
> > 
> > doorbell == available notification? yes in fact it's not strictly needed since PF can
> > use a different address for each VF.
> > 
> Sorry for doorbell terminology.
> Yes, available buffer notification.
> 
> > 
> > I am talking about the idea of exposing legacy VQ notifications in the PF BAR. To
> > me it looks nicely symmetrical, all legacy emulation goes through PF, and I think
> > it simplifies a bunch of driver code moving some complexity into hardware
> > which is what you seem to be intent on?
> > 
> Symmetrical only looks fine in emails.
> In real device, it doesn't. We also discussed this before.
> I will capture this in alternatives section of v4.
> 
> Each VF has its own available buffer notification in hardware like 1.x.
> We do not want to duplicate (and add) such functionality on the PF BAR hardware when it already exists on the VF.

yes but here we are talking about legacy notifications, not 1.x

> > > > Will it help if I get some feedback from windows driver team on the
> > > > design?
> > > >
> > > May be. I am not sure, given that these drivers are not inbox, they are not in
> > purview of the OS vendor.
> > 
> > Exactly a reason we might not see new APIs?
> > 
> I don't know.

Exactly.

> > > And OS vendor improves the OS APIs in the future for new use cases.
> > >
> > > Even the SR-IOV model in Windows is not elaborate as Linux AFAIK.
> > > So I am not sure how much value add we will have.
> > > But sure, better to have their view.
> > > Will you please add them to the discussion here or I should check?
> > 
> > I don't think they are subscribed to the list, so I can't.
> > Will talk to them.
> > 
> Ok.
> 
> > > Did anyone use vdpa acceleration on Windows?
> > > Do you have data points that someone wants VF acceleration on Windows
> > hypervisor?
> > > If you bring the use case, I would like to see there commitment to develop the
> > code also and it will be great to have virtio there.
> > 
> > We are talking about an interface that will be used tens of years from now. If the
> > interface is awkward to use on some platforms let's make it easier not hide
> > behind excuses of no demand to fix it as of last Friday.
> It is not hiding.
> The fact that virtio drivers are not inbox. I don't see an actual user by the OS vendor for the decade passed.

But why does it matter? There are a bunch of users of virtio, I know that.

> And, I do not anticipate use of legacy for tens of years from now.
> 
> It is not even a conclusion that it is awkward to use.
> You are concluding that one OS may never want to evolve their kernel APIs.

They might. That takes many years too.

> I don't see it that way.
> We have seen with two hypervisors evolving their kernel APIs and both have large deployments.
> 
> I am not pessimistic that 3rd OS vendor will not evolve.
> 
> > Device vendors can choose not to support some platforms, that is their
> > decision. As a compromise, consider device exposing this both in a PF and in a
> > VF and let's allow driver to use what's most convenient?
> >
> I also said yes, for this and you said "lets do one way".
> 
> So, when a 2nd OS vendor cannot use IPR scheme that they have, and they MUST have everything through ONLY VF, to support them, a HW vendor will build PCI device with VF legacy access registers stay in the VF.
> And spec update will be done.
> 
> We really don't see this happening. So better to build a practical spec.
> 
> And if this was important, I am still puzzled why you say "Just AQ is fine" in v2 and why you wait for next 2 weeks for v3 to show up to raise the concern now contradicting your ACK.

Because this is just AQ. All I am asking is that the BAR refers to PF,
same AQ command.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-04 14:41             ` [virtio-dev] " Michael S. Tsirkin
@ 2023-06-04 15:01               ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 15:01 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 10:42 AM

> > > BTW all these may/must/should need to go into conformance section.
> > >
> > Conformance section for the AQ itself is missing. And I am aware to fix it post
> your v13 series.
> 
> Hmm missing where? It was supposed to be added here:
>
Conformance chapter doesn't have any links to aq requirements.

 
> commit bf1d6b0d24ae899d08c7cf24ed480cf5881c49ef
> Author: Michael S. Tsirkin <mst@redhat.com>
> Date:   Sun Nov 20 19:43:45 2022 -0500
> 
>     admin: conformance clauses
> 
> what did I miss?
> 
> 
> > > Generally the way we structure the spec is an explanation of the
> > > theory of operation (mostly missing here)
> > >
> > It is not any different from v2.
> > Theory of operation is not going to describe the whole driver design.
> > It is not likely the scope like any other section.
> > Section "Legacy Interfaces: SR-IOV VFs Registers Access" has theory of
> operation described and also in commit log.
> >
> > This is like recent AQ patches and notification coalescing and more.
> >
> > So if can pin point what exactly you want to see in theory of operation, it will
> be helpful.
> > Because for one person, 10 lines of theory is enough like how we have most
> of the spec, another wants 100 lines with pseudo code in appendix.
> 
> yes but I think this assumes a bit much. you start by saying there's no IO BAR.
> Okay, it's not even mandatory to give motivation, but can't hurt. The next step is
> you describe a bunch of commands. Presumably the reader will draw the
> conclusion that they replace an io bar?
> But it's implicit, and that is not good.
> 
> So, I imagine we have a driver that translates legacy accesses to AQ commands,
> yes? 
Yes.

> And it also somehow uses the extra command to get an address and then
> translates notifications to writes at that address? This kind of thing is what I
> called a theory of operation.
>
 
> A couple of paragraphs.
>
Yes, but I don't see such details for the AQ, notification coalescing.
These commands are not special.
Commands described "what" they do. "When and how" is not described in the spec.
It is left to the driver to compose such things.

How Net device should use "queue reset" is not explained in theory of operation.
What is described is mechanics of queue reset steps...

Those details were put in the commit log, and not in the spec.
If you want to add theory of operation like nvme spec, we need to have dedicated section.
I don't see a reason, why this should be the first patch set to do so in v4.

I am more than happy to add, but it can be done in generic way as follow up.
 
> 
> 
> > > v2 had other issues so I missed this one.
> > >
> > > > But ok.
> > > >
> > > > No. It is not related to last command.
> > > > What does a PCI Device use BAR for?
> > >
> > > To reserve address space and know which addresses to claim.
> > >
> > > Generally if I heard "not use BAR0" I would assume that the meaning
> > > is that VF
> > > BAR0 in SRIOV expended capability should be 0. However, that affects
> > > all VFs and not just this VF so I don't really know what can it mean.
> > >
> > A PCI PF and VF device which wants to support legacy emulation should not
> expose BAR 0 in the struct virtio_pci_cap struct.
> > Instead it should use other BARs.
> >
> > > > As described in the spec, it uses the BAR in struct virtio_pci_cap
> > > > for exposing
> > > various things.
> > >
> > > Now I'm confused.
> > > So do you mean the \field{bar} in virtio_pci_cap or PCI BAR?
> > >
> > Yes.
> > > > So it means that PCI VF should use other than PCI BAR 0 for
> > > > various Virtio
> > > Structure PCI Capabilities that it exposes.
> > >
> > > I suspect you then want to say "should not expose to driver any
> > > structures inside it's BAR0"?
> > Instead of bisecting at structure level, it is indicated on usage so that it doesn't
> need to bisect on "what about MSI-X".
> 
> But what is the answer?
>
BAR 0 should not be used at all by the VF device for anything including MSI-X.

> > > And does this include this new command you are adding or not?
> > > It mentions bar too.  What about e.g. MSIX tables? Could there be
> > > other capabilities referring to a BAR?
> >
> 
> ?
> 
New command also should not report BAR 0.

> > > How does hypervisor know whether VF followed this rule (it's a
> > > should, not a hard rule after all)?
> > >
> > It is not a MUST.
> > Hypervisor software using this VF very easily know this when VF is attached to
> the hypervisor driver by reading the capability.
> 
> which capability? E.g. there's a vendor specific capability we don't even know
> what's in there. If you really want to save code in the hypervisor this "should" is
> pretty useless.
> 
All the pci vendor capabilities for which all the code already exists.
It is not related to code saving.

Even those cap check is not needed.
Hypervisor driver needs to only check that BAR-0 is empty of not from the PCI layer. 

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-04 15:01               ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 15:01 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 10:42 AM

> > > BTW all these may/must/should need to go into conformance section.
> > >
> > Conformance section for the AQ itself is missing. And I am aware to fix it post
> your v13 series.
> 
> Hmm missing where? It was supposed to be added here:
>
Conformance chapter doesn't have any links to aq requirements.

 
> commit bf1d6b0d24ae899d08c7cf24ed480cf5881c49ef
> Author: Michael S. Tsirkin <mst@redhat.com>
> Date:   Sun Nov 20 19:43:45 2022 -0500
> 
>     admin: conformance clauses
> 
> what did I miss?
> 
> 
> > > Generally the way we structure the spec is an explanation of the
> > > theory of operation (mostly missing here)
> > >
> > It is not any different from v2.
> > Theory of operation is not going to describe the whole driver design.
> > It is not likely the scope like any other section.
> > Section "Legacy Interfaces: SR-IOV VFs Registers Access" has theory of
> operation described and also in commit log.
> >
> > This is like recent AQ patches and notification coalescing and more.
> >
> > So if can pin point what exactly you want to see in theory of operation, it will
> be helpful.
> > Because for one person, 10 lines of theory is enough like how we have most
> of the spec, another wants 100 lines with pseudo code in appendix.
> 
> yes but I think this assumes a bit much. you start by saying there's no IO BAR.
> Okay, it's not even mandatory to give motivation, but can't hurt. The next step is
> you describe a bunch of commands. Presumably the reader will draw the
> conclusion that they replace an io bar?
> But it's implicit, and that is not good.
> 
> So, I imagine we have a driver that translates legacy accesses to AQ commands,
> yes? 
Yes.

> And it also somehow uses the extra command to get an address and then
> translates notifications to writes at that address? This kind of thing is what I
> called a theory of operation.
>
 
> A couple of paragraphs.
>
Yes, but I don't see such details for the AQ, notification coalescing.
These commands are not special.
Commands described "what" they do. "When and how" is not described in the spec.
It is left to the driver to compose such things.

How Net device should use "queue reset" is not explained in theory of operation.
What is described is mechanics of queue reset steps...

Those details were put in the commit log, and not in the spec.
If you want to add theory of operation like nvme spec, we need to have dedicated section.
I don't see a reason, why this should be the first patch set to do so in v4.

I am more than happy to add, but it can be done in generic way as follow up.
 
> 
> 
> > > v2 had other issues so I missed this one.
> > >
> > > > But ok.
> > > >
> > > > No. It is not related to last command.
> > > > What does a PCI Device use BAR for?
> > >
> > > To reserve address space and know which addresses to claim.
> > >
> > > Generally if I heard "not use BAR0" I would assume that the meaning
> > > is that VF
> > > BAR0 in SRIOV expended capability should be 0. However, that affects
> > > all VFs and not just this VF so I don't really know what can it mean.
> > >
> > A PCI PF and VF device which wants to support legacy emulation should not
> expose BAR 0 in the struct virtio_pci_cap struct.
> > Instead it should use other BARs.
> >
> > > > As described in the spec, it uses the BAR in struct virtio_pci_cap
> > > > for exposing
> > > various things.
> > >
> > > Now I'm confused.
> > > So do you mean the \field{bar} in virtio_pci_cap or PCI BAR?
> > >
> > Yes.
> > > > So it means that PCI VF should use other than PCI BAR 0 for
> > > > various Virtio
> > > Structure PCI Capabilities that it exposes.
> > >
> > > I suspect you then want to say "should not expose to driver any
> > > structures inside it's BAR0"?
> > Instead of bisecting at structure level, it is indicated on usage so that it doesn't
> need to bisect on "what about MSI-X".
> 
> But what is the answer?
>
BAR 0 should not be used at all by the VF device for anything including MSI-X.

> > > And does this include this new command you are adding or not?
> > > It mentions bar too.  What about e.g. MSIX tables? Could there be
> > > other capabilities referring to a BAR?
> >
> 
> ?
> 
New command also should not report BAR 0.

> > > How does hypervisor know whether VF followed this rule (it's a
> > > should, not a hard rule after all)?
> > >
> > It is not a MUST.
> > Hypervisor software using this VF very easily know this when VF is attached to
> the hypervisor driver by reading the capability.
> 
> which capability? E.g. there's a vendor specific capability we don't even know
> what's in there. If you really want to save code in the hypervisor this "should" is
> pretty useless.
> 
All the pci vendor capabilities for which all the code already exists.
It is not related to code saving.

Even those cap check is not needed.
Hypervisor driver needs to only check that BAR-0 is empty of not from the PCI layer. 

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-04 14:53               ` [virtio-dev] " Michael S. Tsirkin
@ 2023-06-04 15:07                 ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 15:07 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 10:54 AM

> > Each VF has its own available buffer notification in hardware like 1.x.
> > We do not want to duplicate (and add) such functionality on the PF BAR
> hardware when it already exists on the VF.
> 
> yes but here we are talking about legacy notifications, not 1.x
>
Legacy can utilize the 1.x hw plumbing without building new hypothetical PF hardware.
 
> > > We are talking about an interface that will be used tens of years
> > > from now. If the interface is awkward to use on some platforms let's
> > > make it easier not hide behind excuses of no demand to fix it as of last
> Friday.
> > It is not hiding.
> > The fact that virtio drivers are not inbox. I don't see an actual user by the OS
> vendor for the decade passed.
> 
> But why does it matter? There are a bunch of users of virtio, I know that.
> 
> > And, I do not anticipate use of legacy for tens of years from now.
> >
> > It is not even a conclusion that it is awkward to use.
> > You are concluding that one OS may never want to evolve their kernel APIs.
> 
> They might. That takes many years too.
>
By that time legacy may not be even a use case for them.
If an OS vendor evolves slowly compare to other two OS, such OS may have to change their process, not the virtio-spec.

> > So, when a 2nd OS vendor cannot use IPR scheme that they have, and they
> MUST have everything through ONLY VF, to support them, a HW vendor will
> build PCI device with VF legacy access registers stay in the VF.
> > And spec update will be done.
> >
> > We really don't see this happening. So better to build a practical spec.
> >
> > And if this was important, I am still puzzled why you say "Just AQ is fine" in v2
> and why you wait for next 2 weeks for v3 to show up to raise the concern now
> contradicting your ACK.
> 
> Because this is just AQ. All I am asking is that the BAR refers to PF, same AQ
> command.

VF has BAR for driver notifications. This BAR is used for 1.x and legacy.
There is no need to ask vendors to build new HW to put driver notifications on the PF BAR for VFs, when it already exists on the VF.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-04 15:07                 ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 15:07 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 10:54 AM

> > Each VF has its own available buffer notification in hardware like 1.x.
> > We do not want to duplicate (and add) such functionality on the PF BAR
> hardware when it already exists on the VF.
> 
> yes but here we are talking about legacy notifications, not 1.x
>
Legacy can utilize the 1.x hw plumbing without building new hypothetical PF hardware.
 
> > > We are talking about an interface that will be used tens of years
> > > from now. If the interface is awkward to use on some platforms let's
> > > make it easier not hide behind excuses of no demand to fix it as of last
> Friday.
> > It is not hiding.
> > The fact that virtio drivers are not inbox. I don't see an actual user by the OS
> vendor for the decade passed.
> 
> But why does it matter? There are a bunch of users of virtio, I know that.
> 
> > And, I do not anticipate use of legacy for tens of years from now.
> >
> > It is not even a conclusion that it is awkward to use.
> > You are concluding that one OS may never want to evolve their kernel APIs.
> 
> They might. That takes many years too.
>
By that time legacy may not be even a use case for them.
If an OS vendor evolves slowly compare to other two OS, such OS may have to change their process, not the virtio-spec.

> > So, when a 2nd OS vendor cannot use IPR scheme that they have, and they
> MUST have everything through ONLY VF, to support them, a HW vendor will
> build PCI device with VF legacy access registers stay in the VF.
> > And spec update will be done.
> >
> > We really don't see this happening. So better to build a practical spec.
> >
> > And if this was important, I am still puzzled why you say "Just AQ is fine" in v2
> and why you wait for next 2 weeks for v3 to show up to raise the concern now
> contradicting your ACK.
> 
> Because this is just AQ. All I am asking is that the BAR refers to PF, same AQ
> command.

VF has BAR for driver notifications. This BAR is used for 1.x and legacy.
There is no need to ask vendors to build new HW to put driver notifications on the PF BAR for VFs, when it already exists on the VF.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-04 15:07                 ` [virtio-comment] " Parav Pandit
@ 2023-06-04 21:48                   ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 21:48 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 03:07:27PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 10:54 AM
> 
> > > Each VF has its own available buffer notification in hardware like 1.x.
> > > We do not want to duplicate (and add) such functionality on the PF BAR
> > hardware when it already exists on the VF.
> > 
> > yes but here we are talking about legacy notifications, not 1.x
> >
> Legacy can utilize the 1.x hw plumbing without building new hypothetical PF hardware.

Maybe.
Whether 1.x BAR can be reused for legacy would depend on a bunch
of factors. E.g. with 1.x using VIRTIO_F_NOTIF_CONFIG_DATA - probably not.

> > > > We are talking about an interface that will be used tens of years
> > > > from now. If the interface is awkward to use on some platforms let's
> > > > make it easier not hide behind excuses of no demand to fix it as of last
> > Friday.
> > > It is not hiding.
> > > The fact that virtio drivers are not inbox. I don't see an actual user by the OS
> > vendor for the decade passed.
> > 
> > But why does it matter? There are a bunch of users of virtio, I know that.
> > 
> > > And, I do not anticipate use of legacy for tens of years from now.
> > >
> > > It is not even a conclusion that it is awkward to use.
> > > You are concluding that one OS may never want to evolve their kernel APIs.
> > 
> > They might. That takes many years too.
> >
> By that time legacy may not be even a use case for them.
> If an OS vendor evolves slowly compare to other two OS, such OS may have to change their process, not the virtio-spec.

Let's just say, we are not in the position where we dictate these things
to OS vendors yet.  One of motivations of the spec is making writing
drivers easier so let's add an option for that pls.

> > > So, when a 2nd OS vendor cannot use IPR scheme that they have, and they
> > MUST have everything through ONLY VF, to support them, a HW vendor will
> > build PCI device with VF legacy access registers stay in the VF.
> > > And spec update will be done.
> > >
> > > We really don't see this happening. So better to build a practical spec.
> > >
> > > And if this was important, I am still puzzled why you say "Just AQ is fine" in v2
> > and why you wait for next 2 weeks for v3 to show up to raise the concern now
> > contradicting your ACK.
> > 
> > Because this is just AQ. All I am asking is that the BAR refers to PF, same AQ
> > command.
> 
> VF has BAR for driver notifications. This BAR is used for 1.x and legacy.

But it's the same piece of silicon - be it in PF or in VF.
I really don't see why it matters.

> There is no need to ask vendors to build new HW to put driver notifications on the PF BAR for VFs, when it already exists on the VF.
I'm talking about giving vendors an option not asking them.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-04 21:48                   ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 21:48 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 03:07:27PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 10:54 AM
> 
> > > Each VF has its own available buffer notification in hardware like 1.x.
> > > We do not want to duplicate (and add) such functionality on the PF BAR
> > hardware when it already exists on the VF.
> > 
> > yes but here we are talking about legacy notifications, not 1.x
> >
> Legacy can utilize the 1.x hw plumbing without building new hypothetical PF hardware.

Maybe.
Whether 1.x BAR can be reused for legacy would depend on a bunch
of factors. E.g. with 1.x using VIRTIO_F_NOTIF_CONFIG_DATA - probably not.

> > > > We are talking about an interface that will be used tens of years
> > > > from now. If the interface is awkward to use on some platforms let's
> > > > make it easier not hide behind excuses of no demand to fix it as of last
> > Friday.
> > > It is not hiding.
> > > The fact that virtio drivers are not inbox. I don't see an actual user by the OS
> > vendor for the decade passed.
> > 
> > But why does it matter? There are a bunch of users of virtio, I know that.
> > 
> > > And, I do not anticipate use of legacy for tens of years from now.
> > >
> > > It is not even a conclusion that it is awkward to use.
> > > You are concluding that one OS may never want to evolve their kernel APIs.
> > 
> > They might. That takes many years too.
> >
> By that time legacy may not be even a use case for them.
> If an OS vendor evolves slowly compare to other two OS, such OS may have to change their process, not the virtio-spec.

Let's just say, we are not in the position where we dictate these things
to OS vendors yet.  One of motivations of the spec is making writing
drivers easier so let's add an option for that pls.

> > > So, when a 2nd OS vendor cannot use IPR scheme that they have, and they
> > MUST have everything through ONLY VF, to support them, a HW vendor will
> > build PCI device with VF legacy access registers stay in the VF.
> > > And spec update will be done.
> > >
> > > We really don't see this happening. So better to build a practical spec.
> > >
> > > And if this was important, I am still puzzled why you say "Just AQ is fine" in v2
> > and why you wait for next 2 weeks for v3 to show up to raise the concern now
> > contradicting your ACK.
> > 
> > Because this is just AQ. All I am asking is that the BAR refers to PF, same AQ
> > command.
> 
> VF has BAR for driver notifications. This BAR is used for 1.x and legacy.

But it's the same piece of silicon - be it in PF or in VF.
I really don't see why it matters.

> There is no need to ask vendors to build new HW to put driver notifications on the PF BAR for VFs, when it already exists on the VF.
I'm talking about giving vendors an option not asking them.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-04 15:01               ` [virtio-comment] " Parav Pandit
@ 2023-06-04 22:10                 ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 22:10 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 03:01:52PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 10:42 AM
> 
> > > > BTW all these may/must/should need to go into conformance section.
> > > >
> > > Conformance section for the AQ itself is missing. And I am aware to fix it post
> > your v13 series.
> > 
> > Hmm missing where? It was supposed to be added here:
> >
> Conformance chapter doesn't have any links to aq requirements.

Good point, but the section itself is not missing, just a couple of links
in the conformance chapter. Sounds like a trivial omission we
can correct as an editorial fix.

>  
> > commit bf1d6b0d24ae899d08c7cf24ed480cf5881c49ef
> > Author: Michael S. Tsirkin <mst@redhat.com>
> > Date:   Sun Nov 20 19:43:45 2022 -0500
> > 
> >     admin: conformance clauses
> > 
> > what did I miss?
> > 
> > 
> > > > Generally the way we structure the spec is an explanation of the
> > > > theory of operation (mostly missing here)
> > > >
> > > It is not any different from v2.
> > > Theory of operation is not going to describe the whole driver design.
> > > It is not likely the scope like any other section.
> > > Section "Legacy Interfaces: SR-IOV VFs Registers Access" has theory of
> > operation described and also in commit log.
> > >
> > > This is like recent AQ patches and notification coalescing and more.
> > >
> > > So if can pin point what exactly you want to see in theory of operation, it will
> > be helpful.
> > > Because for one person, 10 lines of theory is enough like how we have most
> > of the spec, another wants 100 lines with pseudo code in appendix.
> > 
> > yes but I think this assumes a bit much. you start by saying there's no IO BAR.
> > Okay, it's not even mandatory to give motivation, but can't hurt. The next step is
> > you describe a bunch of commands. Presumably the reader will draw the
> > conclusion that they replace an io bar?
> > But it's implicit, and that is not good.
> > 
> > So, I imagine we have a driver that translates legacy accesses to AQ commands,
> > yes? 
> Yes.
> 
> > And it also somehow uses the extra command to get an address and then
> > translates notifications to writes at that address? This kind of thing is what I
> > called a theory of operation.
> >
>  
> > A couple of paragraphs.
> >
> Yes, but I don't see such details for the AQ, notification coalescing.

I certainly tried for AQ.

For notification coalescing there's a whole paragraph:
\subparagraph{Operation}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Notifications Coalescing / Operation}



> These commands are not special.
> Commands described "what" they do. "When and how" is not described in the spec.

If the "what" is "return offset for notifications" but there's no
description on what these notifications are then the "what" is
at best incomplete.

> It is left to the driver to compose such things.
> How Net device should use "queue reset" is not explained in theory of operation.
> What is described is mechanics of queue reset steps...
> 
> Those details were put in the commit log, and not in the spec.
> If you want to add theory of operation like nvme spec, we need to have dedicated section.
> I don't see a reason, why this should be the first patch set to do so in v4.
> I am more than happy to add, but it can be done in generic way as follow up.

I don't think so personally.
As bigger issues get fixed, we start polishing up smaller ones.
It is reasonable to ask that people try to decide on a high level
design up front to avoid sending you back to the drawing board -
though that's unavoidable sometimes, a straw can break camel's back,
but that's not the case here.

Nitpicking when the design itself is undergoing big changes is
unproductive for everyone - reviewers and contributors.
Now you are getting asked to clarify things is a good sign that
the design is converging. The less time we keep arguing about
protocol the faster this will happen.

And I commented on previous versions too that the notification part is
not near ready, and suggested splitting it up to a follow up patch.
This is still the case, and I still think you should get the 4 config
access commands merged first then focus on notifications.

> > 
> > 
> > > > v2 had other issues so I missed this one.
> > > >
> > > > > But ok.
> > > > >
> > > > > No. It is not related to last command.
> > > > > What does a PCI Device use BAR for?
> > > >
> > > > To reserve address space and know which addresses to claim.
> > > >
> > > > Generally if I heard "not use BAR0" I would assume that the meaning
> > > > is that VF
> > > > BAR0 in SRIOV expended capability should be 0. However, that affects
> > > > all VFs and not just this VF so I don't really know what can it mean.
> > > >
> > > A PCI PF and VF device which wants to support legacy emulation should not
> > expose BAR 0 in the struct virtio_pci_cap struct.
> > > Instead it should use other BARs.
> > >
> > > > > As described in the spec, it uses the BAR in struct virtio_pci_cap
> > > > > for exposing
> > > > various things.
> > > >
> > > > Now I'm confused.
> > > > So do you mean the \field{bar} in virtio_pci_cap or PCI BAR?
> > > >
> > > Yes.
> > > > > So it means that PCI VF should use other than PCI BAR 0 for
> > > > > various Virtio
> > > > Structure PCI Capabilities that it exposes.
> > > >
> > > > I suspect you then want to say "should not expose to driver any
> > > > structures inside it's BAR0"?
> > > Instead of bisecting at structure level, it is indicated on usage so that it doesn't
> > need to bisect on "what about MSI-X".
> > 
> > But what is the answer?
> >
> BAR 0 should not be used at all by the VF device for anything including MSI-X.
> > > > And does this include this new command you are adding or not?
> > > > It mentions bar too.  What about e.g. MSIX tables? Could there be
> > > > other capabilities referring to a BAR?
> > >
> > 
> > ?
> > 
> New command also should not report BAR 0.
> > > > How does hypervisor know whether VF followed this rule (it's a
> > > > should, not a hard rule after all)?
> > > >
> > > It is not a MUST.

Check up on the difference between SHOULD and MUST in the RFC.
If things break without this then you make it MUST. SHOULD is
a recommendation.

> > > Hypervisor software using this VF very easily know this when VF is attached to
> > the hypervisor driver by reading the capability.
> > 
> > which capability? E.g. there's a vendor specific capability we don't even know
> > what's in there. If you really want to save code in the hypervisor this "should" is
> > pretty useless.
> > 
> All the pci vendor capabilities for which all the code already exists.
> It is not related to code saving.

Isn't code saving the reason you want to prevent VFs from using BAR0?

> Even those cap check is not needed.
> Hypervisor driver needs to only check that BAR-0 is empty of not from the PCI layer. 

How do you check this? BAR0 size 0? Then say so. That affects all VFs and some of
them might not have legacy access.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-04 22:10                 ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-04 22:10 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 03:01:52PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 10:42 AM
> 
> > > > BTW all these may/must/should need to go into conformance section.
> > > >
> > > Conformance section for the AQ itself is missing. And I am aware to fix it post
> > your v13 series.
> > 
> > Hmm missing where? It was supposed to be added here:
> >
> Conformance chapter doesn't have any links to aq requirements.

Good point, but the section itself is not missing, just a couple of links
in the conformance chapter. Sounds like a trivial omission we
can correct as an editorial fix.

>  
> > commit bf1d6b0d24ae899d08c7cf24ed480cf5881c49ef
> > Author: Michael S. Tsirkin <mst@redhat.com>
> > Date:   Sun Nov 20 19:43:45 2022 -0500
> > 
> >     admin: conformance clauses
> > 
> > what did I miss?
> > 
> > 
> > > > Generally the way we structure the spec is an explanation of the
> > > > theory of operation (mostly missing here)
> > > >
> > > It is not any different from v2.
> > > Theory of operation is not going to describe the whole driver design.
> > > It is not likely the scope like any other section.
> > > Section "Legacy Interfaces: SR-IOV VFs Registers Access" has theory of
> > operation described and also in commit log.
> > >
> > > This is like recent AQ patches and notification coalescing and more.
> > >
> > > So if can pin point what exactly you want to see in theory of operation, it will
> > be helpful.
> > > Because for one person, 10 lines of theory is enough like how we have most
> > of the spec, another wants 100 lines with pseudo code in appendix.
> > 
> > yes but I think this assumes a bit much. you start by saying there's no IO BAR.
> > Okay, it's not even mandatory to give motivation, but can't hurt. The next step is
> > you describe a bunch of commands. Presumably the reader will draw the
> > conclusion that they replace an io bar?
> > But it's implicit, and that is not good.
> > 
> > So, I imagine we have a driver that translates legacy accesses to AQ commands,
> > yes? 
> Yes.
> 
> > And it also somehow uses the extra command to get an address and then
> > translates notifications to writes at that address? This kind of thing is what I
> > called a theory of operation.
> >
>  
> > A couple of paragraphs.
> >
> Yes, but I don't see such details for the AQ, notification coalescing.

I certainly tried for AQ.

For notification coalescing there's a whole paragraph:
\subparagraph{Operation}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Notifications Coalescing / Operation}



> These commands are not special.
> Commands described "what" they do. "When and how" is not described in the spec.

If the "what" is "return offset for notifications" but there's no
description on what these notifications are then the "what" is
at best incomplete.

> It is left to the driver to compose such things.
> How Net device should use "queue reset" is not explained in theory of operation.
> What is described is mechanics of queue reset steps...
> 
> Those details were put in the commit log, and not in the spec.
> If you want to add theory of operation like nvme spec, we need to have dedicated section.
> I don't see a reason, why this should be the first patch set to do so in v4.
> I am more than happy to add, but it can be done in generic way as follow up.

I don't think so personally.
As bigger issues get fixed, we start polishing up smaller ones.
It is reasonable to ask that people try to decide on a high level
design up front to avoid sending you back to the drawing board -
though that's unavoidable sometimes, a straw can break camel's back,
but that's not the case here.

Nitpicking when the design itself is undergoing big changes is
unproductive for everyone - reviewers and contributors.
Now you are getting asked to clarify things is a good sign that
the design is converging. The less time we keep arguing about
protocol the faster this will happen.

And I commented on previous versions too that the notification part is
not near ready, and suggested splitting it up to a follow up patch.
This is still the case, and I still think you should get the 4 config
access commands merged first then focus on notifications.

> > 
> > 
> > > > v2 had other issues so I missed this one.
> > > >
> > > > > But ok.
> > > > >
> > > > > No. It is not related to last command.
> > > > > What does a PCI Device use BAR for?
> > > >
> > > > To reserve address space and know which addresses to claim.
> > > >
> > > > Generally if I heard "not use BAR0" I would assume that the meaning
> > > > is that VF
> > > > BAR0 in SRIOV expended capability should be 0. However, that affects
> > > > all VFs and not just this VF so I don't really know what can it mean.
> > > >
> > > A PCI PF and VF device which wants to support legacy emulation should not
> > expose BAR 0 in the struct virtio_pci_cap struct.
> > > Instead it should use other BARs.
> > >
> > > > > As described in the spec, it uses the BAR in struct virtio_pci_cap
> > > > > for exposing
> > > > various things.
> > > >
> > > > Now I'm confused.
> > > > So do you mean the \field{bar} in virtio_pci_cap or PCI BAR?
> > > >
> > > Yes.
> > > > > So it means that PCI VF should use other than PCI BAR 0 for
> > > > > various Virtio
> > > > Structure PCI Capabilities that it exposes.
> > > >
> > > > I suspect you then want to say "should not expose to driver any
> > > > structures inside it's BAR0"?
> > > Instead of bisecting at structure level, it is indicated on usage so that it doesn't
> > need to bisect on "what about MSI-X".
> > 
> > But what is the answer?
> >
> BAR 0 should not be used at all by the VF device for anything including MSI-X.
> > > > And does this include this new command you are adding or not?
> > > > It mentions bar too.  What about e.g. MSIX tables? Could there be
> > > > other capabilities referring to a BAR?
> > >
> > 
> > ?
> > 
> New command also should not report BAR 0.
> > > > How does hypervisor know whether VF followed this rule (it's a
> > > > should, not a hard rule after all)?
> > > >
> > > It is not a MUST.

Check up on the difference between SHOULD and MUST in the RFC.
If things break without this then you make it MUST. SHOULD is
a recommendation.

> > > Hypervisor software using this VF very easily know this when VF is attached to
> > the hypervisor driver by reading the capability.
> > 
> > which capability? E.g. there's a vendor specific capability we don't even know
> > what's in there. If you really want to save code in the hypervisor this "should" is
> > pretty useless.
> > 
> All the pci vendor capabilities for which all the code already exists.
> It is not related to code saving.

Isn't code saving the reason you want to prevent VFs from using BAR0?

> Even those cap check is not needed.
> Hypervisor driver needs to only check that BAR-0 is empty of not from the PCI layer. 

How do you check this? BAR0 size 0? Then say so. That affects all VFs and some of
them might not have legacy access.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-04 21:48                   ` [virtio-dev] " Michael S. Tsirkin
@ 2023-06-04 23:40                     ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 23:40 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 5:49 PM

> > Legacy can utilize the 1.x hw plumbing without building new hypothetical PF
> hardware.
> 
> Maybe.
> Whether 1.x BAR can be reused for legacy would depend on a bunch of factors.
> E.g. with 1.x using VIRTIO_F_NOTIF_CONFIG_DATA - probably not.
>
Not really because legacy doesn't have that feature.
Legacy notifications are subset of 1.x feature.
This was also discussed.

> Let's just say, we are not in the position where we dictate these things to OS
> vendors yet.  One of motivations of the spec is making writing drivers easier so
> let's add an option for that pls.
>
There is no need to add multiple options at this point when the hw vendors are not going to implement.
When we find another vendor to implement, we can always add the new method.
Marvell and Nvidia both are forwarding with AQ at present proposal.

> > VF has BAR for driver notifications. This BAR is used for 1.x and legacy.
> 
> But it's the same piece of silicon - be it in PF or in VF.
> I really don't see why it matters.
>
In same piece of silicon one needs to open yet another PCI steering entry to tell that treat this for VF.
This double size programming is useless.

Yet again we are discussing same point as before.

> > There is no need to ask vendors to build new HW to put driver notifications
> on the PF BAR for VFs, when it already exists on the VF.
> I'm talking about giving vendors an option not asking them.
>
Ok. Understood.
When a vendor prefers to implement such cross hw forwarding it can be done.
There isn't a desire to burn and program extra hw for functionality that already exists on the VF.
Hence, VF's doorbell on PF can be parked for the future option when one actually wants to implement it.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-04 23:40                     ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 23:40 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 5:49 PM

> > Legacy can utilize the 1.x hw plumbing without building new hypothetical PF
> hardware.
> 
> Maybe.
> Whether 1.x BAR can be reused for legacy would depend on a bunch of factors.
> E.g. with 1.x using VIRTIO_F_NOTIF_CONFIG_DATA - probably not.
>
Not really because legacy doesn't have that feature.
Legacy notifications are subset of 1.x feature.
This was also discussed.

> Let's just say, we are not in the position where we dictate these things to OS
> vendors yet.  One of motivations of the spec is making writing drivers easier so
> let's add an option for that pls.
>
There is no need to add multiple options at this point when the hw vendors are not going to implement.
When we find another vendor to implement, we can always add the new method.
Marvell and Nvidia both are forwarding with AQ at present proposal.

> > VF has BAR for driver notifications. This BAR is used for 1.x and legacy.
> 
> But it's the same piece of silicon - be it in PF or in VF.
> I really don't see why it matters.
>
In same piece of silicon one needs to open yet another PCI steering entry to tell that treat this for VF.
This double size programming is useless.

Yet again we are discussing same point as before.

> > There is no need to ask vendors to build new HW to put driver notifications
> on the PF BAR for VFs, when it already exists on the VF.
> I'm talking about giving vendors an option not asking them.
>
Ok. Understood.
When a vendor prefers to implement such cross hw forwarding it can be done.
There isn't a desire to burn and program extra hw for functionality that already exists on the VF.
Hence, VF's doorbell on PF can be parked for the future option when one actually wants to implement 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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-04 22:10                 ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-04 23:57                   ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 23:57 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 6:10 PM

> > Conformance chapter doesn't have any links to aq requirements.
> 
> Good point, but the section itself is not missing, just a couple of links in the
> conformance chapter. Sounds like a trivial omission we can correct as an
> editorial fix.
>
Yes, to be done.
 
> > > And it also somehow uses the extra command to get an address and
> > > then translates notifications to writes at that address? This kind
> > > of thing is what I called a theory of operation.
> > >
> >
> > > A couple of paragraphs.
> > >
> > Yes, but I don't see such details for the AQ, notification coalescing.
> 
> I certainly tried for AQ.
>
There are many details about "access other device" design details located in the commit log, which is not present in the AQ section.

 
> For notification coalescing there's a whole paragraph:
> \subparagraph{Operation}\label{sec:Device Types / Network Device / Device
> Operation / Control Virtqueue / Notifications Coalescing / Operation}
>
The paragraph explains "what" part of the operation, not the design of how/when things should be done by the driver. 
I am not against adding the theory of operation, but I clearly see being nitpicked.

> 
> > These commands are not special.
> > Commands described "what" they do. "When and how" is not described in
> the spec.
> 
> If the "what" is "return offset for notifications" but there's no description on
> what these notifications are then the "what" is at best incomplete.
> 

The command description says:
"This command returns the notify offset of the member VF for virtqueue driver notifications"

What more to tell than this, as "driver notifications" is clearly described in the section 2.9 for it.
May be I can make it little more verbose.

> > It is left to the driver to compose such things.
> > How Net device should use "queue reset" is not explained in theory of
> operation.
> > What is described is mechanics of queue reset steps...
> >
> > Those details were put in the commit log, and not in the spec.
> > If you want to add theory of operation like nvme spec, we need to have
> dedicated section.
> > I don't see a reason, why this should be the first patch set to do so in v4.
> > I am more than happy to add, but it can be done in generic way as follow up.
> 
> I don't think so personally.
> As bigger issues get fixed, we start polishing up smaller ones.
> It is reasonable to ask that people try to decide on a high level design up front to
> avoid sending you back to the drawing board - though that's unavoidable
> sometimes, a straw can break camel's back, but that's not the case here.
> 
> Nitpicking when the design itself is undergoing big changes is unproductive for
> everyone - reviewers and contributors.
> Now you are getting asked to clarify things is a good sign that the design is
> converging. The less time we keep arguing about protocol the faster this will
> happen.
> 
Most or all questions about notify were literally answered in v2.
I missed to add them to the alternatives considered section in the commit log.
I will add it.

> And I commented on previous versions too that the notification part is not near
> ready, and suggested splitting it up to a follow up patch.
> This is still the case, and I still think you should get the 4 config access
> commands merged first then focus on notifications.
>
After you asked about this in v1, I further clarified in v2.
I would like to cover the notification part as well. It is really the small piece as it is not baking any special or new concept.

> > > But what is the answer?
> > >
> > BAR 0 should not be used at all by the VF device for anything including MSI-X.
> > > > > And does this include this new command you are adding or not?
> > > > > It mentions bar too.  What about e.g. MSIX tables? Could there
> > > > > be other capabilities referring to a BAR?
> > > >
> > >
> > > ?
> > >
> > New command also should not report BAR 0.
> > > > > How does hypervisor know whether VF followed this rule (it's a
> > > > > should, not a hard rule after all)?
> > > > >
> > > > It is not a MUST.
> 
> Check up on the difference between SHOULD and MUST in the RFC.
> If things break without this then you make it MUST. SHOULD is a
> recommendation.
>
One may be still able to work by having it as "SHOULD", it may be just too much of code without much use.
Hence, I kept it as SHOULD.

> Isn't code saving the reason you want to prevent VFs from using BAR0?
>
Code and driver complexity both.
 
> > Even those cap check is not needed.
> > Hypervisor driver needs to only check that BAR-0 is empty of not from the PCI
> layer.
> 
> How do you check this? BAR0 size 0? Then say so. That affects all VFs and some
> of them might not have legacy access.

I don't think we need to enforce this by writing what PCI spec already defines.
For example, we don't write how MSI-X PBA addresses to be programmed when programing a vector and how to memory map PCI BAR region.
It is left to the driver to figure out how to detect BAR0 supported or not for a device.
Multiple solutions exists left to the driver to decide.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-04 23:57                   ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-04 23:57 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 4, 2023 6:10 PM

> > Conformance chapter doesn't have any links to aq requirements.
> 
> Good point, but the section itself is not missing, just a couple of links in the
> conformance chapter. Sounds like a trivial omission we can correct as an
> editorial fix.
>
Yes, to be done.
 
> > > And it also somehow uses the extra command to get an address and
> > > then translates notifications to writes at that address? This kind
> > > of thing is what I called a theory of operation.
> > >
> >
> > > A couple of paragraphs.
> > >
> > Yes, but I don't see such details for the AQ, notification coalescing.
> 
> I certainly tried for AQ.
>
There are many details about "access other device" design details located in the commit log, which is not present in the AQ section.

 
> For notification coalescing there's a whole paragraph:
> \subparagraph{Operation}\label{sec:Device Types / Network Device / Device
> Operation / Control Virtqueue / Notifications Coalescing / Operation}
>
The paragraph explains "what" part of the operation, not the design of how/when things should be done by the driver. 
I am not against adding the theory of operation, but I clearly see being nitpicked.

> 
> > These commands are not special.
> > Commands described "what" they do. "When and how" is not described in
> the spec.
> 
> If the "what" is "return offset for notifications" but there's no description on
> what these notifications are then the "what" is at best incomplete.
> 

The command description says:
"This command returns the notify offset of the member VF for virtqueue driver notifications"

What more to tell than this, as "driver notifications" is clearly described in the section 2.9 for it.
May be I can make it little more verbose.

> > It is left to the driver to compose such things.
> > How Net device should use "queue reset" is not explained in theory of
> operation.
> > What is described is mechanics of queue reset steps...
> >
> > Those details were put in the commit log, and not in the spec.
> > If you want to add theory of operation like nvme spec, we need to have
> dedicated section.
> > I don't see a reason, why this should be the first patch set to do so in v4.
> > I am more than happy to add, but it can be done in generic way as follow up.
> 
> I don't think so personally.
> As bigger issues get fixed, we start polishing up smaller ones.
> It is reasonable to ask that people try to decide on a high level design up front to
> avoid sending you back to the drawing board - though that's unavoidable
> sometimes, a straw can break camel's back, but that's not the case here.
> 
> Nitpicking when the design itself is undergoing big changes is unproductive for
> everyone - reviewers and contributors.
> Now you are getting asked to clarify things is a good sign that the design is
> converging. The less time we keep arguing about protocol the faster this will
> happen.
> 
Most or all questions about notify were literally answered in v2.
I missed to add them to the alternatives considered section in the commit log.
I will add it.

> And I commented on previous versions too that the notification part is not near
> ready, and suggested splitting it up to a follow up patch.
> This is still the case, and I still think you should get the 4 config access
> commands merged first then focus on notifications.
>
After you asked about this in v1, I further clarified in v2.
I would like to cover the notification part as well. It is really the small piece as it is not baking any special or new concept.

> > > But what is the answer?
> > >
> > BAR 0 should not be used at all by the VF device for anything including MSI-X.
> > > > > And does this include this new command you are adding or not?
> > > > > It mentions bar too.  What about e.g. MSIX tables? Could there
> > > > > be other capabilities referring to a BAR?
> > > >
> > >
> > > ?
> > >
> > New command also should not report BAR 0.
> > > > > How does hypervisor know whether VF followed this rule (it's a
> > > > > should, not a hard rule after all)?
> > > > >
> > > > It is not a MUST.
> 
> Check up on the difference between SHOULD and MUST in the RFC.
> If things break without this then you make it MUST. SHOULD is a
> recommendation.
>
One may be still able to work by having it as "SHOULD", it may be just too much of code without much use.
Hence, I kept it as SHOULD.

> Isn't code saving the reason you want to prevent VFs from using BAR0?
>
Code and driver complexity both.
 
> > Even those cap check is not needed.
> > Hypervisor driver needs to only check that BAR-0 is empty of not from the PCI
> layer.
> 
> How do you check this? BAR0 size 0? Then say so. That affects all VFs and some
> of them might not have legacy access.

I don't think we need to enforce this by writing what PCI spec already defines.
For example, we don't write how MSI-X PBA addresses to be programmed when programing a vector and how to memory map PCI BAR region.
It is left to the driver to figure out how to detect BAR0 supported or not for a device.
Multiple solutions exists left to the driver to decide.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-04 23:40                     ` [virtio-comment] " Parav Pandit
@ 2023-06-05  5:51                       ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-05  5:51 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 11:40:54PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 5:49 PM
> 
> > > Legacy can utilize the 1.x hw plumbing without building new hypothetical PF
> > hardware.
> > 
> > Maybe.
> > Whether 1.x BAR can be reused for legacy would depend on a bunch of factors.
> > E.g. with 1.x using VIRTIO_F_NOTIF_CONFIG_DATA - probably not.
> >
> Not really because legacy doesn't have that feature.
> Legacy notifications are subset of 1.x feature.
> This was also discussed.

So for legacy such hardware will likely not want to use the same BAR.


> > Let's just say, we are not in the position where we dictate these things to OS
> > vendors yet.  One of motivations of the spec is making writing drivers easier so
> > let's add an option for that pls.
> >
> There is no need to add multiple options at this point when the hw vendors are not going to implement.
> When we find another vendor to implement, we can always add the new method.
> Marvell and Nvidia both are forwarding with AQ at present proposal.
> 
> > > VF has BAR for driver notifications. This BAR is used for 1.x and legacy.
> > 
> > But it's the same piece of silicon - be it in PF or in VF.
> > I really don't see why it matters.
> >
> In same piece of silicon one needs to open yet another PCI steering entry to tell that treat this for VF.
> This double size programming is useless.
> 
> Yet again we are discussing same point as before.
> 
> > > There is no need to ask vendors to build new HW to put driver notifications
> > on the PF BAR for VFs, when it already exists on the VF.
> > I'm talking about giving vendors an option not asking them.
> >
> Ok. Understood.
> When a vendor prefers to implement such cross hw forwarding it can be done.
> There isn't a desire to burn and program extra hw for functionality that already exists on the VF.
> Hence, VF's doorbell on PF can be parked for the future option when one actually wants to implement it.

I reached out to windows team to know how big a problem this is. Let's
see.


I have another idea meanwhile: VF already has notification
capability. The only issue is offset has to be queried through modern
BAR.  How about we agree that for legacy, we just agree that offset 0 is
used?  Does not sound like a big sacrifice of memory to me, and we
completely avoid the new command and the need to tie PF and VF.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-05  5:51                       ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-05  5:51 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 04, 2023 at 11:40:54PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 4, 2023 5:49 PM
> 
> > > Legacy can utilize the 1.x hw plumbing without building new hypothetical PF
> > hardware.
> > 
> > Maybe.
> > Whether 1.x BAR can be reused for legacy would depend on a bunch of factors.
> > E.g. with 1.x using VIRTIO_F_NOTIF_CONFIG_DATA - probably not.
> >
> Not really because legacy doesn't have that feature.
> Legacy notifications are subset of 1.x feature.
> This was also discussed.

So for legacy such hardware will likely not want to use the same BAR.


> > Let's just say, we are not in the position where we dictate these things to OS
> > vendors yet.  One of motivations of the spec is making writing drivers easier so
> > let's add an option for that pls.
> >
> There is no need to add multiple options at this point when the hw vendors are not going to implement.
> When we find another vendor to implement, we can always add the new method.
> Marvell and Nvidia both are forwarding with AQ at present proposal.
> 
> > > VF has BAR for driver notifications. This BAR is used for 1.x and legacy.
> > 
> > But it's the same piece of silicon - be it in PF or in VF.
> > I really don't see why it matters.
> >
> In same piece of silicon one needs to open yet another PCI steering entry to tell that treat this for VF.
> This double size programming is useless.
> 
> Yet again we are discussing same point as before.
> 
> > > There is no need to ask vendors to build new HW to put driver notifications
> > on the PF BAR for VFs, when it already exists on the VF.
> > I'm talking about giving vendors an option not asking them.
> >
> Ok. Understood.
> When a vendor prefers to implement such cross hw forwarding it can be done.
> There isn't a desire to burn and program extra hw for functionality that already exists on the VF.
> Hence, VF's doorbell on PF can be parked for the future option when one actually wants to implement it.

I reached out to windows team to know how big a problem this is. Let's
see.


I have another idea meanwhile: VF already has notification
capability. The only issue is offset has to be queried through modern
BAR.  How about we agree that for legacy, we just agree that offset 0 is
used?  Does not sound like a big sacrifice of memory to me, and we
completely avoid the new command and the need to tie PF and VF.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-05  5:51                       ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-05 13:27                         ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-05 13:27 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Monday, June 5, 2023 1:52 AM

[..]
> > > E.g. with 1.x using VIRTIO_F_NOTIF_CONFIG_DATA - probably not.
> > >
> > Not really because legacy doesn't have that feature.
> > Legacy notifications are subset of 1.x feature.
> > This was also discussed.
> 
> So for legacy such hardware will likely not want to use the same BAR.
> 
I don't follow this comment in conjunction with your below comment about offset 0.
If we consider offset 0, legacy will use the same notification area as 1.x, right?
So I am confused on "hardware don't want to use the same "BAR".

> 
> > > Let's just say, we are not in the position where we dictate these
> > > things to OS vendors yet.  One of motivations of the spec is making
> > > writing drivers easier so let's add an option for that pls.
> > >
> > There is no need to add multiple options at this point when the hw vendors
> are not going to implement.
> > When we find another vendor to implement, we can always add the new
> method.
> > Marvell and Nvidia both are forwarding with AQ at present proposal.
> >
> > > > VF has BAR for driver notifications. This BAR is used for 1.x and legacy.
> > >
> > > But it's the same piece of silicon - be it in PF or in VF.
> > > I really don't see why it matters.
> > >
> > In same piece of silicon one needs to open yet another PCI steering entry to
> tell that treat this for VF.
> > This double size programming is useless.
> >
> > Yet again we are discussing same point as before.
> >
> > > > There is no need to ask vendors to build new HW to put driver
> > > > notifications
> > > on the PF BAR for VFs, when it already exists on the VF.
> > > I'm talking about giving vendors an option not asking them.
> > >
> > Ok. Understood.
> > When a vendor prefers to implement such cross hw forwarding it can be done.
> > There isn't a desire to burn and program extra hw for functionality that
> already exists on the VF.
> > Hence, VF's doorbell on PF can be parked for the future option when one
> actually wants to implement it.
> 
> I reached out to windows team to know how big a problem this is. Let's see.
> 
> 
Ok. Linux didn't had multi-function driver support and infra was added.
So even if the facility may not be there, or if the current IPR facility they may not want to use,

In future OS vendor itself can provide the new APIs.
I certainly don't see being blocked on this.

But good to get feedback on there current state of OS.

> I have another idea meanwhile: VF already has notification capability. The only
> issue is offset has to be queried through modern BAR.  How about we agree that
> for legacy, we just agree that offset 0 is used?  Does not sound like a big
> sacrifice of memory to me, and we completely avoid the new command and the
> need to tie PF and VF.

It will not work for the SIOV which shouldn't replicate this capability (and some other cap) so many times, are you ok with it?

Can you explain the motivation of : why querying notification offset via the group member PF is a problem, if there is."
I don't see a problem with AQ that covers VF,SF/SIOV for legacy.

Proposed AQ command is cheap and covers both VF, SF/SIOV.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-05 13:27                         ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-05 13:27 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Monday, June 5, 2023 1:52 AM

[..]
> > > E.g. with 1.x using VIRTIO_F_NOTIF_CONFIG_DATA - probably not.
> > >
> > Not really because legacy doesn't have that feature.
> > Legacy notifications are subset of 1.x feature.
> > This was also discussed.
> 
> So for legacy such hardware will likely not want to use the same BAR.
> 
I don't follow this comment in conjunction with your below comment about offset 0.
If we consider offset 0, legacy will use the same notification area as 1.x, right?
So I am confused on "hardware don't want to use the same "BAR".

> 
> > > Let's just say, we are not in the position where we dictate these
> > > things to OS vendors yet.  One of motivations of the spec is making
> > > writing drivers easier so let's add an option for that pls.
> > >
> > There is no need to add multiple options at this point when the hw vendors
> are not going to implement.
> > When we find another vendor to implement, we can always add the new
> method.
> > Marvell and Nvidia both are forwarding with AQ at present proposal.
> >
> > > > VF has BAR for driver notifications. This BAR is used for 1.x and legacy.
> > >
> > > But it's the same piece of silicon - be it in PF or in VF.
> > > I really don't see why it matters.
> > >
> > In same piece of silicon one needs to open yet another PCI steering entry to
> tell that treat this for VF.
> > This double size programming is useless.
> >
> > Yet again we are discussing same point as before.
> >
> > > > There is no need to ask vendors to build new HW to put driver
> > > > notifications
> > > on the PF BAR for VFs, when it already exists on the VF.
> > > I'm talking about giving vendors an option not asking them.
> > >
> > Ok. Understood.
> > When a vendor prefers to implement such cross hw forwarding it can be done.
> > There isn't a desire to burn and program extra hw for functionality that
> already exists on the VF.
> > Hence, VF's doorbell on PF can be parked for the future option when one
> actually wants to implement it.
> 
> I reached out to windows team to know how big a problem this is. Let's see.
> 
> 
Ok. Linux didn't had multi-function driver support and infra was added.
So even if the facility may not be there, or if the current IPR facility they may not want to use,

In future OS vendor itself can provide the new APIs.
I certainly don't see being blocked on this.

But good to get feedback on there current state of OS.

> I have another idea meanwhile: VF already has notification capability. The only
> issue is offset has to be queried through modern BAR.  How about we agree that
> for legacy, we just agree that offset 0 is used?  Does not sound like a big
> sacrifice of memory to me, and we completely avoid the new command and the
> need to tie PF and VF.

It will not work for the SIOV which shouldn't replicate this capability (and some other cap) so many times, are you ok with it?

Can you explain the motivation of : why querying notification offset via the group member PF is a problem, if there is."
I don't see a problem with AQ that covers VF,SF/SIOV for legacy.

Proposed AQ command is cheap and covers both VF, SF/SIOV.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-05 13:27                         ` [virtio-dev] " Parav Pandit
@ 2023-06-05 13:50                           ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-05 13:50 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 05, 2023 at 01:27:04PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Monday, June 5, 2023 1:52 AM
> 
> [..]
> > > > E.g. with 1.x using VIRTIO_F_NOTIF_CONFIG_DATA - probably not.
> > > >
> > > Not really because legacy doesn't have that feature.
> > > Legacy notifications are subset of 1.x feature.
> > > This was also discussed.
> > 
> > So for legacy such hardware will likely not want to use the same BAR.
> > 
> I don't follow this comment in conjunction with your below comment about offset 0.
> If we consider offset 0, legacy will use the same notification area as 1.x, right?
> So I am confused on "hardware don't want to use the same "BAR".

Never mind,

> > 
> > > > Let's just say, we are not in the position where we dictate these
> > > > things to OS vendors yet.  One of motivations of the spec is making
> > > > writing drivers easier so let's add an option for that pls.
> > > >
> > > There is no need to add multiple options at this point when the hw vendors
> > are not going to implement.
> > > When we find another vendor to implement, we can always add the new
> > method.
> > > Marvell and Nvidia both are forwarding with AQ at present proposal.
> > >
> > > > > VF has BAR for driver notifications. This BAR is used for 1.x and legacy.
> > > >
> > > > But it's the same piece of silicon - be it in PF or in VF.
> > > > I really don't see why it matters.
> > > >
> > > In same piece of silicon one needs to open yet another PCI steering entry to
> > tell that treat this for VF.
> > > This double size programming is useless.
> > >
> > > Yet again we are discussing same point as before.
> > >
> > > > > There is no need to ask vendors to build new HW to put driver
> > > > > notifications
> > > > on the PF BAR for VFs, when it already exists on the VF.
> > > > I'm talking about giving vendors an option not asking them.
> > > >
> > > Ok. Understood.
> > > When a vendor prefers to implement such cross hw forwarding it can be done.
> > > There isn't a desire to burn and program extra hw for functionality that
> > already exists on the VF.
> > > Hence, VF's doorbell on PF can be parked for the future option when one
> > actually wants to implement it.
> > 
> > I reached out to windows team to know how big a problem this is. Let's see.
> > 
> > 
> Ok. Linux didn't had multi-function driver support and infra was added.
> So even if the facility may not be there, or if the current IPR facility they may not want to use,
> 
> In future OS vendor itself can provide the new APIs.
> I certainly don't see being blocked on this.
> 
> But good to get feedback on there current state of OS.
> 
> > I have another idea meanwhile: VF already has notification capability. The only
> > issue is offset has to be queried through modern BAR.  How about we agree that
> > for legacy, we just agree that offset 0 is used?  Does not sound like a big
> > sacrifice of memory to me, and we completely avoid the new command and the
> > need to tie PF and VF.
> 
> It will not work for the SIOV which shouldn't replicate this capability (and some other cap) so many times, are you ok with it?

Yes - SIOV has both command and BAR in the PF.

> Can you explain the motivation of : why querying notification offset via the group member PF is a problem, if there is."

I tried already, I can repeat if you like:

So, I am thinking of a model of using a tiny stub driver for the member.
Control path driver is bigger as it operates AQ command, that would be
the owner driver.  E.g. for PCI this driver needs to map BAR offsets.
Then it handles all data path for this member: driver and device
notifications.  It is clean and easy on all systems assuming you know
offsets at device probe.  But getting it in software from another driver
(owner driver) is AFAIK tricky on some systems.

Generally solutions can be found, they can be more or less robust, and
if systems designers have to overcome obstacles in implementing virtio
they will just go to a competing interface as opposed to jump through
hoops and work on extending either the OS or the virtio spec.

Yes I know your sales department tells you there's no demand for this
feature on anything that is not linux/x86 and maybe arm, and maybe this
means there won't ever be either, but let's just not raise this again
can we? E.g. there was some interest from microsoft at some point,
I think there was a reorg and that project died but hey you never know.
Anyway, you asked I am trying to answer.

The cleanest way is just doing things consistently through one device.
In this case for data path it has to be the VF, so let's just make this
part simple and self contained.


> I don't see a problem with AQ that covers VF,SF/SIOV for legacy.
> 
> Proposed AQ command is cheap and covers both VF, SF/SIOV.

Well for SIOV BAR has to be the owner BAR. This was exactly the reason I
asked for this. If it's not to be I think this is my second preference:
no new command at all, and SIOV will come up with its own.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-05 13:50                           ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-05 13:50 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 05, 2023 at 01:27:04PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Monday, June 5, 2023 1:52 AM
> 
> [..]
> > > > E.g. with 1.x using VIRTIO_F_NOTIF_CONFIG_DATA - probably not.
> > > >
> > > Not really because legacy doesn't have that feature.
> > > Legacy notifications are subset of 1.x feature.
> > > This was also discussed.
> > 
> > So for legacy such hardware will likely not want to use the same BAR.
> > 
> I don't follow this comment in conjunction with your below comment about offset 0.
> If we consider offset 0, legacy will use the same notification area as 1.x, right?
> So I am confused on "hardware don't want to use the same "BAR".

Never mind,

> > 
> > > > Let's just say, we are not in the position where we dictate these
> > > > things to OS vendors yet.  One of motivations of the spec is making
> > > > writing drivers easier so let's add an option for that pls.
> > > >
> > > There is no need to add multiple options at this point when the hw vendors
> > are not going to implement.
> > > When we find another vendor to implement, we can always add the new
> > method.
> > > Marvell and Nvidia both are forwarding with AQ at present proposal.
> > >
> > > > > VF has BAR for driver notifications. This BAR is used for 1.x and legacy.
> > > >
> > > > But it's the same piece of silicon - be it in PF or in VF.
> > > > I really don't see why it matters.
> > > >
> > > In same piece of silicon one needs to open yet another PCI steering entry to
> > tell that treat this for VF.
> > > This double size programming is useless.
> > >
> > > Yet again we are discussing same point as before.
> > >
> > > > > There is no need to ask vendors to build new HW to put driver
> > > > > notifications
> > > > on the PF BAR for VFs, when it already exists on the VF.
> > > > I'm talking about giving vendors an option not asking them.
> > > >
> > > Ok. Understood.
> > > When a vendor prefers to implement such cross hw forwarding it can be done.
> > > There isn't a desire to burn and program extra hw for functionality that
> > already exists on the VF.
> > > Hence, VF's doorbell on PF can be parked for the future option when one
> > actually wants to implement it.
> > 
> > I reached out to windows team to know how big a problem this is. Let's see.
> > 
> > 
> Ok. Linux didn't had multi-function driver support and infra was added.
> So even if the facility may not be there, or if the current IPR facility they may not want to use,
> 
> In future OS vendor itself can provide the new APIs.
> I certainly don't see being blocked on this.
> 
> But good to get feedback on there current state of OS.
> 
> > I have another idea meanwhile: VF already has notification capability. The only
> > issue is offset has to be queried through modern BAR.  How about we agree that
> > for legacy, we just agree that offset 0 is used?  Does not sound like a big
> > sacrifice of memory to me, and we completely avoid the new command and the
> > need to tie PF and VF.
> 
> It will not work for the SIOV which shouldn't replicate this capability (and some other cap) so many times, are you ok with it?

Yes - SIOV has both command and BAR in the PF.

> Can you explain the motivation of : why querying notification offset via the group member PF is a problem, if there is."

I tried already, I can repeat if you like:

So, I am thinking of a model of using a tiny stub driver for the member.
Control path driver is bigger as it operates AQ command, that would be
the owner driver.  E.g. for PCI this driver needs to map BAR offsets.
Then it handles all data path for this member: driver and device
notifications.  It is clean and easy on all systems assuming you know
offsets at device probe.  But getting it in software from another driver
(owner driver) is AFAIK tricky on some systems.

Generally solutions can be found, they can be more or less robust, and
if systems designers have to overcome obstacles in implementing virtio
they will just go to a competing interface as opposed to jump through
hoops and work on extending either the OS or the virtio spec.

Yes I know your sales department tells you there's no demand for this
feature on anything that is not linux/x86 and maybe arm, and maybe this
means there won't ever be either, but let's just not raise this again
can we? E.g. there was some interest from microsoft at some point,
I think there was a reorg and that project died but hey you never know.
Anyway, you asked I am trying to answer.

The cleanest way is just doing things consistently through one device.
In this case for data path it has to be the VF, so let's just make this
part simple and self contained.


> I don't see a problem with AQ that covers VF,SF/SIOV for legacy.
> 
> Proposed AQ command is cheap and covers both VF, SF/SIOV.

Well for SIOV BAR has to be the owner BAR. This was exactly the reason I
asked for this. If it's not to be I think this is my second preference:
no new command at all, and SIOV will come up with its own.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-05 13:50                           ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-05 16:04                             ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-05 16:04 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Monday, June 5, 2023 9:50 AM

> > Can you explain the motivation of : why querying notification offset via the
> group member PF is a problem, if there is."
> 
> I tried already, I can repeat if you like:
> 
> So, I am thinking of a model of using a tiny stub driver for the member.
This is what is proposed here.

> Control path driver is bigger as it operates AQ command, that would be the
> owner driver.  E.g. for PCI this driver needs to map BAR offsets.
The bar belongs to the PCI VF and hence BAR mapping will be done by the VF tiny stub driver, aka vfio vf driver in this proposal.
And control path driver provides the AQ facility to issue the commands for register read/write.

> Then it handles all data path for this member: driver and device notifications.
> It is clean and easy on all systems assuming you know offsets at device probe.
> But getting it in software from another driver (owner driver) is AFAIK tricky on
> some systems.
> 
We can assume that systems will eventually improve as multiple OS are improving one way or another.

> Generally solutions can be found, they can be more or less robust, and if
> systems designers have to overcome obstacles in implementing virtio they will
> just go to a competing interface as opposed to jump through hoops and work on
> extending either the OS or the virtio spec.
> 

> Yes I know your sales department tells you there's no demand for this feature
> on anything that is not linux/x86 and maybe arm, and maybe this means there
> won't ever be either, but let's just not raise this again can we? E.g. there was
> some interest from microsoft at some point, I think there was a reorg and that
> project died but hey you never know.
> Anyway, you asked I am trying to answer.
> 
It is not the sales department. MS has zero virtio tc presence to show the interest.
MS has zero inbox driver to my knowledge without current feature.
Hence, the absence shows lack of interest and hence building something for them with pessimism that they will not extend is not right IMHO.

> The cleanest way is just doing things consistently through one device.
I would surely do that for all future devices which will be self-contained.
The cost of doing that for legacy is not worth the efforts.
And since we agree that read/write 4 commands are OK on the AQ, the 5th command is no exception to it.

We are not at the point of questioning the existence of 4 commands itself on AQ.

> In this case for data path it has to be the VF, so let's just make this part simple
> and self contained.
> 
So data path is on the VF to do driver notifications by the tiny stub vfio vf driver.
It queries the PF driver when it wants to use AQ facility.

> 
> > I don't see a problem with AQ that covers VF,SF/SIOV for legacy.
> >
> > Proposed AQ command is cheap and covers both VF, SF/SIOV.
> 
> Well for SIOV BAR has to be the owner BAR. This was exactly the reason I asked
> for this. If it's not to be I think this is my second preference:
> no new command at all, and SIOV will come up with its own.

So a AQ notify query command services both VF and PF.
It always returns the BAR number for the own.
A PF would have delegated the window in the PF BAR to the SF/SIOV.
And hence, this command is just fine like rest of the 4 commands.

(Linux already has SF accessing the PF dedicated BAR for more than 2 years for non virtio device).

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-05 16:04                             ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-05 16:04 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Monday, June 5, 2023 9:50 AM

> > Can you explain the motivation of : why querying notification offset via the
> group member PF is a problem, if there is."
> 
> I tried already, I can repeat if you like:
> 
> So, I am thinking of a model of using a tiny stub driver for the member.
This is what is proposed here.

> Control path driver is bigger as it operates AQ command, that would be the
> owner driver.  E.g. for PCI this driver needs to map BAR offsets.
The bar belongs to the PCI VF and hence BAR mapping will be done by the VF tiny stub driver, aka vfio vf driver in this proposal.
And control path driver provides the AQ facility to issue the commands for register read/write.

> Then it handles all data path for this member: driver and device notifications.
> It is clean and easy on all systems assuming you know offsets at device probe.
> But getting it in software from another driver (owner driver) is AFAIK tricky on
> some systems.
> 
We can assume that systems will eventually improve as multiple OS are improving one way or another.

> Generally solutions can be found, they can be more or less robust, and if
> systems designers have to overcome obstacles in implementing virtio they will
> just go to a competing interface as opposed to jump through hoops and work on
> extending either the OS or the virtio spec.
> 

> Yes I know your sales department tells you there's no demand for this feature
> on anything that is not linux/x86 and maybe arm, and maybe this means there
> won't ever be either, but let's just not raise this again can we? E.g. there was
> some interest from microsoft at some point, I think there was a reorg and that
> project died but hey you never know.
> Anyway, you asked I am trying to answer.
> 
It is not the sales department. MS has zero virtio tc presence to show the interest.
MS has zero inbox driver to my knowledge without current feature.
Hence, the absence shows lack of interest and hence building something for them with pessimism that they will not extend is not right IMHO.

> The cleanest way is just doing things consistently through one device.
I would surely do that for all future devices which will be self-contained.
The cost of doing that for legacy is not worth the efforts.
And since we agree that read/write 4 commands are OK on the AQ, the 5th command is no exception to it.

We are not at the point of questioning the existence of 4 commands itself on AQ.

> In this case for data path it has to be the VF, so let's just make this part simple
> and self contained.
> 
So data path is on the VF to do driver notifications by the tiny stub vfio vf driver.
It queries the PF driver when it wants to use AQ facility.

> 
> > I don't see a problem with AQ that covers VF,SF/SIOV for legacy.
> >
> > Proposed AQ command is cheap and covers both VF, SF/SIOV.
> 
> Well for SIOV BAR has to be the owner BAR. This was exactly the reason I asked
> for this. If it's not to be I think this is my second preference:
> no new command at all, and SIOV will come up with its own.

So a AQ notify query command services both VF and PF.
It always returns the BAR number for the own.
A PF would have delegated the window in the PF BAR to the SF/SIOV.
And hence, this command is just fine like rest of the 4 commands.

(Linux already has SF accessing the PF dedicated BAR for more than 2 years for non virtio device).

This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-05 16:04                             ` [virtio-comment] " Parav Pandit
@ 2023-06-05 21:57                               ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-05 21:57 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 05, 2023 at 04:04:57PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Monday, June 5, 2023 9:50 AM
> 
> > > Can you explain the motivation of : why querying notification offset via the
> > group member PF is a problem, if there is."
> > 
> > I tried already, I can repeat if you like:
> > 
> > So, I am thinking of a model of using a tiny stub driver for the member.
> This is what is proposed here.
> 
> > Control path driver is bigger as it operates AQ command, that would be the
> > owner driver.  E.g. for PCI this driver needs to map BAR offsets.
> The bar belongs to the PCI VF and hence BAR mapping will be done by the VF tiny stub driver, aka vfio vf driver in this proposal.
> And control path driver provides the AQ facility to issue the commands for register read/write.
> 
> > Then it handles all data path for this member: driver and device notifications.
> > It is clean and easy on all systems assuming you know offsets at device probe.
> > But getting it in software from another driver (owner driver) is AFAIK tricky on
> > some systems.
> > 
> We can assume that systems will eventually improve as multiple OS are improving one way or another.
> 
> > Generally solutions can be found, they can be more or less robust, and if
> > systems designers have to overcome obstacles in implementing virtio they will
> > just go to a competing interface as opposed to jump through hoops and work on
> > extending either the OS or the virtio spec.
> > 
> 
> > Yes I know your sales department tells you there's no demand for this feature
> > on anything that is not linux/x86 and maybe arm, and maybe this means there
> > won't ever be either, but let's just not raise this again can we? E.g. there was
> > some interest from microsoft at some point, I think there was a reorg and that
> > project died but hey you never know.
> > Anyway, you asked I am trying to answer.
> > 
> It is not the sales department. MS has zero virtio tc presence to show the interest.
> MS has zero inbox driver to my knowledge without current feature.
> Hence, the absence shows lack of interest and hence building something for them with pessimism that they will not extend is not right IMHO.
> 
> > The cleanest way is just doing things consistently through one device.
> I would surely do that for all future devices which will be self-contained.
> The cost of doing that for legacy is not worth the efforts.
> And since we agree that read/write 4 commands are OK on the AQ, the 5th command is no exception to it.
> 
> We are not at the point of questioning the existence of 4 commands itself on AQ.

Yes I think these 4 are fine.

> > In this case for data path it has to be the VF, so let's just make this part simple
> > and self contained.
> > 
> So data path is on the VF to do driver notifications by the tiny stub vfio vf driver.
> It queries the PF driver when it wants to use AQ facility.

No. The VMM talks to either PF for config space or VF for data path.

> > 
> > > I don't see a problem with AQ that covers VF,SF/SIOV for legacy.
> > >
> > > Proposed AQ command is cheap and covers both VF, SF/SIOV.
> > 
> > Well for SIOV BAR has to be the owner BAR. This was exactly the reason I asked
> > for this. If it's not to be I think this is my second preference:
> > no new command at all, and SIOV will come up with its own.
> 
> So a AQ notify query command services both VF and PF.
> It always returns the BAR number for the own.

For the owner? owner of SRIOV group is PF, not VF.

> A PF would have delegated the window in the PF BAR to the SF/SIOV.
> And hence, this command is just fine like rest of the 4 commands.

It would be fine if it could return PF BAR, but in your proposal
it can't.

> (Linux already has SF accessing the PF dedicated BAR for more than 2 years for non virtio device).


What's the point of this discussion even? You ask some questions
apparently to clarify what issue I'm trying to address.  I try to
clarify. You then turn around and say we agree, there's no issue, all of
this does not matter, case closed.  Whom do you expect to convince with
this line of reasoning? 

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-05 21:57                               ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-05 21:57 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 05, 2023 at 04:04:57PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Monday, June 5, 2023 9:50 AM
> 
> > > Can you explain the motivation of : why querying notification offset via the
> > group member PF is a problem, if there is."
> > 
> > I tried already, I can repeat if you like:
> > 
> > So, I am thinking of a model of using a tiny stub driver for the member.
> This is what is proposed here.
> 
> > Control path driver is bigger as it operates AQ command, that would be the
> > owner driver.  E.g. for PCI this driver needs to map BAR offsets.
> The bar belongs to the PCI VF and hence BAR mapping will be done by the VF tiny stub driver, aka vfio vf driver in this proposal.
> And control path driver provides the AQ facility to issue the commands for register read/write.
> 
> > Then it handles all data path for this member: driver and device notifications.
> > It is clean and easy on all systems assuming you know offsets at device probe.
> > But getting it in software from another driver (owner driver) is AFAIK tricky on
> > some systems.
> > 
> We can assume that systems will eventually improve as multiple OS are improving one way or another.
> 
> > Generally solutions can be found, they can be more or less robust, and if
> > systems designers have to overcome obstacles in implementing virtio they will
> > just go to a competing interface as opposed to jump through hoops and work on
> > extending either the OS or the virtio spec.
> > 
> 
> > Yes I know your sales department tells you there's no demand for this feature
> > on anything that is not linux/x86 and maybe arm, and maybe this means there
> > won't ever be either, but let's just not raise this again can we? E.g. there was
> > some interest from microsoft at some point, I think there was a reorg and that
> > project died but hey you never know.
> > Anyway, you asked I am trying to answer.
> > 
> It is not the sales department. MS has zero virtio tc presence to show the interest.
> MS has zero inbox driver to my knowledge without current feature.
> Hence, the absence shows lack of interest and hence building something for them with pessimism that they will not extend is not right IMHO.
> 
> > The cleanest way is just doing things consistently through one device.
> I would surely do that for all future devices which will be self-contained.
> The cost of doing that for legacy is not worth the efforts.
> And since we agree that read/write 4 commands are OK on the AQ, the 5th command is no exception to it.
> 
> We are not at the point of questioning the existence of 4 commands itself on AQ.

Yes I think these 4 are fine.

> > In this case for data path it has to be the VF, so let's just make this part simple
> > and self contained.
> > 
> So data path is on the VF to do driver notifications by the tiny stub vfio vf driver.
> It queries the PF driver when it wants to use AQ facility.

No. The VMM talks to either PF for config space or VF for data path.

> > 
> > > I don't see a problem with AQ that covers VF,SF/SIOV for legacy.
> > >
> > > Proposed AQ command is cheap and covers both VF, SF/SIOV.
> > 
> > Well for SIOV BAR has to be the owner BAR. This was exactly the reason I asked
> > for this. If it's not to be I think this is my second preference:
> > no new command at all, and SIOV will come up with its own.
> 
> So a AQ notify query command services both VF and PF.
> It always returns the BAR number for the own.

For the owner? owner of SRIOV group is PF, not VF.

> A PF would have delegated the window in the PF BAR to the SF/SIOV.
> And hence, this command is just fine like rest of the 4 commands.

It would be fine if it could return PF BAR, but in your proposal
it can't.

> (Linux already has SF accessing the PF dedicated BAR for more than 2 years for non virtio device).


What's the point of this discussion even? You ask some questions
apparently to clarify what issue I'm trying to address.  I try to
clarify. You then turn around and say we agree, there's no issue, all of
this does not matter, case closed.  Whom do you expect to convince with
this line of reasoning? 

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-05 21:57                               ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-05 22:12                                 ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-05 22:12 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: virtio-dev@lists.oasis-open.org <virtio-dev@lists.oasis-open.org> On
> Behalf Of Michael S. Tsirkin
> Sent: Monday, June 5, 2023 5:57 PM

> > I would surely do that for all future devices which will be self-contained.
> > The cost of doing that for legacy is not worth the efforts.
> > And since we agree that read/write 4 commands are OK on the AQ, the 5th
> command is no exception to it.
> >
> > We are not at the point of questioning the existence of 4 commands itself on
> AQ.
> 
> Yes I think these 4 are fine.
>
Ok. so we at least converge on it. :)
 
> No. The VMM talks to either PF for config space or VF for data path.
>
Ok. than offset 0 for notification.

> > So a AQ notify query command services both VF and PF.
> > It always returns the BAR number for the own.
> 
> For the owner? owner of SRIOV group is PF, not VF.
> 
> > A PF would have delegated the window in the PF BAR to the SF/SIOV.
> > And hence, this command is just fine like rest of the 4 commands.
> 
> It would be fine if it could return PF BAR, but in your proposal it can't.
> 
> > (Linux already has SF accessing the PF dedicated BAR for more than 2 years for
> non virtio device).
> 
> 
> What's the point of this discussion even? You ask some questions apparently to
> clarify what issue I'm trying to address.  I try to clarify. You then turn around and
> say we agree, there's no issue, all of this does not matter, case closed.  Whom
> do you expect to convince with this line of reasoning?

I really don't understand what you want to say.
What I explained above is for SF (not VF), you asked things for VF...

You suggested that tiny stub vfio driver to perform discovery of notification must be done only through the VF without explaining "why such rationale" when there is anyway VF-PF driver interaction for the AQ.

But anyway, we need to progress; since the notify offset of 0 is acceptable for legacy VF notifications as you suggest, 

I will drop the 5th notify query command for now.
And add description to use the existing notify capability of VF with notify offset of 0 for legacy q notifications. 

Rolling v4 now.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-05 22:12                                 ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-05 22:12 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: virtio-dev@lists.oasis-open.org <virtio-dev@lists.oasis-open.org> On
> Behalf Of Michael S. Tsirkin
> Sent: Monday, June 5, 2023 5:57 PM

> > I would surely do that for all future devices which will be self-contained.
> > The cost of doing that for legacy is not worth the efforts.
> > And since we agree that read/write 4 commands are OK on the AQ, the 5th
> command is no exception to it.
> >
> > We are not at the point of questioning the existence of 4 commands itself on
> AQ.
> 
> Yes I think these 4 are fine.
>
Ok. so we at least converge on it. :)
 
> No. The VMM talks to either PF for config space or VF for data path.
>
Ok. than offset 0 for notification.

> > So a AQ notify query command services both VF and PF.
> > It always returns the BAR number for the own.
> 
> For the owner? owner of SRIOV group is PF, not VF.
> 
> > A PF would have delegated the window in the PF BAR to the SF/SIOV.
> > And hence, this command is just fine like rest of the 4 commands.
> 
> It would be fine if it could return PF BAR, but in your proposal it can't.
> 
> > (Linux already has SF accessing the PF dedicated BAR for more than 2 years for
> non virtio device).
> 
> 
> What's the point of this discussion even? You ask some questions apparently to
> clarify what issue I'm trying to address.  I try to clarify. You then turn around and
> say we agree, there's no issue, all of this does not matter, case closed.  Whom
> do you expect to convince with this line of reasoning?

I really don't understand what you want to say.
What I explained above is for SF (not VF), you asked things for VF...

You suggested that tiny stub vfio driver to perform discovery of notification must be done only through the VF without explaining "why such rationale" when there is anyway VF-PF driver interaction for the AQ.

But anyway, we need to progress; since the notify offset of 0 is acceptable for legacy VF notifications as you suggest, 

I will drop the 5th notify query command for now.
And add description to use the existing notify capability of VF with notify offset of 0 for legacy q notifications. 

Rolling v4 now.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-05 22:12                                 ` [virtio-comment] " Parav Pandit
@ 2023-06-06 11:56                                   ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-06 11:56 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 05, 2023 at 10:12:59PM +0000, Parav Pandit wrote:
> Rolling v4 now.

Great thanks! I think the result will be in a good shape from
the ABI point of view. Good job!

I think so far Jason was the only one with significant comments
on the series so let's see what he says.

From my personal POV what will be left to do to get this
feature ready for merging would be

- tightening the language:
- thinking of and addressing all kind of corner cases.


Since by now from our email discussions I have I think
a decent understanding of how the feature is supposed to work
I understand how these things work but I think there are still
things that would be a bit unclear for an unprepared reader.

Just to give a random example, there's no explicit
time where the member kind of switches to the legacy/back to modern
mode. I am guessing setting DRIVER bit through legacy interface
does this. We'll want to list that.

I'll try to help find these issues and maybe even suggest wording.

I've delayed commenting on these until the high level design is agreed
on, didn't want to make you waste time on polishing as the patches
undergo significant changes, and I suggest you do the same in v4: let's
make sure there's a wide agreement on the ABI then focus on the spec
language.



-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-06 11:56                                   ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-06 11:56 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 05, 2023 at 10:12:59PM +0000, Parav Pandit wrote:
> Rolling v4 now.

Great thanks! I think the result will be in a good shape from
the ABI point of view. Good job!

I think so far Jason was the only one with significant comments
on the series so let's see what he says.

From my personal POV what will be left to do to get this
feature ready for merging would be

- tightening the language:
- thinking of and addressing all kind of corner cases.


Since by now from our email discussions I have I think
a decent understanding of how the feature is supposed to work
I understand how these things work but I think there are still
things that would be a bit unclear for an unprepared reader.

Just to give a random example, there's no explicit
time where the member kind of switches to the legacy/back to modern
mode. I am guessing setting DRIVER bit through legacy interface
does this. We'll want to list that.

I'll try to help find these issues and maybe even suggest wording.

I've delayed commenting on these until the high level design is agreed
on, didn't want to make you waste time on polishing as the patches
undergo significant changes, and I suggest you do the same in v4: let's
make sure there's a wide agreement on the ABI then focus on the spec
language.



-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-06 11:56                                   ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-06 20:15                                     ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-06 20:15 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Tuesday, June 6, 2023 7:56 AM
> 
> On Mon, Jun 05, 2023 at 10:12:59PM +0000, Parav Pandit wrote:
> > Rolling v4 now.
> 
> Great thanks! I think the result will be in a good shape from the ABI point of
> view. Good job!
> 
Thanks.

> I think so far Jason was the only one with significant comments on the series so
> let's see what he says.
> 
> From my personal POV what will be left to do to get this feature ready for
> merging would be
> 
> - tightening the language:
> - thinking of and addressing all kind of corner cases.
>
> 
> Since by now from our email discussions I have I think a decent understanding
> of how the feature is supposed to work I understand how these things work but I
> think there are still things that would be a bit unclear for an unprepared reader.
> 
Many aspects are covered in the cover letter.

> Just to give a random example, there's no explicit time where the member kind
> of switches to the legacy/back to modern mode. I am guessing setting DRIVER
> bit through legacy interface does this. We'll want to list that.
> 
Switch between the two is the same as today how a transitional device accesses both the register space.
Hypervisor level vfio tiny stub driver is not involved in such switchover as today.

> I'll try to help find these issues and maybe even suggest wording.
> 
Sure. That will be great.

> I've delayed commenting on these until the high level design is agreed on,
> didn't want to make you waste time on polishing as the patches undergo
> significant changes, and I suggest you do the same in v4: let's make sure there's
> a wide agreement on the ABI then focus on the spec language.

I agree, now that we agree on the design and ABI, lets polish above aspects you told in v4.
I posted v4.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-06 20:15                                     ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-06 20:15 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Tuesday, June 6, 2023 7:56 AM
> 
> On Mon, Jun 05, 2023 at 10:12:59PM +0000, Parav Pandit wrote:
> > Rolling v4 now.
> 
> Great thanks! I think the result will be in a good shape from the ABI point of
> view. Good job!
> 
Thanks.

> I think so far Jason was the only one with significant comments on the series so
> let's see what he says.
> 
> From my personal POV what will be left to do to get this feature ready for
> merging would be
> 
> - tightening the language:
> - thinking of and addressing all kind of corner cases.
>
> 
> Since by now from our email discussions I have I think a decent understanding
> of how the feature is supposed to work I understand how these things work but I
> think there are still things that would be a bit unclear for an unprepared reader.
> 
Many aspects are covered in the cover letter.

> Just to give a random example, there's no explicit time where the member kind
> of switches to the legacy/back to modern mode. I am guessing setting DRIVER
> bit through legacy interface does this. We'll want to list that.
> 
Switch between the two is the same as today how a transitional device accesses both the register space.
Hypervisor level vfio tiny stub driver is not involved in such switchover as today.

> I'll try to help find these issues and maybe even suggest wording.
> 
Sure. That will be great.

> I've delayed commenting on these until the high level design is agreed on,
> didn't want to make you waste time on polishing as the patches undergo
> significant changes, and I suggest you do the same in v4: let's make sure there's
> a wide agreement on the ABI then focus on the spec language.

I agree, now that we agree on the design and ABI, lets polish above aspects you told in v4.
I posted 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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-06 11:56                                   ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-07  2:27                                     ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-07  2:27 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Tue, Jun 6, 2023 at 7:56 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Mon, Jun 05, 2023 at 10:12:59PM +0000, Parav Pandit wrote:
> > Rolling v4 now.
>
> Great thanks! I think the result will be in a good shape from
> the ABI point of view. Good job!
>
> I think so far Jason was the only one with significant comments
> on the series so let's see what he says.

I can't say I like this. I prefer to do meditation on top of a modern
device with some lightweight features like _F_LEAGCY_HEADER. I don't
see any advantages of a new legacy ABI over _F_LEGACY_HEADER. I don't
want to repeat but I don't get any response here

https://lore.kernel.org/virtio-dev/CACGkMEuixsBibSq_pEQvcKOH0WBQWnta4Q2c28SV8qTS8gaVcA@mail.gmail.com/#t

>
> From my personal POV what will be left to do to get this
> feature ready for merging would be
>
> - tightening the language:
> - thinking of and addressing all kind of corner cases.

We need first to check whether it's possible (not too late) to find
all the corner cases.

Thanks

>
>
> Since by now from our email discussions I have I think
> a decent understanding of how the feature is supposed to work
> I understand how these things work but I think there are still
> things that would be a bit unclear for an unprepared reader.
>
> Just to give a random example, there's no explicit
> time where the member kind of switches to the legacy/back to modern
> mode. I am guessing setting DRIVER bit through legacy interface
> does this. We'll want to list that.
>
> I'll try to help find these issues and maybe even suggest wording.
>
> I've delayed commenting on these until the high level design is agreed
> on, didn't want to make you waste time on polishing as the patches
> undergo significant changes, and I suggest you do the same in v4: let's
> make sure there's a wide agreement on the ABI then focus on the spec
> language.
>
>
>
> --
> MST
>


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-07  2:27                                     ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-07  2:27 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Tue, Jun 6, 2023 at 7:56 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Mon, Jun 05, 2023 at 10:12:59PM +0000, Parav Pandit wrote:
> > Rolling v4 now.
>
> Great thanks! I think the result will be in a good shape from
> the ABI point of view. Good job!
>
> I think so far Jason was the only one with significant comments
> on the series so let's see what he says.

I can't say I like this. I prefer to do meditation on top of a modern
device with some lightweight features like _F_LEAGCY_HEADER. I don't
see any advantages of a new legacy ABI over _F_LEGACY_HEADER. I don't
want to repeat but I don't get any response here

https://lore.kernel.org/virtio-dev/CACGkMEuixsBibSq_pEQvcKOH0WBQWnta4Q2c28SV8qTS8gaVcA@mail.gmail.com/#t

>
> From my personal POV what will be left to do to get this
> feature ready for merging would be
>
> - tightening the language:
> - thinking of and addressing all kind of corner cases.

We need first to check whether it's possible (not too late) to find
all the corner cases.

Thanks

>
>
> Since by now from our email discussions I have I think
> a decent understanding of how the feature is supposed to work
> I understand how these things work but I think there are still
> things that would be a bit unclear for an unprepared reader.
>
> Just to give a random example, there's no explicit
> time where the member kind of switches to the legacy/back to modern
> mode. I am guessing setting DRIVER bit through legacy interface
> does this. We'll want to list that.
>
> I'll try to help find these issues and maybe even suggest wording.
>
> I've delayed commenting on these until the high level design is agreed
> on, didn't want to make you waste time on polishing as the patches
> undergo significant changes, and I suggest you do the same in v4: let's
> make sure there's a wide agreement on the ABI then focus on the spec
> language.
>
>
>
> --
> 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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-07  2:27                                     ` [virtio-comment] " Jason Wang
@ 2023-06-07  3:05                                       ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-07  3:05 UTC (permalink / raw)
  To: Jason Wang, Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, Yishai Hadas,
	Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Jason Wang <jasowang@redhat.com>
> Sent: Tuesday, June 6, 2023 10:27 PM
> 
> I can't say I like this. I prefer to do meditation on top of a modern device with
> some lightweight features like _F_LEAGCY_HEADER. I don't see any advantages
> of a new legacy ABI over _F_LEGACY_HEADER. I don't want to repeat but I don't
> get any response here
> 
It is net only and not generic. Not a big blocker.
It doesnt stop at _F_LEAGCY_HEADER.

> Anything that prevents you from adding things like VIRTIO_NET_F_LEGACY_HEADER?
It requires hypervisor to mediate 1.x config region and intercept feature negotiation including q config and more.

Additionally, 1.x device says the mac address is read only, while legacy is RW.
And that requires yet another feature bit negotiation.

The main design goal is to not mediate 1.x specific region and not modify 1.x region definitions.
Which is why we step forward with the AQ.

> https://lore.kernel.org/virtio-
> dev/CACGkMEuixsBibSq_pEQvcKOH0WBQWnta4Q2c28SV8qTS8gaVcA@mail.g
> mail.com/#t

^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-07  3:05                                       ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-07  3:05 UTC (permalink / raw)
  To: Jason Wang, Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, Yishai Hadas,
	Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Jason Wang <jasowang@redhat.com>
> Sent: Tuesday, June 6, 2023 10:27 PM
> 
> I can't say I like this. I prefer to do meditation on top of a modern device with
> some lightweight features like _F_LEAGCY_HEADER. I don't see any advantages
> of a new legacy ABI over _F_LEGACY_HEADER. I don't want to repeat but I don't
> get any response here
> 
It is net only and not generic. Not a big blocker.
It doesnt stop at _F_LEAGCY_HEADER.

> Anything that prevents you from adding things like VIRTIO_NET_F_LEGACY_HEADER?
It requires hypervisor to mediate 1.x config region and intercept feature negotiation including q config and more.

Additionally, 1.x device says the mac address is read only, while legacy is RW.
And that requires yet another feature bit negotiation.

The main design goal is to not mediate 1.x specific region and not modify 1.x region definitions.
Which is why we step forward with the AQ.

> https://lore.kernel.org/virtio-
> dev/CACGkMEuixsBibSq_pEQvcKOH0WBQWnta4Q2c28SV8qTS8gaVcA@mail.g
> mail.com/#t

^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-07  3:05                                       ` [virtio-comment] " Parav Pandit
@ 2023-06-07  6:54                                         ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-07  6:54 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Wed, Jun 7, 2023 at 11:06 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Tuesday, June 6, 2023 10:27 PM
> >
> > I can't say I like this. I prefer to do meditation on top of a modern device with
> > some lightweight features like _F_LEAGCY_HEADER. I don't see any advantages
> > of a new legacy ABI over _F_LEGACY_HEADER. I don't want to repeat but I don't
> > get any response here
> >
> It is net only and not generic. Not a big blocker.
> It doesnt stop at _F_LEAGCY_HEADER.
>
> > Anything that prevents you from adding things like VIRTIO_NET_F_LEGACY_HEADER?
> It requires hypervisor to mediate 1.x config region and intercept feature negotiation including q config and more.

For config region, do you mean device configuration space or common
config space?

I don't see why we need to do mediation on neiter of the above.
Hypervisor just need to prepare

1) legacy BAR with legacy config and device configuration space and
2) modern BAR with modern capabilities (common cfg and device cfg)

For 2) it could be mapped directly to the modern capabilities. For 1)
hypervisor needs to mediate

>
> Additionally, 1.x device says the mac address is read only, while legacy is RW.
> And that requires yet another feature bit negotiation.

Hypervisor can trap the legacy device configuration space write and
convert it to cvq commands.

Thanks

>
> The main design goal is to not mediate 1.x specific region and not modify 1.x region definitions.
> Which is why we step forward with the AQ.
>
> > https://lore.kernel.org/virtio-
> > dev/CACGkMEuixsBibSq_pEQvcKOH0WBQWnta4Q2c28SV8qTS8gaVcA@mail.g
> > mail.com/#t


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-07  6:54                                         ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-07  6:54 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Wed, Jun 7, 2023 at 11:06 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Tuesday, June 6, 2023 10:27 PM
> >
> > I can't say I like this. I prefer to do meditation on top of a modern device with
> > some lightweight features like _F_LEAGCY_HEADER. I don't see any advantages
> > of a new legacy ABI over _F_LEGACY_HEADER. I don't want to repeat but I don't
> > get any response here
> >
> It is net only and not generic. Not a big blocker.
> It doesnt stop at _F_LEAGCY_HEADER.
>
> > Anything that prevents you from adding things like VIRTIO_NET_F_LEGACY_HEADER?
> It requires hypervisor to mediate 1.x config region and intercept feature negotiation including q config and more.

For config region, do you mean device configuration space or common
config space?

I don't see why we need to do mediation on neiter of the above.
Hypervisor just need to prepare

1) legacy BAR with legacy config and device configuration space and
2) modern BAR with modern capabilities (common cfg and device cfg)

For 2) it could be mapped directly to the modern capabilities. For 1)
hypervisor needs to mediate

>
> Additionally, 1.x device says the mac address is read only, while legacy is RW.
> And that requires yet another feature bit negotiation.

Hypervisor can trap the legacy device configuration space write and
convert it to cvq commands.

Thanks

>
> The main design goal is to not mediate 1.x specific region and not modify 1.x region definitions.
> Which is why we step forward with the AQ.
>
> > https://lore.kernel.org/virtio-
> > dev/CACGkMEuixsBibSq_pEQvcKOH0WBQWnta4Q2c28SV8qTS8gaVcA@mail.g
> > mail.com/#t


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-07  6:54                                         ` [virtio-comment] " Jason Wang
@ 2023-06-07  8:54                                           ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-07  8:54 UTC (permalink / raw)
  To: Jason Wang
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Wed, Jun 07, 2023 at 02:54:22PM +0800, Jason Wang wrote:
> On Wed, Jun 7, 2023 at 11:06 AM Parav Pandit <parav@nvidia.com> wrote:
> >
> >
> >
> > > From: Jason Wang <jasowang@redhat.com>
> > > Sent: Tuesday, June 6, 2023 10:27 PM
> > >
> > > I can't say I like this. I prefer to do meditation on top of a modern device with
> > > some lightweight features like _F_LEAGCY_HEADER. I don't see any advantages
> > > of a new legacy ABI over _F_LEGACY_HEADER. I don't want to repeat but I don't
> > > get any response here
> > >
> > It is net only and not generic. Not a big blocker.
> > It doesnt stop at _F_LEAGCY_HEADER.
> >
> > > Anything that prevents you from adding things like VIRTIO_NET_F_LEGACY_HEADER?
> > It requires hypervisor to mediate 1.x config region and intercept feature negotiation including q config and more.
> 
> For config region, do you mean device configuration space or common
> config space?
> 
> I don't see why we need to do mediation on neiter of the above.
> Hypervisor just need to prepare
> 
> 1) legacy BAR with legacy config and device configuration space and
> 2) modern BAR with modern capabilities (common cfg and device cfg)
> 
> For 2) it could be mapped directly to the modern capabilities. For 1)
> hypervisor needs to mediate
> 
> >
> > Additionally, 1.x device says the mac address is read only, while legacy is RW.
> > And that requires yet another feature bit negotiation.
> 
> Hypervisor can trap the legacy device configuration space write and
> convert it to cvq commands.
> 
> Thanks

Hypervisor really can't access cvq if guest is doing it too -
that requires emulating cvq in software. And *that* is going
to be broken for workloads such as confidential computing.

> >
> > The main design goal is to not mediate 1.x specific region and not modify 1.x region definitions.
> > Which is why we step forward with the AQ.
> >
> > > https://lore.kernel.org/virtio-
> > > dev/CACGkMEuixsBibSq_pEQvcKOH0WBQWnta4Q2c28SV8qTS8gaVcA@mail.g
> > > mail.com/#t


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-07  8:54                                           ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-07  8:54 UTC (permalink / raw)
  To: Jason Wang
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Wed, Jun 07, 2023 at 02:54:22PM +0800, Jason Wang wrote:
> On Wed, Jun 7, 2023 at 11:06 AM Parav Pandit <parav@nvidia.com> wrote:
> >
> >
> >
> > > From: Jason Wang <jasowang@redhat.com>
> > > Sent: Tuesday, June 6, 2023 10:27 PM
> > >
> > > I can't say I like this. I prefer to do meditation on top of a modern device with
> > > some lightweight features like _F_LEAGCY_HEADER. I don't see any advantages
> > > of a new legacy ABI over _F_LEGACY_HEADER. I don't want to repeat but I don't
> > > get any response here
> > >
> > It is net only and not generic. Not a big blocker.
> > It doesnt stop at _F_LEAGCY_HEADER.
> >
> > > Anything that prevents you from adding things like VIRTIO_NET_F_LEGACY_HEADER?
> > It requires hypervisor to mediate 1.x config region and intercept feature negotiation including q config and more.
> 
> For config region, do you mean device configuration space or common
> config space?
> 
> I don't see why we need to do mediation on neiter of the above.
> Hypervisor just need to prepare
> 
> 1) legacy BAR with legacy config and device configuration space and
> 2) modern BAR with modern capabilities (common cfg and device cfg)
> 
> For 2) it could be mapped directly to the modern capabilities. For 1)
> hypervisor needs to mediate
> 
> >
> > Additionally, 1.x device says the mac address is read only, while legacy is RW.
> > And that requires yet another feature bit negotiation.
> 
> Hypervisor can trap the legacy device configuration space write and
> convert it to cvq commands.
> 
> Thanks

Hypervisor really can't access cvq if guest is doing it too -
that requires emulating cvq in software. And *that* is going
to be broken for workloads such as confidential computing.

> >
> > The main design goal is to not mediate 1.x specific region and not modify 1.x region definitions.
> > Which is why we step forward with the AQ.
> >
> > > https://lore.kernel.org/virtio-
> > > dev/CACGkMEuixsBibSq_pEQvcKOH0WBQWnta4Q2c28SV8qTS8gaVcA@mail.g
> > > mail.com/#t


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-07  2:27                                     ` [virtio-comment] " Jason Wang
@ 2023-06-07  8:57                                       ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-07  8:57 UTC (permalink / raw)
  To: Jason Wang
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Wed, Jun 07, 2023 at 10:27:12AM +0800, Jason Wang wrote:
> On Tue, Jun 6, 2023 at 7:56 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > On Mon, Jun 05, 2023 at 10:12:59PM +0000, Parav Pandit wrote:
> > > Rolling v4 now.
> >
> > Great thanks! I think the result will be in a good shape from
> > the ABI point of view. Good job!
> >
> > I think so far Jason was the only one with significant comments
> > on the series so let's see what he says.
> 
> I can't say I like this. I prefer to do meditation on top of a modern
> device with some lightweight features like _F_LEAGCY_HEADER. I don't
> see any advantages of a new legacy ABI over _F_LEGACY_HEADER. I don't
> want to repeat but I don't get any response here
> 
> https://lore.kernel.org/virtio-dev/CACGkMEuixsBibSq_pEQvcKOH0WBQWnta4Q2c28SV8qTS8gaVcA@mail.gmail.com/#t


After trying to write this I came away with a conviction that
if hardware vendors are prepared to implement legacy
in hardware we should let them do exactly that.


> >
> > From my personal POV what will be left to do to get this
> > feature ready for merging would be
> >
> > - tightening the language:
> > - thinking of and addressing all kind of corner cases.
> 
> We need first to check whether it's possible (not too late) to find
> all the corner cases.
> 
> Thanks

For sure, but of course we need to stop arguing about whether
to have the feature in the 1st place.

> >
> >
> > Since by now from our email discussions I have I think
> > a decent understanding of how the feature is supposed to work
> > I understand how these things work but I think there are still
> > things that would be a bit unclear for an unprepared reader.
> >
> > Just to give a random example, there's no explicit
> > time where the member kind of switches to the legacy/back to modern
> > mode. I am guessing setting DRIVER bit through legacy interface
> > does this. We'll want to list that.
> >
> > I'll try to help find these issues and maybe even suggest wording.
> >
> > I've delayed commenting on these until the high level design is agreed
> > on, didn't want to make you waste time on polishing as the patches
> > undergo significant changes, and I suggest you do the same in v4: let's
> > make sure there's a wide agreement on the ABI then focus on the spec
> > language.
> >
> >
> >
> > --
> > MST
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-07  8:57                                       ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-07  8:57 UTC (permalink / raw)
  To: Jason Wang
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Wed, Jun 07, 2023 at 10:27:12AM +0800, Jason Wang wrote:
> On Tue, Jun 6, 2023 at 7:56 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > On Mon, Jun 05, 2023 at 10:12:59PM +0000, Parav Pandit wrote:
> > > Rolling v4 now.
> >
> > Great thanks! I think the result will be in a good shape from
> > the ABI point of view. Good job!
> >
> > I think so far Jason was the only one with significant comments
> > on the series so let's see what he says.
> 
> I can't say I like this. I prefer to do meditation on top of a modern
> device with some lightweight features like _F_LEAGCY_HEADER. I don't
> see any advantages of a new legacy ABI over _F_LEGACY_HEADER. I don't
> want to repeat but I don't get any response here
> 
> https://lore.kernel.org/virtio-dev/CACGkMEuixsBibSq_pEQvcKOH0WBQWnta4Q2c28SV8qTS8gaVcA@mail.gmail.com/#t


After trying to write this I came away with a conviction that
if hardware vendors are prepared to implement legacy
in hardware we should let them do exactly that.


> >
> > From my personal POV what will be left to do to get this
> > feature ready for merging would be
> >
> > - tightening the language:
> > - thinking of and addressing all kind of corner cases.
> 
> We need first to check whether it's possible (not too late) to find
> all the corner cases.
> 
> Thanks

For sure, but of course we need to stop arguing about whether
to have the feature in the 1st place.

> >
> >
> > Since by now from our email discussions I have I think
> > a decent understanding of how the feature is supposed to work
> > I understand how these things work but I think there are still
> > things that would be a bit unclear for an unprepared reader.
> >
> > Just to give a random example, there's no explicit
> > time where the member kind of switches to the legacy/back to modern
> > mode. I am guessing setting DRIVER bit through legacy interface
> > does this. We'll want to list that.
> >
> > I'll try to help find these issues and maybe even suggest wording.
> >
> > I've delayed commenting on these until the high level design is agreed
> > on, didn't want to make you waste time on polishing as the patches
> > undergo significant changes, and I suggest you do the same in v4: let's
> > make sure there's a wide agreement on the ABI then focus on the spec
> > language.
> >
> >
> >
> > --
> > 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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-07  6:54                                         ` [virtio-comment] " Jason Wang
@ 2023-06-08 14:38                                           ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 14:38 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Jason Wang <jasowang@redhat.com>
> Sent: Wednesday, June 7, 2023 2:54 AM

> Hypervisor can trap the legacy device configuration space write and convert it
> to cvq commands.
Michael already answered that cvq is not trapped; this is the main design goal we talked several times that it is passthrough device.

So no point discussing this again.

If you have any comments on v4, please let me know.

Both the design points are addressed in v4.
1. To split to two commands for device and config area
2. Use pci cap to learn about notification region

Since this ABI reflects what we agree on,
I would want to raise for vote in coming days to be part of 1.3 in few days as we have more than 3 weeks to sort out non-ABI language part.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-08 14:38                                           ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 14:38 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Jason Wang <jasowang@redhat.com>
> Sent: Wednesday, June 7, 2023 2:54 AM

> Hypervisor can trap the legacy device configuration space write and convert it
> to cvq commands.
Michael already answered that cvq is not trapped; this is the main design goal we talked several times that it is passthrough device.

So no point discussing this again.

If you have any comments on v4, please let me know.

Both the design points are addressed in v4.
1. To split to two commands for device and config area
2. Use pci cap to learn about notification region

Since this ABI reflects what we agree on,
I would want to raise for vote in coming days to be part of 1.3 in few days as we have more than 3 weeks to sort out non-ABI language part.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-08 14:38                                           ` [virtio-comment] " Parav Pandit
@ 2023-06-08 14:44                                             ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 14:44 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 08, 2023 at 02:38:43PM +0000, Parav Pandit wrote:
> 
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Wednesday, June 7, 2023 2:54 AM
> 
> > Hypervisor can trap the legacy device configuration space write and convert it
> > to cvq commands.
> Michael already answered that cvq is not trapped; this is the main design goal we talked several times that it is passthrough device.
> 
> So no point discussing this again.
> 
> If you have any comments on v4, please let me know.
> 
> Both the design points are addressed in v4.
> 1. To split to two commands for device and config area
> 2. Use pci cap to learn about notification region
> 
> Since this ABI reflects what we agree on,
> I would want to raise for vote in coming days to be part of 1.3 in few days as we have more than 3 weeks to sort out non-ABI language part.

I think there's a bunch of work to tighten wording in v4, don't believe
it is ready for vote yet. Unfortunately I need to get ready for travel
and then travel for the kvm forum, during this time I will try but I
can't promise when I will be able to go over it in detail and send
comments. Back June 20.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-08 14:44                                             ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 14:44 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 08, 2023 at 02:38:43PM +0000, Parav Pandit wrote:
> 
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Wednesday, June 7, 2023 2:54 AM
> 
> > Hypervisor can trap the legacy device configuration space write and convert it
> > to cvq commands.
> Michael already answered that cvq is not trapped; this is the main design goal we talked several times that it is passthrough device.
> 
> So no point discussing this again.
> 
> If you have any comments on v4, please let me know.
> 
> Both the design points are addressed in v4.
> 1. To split to two commands for device and config area
> 2. Use pci cap to learn about notification region
> 
> Since this ABI reflects what we agree on,
> I would want to raise for vote in coming days to be part of 1.3 in few days as we have more than 3 weeks to sort out non-ABI language part.

I think there's a bunch of work to tighten wording in v4, don't believe
it is ready for vote yet. Unfortunately I need to get ready for travel
and then travel for the kvm forum, during this time I will try but I
can't promise when I will be able to go over it in detail and send
comments. Back June 20.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-08 14:44                                             ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-08 14:53                                               ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 14:53 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 10:44 AM
> > Since this ABI reflects what we agree on, I would want to raise for
> > vote in coming days to be part of 1.3 in few days as we have more than 3
> weeks to sort out non-ABI language part.
> 
> I think there's a bunch of work to tighten wording in v4, don't believe it is ready
> for vote yet. 
3rd patch has the conformance section.
Rest of the legacy interface semantics are just same as today.
We are not fixing the legacy interface itself, so not sure what to tighten specifically.

> Unfortunately I need to get ready for travel and then travel for the
> kvm forum, during this time I will try but I can't promise when I will be able to
> go over it in detail and send comments. Back June 20.

Ok. that will be really helpful. I will revise v5 as soon as you and others have comments.

Total line of spec line are < 200 lines including the 1st clean patch.
And changelog anyway precisely captures what changed so should not be too many reviews to me.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-08 14:53                                               ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 14:53 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 10:44 AM
> > Since this ABI reflects what we agree on, I would want to raise for
> > vote in coming days to be part of 1.3 in few days as we have more than 3
> weeks to sort out non-ABI language part.
> 
> I think there's a bunch of work to tighten wording in v4, don't believe it is ready
> for vote yet. 
3rd patch has the conformance section.
Rest of the legacy interface semantics are just same as today.
We are not fixing the legacy interface itself, so not sure what to tighten specifically.

> Unfortunately I need to get ready for travel and then travel for the
> kvm forum, during this time I will try but I can't promise when I will be able to
> go over it in detail and send comments. Back June 20.

Ok. that will be really helpful. I will revise v5 as soon as you and others have comments.

Total line of spec line are < 200 lines including the 1st clean patch.
And changelog anyway precisely captures what changed so should not be too many reviews to me.

This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-08 14:53                                               ` [virtio-comment] " Parav Pandit
@ 2023-06-08 15:03                                                 ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 15:03 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 08, 2023 at 02:53:28PM +0000, Parav Pandit wrote:
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Thursday, June 8, 2023 10:44 AM
> > > Since this ABI reflects what we agree on, I would want to raise for
> > > vote in coming days to be part of 1.3 in few days as we have more than 3
> > weeks to sort out non-ABI language part.
> > 
> > I think there's a bunch of work to tighten wording in v4, don't believe it is ready
> > for vote yet. 
> 3rd patch has the conformance section.
> Rest of the legacy interface semantics are just same as today.
> We are not fixing the legacy interface itself, so not sure what to tighten specifically.

I'll do a proper review after the forum. Generally
lots of small things. Went looking just to give you a couple of
examples:
	  too many mentions of VFs and PFs.
	  text should talk about owner and member. Minimise
	  mention of VFs to make it easier to extend to
	  different group types.

another example:
	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to support

VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.



> > Unfortunately I need to get ready for travel and then travel for the
> > kvm forum, during this time I will try but I can't promise when I will be able to
> > go over it in detail and send comments. Back June 20.
> 
> Ok. that will be really helpful. I will revise v5 as soon as you and others have comments.
> 
> Total line of spec line are < 200 lines including the 1st clean patch.
> And changelog anyway precisely captures what changed so should not be too many reviews to me.


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-08 15:03                                                 ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 15:03 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 08, 2023 at 02:53:28PM +0000, Parav Pandit wrote:
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Thursday, June 8, 2023 10:44 AM
> > > Since this ABI reflects what we agree on, I would want to raise for
> > > vote in coming days to be part of 1.3 in few days as we have more than 3
> > weeks to sort out non-ABI language part.
> > 
> > I think there's a bunch of work to tighten wording in v4, don't believe it is ready
> > for vote yet. 
> 3rd patch has the conformance section.
> Rest of the legacy interface semantics are just same as today.
> We are not fixing the legacy interface itself, so not sure what to tighten specifically.

I'll do a proper review after the forum. Generally
lots of small things. Went looking just to give you a couple of
examples:
	  too many mentions of VFs and PFs.
	  text should talk about owner and member. Minimise
	  mention of VFs to make it easier to extend to
	  different group types.

another example:
	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to support

VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.



> > Unfortunately I need to get ready for travel and then travel for the
> > kvm forum, during this time I will try but I can't promise when I will be able to
> > go over it in detail and send comments. Back June 20.
> 
> Ok. that will be really helpful. I will revise v5 as soon as you and others have comments.
> 
> Total line of spec line are < 200 lines including the 1st clean patch.
> And changelog anyway precisely captures what changed so should not be too many reviews to me.


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-08 15:03                                                 ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-08 15:16                                                   ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 15:16 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 11:04 AM
> 
> On Thu, Jun 08, 2023 at 02:53:28PM +0000, Parav Pandit wrote:
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Thursday, June 8, 2023 10:44 AM
> > > > Since this ABI reflects what we agree on, I would want to raise
> > > > for vote in coming days to be part of 1.3 in few days as we have
> > > > more than 3
> > > weeks to sort out non-ABI language part.
> > >
> > > I think there's a bunch of work to tighten wording in v4, don't
> > > believe it is ready for vote yet.
> > 3rd patch has the conformance section.
> > Rest of the legacy interface semantics are just same as today.
> > We are not fixing the legacy interface itself, so not sure what to tighten
> specifically.
> 
> I'll do a proper review after the forum. Generally lots of small things. Went
> looking just to give you a couple of
> examples:
> 	  too many mentions of VFs and PFs.
> 	  text should talk about owner and member. Minimise
> 	  mention of VFs to make it easier to extend to
> 	  different group types.
> 
True but most additions are in PCI transport chapter.
But will change to member and owner.

> another example:
> 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to
> support
> 
> VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> 
Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not right.
I will reword it.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-08 15:16                                                   ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 15:16 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 11:04 AM
> 
> On Thu, Jun 08, 2023 at 02:53:28PM +0000, Parav Pandit wrote:
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Thursday, June 8, 2023 10:44 AM
> > > > Since this ABI reflects what we agree on, I would want to raise
> > > > for vote in coming days to be part of 1.3 in few days as we have
> > > > more than 3
> > > weeks to sort out non-ABI language part.
> > >
> > > I think there's a bunch of work to tighten wording in v4, don't
> > > believe it is ready for vote yet.
> > 3rd patch has the conformance section.
> > Rest of the legacy interface semantics are just same as today.
> > We are not fixing the legacy interface itself, so not sure what to tighten
> specifically.
> 
> I'll do a proper review after the forum. Generally lots of small things. Went
> looking just to give you a couple of
> examples:
> 	  too many mentions of VFs and PFs.
> 	  text should talk about owner and member. Minimise
> 	  mention of VFs to make it easier to extend to
> 	  different group types.
> 
True but most additions are in PCI transport chapter.
But will change to member and owner.

> another example:
> 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to
> support
> 
> VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> 
Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not right.
I will reword 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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-08 15:16                                                   ` [virtio-comment] " Parav Pandit
@ 2023-06-08 18:03                                                     ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 18:03 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 08, 2023 at 03:16:02PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Thursday, June 8, 2023 11:04 AM
> > 
> > On Thu, Jun 08, 2023 at 02:53:28PM +0000, Parav Pandit wrote:
> > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > Sent: Thursday, June 8, 2023 10:44 AM
> > > > > Since this ABI reflects what we agree on, I would want to raise
> > > > > for vote in coming days to be part of 1.3 in few days as we have
> > > > > more than 3
> > > > weeks to sort out non-ABI language part.
> > > >
> > > > I think there's a bunch of work to tighten wording in v4, don't
> > > > believe it is ready for vote yet.
> > > 3rd patch has the conformance section.
> > > Rest of the legacy interface semantics are just same as today.
> > > We are not fixing the legacy interface itself, so not sure what to tighten
> > specifically.
> > 
> > I'll do a proper review after the forum. Generally lots of small things. Went
> > looking just to give you a couple of
> > examples:
> > 	  too many mentions of VFs and PFs.
> > 	  text should talk about owner and member. Minimise
> > 	  mention of VFs to make it easier to extend to
> > 	  different group types.
> > 
> True but most additions are in PCI transport chapter.
> But will change to member and owner.
> 
> > another example:
> > 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to
> > support
> > 
> > VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> > 
> Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not right.
> I will reword it.

Note that this will then apply to all VFs of this PF, even those without
legacy support. Still not sure why it's SHOULD not a MUST.
So that driver actually checks, but it's ok to fail if the rule
is not followed maybe? In that case add a driver normative statement
too.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-08 18:03                                                     ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 18:03 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 08, 2023 at 03:16:02PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Thursday, June 8, 2023 11:04 AM
> > 
> > On Thu, Jun 08, 2023 at 02:53:28PM +0000, Parav Pandit wrote:
> > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > Sent: Thursday, June 8, 2023 10:44 AM
> > > > > Since this ABI reflects what we agree on, I would want to raise
> > > > > for vote in coming days to be part of 1.3 in few days as we have
> > > > > more than 3
> > > > weeks to sort out non-ABI language part.
> > > >
> > > > I think there's a bunch of work to tighten wording in v4, don't
> > > > believe it is ready for vote yet.
> > > 3rd patch has the conformance section.
> > > Rest of the legacy interface semantics are just same as today.
> > > We are not fixing the legacy interface itself, so not sure what to tighten
> > specifically.
> > 
> > I'll do a proper review after the forum. Generally lots of small things. Went
> > looking just to give you a couple of
> > examples:
> > 	  too many mentions of VFs and PFs.
> > 	  text should talk about owner and member. Minimise
> > 	  mention of VFs to make it easier to extend to
> > 	  different group types.
> > 
> True but most additions are in PCI transport chapter.
> But will change to member and owner.
> 
> > another example:
> > 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to
> > support
> > 
> > VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> > 
> Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not right.
> I will reword it.

Note that this will then apply to all VFs of this PF, even those without
legacy support. Still not sure why it's SHOULD not a MUST.
So that driver actually checks, but it's ok to fail if the rule
is not followed maybe? In that case add a driver normative statement
too.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-08 18:03                                                     ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-08 18:11                                                       ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 18:11 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 2:03 PM
> 
> On Thu, Jun 08, 2023 at 03:16:02PM +0000, Parav Pandit wrote:
> >
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Thursday, June 8, 2023 11:04 AM
> > >
> > > On Thu, Jun 08, 2023 at 02:53:28PM +0000, Parav Pandit wrote:
> > > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > > Sent: Thursday, June 8, 2023 10:44 AM
> > > > > > Since this ABI reflects what we agree on, I would want to
> > > > > > raise for vote in coming days to be part of 1.3 in few days as
> > > > > > we have more than 3
> > > > > weeks to sort out non-ABI language part.
> > > > >
> > > > > I think there's a bunch of work to tighten wording in v4, don't
> > > > > believe it is ready for vote yet.
> > > > 3rd patch has the conformance section.
> > > > Rest of the legacy interface semantics are just same as today.
> > > > We are not fixing the legacy interface itself, so not sure what to
> > > > tighten
> > > specifically.
> > >
> > > I'll do a proper review after the forum. Generally lots of small
> > > things. Went looking just to give you a couple of
> > > examples:
> > > 	  too many mentions of VFs and PFs.
> > > 	  text should talk about owner and member. Minimise
> > > 	  mention of VFs to make it easier to extend to
> > > 	  different group types.
> > >
> > True but most additions are in PCI transport chapter.
> > But will change to member and owner.
> >
> > > another example:
> > > 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to
> > > support
> > >
> > > VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> > >
> > Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not right.
> > I will reword it.
> 
> Note that this will then apply to all VFs of this PF, even those without legacy
> support. Still not sure why it's SHOULD not a MUST.
It applies to all the VFs, but it doesn't apply without legacy.
For example, if one wants to build a PCI VF device that doesn't want to support legacy, it can still be on BAR2 or BAR 4.
This is fine.

> So that driver actually checks, but it's ok to fail if the rule is not followed
> maybe? In that case add a driver normative statement too.

Yes.
I will add.

Change log and commit log already capture this, but in case you missed it,
v4 extended the struct virtio_pci_notify_cap with a boolean and removed the AQ notify query command as you suggested.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-08 18:11                                                       ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 18:11 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 2:03 PM
> 
> On Thu, Jun 08, 2023 at 03:16:02PM +0000, Parav Pandit wrote:
> >
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Thursday, June 8, 2023 11:04 AM
> > >
> > > On Thu, Jun 08, 2023 at 02:53:28PM +0000, Parav Pandit wrote:
> > > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > > Sent: Thursday, June 8, 2023 10:44 AM
> > > > > > Since this ABI reflects what we agree on, I would want to
> > > > > > raise for vote in coming days to be part of 1.3 in few days as
> > > > > > we have more than 3
> > > > > weeks to sort out non-ABI language part.
> > > > >
> > > > > I think there's a bunch of work to tighten wording in v4, don't
> > > > > believe it is ready for vote yet.
> > > > 3rd patch has the conformance section.
> > > > Rest of the legacy interface semantics are just same as today.
> > > > We are not fixing the legacy interface itself, so not sure what to
> > > > tighten
> > > specifically.
> > >
> > > I'll do a proper review after the forum. Generally lots of small
> > > things. Went looking just to give you a couple of
> > > examples:
> > > 	  too many mentions of VFs and PFs.
> > > 	  text should talk about owner and member. Minimise
> > > 	  mention of VFs to make it easier to extend to
> > > 	  different group types.
> > >
> > True but most additions are in PCI transport chapter.
> > But will change to member and owner.
> >
> > > another example:
> > > 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to
> > > support
> > >
> > > VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> > >
> > Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not right.
> > I will reword it.
> 
> Note that this will then apply to all VFs of this PF, even those without legacy
> support. Still not sure why it's SHOULD not a MUST.
It applies to all the VFs, but it doesn't apply without legacy.
For example, if one wants to build a PCI VF device that doesn't want to support legacy, it can still be on BAR2 or BAR 4.
This is fine.

> So that driver actually checks, but it's ok to fail if the rule is not followed
> maybe? In that case add a driver normative statement too.

Yes.
I will add.

Change log and commit log already capture this, but in case you missed it,
v4 extended the struct virtio_pci_notify_cap with a boolean and removed the AQ notify query command as you suggested.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-08 15:16                                                   ` [virtio-comment] " Parav Pandit
@ 2023-06-08 18:31                                                     ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 18:31 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 08, 2023 at 03:16:02PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Thursday, June 8, 2023 11:04 AM
> > 
> > On Thu, Jun 08, 2023 at 02:53:28PM +0000, Parav Pandit wrote:
> > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > Sent: Thursday, June 8, 2023 10:44 AM
> > > > > Since this ABI reflects what we agree on, I would want to raise
> > > > > for vote in coming days to be part of 1.3 in few days as we have
> > > > > more than 3
> > > > weeks to sort out non-ABI language part.
> > > >
> > > > I think there's a bunch of work to tighten wording in v4, don't
> > > > believe it is ready for vote yet.
> > > 3rd patch has the conformance section.
> > > Rest of the legacy interface semantics are just same as today.
> > > We are not fixing the legacy interface itself, so not sure what to tighten
> > specifically.
> > 
> > I'll do a proper review after the forum. Generally lots of small things. Went
> > looking just to give you a couple of
> > examples:
> > 	  too many mentions of VFs and PFs.
> > 	  text should talk about owner and member. Minimise
> > 	  mention of VFs to make it easier to extend to
> > 	  different group types.
> > 
> True but most additions are in PCI transport chapter.
> But will change to member and owner.

Another thing that bothers me is that it references admin commands
that are defined later in the spec. I don't like it that we
are making the reader jump back and forth ...
Maybe it's better to put this in the admin command chapter.

> > another example:
> > 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to
> > support
> > 
> > VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> > 
> Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not right.
> I will reword it.

So here's an example wording, I don't insist on it exactly but
the point is to show how we should use spec terminology whereever
possible:

If an owner of an SRIOV group supports all of VIRTIO_ADMIN_CMD_LCC_REG_WRITE,
VIRTIO_ADMIN_CMD_LCC_REG_READ .... then it SHOULD NOT
expose VF BAR0 (of non 0 size) as part of its SRIOV capability;
this is to facilitate emulating IO BAR0 for the legacy interface in software.



---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-08 18:31                                                     ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 18:31 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 08, 2023 at 03:16:02PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Thursday, June 8, 2023 11:04 AM
> > 
> > On Thu, Jun 08, 2023 at 02:53:28PM +0000, Parav Pandit wrote:
> > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > Sent: Thursday, June 8, 2023 10:44 AM
> > > > > Since this ABI reflects what we agree on, I would want to raise
> > > > > for vote in coming days to be part of 1.3 in few days as we have
> > > > > more than 3
> > > > weeks to sort out non-ABI language part.
> > > >
> > > > I think there's a bunch of work to tighten wording in v4, don't
> > > > believe it is ready for vote yet.
> > > 3rd patch has the conformance section.
> > > Rest of the legacy interface semantics are just same as today.
> > > We are not fixing the legacy interface itself, so not sure what to tighten
> > specifically.
> > 
> > I'll do a proper review after the forum. Generally lots of small things. Went
> > looking just to give you a couple of
> > examples:
> > 	  too many mentions of VFs and PFs.
> > 	  text should talk about owner and member. Minimise
> > 	  mention of VFs to make it easier to extend to
> > 	  different group types.
> > 
> True but most additions are in PCI transport chapter.
> But will change to member and owner.

Another thing that bothers me is that it references admin commands
that are defined later in the spec. I don't like it that we
are making the reader jump back and forth ...
Maybe it's better to put this in the admin command chapter.

> > another example:
> > 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to
> > support
> > 
> > VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> > 
> Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not right.
> I will reword it.

So here's an example wording, I don't insist on it exactly but
the point is to show how we should use spec terminology whereever
possible:

If an owner of an SRIOV group supports all of VIRTIO_ADMIN_CMD_LCC_REG_WRITE,
VIRTIO_ADMIN_CMD_LCC_REG_READ .... then it SHOULD NOT
expose VF BAR0 (of non 0 size) as part of its SRIOV capability;
this is to facilitate emulating IO BAR0 for the legacy interface in software.



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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-02 20:36   ` [virtio-comment] " Parav Pandit
@ 2023-06-08 18:34     ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 18:34 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang, yishaih,
	maorg, virtio-comment, shahafs

On Fri, Jun 02, 2023 at 11:36:03PM +0300, Parav Pandit wrote:
> This patch 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.
> 
> 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 can be 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.
> 
> The third command suggested by Jason queries the VF device's driver
> notification region.
> 
> 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 notifications
>        |                         |
>   +----+------------+       +----+------------+
>   | +-----+         |       | 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 as native device in the host.
> 
> 3. Use it in a light weight hypervisor to run bare-metal OS.
> 
> Please review.
> 
> Fixes: https://github.com/oasis-tcs/virtio-spec/issues/167
> Signed-off-by: Parav Pandit <parav@nvidia.com>
> ---
> changelog:
> v2->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
> ---
>  admin.tex                     |  12 ++-
>  transport-pci-legacy-regs.tex | 153 ++++++++++++++++++++++++++++++++++
>  transport-pci.tex             |   2 +
>  3 files changed, 166 insertions(+), 1 deletion(-)
>  create mode 100644 transport-pci-legacy-regs.tex
> 
> diff --git a/admin.tex b/admin.tex
> index e51f9e6..5bcde98 100644
> --- a/admin.tex
> +++ b/admin.tex
> @@ -117,7 +117,17 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti
>  \hline
>  0x0001 & VIRTIO_ADMIN_CMD_LIST_USE & Provides to device list of commands used for this group type \\
>  \hline
> -0x0002 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd}    \\
> +0x0002 & VIRTIO_ADMIN_CMD_LCC_REG_WRITE & Write legacy common configuration registers of a member device    \\
> +\hline
> +0x0003 & VIRTIO_ADMIN_CMD_LCC_REG_READ & Read legacy common configuration registers of a member device    \\
> +\hline
> +0x0004 & VIRTIO_ADMIN_CMD_LD_REG_WRITE & Write legacy device registers of a member device    \\
> +\hline
> +0x0005 & VIRTIO_ADMIN_CMD_LD_REG_READ & Read legacy device registers of a member device    \\
> +\hline
> +0x0006 & VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY & Read the queue notification offset for legacy interface \\
> +\hline

Could you avoid such drastic abbreviation in command names? 
Standard things like CMD,CFG are ok, but
LCC/LD will not ring any bells for anyone, except maybe confusingly
make one think of "C Compiler" and "Link eDitor".
Let's just LEGACY_COMMON_CFG/LEGACY_DEVICE_CFG?


> +0x0007 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd}    \\
>  \hline
>  0x8000 - 0xFFFF & - & Reserved for future commands (possibly using a different structure)    \\
>  \hline
> diff --git a/transport-pci-legacy-regs.tex b/transport-pci-legacy-regs.tex
> new file mode 100644
> index 0000000..948ac73
> --- /dev/null
> +++ b/transport-pci-legacy-regs.tex
> @@ -0,0 +1,153 @@
> +\subsection{Legacy Interfaces: SR-IOV VFs Registers Access}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access}
> +
> +As described in PCIe base specification \hyperref[intro:PCIe]{[PCIe]} PCI VFs
> +do not support the I/O space BAR. A PCI VF hardware device that can support
> +legacy interfaces cannot be passthrough to the guest virtual machine
> +due to this limitation. To have a transitional virtio device in the guest
> +virtual machine, a PCI PF device as a group owner may support accessing its
> +group member PCI VF device's legacy registers using an administrative
> +virtqueue. This enables minimal intervention in the hypervisor only for
> +the purpose of legacy registers access.
> +
> +A hypervisor software accesses the legacy configuration and device specific
> +registers requested by the guest virtual machine using an administrative
> +virtqueue. Even though virtqueue driver notifications can be communicated
> +through administrative virtqueue, if the PCI PF and VF devices support such
> +notifications using a memory-mapped operation, such driver notifications
> +are sent using a device defined notification region.
> +
> +The group owner PCI PF device can optionally enable the driver to access
> +its member PCI VFs devices legacy common configuration and device configuration
> +registers using an administration virtqueue. Such a PCI PF device supports
> +the following commands:
> +
> +\begin{enumerate}
> +\item Legacy Common Configuration Registers Write Command
> +\item Legacy common Configuration Registers Read Command
> +\item Legacy Device Specific registers Write Command
> +\item Legacy Device Specific registers Read Command
> +\item Legacy Queue Notify Offset Query Command
> +\end{enumerate}
> +
> +\subsubsection{Legacy Common Configuration Registers Write Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Write Command}
> +
> +The Legacy Common Configuration Registers Write Command follows
> +\field{struct virtio_admin_cmd}.
> +This command writes legacy common configuration registers of a member VF device.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LCC_REG_WRITE.
> +
> +The command VIRTIO_ADMIN_CMD_LCC_REG_WRITE uses following structure for
> +\field{command_specific_data}:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_lcc_reg_wr_data {
> +	u8 offset; /* Starting byte offset of the common configuration register(s) to write */
> +	u8 register[];
> +};
> +\end{lstlisting}
> +
> +This command does not have any command specific result.
> +
> +\subsubsection{Legacy Common Configuration Registers Read Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Read Command}
> +
> +The Legacy Common Configuration Registers Read Command follows \field{struct virtio_admin_cmd}.
> +This command reads legacy common configuration registers of a member VF device.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LCC_REG_READ.
> +
> +The command VIRTIO_ADMIN_CMD_LCC_REG_READ uses following listed structure for
> +\field{command_specific_data}:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_lcc_reg_rd_data {
> +	u8 offset; /* Starting byte offset of the register to read */
> +};
> +\end{lstlisting}
> +
> +When command completes successfully, \field{command_specific_result}
> +uses following listed structure:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_lcc_reg_rd_result {
> +	u8 registers[];
> +};
> +\end{lstlisting}
> +
> +
> +\subsubsection{Legacy Device Registers Write Command}\label{sec:Virtio Transport
> +Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Device Registers Write Command}
> +
> +The Legacy Device Registers Write Command follows \field{struct virtio_admin_cmd}.
> +This command writes legacy device registers of a member VF device.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LD_REG_WRITE.
> +
> +The command VIRTIO_ADMIN_CMD_LD_REG_WRITE 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 register(s) to write */
> +	u8 register[];
> +};
> +\end{lstlisting}
> +
> +This command does not have any command specific result.
> +
> +\subsubsection{Legacy Device Registers Read Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Read Command}
> +
> +The Legacy Device Registers Read Command follows \field{struct virtio_admin_cmd}.
> +This command reads legacy device specific registers of a member VF device.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LD_REG_READ.
> +
> +The command VIRTIO_ADMIN_CMD_LD_REG_READ uses following listed structure for
> +\field{command_specific_data}:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_ld_reg_rd_data {
> +	u8 offset; /* Starting byte offset of the register to read */
> +};
> +\end{lstlisting}
> +
> +When command completes successfully, \field{command_specific_result}
> +uses following listed structure:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_ld_reg_rd_result {
> +	u8 registers[];
> +};
> +\end{lstlisting}
> +
> +\subsubsection{Legacy Queue Notify Offset Query Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Queue Notify Offset Query Command}
> +
> +This command returns the notify offset of the member VF for virtqueue
> +driver notifications. This command follows \field{struct virtio_admin_cmd}.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY.
> +There is no command specific data for this command.
> +
> +When command completes successfully, \field{command_specific_result}
> +uses following listed structure:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_lq_notify_query_result {
> +	u8 bar; /* PCI BAR number of the member VF */
> +	u8 reserved[7];
> +	le64 offset; /* Byte offset within the BAR */
> +};
> +\end{lstlisting}
> +
> +The driver that may use the driver notifications region of the VF device
> +returned in this result likely attain higher performance or the drier may use
> +the VIRTIO_ADMIN_CMD_LREG_WRITE command.
> +
> +\begin{note}
> +The device and driver must encode and decode legacy device specific registers
> +using little endian format. Per PCI VF device level big endian format support
> +is left for the future.
> +\end{note}
> +
> +\begin{note}
> +The PCI VF device should not use PCI BAR 0 when it prefers to support
> +legacy interface registers access using its group owner PF. This enables
> +hypervisor software to operate with least complexities to compose a legacy
> +interface I/O space BAR and passthrough other PCI BARs and PCI device
> +capabilities to the guest virtual machine without any translation.
> +\end{note}
> diff --git a/transport-pci.tex b/transport-pci.tex
> index a5c6719..72c78f6 100644
> --- a/transport-pci.tex
> +++ b/transport-pci.tex
> @@ -1212,3 +1212,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}
> -- 
> 2.26.2


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-08 18:34     ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 18:34 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang, yishaih,
	maorg, virtio-comment, shahafs

On Fri, Jun 02, 2023 at 11:36:03PM +0300, Parav Pandit wrote:
> This patch 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.
> 
> 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 can be 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.
> 
> The third command suggested by Jason queries the VF device's driver
> notification region.
> 
> 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 notifications
>        |                         |
>   +----+------------+       +----+------------+
>   | +-----+         |       | 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 as native device in the host.
> 
> 3. Use it in a light weight hypervisor to run bare-metal OS.
> 
> Please review.
> 
> Fixes: https://github.com/oasis-tcs/virtio-spec/issues/167
> Signed-off-by: Parav Pandit <parav@nvidia.com>
> ---
> changelog:
> v2->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
> ---
>  admin.tex                     |  12 ++-
>  transport-pci-legacy-regs.tex | 153 ++++++++++++++++++++++++++++++++++
>  transport-pci.tex             |   2 +
>  3 files changed, 166 insertions(+), 1 deletion(-)
>  create mode 100644 transport-pci-legacy-regs.tex
> 
> diff --git a/admin.tex b/admin.tex
> index e51f9e6..5bcde98 100644
> --- a/admin.tex
> +++ b/admin.tex
> @@ -117,7 +117,17 @@ \subsection{Group administration commands}\label{sec:Basic Facilities of a Virti
>  \hline
>  0x0001 & VIRTIO_ADMIN_CMD_LIST_USE & Provides to device list of commands used for this group type \\
>  \hline
> -0x0002 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd}    \\
> +0x0002 & VIRTIO_ADMIN_CMD_LCC_REG_WRITE & Write legacy common configuration registers of a member device    \\
> +\hline
> +0x0003 & VIRTIO_ADMIN_CMD_LCC_REG_READ & Read legacy common configuration registers of a member device    \\
> +\hline
> +0x0004 & VIRTIO_ADMIN_CMD_LD_REG_WRITE & Write legacy device registers of a member device    \\
> +\hline
> +0x0005 & VIRTIO_ADMIN_CMD_LD_REG_READ & Read legacy device registers of a member device    \\
> +\hline
> +0x0006 & VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY & Read the queue notification offset for legacy interface \\
> +\hline

Could you avoid such drastic abbreviation in command names? 
Standard things like CMD,CFG are ok, but
LCC/LD will not ring any bells for anyone, except maybe confusingly
make one think of "C Compiler" and "Link eDitor".
Let's just LEGACY_COMMON_CFG/LEGACY_DEVICE_CFG?


> +0x0007 - 0x7FFF & - & Commands using \field{struct virtio_admin_cmd}    \\
>  \hline
>  0x8000 - 0xFFFF & - & Reserved for future commands (possibly using a different structure)    \\
>  \hline
> diff --git a/transport-pci-legacy-regs.tex b/transport-pci-legacy-regs.tex
> new file mode 100644
> index 0000000..948ac73
> --- /dev/null
> +++ b/transport-pci-legacy-regs.tex
> @@ -0,0 +1,153 @@
> +\subsection{Legacy Interfaces: SR-IOV VFs Registers Access}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access}
> +
> +As described in PCIe base specification \hyperref[intro:PCIe]{[PCIe]} PCI VFs
> +do not support the I/O space BAR. A PCI VF hardware device that can support
> +legacy interfaces cannot be passthrough to the guest virtual machine
> +due to this limitation. To have a transitional virtio device in the guest
> +virtual machine, a PCI PF device as a group owner may support accessing its
> +group member PCI VF device's legacy registers using an administrative
> +virtqueue. This enables minimal intervention in the hypervisor only for
> +the purpose of legacy registers access.
> +
> +A hypervisor software accesses the legacy configuration and device specific
> +registers requested by the guest virtual machine using an administrative
> +virtqueue. Even though virtqueue driver notifications can be communicated
> +through administrative virtqueue, if the PCI PF and VF devices support such
> +notifications using a memory-mapped operation, such driver notifications
> +are sent using a device defined notification region.
> +
> +The group owner PCI PF device can optionally enable the driver to access
> +its member PCI VFs devices legacy common configuration and device configuration
> +registers using an administration virtqueue. Such a PCI PF device supports
> +the following commands:
> +
> +\begin{enumerate}
> +\item Legacy Common Configuration Registers Write Command
> +\item Legacy common Configuration Registers Read Command
> +\item Legacy Device Specific registers Write Command
> +\item Legacy Device Specific registers Read Command
> +\item Legacy Queue Notify Offset Query Command
> +\end{enumerate}
> +
> +\subsubsection{Legacy Common Configuration Registers Write Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Write Command}
> +
> +The Legacy Common Configuration Registers Write Command follows
> +\field{struct virtio_admin_cmd}.
> +This command writes legacy common configuration registers of a member VF device.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LCC_REG_WRITE.
> +
> +The command VIRTIO_ADMIN_CMD_LCC_REG_WRITE uses following structure for
> +\field{command_specific_data}:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_lcc_reg_wr_data {
> +	u8 offset; /* Starting byte offset of the common configuration register(s) to write */
> +	u8 register[];
> +};
> +\end{lstlisting}
> +
> +This command does not have any command specific result.
> +
> +\subsubsection{Legacy Common Configuration Registers Read Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Read Command}
> +
> +The Legacy Common Configuration Registers Read Command follows \field{struct virtio_admin_cmd}.
> +This command reads legacy common configuration registers of a member VF device.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LCC_REG_READ.
> +
> +The command VIRTIO_ADMIN_CMD_LCC_REG_READ uses following listed structure for
> +\field{command_specific_data}:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_lcc_reg_rd_data {
> +	u8 offset; /* Starting byte offset of the register to read */
> +};
> +\end{lstlisting}
> +
> +When command completes successfully, \field{command_specific_result}
> +uses following listed structure:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_lcc_reg_rd_result {
> +	u8 registers[];
> +};
> +\end{lstlisting}
> +
> +
> +\subsubsection{Legacy Device Registers Write Command}\label{sec:Virtio Transport
> +Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Device Registers Write Command}
> +
> +The Legacy Device Registers Write Command follows \field{struct virtio_admin_cmd}.
> +This command writes legacy device registers of a member VF device.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LD_REG_WRITE.
> +
> +The command VIRTIO_ADMIN_CMD_LD_REG_WRITE 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 register(s) to write */
> +	u8 register[];
> +};
> +\end{lstlisting}
> +
> +This command does not have any command specific result.
> +
> +\subsubsection{Legacy Device Registers Read Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Common Configuration Registers Read Command}
> +
> +The Legacy Device Registers Read Command follows \field{struct virtio_admin_cmd}.
> +This command reads legacy device specific registers of a member VF device.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LD_REG_READ.
> +
> +The command VIRTIO_ADMIN_CMD_LD_REG_READ uses following listed structure for
> +\field{command_specific_data}:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_ld_reg_rd_data {
> +	u8 offset; /* Starting byte offset of the register to read */
> +};
> +\end{lstlisting}
> +
> +When command completes successfully, \field{command_specific_result}
> +uses following listed structure:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_ld_reg_rd_result {
> +	u8 registers[];
> +};
> +\end{lstlisting}
> +
> +\subsubsection{Legacy Queue Notify Offset Query Command}\label{sec:Virtio Transport Options / Virtio Over PCI Bus / Legacy Interfaces: SR-IOV VFs Registers Access / Legacy Queue Notify Offset Query Command}
> +
> +This command returns the notify offset of the member VF for virtqueue
> +driver notifications. This command follows \field{struct virtio_admin_cmd}.
> +The driver sets command \field{opcode} to VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY.
> +There is no command specific data for this command.
> +
> +When command completes successfully, \field{command_specific_result}
> +uses following listed structure:
> +
> +\begin{lstlisting}
> +struct virtio_admin_cmd_lq_notify_query_result {
> +	u8 bar; /* PCI BAR number of the member VF */
> +	u8 reserved[7];
> +	le64 offset; /* Byte offset within the BAR */
> +};
> +\end{lstlisting}
> +
> +The driver that may use the driver notifications region of the VF device
> +returned in this result likely attain higher performance or the drier may use
> +the VIRTIO_ADMIN_CMD_LREG_WRITE command.
> +
> +\begin{note}
> +The device and driver must encode and decode legacy device specific registers
> +using little endian format. Per PCI VF device level big endian format support
> +is left for the future.
> +\end{note}
> +
> +\begin{note}
> +The PCI VF device should not use PCI BAR 0 when it prefers to support
> +legacy interface registers access using its group owner PF. This enables
> +hypervisor software to operate with least complexities to compose a legacy
> +interface I/O space BAR and passthrough other PCI BARs and PCI device
> +capabilities to the guest virtual machine without any translation.
> +\end{note}
> diff --git a/transport-pci.tex b/transport-pci.tex
> index a5c6719..72c78f6 100644
> --- a/transport-pci.tex
> +++ b/transport-pci.tex
> @@ -1212,3 +1212,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}
> -- 
> 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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-08 18:34     ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-08 18:55       ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 18:55 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 2:34 PM

> > +0x0003 & VIRTIO_ADMIN_CMD_LCC_REG_READ & Read legacy common
> configuration registers of a member device    \\
> > +\hline
> > +0x0004 & VIRTIO_ADMIN_CMD_LD_REG_WRITE & Write legacy device
> registers of a member device    \\
> > +\hline
> > +0x0005 & VIRTIO_ADMIN_CMD_LD_REG_READ & Read legacy device
> registers of a member device    \\
> > +\hline
> > +0x0006 & VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY & Read the queue
> > +notification offset for legacy interface \\ \hline
> 
> Could you avoid such drastic abbreviation in command names?
> Standard things like CMD,CFG are ok, but LCC/LD will not ring any bells for
> anyone, except maybe confusingly make one think of "C Compiler" and "Link
> eDitor".
> Let's just LEGACY_COMMON_CFG/LEGACY_DEVICE_CFG?
> 
It looked too long before abbreviating it.
Will change.

VIRTIO_ADMIN_CMD_LEGACY_COMMON_REG_READ 
VIRTIO_ADMIN_CMD_LEGACY_DEV_REG_READ

^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-08 18:55       ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 18:55 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 2:34 PM

> > +0x0003 & VIRTIO_ADMIN_CMD_LCC_REG_READ & Read legacy common
> configuration registers of a member device    \\
> > +\hline
> > +0x0004 & VIRTIO_ADMIN_CMD_LD_REG_WRITE & Write legacy device
> registers of a member device    \\
> > +\hline
> > +0x0005 & VIRTIO_ADMIN_CMD_LD_REG_READ & Read legacy device
> registers of a member device    \\
> > +\hline
> > +0x0006 & VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY & Read the queue
> > +notification offset for legacy interface \\ \hline
> 
> Could you avoid such drastic abbreviation in command names?
> Standard things like CMD,CFG are ok, but LCC/LD will not ring any bells for
> anyone, except maybe confusingly make one think of "C Compiler" and "Link
> eDitor".
> Let's just LEGACY_COMMON_CFG/LEGACY_DEVICE_CFG?
> 
It looked too long before abbreviating it.
Will change.

VIRTIO_ADMIN_CMD_LEGACY_COMMON_REG_READ 
VIRTIO_ADMIN_CMD_LEGACY_DEV_REG_READ

^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-08 18:31                                                     ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-08 19:00                                                       ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 19:00 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 2:31 PM

> > > I'll do a proper review after the forum. Generally lots of small
> > > things. Went looking just to give you a couple of
> > > examples:
> > > 	  too many mentions of VFs and PFs.
> > > 	  text should talk about owner and member. Minimise
> > > 	  mention of VFs to make it easier to extend to
> > > 	  different group types.
> > >
> > True but most additions are in PCI transport chapter.
> > But will change to member and owner.
> 
> Another thing that bothers me is that it references admin commands that are
> defined later in the spec. I don't like it that we are making the reader jump back
> and forth ...
> Maybe it's better to put this in the admin command chapter.
> 
I considered that before.
In its current form, there is very less back-n-forth jump.
This is because admin chapter mostly enumerates the opcode.

And PCI legacy chapter talks about rest of the theory and command details.

When/if we have more transports for this, probably a generic place will be suitable.

Moving now to admin will surely have more back-n-forth as it needs to talk about PCI part and that PCI part will reside in PCI section.

> > > another example:
> > > 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to
> > > support
> > >
> > > VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> > >
> > Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not right.
> > I will reword it.
> 
> So here's an example wording, I don't insist on it exactly but the point is to show
> how we should use spec terminology whereever
> possible:
> 
> If an owner of an SRIOV group supports all of
> VIRTIO_ADMIN_CMD_LCC_REG_WRITE,
> VIRTIO_ADMIN_CMD_LCC_REG_READ .... then it SHOULD NOT expose VF BAR0
> (of non 0 size) as part of its SRIOV capability; this is to facilitate emulating IO
> BAR0 for the legacy interface in software.
> 
Yes good one. Will use.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-08 19:00                                                       ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 19:00 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 2:31 PM

> > > I'll do a proper review after the forum. Generally lots of small
> > > things. Went looking just to give you a couple of
> > > examples:
> > > 	  too many mentions of VFs and PFs.
> > > 	  text should talk about owner and member. Minimise
> > > 	  mention of VFs to make it easier to extend to
> > > 	  different group types.
> > >
> > True but most additions are in PCI transport chapter.
> > But will change to member and owner.
> 
> Another thing that bothers me is that it references admin commands that are
> defined later in the spec. I don't like it that we are making the reader jump back
> and forth ...
> Maybe it's better to put this in the admin command chapter.
> 
I considered that before.
In its current form, there is very less back-n-forth jump.
This is because admin chapter mostly enumerates the opcode.

And PCI legacy chapter talks about rest of the theory and command details.

When/if we have more transports for this, probably a generic place will be suitable.

Moving now to admin will surely have more back-n-forth as it needs to talk about PCI part and that PCI part will reside in PCI section.

> > > another example:
> > > 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to
> > > support
> > >
> > > VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> > >
> > Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not right.
> > I will reword it.
> 
> So here's an example wording, I don't insist on it exactly but the point is to show
> how we should use spec terminology whereever
> possible:
> 
> If an owner of an SRIOV group supports all of
> VIRTIO_ADMIN_CMD_LCC_REG_WRITE,
> VIRTIO_ADMIN_CMD_LCC_REG_READ .... then it SHOULD NOT expose VF BAR0
> (of non 0 size) as part of its SRIOV capability; this is to facilitate emulating IO
> BAR0 for the legacy interface in software.
> 
Yes good one. Will use.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-08 18:55       ` [virtio-comment] " Parav Pandit
@ 2023-06-08 19:00         ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 19:00 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 08, 2023 at 06:55:29PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Thursday, June 8, 2023 2:34 PM
> 
> > > +0x0003 & VIRTIO_ADMIN_CMD_LCC_REG_READ & Read legacy common
> > configuration registers of a member device    \\
> > > +\hline
> > > +0x0004 & VIRTIO_ADMIN_CMD_LD_REG_WRITE & Write legacy device
> > registers of a member device    \\
> > > +\hline
> > > +0x0005 & VIRTIO_ADMIN_CMD_LD_REG_READ & Read legacy device
> > registers of a member device    \\
> > > +\hline
> > > +0x0006 & VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY & Read the queue
> > > +notification offset for legacy interface \\ \hline
> > 
> > Could you avoid such drastic abbreviation in command names?
> > Standard things like CMD,CFG are ok, but LCC/LD will not ring any bells for
> > anyone, except maybe confusingly make one think of "C Compiler" and "Link
> > eDitor".
> > Let's just LEGACY_COMMON_CFG/LEGACY_DEVICE_CFG?
> > 
> It looked too long before abbreviating it.
> Will change.
> 
> VIRTIO_ADMIN_CMD_LEGACY_COMMON_REG_READ 
> VIRTIO_ADMIN_CMD_LEGACY_DEV_REG_READ

I think you can drop _REG_ that does not really add any value
and does not match anything in the spec.  _CFG_ would make sense spec calls
this common configuration and device configuration.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-08 19:00         ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 19:00 UTC (permalink / raw)
  To: Parav Pandit
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 08, 2023 at 06:55:29PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Thursday, June 8, 2023 2:34 PM
> 
> > > +0x0003 & VIRTIO_ADMIN_CMD_LCC_REG_READ & Read legacy common
> > configuration registers of a member device    \\
> > > +\hline
> > > +0x0004 & VIRTIO_ADMIN_CMD_LD_REG_WRITE & Write legacy device
> > registers of a member device    \\
> > > +\hline
> > > +0x0005 & VIRTIO_ADMIN_CMD_LD_REG_READ & Read legacy device
> > registers of a member device    \\
> > > +\hline
> > > +0x0006 & VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY & Read the queue
> > > +notification offset for legacy interface \\ \hline
> > 
> > Could you avoid such drastic abbreviation in command names?
> > Standard things like CMD,CFG are ok, but LCC/LD will not ring any bells for
> > anyone, except maybe confusingly make one think of "C Compiler" and "Link
> > eDitor".
> > Let's just LEGACY_COMMON_CFG/LEGACY_DEVICE_CFG?
> > 
> It looked too long before abbreviating it.
> Will change.
> 
> VIRTIO_ADMIN_CMD_LEGACY_COMMON_REG_READ 
> VIRTIO_ADMIN_CMD_LEGACY_DEV_REG_READ

I think you can drop _REG_ that does not really add any value
and does not match anything in the spec.  _CFG_ would make sense spec calls
this common configuration and device configuration.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-08 19:00                                                       ` [virtio-comment] " Parav Pandit
@ 2023-06-08 19:03                                                         ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 19:03 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 08, 2023 at 07:00:32PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Thursday, June 8, 2023 2:31 PM
> 
> > > > I'll do a proper review after the forum. Generally lots of small
> > > > things. Went looking just to give you a couple of
> > > > examples:
> > > > 	  too many mentions of VFs and PFs.
> > > > 	  text should talk about owner and member. Minimise
> > > > 	  mention of VFs to make it easier to extend to
> > > > 	  different group types.
> > > >
> > > True but most additions are in PCI transport chapter.
> > > But will change to member and owner.
> > 
> > Another thing that bothers me is that it references admin commands that are
> > defined later in the spec. I don't like it that we are making the reader jump back
> > and forth ...
> > Maybe it's better to put this in the admin command chapter.
> > 
> I considered that before.
> In its current form, there is very less back-n-forth jump.
> This is because admin chapter mostly enumerates the opcode.
> 
> And PCI legacy chapter talks about rest of the theory and command details.
> 
> When/if we have more transports for this, probably a generic place will be suitable.
> 
> Moving now to admin will surely have more back-n-forth as it needs to talk about PCI part and that PCI part will reside in PCI section.

well the point is that it's *back" not *forth*.
IOW add the command description in admin chapter,
make it point to legacy description in pci chapter which reader has
already read.

> > > > another example:
> > > > 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to
> > > > support
> > > >
> > > > VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> > > >
> > > Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not right.
> > > I will reword it.
> > 
> > So here's an example wording, I don't insist on it exactly but the point is to show
> > how we should use spec terminology whereever
> > possible:
> > 
> > If an owner of an SRIOV group supports all of
> > VIRTIO_ADMIN_CMD_LCC_REG_WRITE,
> > VIRTIO_ADMIN_CMD_LCC_REG_READ .... then it SHOULD NOT expose VF BAR0
> > (of non 0 size) as part of its SRIOV capability; this is to facilitate emulating IO
> > BAR0 for the legacy interface in software.
> > 
> Yes good one. Will use.

right and my point is try to word all of it like this.


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-08 19:03                                                         ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-08 19:03 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 08, 2023 at 07:00:32PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Thursday, June 8, 2023 2:31 PM
> 
> > > > I'll do a proper review after the forum. Generally lots of small
> > > > things. Went looking just to give you a couple of
> > > > examples:
> > > > 	  too many mentions of VFs and PFs.
> > > > 	  text should talk about owner and member. Minimise
> > > > 	  mention of VFs to make it easier to extend to
> > > > 	  different group types.
> > > >
> > > True but most additions are in PCI transport chapter.
> > > But will change to member and owner.
> > 
> > Another thing that bothers me is that it references admin commands that are
> > defined later in the spec. I don't like it that we are making the reader jump back
> > and forth ...
> > Maybe it's better to put this in the admin command chapter.
> > 
> I considered that before.
> In its current form, there is very less back-n-forth jump.
> This is because admin chapter mostly enumerates the opcode.
> 
> And PCI legacy chapter talks about rest of the theory and command details.
> 
> When/if we have more transports for this, probably a generic place will be suitable.
> 
> Moving now to admin will surely have more back-n-forth as it needs to talk about PCI part and that PCI part will reside in PCI section.

well the point is that it's *back" not *forth*.
IOW add the command description in admin chapter,
make it point to legacy description in pci chapter which reader has
already read.

> > > > another example:
> > > > 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers to
> > > > support
> > > >
> > > > VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> > > >
> > > Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not right.
> > > I will reword it.
> > 
> > So here's an example wording, I don't insist on it exactly but the point is to show
> > how we should use spec terminology whereever
> > possible:
> > 
> > If an owner of an SRIOV group supports all of
> > VIRTIO_ADMIN_CMD_LCC_REG_WRITE,
> > VIRTIO_ADMIN_CMD_LCC_REG_READ .... then it SHOULD NOT expose VF BAR0
> > (of non 0 size) as part of its SRIOV capability; this is to facilitate emulating IO
> > BAR0 for the legacy interface in software.
> > 
> Yes good one. Will use.

right and my point is try to word all of it like this.


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
  2023-06-08 19:00         ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-08 19:04           ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 19:04 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 3:01 PM
> 
> On Thu, Jun 08, 2023 at 06:55:29PM +0000, Parav Pandit wrote:
> >
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Thursday, June 8, 2023 2:34 PM
> >
> > > > +0x0003 & VIRTIO_ADMIN_CMD_LCC_REG_READ & Read legacy
> common
> > > configuration registers of a member device    \\
> > > > +\hline
> > > > +0x0004 & VIRTIO_ADMIN_CMD_LD_REG_WRITE & Write legacy device
> > > registers of a member device    \\
> > > > +\hline
> > > > +0x0005 & VIRTIO_ADMIN_CMD_LD_REG_READ & Read legacy device
> > > registers of a member device    \\
> > > > +\hline
> > > > +0x0006 & VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY & Read the queue
> > > > +notification offset for legacy interface \\ \hline
> > >
> > > Could you avoid such drastic abbreviation in command names?
> > > Standard things like CMD,CFG are ok, but LCC/LD will not ring any
> > > bells for anyone, except maybe confusingly make one think of "C
> > > Compiler" and "Link eDitor".
> > > Let's just LEGACY_COMMON_CFG/LEGACY_DEVICE_CFG?
> > >
> > It looked too long before abbreviating it.
> > Will change.
> >
> > VIRTIO_ADMIN_CMD_LEGACY_COMMON_REG_READ
> > VIRTIO_ADMIN_CMD_LEGACY_DEV_REG_READ
> 
> I think you can drop _REG_ that does not really add any value and does not
> match anything in the spec.  _CFG_ would make sense spec calls this common
> configuration and device configuration.

Ok.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands
@ 2023-06-08 19:04           ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 19:04 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, jasowang,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 3:01 PM
> 
> On Thu, Jun 08, 2023 at 06:55:29PM +0000, Parav Pandit wrote:
> >
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Thursday, June 8, 2023 2:34 PM
> >
> > > > +0x0003 & VIRTIO_ADMIN_CMD_LCC_REG_READ & Read legacy
> common
> > > configuration registers of a member device    \\
> > > > +\hline
> > > > +0x0004 & VIRTIO_ADMIN_CMD_LD_REG_WRITE & Write legacy device
> > > registers of a member device    \\
> > > > +\hline
> > > > +0x0005 & VIRTIO_ADMIN_CMD_LD_REG_READ & Read legacy device
> > > registers of a member device    \\
> > > > +\hline
> > > > +0x0006 & VIRTIO_ADMIN_CMD_LQ_NOTIFY_QUERY & Read the queue
> > > > +notification offset for legacy interface \\ \hline
> > >
> > > Could you avoid such drastic abbreviation in command names?
> > > Standard things like CMD,CFG are ok, but LCC/LD will not ring any
> > > bells for anyone, except maybe confusingly make one think of "C
> > > Compiler" and "Link eDitor".
> > > Let's just LEGACY_COMMON_CFG/LEGACY_DEVICE_CFG?
> > >
> > It looked too long before abbreviating it.
> > Will change.
> >
> > VIRTIO_ADMIN_CMD_LEGACY_COMMON_REG_READ
> > VIRTIO_ADMIN_CMD_LEGACY_DEV_REG_READ
> 
> I think you can drop _REG_ that does not really add any value and does not
> match anything in the spec.  _CFG_ would make sense spec calls this common
> configuration and device configuration.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-08 19:03                                                         ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-08 19:12                                                           ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 19:12 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 3:04 PM

> > Moving now to admin will surely have more back-n-forth as it needs to talk
> about PCI part and that PCI part will reside in PCI section.
> 
> well the point is that it's *back" not *forth*.
> IOW add the command description in admin chapter, make it point to legacy
> description in pci chapter which reader has already read.
> 
There is no back-n forth today. Reader interested only reads the pci chapter.
Only to know the opcode value in a common table it reads the admin chapter.

Putting command descriptions in the "basic facilities" without referring to transport will create back-n-forth, where reader needs to go to PCI chapter to understand the motivation.
Come and to basic facilities and implement it.

When there are too many things common across all transports and very little changing across transport, placement in common place results in better reading.
I find the opposite here.

> > > > > another example:
> > > > > 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers
> > > > > to support
> > > > >
> > > > > VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> > > > >
> > > > Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not
> right.
> > > > I will reword it.
> > >
> > > So here's an example wording, I don't insist on it exactly but the
> > > point is to show how we should use spec terminology whereever
> > > possible:
> > >
> > > If an owner of an SRIOV group supports all of
> > > VIRTIO_ADMIN_CMD_LCC_REG_WRITE,
> VIRTIO_ADMIN_CMD_LCC_REG_READ ....
> > > then it SHOULD NOT expose VF BAR0 (of non 0 size) as part of its
> > > SRIOV capability; this is to facilitate emulating IO
> > > BAR0 for the legacy interface in software.
> > >
> > Yes good one. Will use.
> 
> right and my point is try to word all of it like this.
Yes, as owner and group.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-08 19:12                                                           ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-08 19:12 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, June 8, 2023 3:04 PM

> > Moving now to admin will surely have more back-n-forth as it needs to talk
> about PCI part and that PCI part will reside in PCI section.
> 
> well the point is that it's *back" not *forth*.
> IOW add the command description in admin chapter, make it point to legacy
> description in pci chapter which reader has already read.
> 
There is no back-n forth today. Reader interested only reads the pci chapter.
Only to know the opcode value in a common table it reads the admin chapter.

Putting command descriptions in the "basic facilities" without referring to transport will create back-n-forth, where reader needs to go to PCI chapter to understand the motivation.
Come and to basic facilities and implement it.

When there are too many things common across all transports and very little changing across transport, placement in common place results in better reading.
I find the opposite here.

> > > > > another example:
> > > > > 	+The PCI VF device SHOULD NOT expose PCI BAR 0 when it prefers
> > > > > to support
> > > > >
> > > > > VFs don't expose BARs at all. PF exposes VF BARs in SRIOV capability.
> > > > >
> > > > Yes, it is exposed by PF, the wording of "PCI VF device exposing" is not
> right.
> > > > I will reword it.
> > >
> > > So here's an example wording, I don't insist on it exactly but the
> > > point is to show how we should use spec terminology whereever
> > > possible:
> > >
> > > If an owner of an SRIOV group supports all of
> > > VIRTIO_ADMIN_CMD_LCC_REG_WRITE,
> VIRTIO_ADMIN_CMD_LCC_REG_READ ....
> > > then it SHOULD NOT expose VF BAR0 (of non 0 size) as part of its
> > > SRIOV capability; this is to facilitate emulating IO
> > > BAR0 for the legacy interface in software.
> > >
> > Yes good one. Will use.
> 
> right and my point is try to word all of it like this.
Yes, as owner and group.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-08 14:38                                           ` [virtio-comment] " Parav Pandit
@ 2023-06-09  2:06                                             ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-09  2:06 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 8, 2023 at 10:38 PM Parav Pandit <parav@nvidia.com> wrote:
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Wednesday, June 7, 2023 2:54 AM
>
> > Hypervisor can trap the legacy device configuration space write and convert it
> > to cvq commands.
> Michael already answered that cvq is not trapped; this is the main design goal we talked several times that it is passthrough device.

Is this really a blocker? Wouldn't a new feature(_F_LEFACY_MAC) or cap
resolve this?

>
> So no point discussing this again.
>
> If you have any comments on v4, please let me know.
>
> Both the design points are addressed in v4.
> 1. To split to two commands for device and config area
> 2. Use pci cap to learn about notification region
>
> Since this ABI reflects what we agree on,

I think not since you fail to explain why this approach is better than
simply adding new features like _F_LEGACY_HEADER and _F_LEGACY_MAC.

Thanks

> I would want to raise for vote in coming days to be part of 1.3 in few days as we have more than 3 weeks to sort out non-ABI language part.


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-09  2:06                                             ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-09  2:06 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Thu, Jun 8, 2023 at 10:38 PM Parav Pandit <parav@nvidia.com> wrote:
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Wednesday, June 7, 2023 2:54 AM
>
> > Hypervisor can trap the legacy device configuration space write and convert it
> > to cvq commands.
> Michael already answered that cvq is not trapped; this is the main design goal we talked several times that it is passthrough device.

Is this really a blocker? Wouldn't a new feature(_F_LEFACY_MAC) or cap
resolve this?

>
> So no point discussing this again.
>
> If you have any comments on v4, please let me know.
>
> Both the design points are addressed in v4.
> 1. To split to two commands for device and config area
> 2. Use pci cap to learn about notification region
>
> Since this ABI reflects what we agree on,

I think not since you fail to explain why this approach is better than
simply adding new features like _F_LEGACY_HEADER and _F_LEGACY_MAC.

Thanks

> I would want to raise for vote in coming days to be part of 1.3 in few days as we have more than 3 weeks to sort out non-ABI language part.


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  2:06                                             ` [virtio-comment] " Jason Wang
@ 2023-06-09  2:29                                               ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-09  2:29 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Jason Wang <jasowang@redhat.com>
> Sent: Thursday, June 8, 2023 10:07 PM
 
> I think not since you fail to explain why this approach is better than simply
> adding new features like _F_LEGACY_HEADER and _F_LEGACY_MAC.

Please refer back to the requirements of cover letter and multiple past discussions.
And Michael also explained...

It is passthrough device, none of the 1.x objects are accessible or mediated by the hypervisor.

Cannot repeat more.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-09  2:29                                               ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-09  2:29 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Jason Wang <jasowang@redhat.com>
> Sent: Thursday, June 8, 2023 10:07 PM
 
> I think not since you fail to explain why this approach is better than simply
> adding new features like _F_LEGACY_HEADER and _F_LEGACY_MAC.

Please refer back to the requirements of cover letter and multiple past discussions.
And Michael also explained...

It is passthrough device, none of the 1.x objects are accessible or mediated by the hypervisor.

Cannot repeat more.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  2:29                                               ` [virtio-comment] " Parav Pandit
@ 2023-06-09  2:42                                                 ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-09  2:42 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 9, 2023 at 10:29 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Thursday, June 8, 2023 10:07 PM
>
> > I think not since you fail to explain why this approach is better than simply
> > adding new features like _F_LEGACY_HEADER and _F_LEGACY_MAC.
>
> Please refer back to the requirements of cover letter and multiple past discussions.
> And Michael also explained...
>
> It is passthrough device, none of the 1.x objects are accessible or mediated by the hypervisor.

Let me quote my reply once again:

"
Hypervisor just need to prepare

1) legacy BAR with legacy config and device configuration space
2) modern BAR with modern capabilities (common cfg and device cfg)

For 2) it could be mapped directly to guest without any mediation For
1) hypervisor needs to mediate
"

There's zero mediation for 1.x objects at all. No?

For accessing 1.x objects by hypervisor, what's wrong with that
especially considering it is used for legacy mediation only but not
modern? (Btw, how do you define 1.x objects, isn't any facility via
adminq an 1.x object?)

In order to converge the discussion, maybe you can explain which one
of your 3 use cases and why can't work with _F_LEGACY_HEADER +
_F_LEGACY_MAC.

Thanks

>
> Cannot repeat more.


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-09  2:42                                                 ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-09  2:42 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 9, 2023 at 10:29 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Thursday, June 8, 2023 10:07 PM
>
> > I think not since you fail to explain why this approach is better than simply
> > adding new features like _F_LEGACY_HEADER and _F_LEGACY_MAC.
>
> Please refer back to the requirements of cover letter and multiple past discussions.
> And Michael also explained...
>
> It is passthrough device, none of the 1.x objects are accessible or mediated by the hypervisor.

Let me quote my reply once again:

"
Hypervisor just need to prepare

1) legacy BAR with legacy config and device configuration space
2) modern BAR with modern capabilities (common cfg and device cfg)

For 2) it could be mapped directly to guest without any mediation For
1) hypervisor needs to mediate
"

There's zero mediation for 1.x objects at all. No?

For accessing 1.x objects by hypervisor, what's wrong with that
especially considering it is used for legacy mediation only but not
modern? (Btw, how do you define 1.x objects, isn't any facility via
adminq an 1.x object?)

In order to converge the discussion, maybe you can explain which one
of your 3 use cases and why can't work with _F_LEGACY_HEADER +
_F_LEGACY_MAC.

Thanks

>
> Cannot repeat more.


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  2:42                                                 ` [virtio-comment] " Jason Wang
@ 2023-06-09  2:53                                                   ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-09  2:53 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Jason Wang <jasowang@redhat.com>
> Sent: Thursday, June 8, 2023 10:43 PM

> > It is passthrough device, none of the 1.x objects are accessible or mediated by
> the hypervisor.
> 
> Let me quote my reply once again:
> 
> "
> Hypervisor just need to prepare
> 
> 1) legacy BAR with legacy config and device configuration space
> 2) modern BAR with modern capabilities (common cfg and device cfg)
> 
This is what is done in v5.

> For 2) it could be mapped directly to guest without any mediation For
> 1) hypervisor needs to mediate
> "
> 
> There's zero mediation for 1.x objects at all. No?
> 

> For accessing 1.x objects by hypervisor, what's wrong with that especially
> considering it is used for legacy mediation only but not modern? 
I didn’t follow the question.

> (Btw, how do
> you define 1.x objects, isn't any facility via adminq an 1.x object?)
> 
1.x objects of the passthrough VF device.

> In order to converge the discussion, maybe you can explain which one of your 3
> use cases and why can't work with _F_LEGACY_HEADER + _F_LEGACY_MAC.
Hypervisor does not involve in feature negotiation and device life cycle phase so it cannot negotiate it.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] RE: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-09  2:53                                                   ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-09  2:53 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Jason Wang <jasowang@redhat.com>
> Sent: Thursday, June 8, 2023 10:43 PM

> > It is passthrough device, none of the 1.x objects are accessible or mediated by
> the hypervisor.
> 
> Let me quote my reply once again:
> 
> "
> Hypervisor just need to prepare
> 
> 1) legacy BAR with legacy config and device configuration space
> 2) modern BAR with modern capabilities (common cfg and device cfg)
> 
This is what is done in v5.

> For 2) it could be mapped directly to guest without any mediation For
> 1) hypervisor needs to mediate
> "
> 
> There's zero mediation for 1.x objects at all. No?
> 

> For accessing 1.x objects by hypervisor, what's wrong with that especially
> considering it is used for legacy mediation only but not modern? 
I didn’t follow the question.

> (Btw, how do
> you define 1.x objects, isn't any facility via adminq an 1.x object?)
> 
1.x objects of the passthrough VF device.

> In order to converge the discussion, maybe you can explain which one of your 3
> use cases and why can't work with _F_LEGACY_HEADER + _F_LEGACY_MAC.
Hypervisor does not involve in feature negotiation and device life cycle phase so it cannot negotiate it.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  2:53                                                   ` [virtio-comment] " Parav Pandit
@ 2023-06-09  2:56                                                     ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-09  2:56 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 9, 2023 at 10:53 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Thursday, June 8, 2023 10:43 PM
>
> > > It is passthrough device, none of the 1.x objects are accessible or mediated by
> > the hypervisor.
> >
> > Let me quote my reply once again:
> >
> > "
> > Hypervisor just need to prepare
> >
> > 1) legacy BAR with legacy config and device configuration space
> > 2) modern BAR with modern capabilities (common cfg and device cfg)
> >
> This is what is done in v5.

I meant this could be done with _F_LEGACY_HEADER/MAC as well.

>
> > For 2) it could be mapped directly to guest without any mediation For
> > 1) hypervisor needs to mediate
> > "
> >
> > There's zero mediation for 1.x objects at all. No?
> >
>
> > For accessing 1.x objects by hypervisor, what's wrong with that especially
> > considering it is used for legacy mediation only but not modern?
> I didn’t follow the question.
>
> > (Btw, how do
> > you define 1.x objects, isn't any facility via adminq an 1.x object?)
> >
> 1.x objects of the passthrough VF device.
>
> > In order to converge the discussion, maybe you can explain which one of your 3
> > use cases and why can't work with _F_LEGACY_HEADER + _F_LEGACY_MAC.
> Hypervisor does not involve in feature negotiation and device life cycle phase so it cannot negotiate it.

With  _F_LEGACY_HEADER + _F_LEGACY_MAC, hypervisor doesn't need to be
involved in the feature negotiation for modern devices as well.

Anything I missed?

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-09  2:56                                                     ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-09  2:56 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 9, 2023 at 10:53 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Thursday, June 8, 2023 10:43 PM
>
> > > It is passthrough device, none of the 1.x objects are accessible or mediated by
> > the hypervisor.
> >
> > Let me quote my reply once again:
> >
> > "
> > Hypervisor just need to prepare
> >
> > 1) legacy BAR with legacy config and device configuration space
> > 2) modern BAR with modern capabilities (common cfg and device cfg)
> >
> This is what is done in v5.

I meant this could be done with _F_LEGACY_HEADER/MAC as well.

>
> > For 2) it could be mapped directly to guest without any mediation For
> > 1) hypervisor needs to mediate
> > "
> >
> > There's zero mediation for 1.x objects at all. No?
> >
>
> > For accessing 1.x objects by hypervisor, what's wrong with that especially
> > considering it is used for legacy mediation only but not modern?
> I didn’t follow the question.
>
> > (Btw, how do
> > you define 1.x objects, isn't any facility via adminq an 1.x object?)
> >
> 1.x objects of the passthrough VF device.
>
> > In order to converge the discussion, maybe you can explain which one of your 3
> > use cases and why can't work with _F_LEGACY_HEADER + _F_LEGACY_MAC.
> Hypervisor does not involve in feature negotiation and device life cycle phase so it cannot negotiate it.

With  _F_LEGACY_HEADER + _F_LEGACY_MAC, hypervisor doesn't need to be
involved in the feature negotiation for modern devices as well.

Anything I missed?

Thanks


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  2:56                                                     ` [virtio-comment] " Jason Wang
@ 2023-06-09  2:58                                                       ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-09  2:58 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: virtio-comment@lists.oasis-open.org <virtio-comment@lists.oasis-
> open.org> On Behalf Of Jason Wang
> Sent: Thursday, June 8, 2023 10:57 PM

> > > In order to converge the discussion, maybe you can explain which one
> > > of your 3 use cases and why can't work with _F_LEGACY_HEADER +
> _F_LEGACY_MAC.
> > Hypervisor does not involve in feature negotiation and device life cycle phase
> so it cannot negotiate it.
> 
> With  _F_LEGACY_HEADER + _F_LEGACY_MAC, hypervisor doesn't need to be
> involved in the feature negotiation for modern devices as well.
> 
Guest does not have this feature negotiation driver.
Hypervisor is not involved.
So, who negotiates?

^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-09  2:58                                                       ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-09  2:58 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: virtio-comment@lists.oasis-open.org <virtio-comment@lists.oasis-
> open.org> On Behalf Of Jason Wang
> Sent: Thursday, June 8, 2023 10:57 PM

> > > In order to converge the discussion, maybe you can explain which one
> > > of your 3 use cases and why can't work with _F_LEGACY_HEADER +
> _F_LEGACY_MAC.
> > Hypervisor does not involve in feature negotiation and device life cycle phase
> so it cannot negotiate it.
> 
> With  _F_LEGACY_HEADER + _F_LEGACY_MAC, hypervisor doesn't need to be
> involved in the feature negotiation for modern devices as well.
> 
Guest does not have this feature negotiation driver.
Hypervisor is not involved.
So, who negotiates?

^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  2:58                                                       ` Parav Pandit
@ 2023-06-09  3:02                                                         ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-09  3:02 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 9, 2023 at 10:58 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
> > From: virtio-comment@lists.oasis-open.org <virtio-comment@lists.oasis-
> > open.org> On Behalf Of Jason Wang
> > Sent: Thursday, June 8, 2023 10:57 PM
>
> > > > In order to converge the discussion, maybe you can explain which one
> > > > of your 3 use cases and why can't work with _F_LEGACY_HEADER +
> > _F_LEGACY_MAC.
> > > Hypervisor does not involve in feature negotiation and device life cycle phase
> > so it cannot negotiate it.
> >
> > With  _F_LEGACY_HEADER + _F_LEGACY_MAC, hypervisor doesn't need to be
> > involved in the feature negotiation for modern devices as well.
> >
> Guest does not have this feature negotiation driver.
> Hypervisor is not involved.
> So, who negotiates?

When legacy drivers are doing feature negotiation, the hypervisor must
trap and negotiate those two features.
When modern drivers are doing the feature negotiation, the hypervisor
is not involved at all. So modern drivers can choose to negotiate (e.g
try to mediate legacy for L2) or not.

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-09  3:02                                                         ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-09  3:02 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 9, 2023 at 10:58 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
> > From: virtio-comment@lists.oasis-open.org <virtio-comment@lists.oasis-
> > open.org> On Behalf Of Jason Wang
> > Sent: Thursday, June 8, 2023 10:57 PM
>
> > > > In order to converge the discussion, maybe you can explain which one
> > > > of your 3 use cases and why can't work with _F_LEGACY_HEADER +
> > _F_LEGACY_MAC.
> > > Hypervisor does not involve in feature negotiation and device life cycle phase
> > so it cannot negotiate it.
> >
> > With  _F_LEGACY_HEADER + _F_LEGACY_MAC, hypervisor doesn't need to be
> > involved in the feature negotiation for modern devices as well.
> >
> Guest does not have this feature negotiation driver.
> Hypervisor is not involved.
> So, who negotiates?

When legacy drivers are doing feature negotiation, the hypervisor must
trap and negotiate those two features.
When modern drivers are doing the feature negotiation, the hypervisor
is not involved at all. So modern drivers can choose to negotiate (e.g
try to mediate legacy for L2) or not.

Thanks


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  3:02                                                         ` Jason Wang
@ 2023-06-09  3:25                                                           ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-09  3:25 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Jason Wang <jasowang@redhat.com>
> Sent: Thursday, June 8, 2023 11:03 PM

> When legacy drivers are doing feature negotiation, the hypervisor must trap and
> negotiate those two features.
Device reset to be trapped as well towards 1.x.

And this messes the 1.x flow with FEATURES_OK.
More citations from the spec:

"Legacy driver implementations often used the device before setting the DRIVER_OK bit, and sometimes
even before writing the feature bits to the device."

It may even set before setting the feature bits.
It is ugly to use the 1.x state machine.
I would like to keep the stateful interactions of 1.x device outside of 0.9.5.

> When modern drivers are doing the feature negotiation, the hypervisor is not
> involved at all. So modern drivers can choose to negotiate (e.g try to mediate
> legacy for L2) or not.


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-09  3:25                                                           ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-09  3:25 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Jason Wang <jasowang@redhat.com>
> Sent: Thursday, June 8, 2023 11:03 PM

> When legacy drivers are doing feature negotiation, the hypervisor must trap and
> negotiate those two features.
Device reset to be trapped as well towards 1.x.

And this messes the 1.x flow with FEATURES_OK.
More citations from the spec:

"Legacy driver implementations often used the device before setting the DRIVER_OK bit, and sometimes
even before writing the feature bits to the device."

It may even set before setting the feature bits.
It is ugly to use the 1.x state machine.
I would like to keep the stateful interactions of 1.x device outside of 0.9.5.

> When modern drivers are doing the feature negotiation, the hypervisor is not
> involved at all. So modern drivers can choose to negotiate (e.g try to mediate
> legacy for L2) or not.


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  3:25                                                           ` Parav Pandit
@ 2023-06-09  6:27                                                             ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-09  6:27 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 9, 2023 at 11:26 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Thursday, June 8, 2023 11:03 PM
>
> > When legacy drivers are doing feature negotiation, the hypervisor must trap and
> > negotiate those two features.
> Device reset to be trapped as well towards 1.x.

It needs to be trapped even with admin virtqueue.

>
> And this messes the 1.x flow with FEATURES_OK.

How can it mess? The new status was hidden from the legacy driver.
This kind of trick has been used by Qemu for a while.

> More citations from the spec:
>
> "Legacy driver implementations often used the device before setting the DRIVER_OK bit, and sometimes
> even before writing the feature bits to the device."
>
> It may even set before setting the feature bits.

How does adminq differ/help in this case? Note that the legacy
interface is fully mediated/emulated, the control patch is fully
trapped so it can choose to do anything it can.

What's more important, the above example is exactly what we should do
with modern devices since it's too late to precisely define the
behaviour of the legacy device. Admin virtqueue is not the cure for
this since the legacy device's behaviour is defined by the existing
hypervisor codes, not the spec.

So again, we have:

1) well defined (if it's not we can fix the spec) device behaviour
(modern device plus well defined legacy features like mac/header)
2) device with legacy behaviours that can't be defined or documented
(approach used in this series)

1) is far more simple for both hypervisor and hardware and 2) may end
up with subtle undocumented behaviour differences among vendors.

> It is ugly to use the 1.x state machine.

This is the methodology used by mediation which is very common in
virtualization.

> I would like to keep the stateful interactions of 1.x device outside of 0.9.5.

I don't think this is a real problem, but let's see the drawbacks of
this proposal:

1) non-trivial changes of full new transport alike ABI
2) can't work for nesting
3) require vendor to implement legacy behaviour which can't be
documented precisely
4) require admin virtqueue to work

We won't have the above issues if we use modern + legacy header/mac.

Thanks


>
> > When modern drivers are doing the feature negotiation, the hypervisor is not
> > involved at all. So modern drivers can choose to negotiate (e.g try to mediate
> > legacy for L2) or not.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-09  6:27                                                             ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-09  6:27 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 9, 2023 at 11:26 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Thursday, June 8, 2023 11:03 PM
>
> > When legacy drivers are doing feature negotiation, the hypervisor must trap and
> > negotiate those two features.
> Device reset to be trapped as well towards 1.x.

It needs to be trapped even with admin virtqueue.

>
> And this messes the 1.x flow with FEATURES_OK.

How can it mess? The new status was hidden from the legacy driver.
This kind of trick has been used by Qemu for a while.

> More citations from the spec:
>
> "Legacy driver implementations often used the device before setting the DRIVER_OK bit, and sometimes
> even before writing the feature bits to the device."
>
> It may even set before setting the feature bits.

How does adminq differ/help in this case? Note that the legacy
interface is fully mediated/emulated, the control patch is fully
trapped so it can choose to do anything it can.

What's more important, the above example is exactly what we should do
with modern devices since it's too late to precisely define the
behaviour of the legacy device. Admin virtqueue is not the cure for
this since the legacy device's behaviour is defined by the existing
hypervisor codes, not the spec.

So again, we have:

1) well defined (if it's not we can fix the spec) device behaviour
(modern device plus well defined legacy features like mac/header)
2) device with legacy behaviours that can't be defined or documented
(approach used in this series)

1) is far more simple for both hypervisor and hardware and 2) may end
up with subtle undocumented behaviour differences among vendors.

> It is ugly to use the 1.x state machine.

This is the methodology used by mediation which is very common in
virtualization.

> I would like to keep the stateful interactions of 1.x device outside of 0.9.5.

I don't think this is a real problem, but let's see the drawbacks of
this proposal:

1) non-trivial changes of full new transport alike ABI
2) can't work for nesting
3) require vendor to implement legacy behaviour which can't be
documented precisely
4) require admin virtqueue to work

We won't have the above issues if we use modern + legacy header/mac.

Thanks


>
> > When modern drivers are doing the feature negotiation, the hypervisor is not
> > involved at all. So modern drivers can choose to negotiate (e.g try to mediate
> > legacy for L2) or not.
>


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  2:06                                             ` [virtio-comment] " Jason Wang
@ 2023-06-09  7:15                                               ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-09  7:15 UTC (permalink / raw)
  To: Jason Wang
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 09, 2023 at 10:06:43AM +0800, Jason Wang wrote:
> On Thu, Jun 8, 2023 at 10:38 PM Parav Pandit <parav@nvidia.com> wrote:
> >
> >
> > > From: Jason Wang <jasowang@redhat.com>
> > > Sent: Wednesday, June 7, 2023 2:54 AM
> >
> > > Hypervisor can trap the legacy device configuration space write and convert it
> > > to cvq commands.
> > Michael already answered that cvq is not trapped; this is the main design goal we talked several times that it is passthrough device.
> 
> Is this really a blocker? Wouldn't a new feature(_F_LEFACY_MAC) or cap
> resolve this?

Of course we can create a set of feature bits emulating legacy.

> >
> > So no point discussing this again.
> >
> > If you have any comments on v4, please let me know.
> >
> > Both the design points are addressed in v4.
> > 1. To split to two commands for device and config area
> > 2. Use pci cap to learn about notification region
> >
> > Since this ABI reflects what we agree on,
> 
> I think not since you fail to explain why this approach is better than
> simply adding new features like _F_LEGACY_HEADER and _F_LEGACY_MAC.
> 
> Thanks

I can explain, I think it's better for these reasons:

- limit the scope. We started out with _F_LEGACY_HEADER
  but now there's _F_LEGACY_MAC too. What about other
  device types? Could be nasty surprises there too.
  This way we just say "make legacy guests work" and
  this is the problem of the hardware vendor not ours.

- limit the impact. We don't get to maintain the set of hacks
  needed for legacy in the hypervisor - when some weird legacy
  support requirement surfaces, it will be up to the vendor
  to fix. HW vendors are also more agressive in deprecating
  old hardware - they will just stop shipping new
  hardware when there are no new customers and we can
  stop adding new hacks.

- test out admin command interface. This use-case is smaller
  than full transport vq but similar enough that
  we will learn valuable lessons from it.
  For example, it already helped us find and correct
  a design mistake where admin commands had 8 byte aligned length.
  As another example, I am working on ability to report events to admin command
  infrastructure which is currently missing.
  With that in place we will be able to add INT#x emulation for very old
  guests.



In short, this interface as you correctly point out is not the normal
way we build interfaces since it is not modular and less flexible than
individual feature bits.  However, for the legacy interface this might
be a good thing.


> > I would want to raise for vote in coming days to be part of 1.3 in few days as we have more than 3 weeks to sort out non-ABI language part.


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-09  7:15                                               ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-09  7:15 UTC (permalink / raw)
  To: Jason Wang
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 09, 2023 at 10:06:43AM +0800, Jason Wang wrote:
> On Thu, Jun 8, 2023 at 10:38 PM Parav Pandit <parav@nvidia.com> wrote:
> >
> >
> > > From: Jason Wang <jasowang@redhat.com>
> > > Sent: Wednesday, June 7, 2023 2:54 AM
> >
> > > Hypervisor can trap the legacy device configuration space write and convert it
> > > to cvq commands.
> > Michael already answered that cvq is not trapped; this is the main design goal we talked several times that it is passthrough device.
> 
> Is this really a blocker? Wouldn't a new feature(_F_LEFACY_MAC) or cap
> resolve this?

Of course we can create a set of feature bits emulating legacy.

> >
> > So no point discussing this again.
> >
> > If you have any comments on v4, please let me know.
> >
> > Both the design points are addressed in v4.
> > 1. To split to two commands for device and config area
> > 2. Use pci cap to learn about notification region
> >
> > Since this ABI reflects what we agree on,
> 
> I think not since you fail to explain why this approach is better than
> simply adding new features like _F_LEGACY_HEADER and _F_LEGACY_MAC.
> 
> Thanks

I can explain, I think it's better for these reasons:

- limit the scope. We started out with _F_LEGACY_HEADER
  but now there's _F_LEGACY_MAC too. What about other
  device types? Could be nasty surprises there too.
  This way we just say "make legacy guests work" and
  this is the problem of the hardware vendor not ours.

- limit the impact. We don't get to maintain the set of hacks
  needed for legacy in the hypervisor - when some weird legacy
  support requirement surfaces, it will be up to the vendor
  to fix. HW vendors are also more agressive in deprecating
  old hardware - they will just stop shipping new
  hardware when there are no new customers and we can
  stop adding new hacks.

- test out admin command interface. This use-case is smaller
  than full transport vq but similar enough that
  we will learn valuable lessons from it.
  For example, it already helped us find and correct
  a design mistake where admin commands had 8 byte aligned length.
  As another example, I am working on ability to report events to admin command
  infrastructure which is currently missing.
  With that in place we will be able to add INT#x emulation for very old
  guests.



In short, this interface as you correctly point out is not the normal
way we build interfaces since it is not modular and less flexible than
individual feature bits.  However, for the legacy interface this might
be a good thing.


> > I would want to raise for vote in coming days to be part of 1.3 in few days as we have more than 3 weeks to sort out non-ABI language part.


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  6:27                                                             ` Jason Wang
@ 2023-06-09  7:21                                                               ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-09  7:21 UTC (permalink / raw)
  To: Jason Wang
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 09, 2023 at 02:27:01PM +0800, Jason Wang wrote:
> > I would like to keep the stateful interactions of 1.x device outside of 0.9.5.
> 
> I don't think this is a real problem, but let's see the drawbacks of
> this proposal:
> 
> 1) non-trivial changes of full new transport alike ABI
> 2) can't work for nesting
> 3) require vendor to implement legacy behaviour which can't be
> documented precisely
> 4) require admin virtqueue to work
> 
> We won't have the above issues if we use modern + legacy header/mac.
> 
> Thanks


All this is true. But it's by design. It makes the legacy thing
as isolated as possible. Because let's be frank we won't be
able to drop legacy support in like 10 years. But hardware
vendors will do that quickly if they can't sell hardware.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-09  7:21                                                               ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-09  7:21 UTC (permalink / raw)
  To: Jason Wang
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 09, 2023 at 02:27:01PM +0800, Jason Wang wrote:
> > I would like to keep the stateful interactions of 1.x device outside of 0.9.5.
> 
> I don't think this is a real problem, but let's see the drawbacks of
> this proposal:
> 
> 1) non-trivial changes of full new transport alike ABI
> 2) can't work for nesting
> 3) require vendor to implement legacy behaviour which can't be
> documented precisely
> 4) require admin virtqueue to work
> 
> We won't have the above issues if we use modern + legacy header/mac.
> 
> Thanks


All this is true. But it's by design. It makes the legacy thing
as isolated as possible. Because let's be frank we won't be
able to drop legacy support in like 10 years. But hardware
vendors will do that quickly if they can't sell hardware.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  7:21                                                               ` Michael S. Tsirkin
@ 2023-06-09 17:11                                                                 ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-09 17:11 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jason Wang
  Cc: virtio-dev, cohuck, david.edmondson, sburla, Yishai Hadas,
	Maor Gottlieb, virtio-comment, Shahaf Shuler

> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Friday, June 9, 2023 3:22 AM
> 
> On Fri, Jun 09, 2023 at 02:27:01PM +0800, Jason Wang wrote:
> > > I would like to keep the stateful interactions of 1.x device outside of 0.9.5.
> >
> > I don't think this is a real problem, but let's see the drawbacks of
> > this proposal:
> >
> > 1) non-trivial changes of full new transport alike ABI
> > 2) can't work for nesting
> > 3) require vendor to implement legacy behaviour which can't be
> > documented precisely
> > 4) require admin virtqueue to work
> >
> > We won't have the above issues if we use modern + legacy header/mac.
> >
> > Thanks
> 
> 
> All this is true. But it's by design. It makes the legacy thing as isolated as
> possible. Because let's be frank we won't be able to drop legacy support in like
> 10 years. But hardware vendors will do that quickly if they can't sell hardware.

I don't think above 4 points are true for below reasoning.

Hypervisor flow without involving guest; first sanity round to figure out things can work:
1. reset the device
2. set ACK and DRIVER bit
3. read features and make sure _MAC, _HDR are supported.
4. if not abort.
5. reset the device 2nd time so that guest can have right view of things.

On guest access of legacy area:
6. reset the device
7. set ACK and DRIVER bit on guest request
8. read features and make sure _MAC, _HDR are offered
8.1 Hope for the best that on two completely unrelated device reset on #1 and #6, the device offers exact same feature bits.
And mention this in the spec 1.x for rest of the future.

We shouldn't be adding such a limitation to the spec.
We have seen this with mlx5 device where 5 years ago one thought this cannot happen.
And now with modern use case now features changes across two resets for mlx5 device.
Baking such limitation in current spec for past 1.x is sub-optimal.

ok, so to avoid baking such reset flow nasty things in spec, lets avoid flow of #1 to #5 in hypervisor.
So, provision the device to support these new feature bits via AQ.
So AQ is required for feature provisioning anyway.

So, your point #4 is required in both methods and so it scores same as this proposal.
Hence feature bit is not of an advantage.

With _MAC now we need writable mac on 1.x config space.
for 1.x writable mac has two requirements.
1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
2. should be synchronous to know success/failure to know when it is effective

Both are present on the CVQ, so yet add another duplicate 1.x scheme that fulfill above requirements.

ok. So may be let's do AQ command for just mac setting.

This scores down now for two reasons.
a. Duplicate of existing 1.x feature
b. requires AQ.

So, from RW mac we moved from 1.x cfg space to AQ. This mediation for 1.x is not good.
And now it's not trivial either as it is not just simple *p_mac = X.
Hence, #1 of non-trivial starts to looks less appealing.

Your point #3 about vendor to implement legacy behavior.
If vendor needs to support legacy, vendor anyway needs to implement _HDR anyway in data path.
and above MAC change, and feature provisioning.

For legacy there is no extra/special documentation.
All the behavior listed in Legacy interfaces section for configuration register present applies here.

So, I don't see mac support is trivial by any means compared to proposed scheme for 1.x.
Hence, comparing trivialness of two solutions seems same for your point #1 once you do mac plumbing.

Regarding #2 on nesting. I won't claim I understand this as your level of knowledge.
If you are sauing only the VF is in VM as virtio PCI device to supporting nested guest, that doesn't have AQ, hence it doesn't work due above issues.

Then yes, but than it is back to square one, where you need sequence #1 to #8 to be done + non-forward-looking spec changes on reset flow.

In that alternative, one can say, hey skip steps #1 to #5, and on step #8 doesn't have required feature bit, mark the device FAILED.
But this is common case and its late in the init flow to discover it.

And now MAC cannot be set atomically either in nesting with just feature bit without ugly and non-trivial spec updates.
And when one needs nesting with legacy, probably PV is better.

As Michael said,
Overall isolating legacy to AQ for config, intx and by reusing 1.x's notification is good trade off where 1.x device level interface is kept as detached from the legacy as possible.

This is why the notification address query also was desired via AQ as proposed in v3, but it is small trade off if you think it should be discovered via PCI cap like v5.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-09 17:11                                                                 ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-09 17:11 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jason Wang
  Cc: virtio-dev, cohuck, david.edmondson, sburla, Yishai Hadas,
	Maor Gottlieb, virtio-comment, Shahaf Shuler

> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Friday, June 9, 2023 3:22 AM
> 
> On Fri, Jun 09, 2023 at 02:27:01PM +0800, Jason Wang wrote:
> > > I would like to keep the stateful interactions of 1.x device outside of 0.9.5.
> >
> > I don't think this is a real problem, but let's see the drawbacks of
> > this proposal:
> >
> > 1) non-trivial changes of full new transport alike ABI
> > 2) can't work for nesting
> > 3) require vendor to implement legacy behaviour which can't be
> > documented precisely
> > 4) require admin virtqueue to work
> >
> > We won't have the above issues if we use modern + legacy header/mac.
> >
> > Thanks
> 
> 
> All this is true. But it's by design. It makes the legacy thing as isolated as
> possible. Because let's be frank we won't be able to drop legacy support in like
> 10 years. But hardware vendors will do that quickly if they can't sell hardware.

I don't think above 4 points are true for below reasoning.

Hypervisor flow without involving guest; first sanity round to figure out things can work:
1. reset the device
2. set ACK and DRIVER bit
3. read features and make sure _MAC, _HDR are supported.
4. if not abort.
5. reset the device 2nd time so that guest can have right view of things.

On guest access of legacy area:
6. reset the device
7. set ACK and DRIVER bit on guest request
8. read features and make sure _MAC, _HDR are offered
8.1 Hope for the best that on two completely unrelated device reset on #1 and #6, the device offers exact same feature bits.
And mention this in the spec 1.x for rest of the future.

We shouldn't be adding such a limitation to the spec.
We have seen this with mlx5 device where 5 years ago one thought this cannot happen.
And now with modern use case now features changes across two resets for mlx5 device.
Baking such limitation in current spec for past 1.x is sub-optimal.

ok, so to avoid baking such reset flow nasty things in spec, lets avoid flow of #1 to #5 in hypervisor.
So, provision the device to support these new feature bits via AQ.
So AQ is required for feature provisioning anyway.

So, your point #4 is required in both methods and so it scores same as this proposal.
Hence feature bit is not of an advantage.

With _MAC now we need writable mac on 1.x config space.
for 1.x writable mac has two requirements.
1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
2. should be synchronous to know success/failure to know when it is effective

Both are present on the CVQ, so yet add another duplicate 1.x scheme that fulfill above requirements.

ok. So may be let's do AQ command for just mac setting.

This scores down now for two reasons.
a. Duplicate of existing 1.x feature
b. requires AQ.

So, from RW mac we moved from 1.x cfg space to AQ. This mediation for 1.x is not good.
And now it's not trivial either as it is not just simple *p_mac = X.
Hence, #1 of non-trivial starts to looks less appealing.

Your point #3 about vendor to implement legacy behavior.
If vendor needs to support legacy, vendor anyway needs to implement _HDR anyway in data path.
and above MAC change, and feature provisioning.

For legacy there is no extra/special documentation.
All the behavior listed in Legacy interfaces section for configuration register present applies here.

So, I don't see mac support is trivial by any means compared to proposed scheme for 1.x.
Hence, comparing trivialness of two solutions seems same for your point #1 once you do mac plumbing.

Regarding #2 on nesting. I won't claim I understand this as your level of knowledge.
If you are sauing only the VF is in VM as virtio PCI device to supporting nested guest, that doesn't have AQ, hence it doesn't work due above issues.

Then yes, but than it is back to square one, where you need sequence #1 to #8 to be done + non-forward-looking spec changes on reset flow.

In that alternative, one can say, hey skip steps #1 to #5, and on step #8 doesn't have required feature bit, mark the device FAILED.
But this is common case and its late in the init flow to discover it.

And now MAC cannot be set atomically either in nesting with just feature bit without ugly and non-trivial spec updates.
And when one needs nesting with legacy, probably PV is better.

As Michael said,
Overall isolating legacy to AQ for config, intx and by reusing 1.x's notification is good trade off where 1.x device level interface is kept as detached from the legacy as possible.

This is why the notification address query also was desired via AQ as proposed in v3, but it is small trade off if you think it should be discovered via PCI cap like v5.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09 17:11                                                                 ` Parav Pandit
@ 2023-06-11  0:27                                                                   ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-11  0:27 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 09, 2023 at 05:11:53PM +0000, Parav Pandit wrote:
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Friday, June 9, 2023 3:22 AM
> > 
> > On Fri, Jun 09, 2023 at 02:27:01PM +0800, Jason Wang wrote:
> > > > I would like to keep the stateful interactions of 1.x device outside of 0.9.5.
> > >
> > > I don't think this is a real problem, but let's see the drawbacks of
> > > this proposal:
> > >
> > > 1) non-trivial changes of full new transport alike ABI
> > > 2) can't work for nesting
> > > 3) require vendor to implement legacy behaviour which can't be
> > > documented precisely
> > > 4) require admin virtqueue to work
> > >
> > > We won't have the above issues if we use modern + legacy header/mac.
> > >
> > > Thanks
> > 
> > 
> > All this is true. But it's by design. It makes the legacy thing as isolated as
> > possible. Because let's be frank we won't be able to drop legacy support in like
> > 10 years. But hardware vendors will do that quickly if they can't sell hardware.
> 
> I don't think above 4 points are true for below reasoning.
> 
> Hypervisor flow without involving guest; first sanity round to figure out things can work:
> 1. reset the device
> 2. set ACK and DRIVER bit
> 3. read features and make sure _MAC, _HDR are supported.
> 4. if not abort.
> 5. reset the device 2nd time so that guest can have right view of things.
> 
> On guest access of legacy area:
> 6. reset the device
> 7. set ACK and DRIVER bit on guest request
> 8. read features and make sure _MAC, _HDR are offered
> 8.1 Hope for the best that on two completely unrelated device reset on #1 and #6, the device offers exact same feature bits.
> And mention this in the spec 1.x for rest of the future.

> We shouldn't be adding such a limitation to the spec.
> We have seen this with mlx5 device where 5 years ago one thought this cannot happen.
> And now with modern use case now features changes across two resets for mlx5 device.

Interesting this actually violates a spec recommendation:

	If a device has successfully negotiated a set of features 
	at least once (by accepting the FEATURES_OK \field{device
	status} bit during device initialization), then it SHOULD
	NOT fail re-negotiation of the same set of features after
	a device or system reset.  Failure to do so would interfere
	with resuming from suspend and error recovery.


> Baking such limitation in current spec for past 1.x is sub-optimal.
> 
> ok, so to avoid baking such reset flow nasty things in spec, lets avoid flow of #1 to #5 in hypervisor.
> So, provision the device to support these new feature bits via AQ.
> So AQ is required for feature provisioning anyway.
> 
> So, your point #4 is required in both methods and so it scores same as this proposal.
> Hence feature bit is not of an advantage.
> 
> With _MAC now we need writable mac on 1.x config space.
> for 1.x writable mac has two requirements.
> 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
> 2. should be synchronous to know success/failure to know when it is effective
> 
> Both are present on the CVQ, so yet add another duplicate 1.x scheme that fulfill above requirements.
> 
> ok. So may be let's do AQ command for just mac setting.
> 
> This scores down now for two reasons.
> a. Duplicate of existing 1.x feature
> b. requires AQ.
> 
> So, from RW mac we moved from 1.x cfg space to AQ. This mediation for 1.x is not good.
> And now it's not trivial either as it is not just simple *p_mac = X.
> Hence, #1 of non-trivial starts to looks less appealing.
> 
> Your point #3 about vendor to implement legacy behavior.
> If vendor needs to support legacy, vendor anyway needs to implement _HDR anyway in data path.
> and above MAC change, and feature provisioning.
> 
> For legacy there is no extra/special documentation.
> All the behavior listed in Legacy interfaces section for configuration register present applies here.
> 
> So, I don't see mac support is trivial by any means compared to proposed scheme for 1.x.
> Hence, comparing trivialness of two solutions seems same for your point #1 once you do mac plumbing.
> 
> Regarding #2 on nesting. I won't claim I understand this as your level of knowledge.
> If you are sauing only the VF is in VM as virtio PCI device to supporting nested guest, that doesn't have AQ, hence it doesn't work due above issues.

Nothing is tied to admin queue here btw - it's using admin commands.
And by the way, there's a simple way to make this work with nesting
down the road if we want to: add support for sending admin commands
using MMIO. Jason, if you want to solve nesting I think that's the best
way. Will address other use-cases too, not just legacy.


> Then yes, but than it is back to square one, where you need sequence #1 to #8 to be done + non-forward-looking spec changes on reset flow.
> 
> In that alternative, one can say, hey skip steps #1 to #5, and on step #8 doesn't have required feature bit, mark the device FAILED.
> But this is common case and its late in the init flow to discover it.
> 
> And now MAC cannot be set atomically either in nesting with just feature bit without ugly and non-trivial spec updates.
> And when one needs nesting with legacy, probably PV is better.
> 
> As Michael said,
> Overall isolating legacy to AQ for config, intx and by reusing 1.x's notification is good trade off where 1.x device level interface is kept as detached from the legacy as possible.
> 
> This is why the notification address query also was desired via AQ as proposed in v3, but it is small trade off if you think it should be discovered via PCI cap like v5.


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-11  0:27                                                                   ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-11  0:27 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 09, 2023 at 05:11:53PM +0000, Parav Pandit wrote:
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Friday, June 9, 2023 3:22 AM
> > 
> > On Fri, Jun 09, 2023 at 02:27:01PM +0800, Jason Wang wrote:
> > > > I would like to keep the stateful interactions of 1.x device outside of 0.9.5.
> > >
> > > I don't think this is a real problem, but let's see the drawbacks of
> > > this proposal:
> > >
> > > 1) non-trivial changes of full new transport alike ABI
> > > 2) can't work for nesting
> > > 3) require vendor to implement legacy behaviour which can't be
> > > documented precisely
> > > 4) require admin virtqueue to work
> > >
> > > We won't have the above issues if we use modern + legacy header/mac.
> > >
> > > Thanks
> > 
> > 
> > All this is true. But it's by design. It makes the legacy thing as isolated as
> > possible. Because let's be frank we won't be able to drop legacy support in like
> > 10 years. But hardware vendors will do that quickly if they can't sell hardware.
> 
> I don't think above 4 points are true for below reasoning.
> 
> Hypervisor flow without involving guest; first sanity round to figure out things can work:
> 1. reset the device
> 2. set ACK and DRIVER bit
> 3. read features and make sure _MAC, _HDR are supported.
> 4. if not abort.
> 5. reset the device 2nd time so that guest can have right view of things.
> 
> On guest access of legacy area:
> 6. reset the device
> 7. set ACK and DRIVER bit on guest request
> 8. read features and make sure _MAC, _HDR are offered
> 8.1 Hope for the best that on two completely unrelated device reset on #1 and #6, the device offers exact same feature bits.
> And mention this in the spec 1.x for rest of the future.

> We shouldn't be adding such a limitation to the spec.
> We have seen this with mlx5 device where 5 years ago one thought this cannot happen.
> And now with modern use case now features changes across two resets for mlx5 device.

Interesting this actually violates a spec recommendation:

	If a device has successfully negotiated a set of features 
	at least once (by accepting the FEATURES_OK \field{device
	status} bit during device initialization), then it SHOULD
	NOT fail re-negotiation of the same set of features after
	a device or system reset.  Failure to do so would interfere
	with resuming from suspend and error recovery.


> Baking such limitation in current spec for past 1.x is sub-optimal.
> 
> ok, so to avoid baking such reset flow nasty things in spec, lets avoid flow of #1 to #5 in hypervisor.
> So, provision the device to support these new feature bits via AQ.
> So AQ is required for feature provisioning anyway.
> 
> So, your point #4 is required in both methods and so it scores same as this proposal.
> Hence feature bit is not of an advantage.
> 
> With _MAC now we need writable mac on 1.x config space.
> for 1.x writable mac has two requirements.
> 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
> 2. should be synchronous to know success/failure to know when it is effective
> 
> Both are present on the CVQ, so yet add another duplicate 1.x scheme that fulfill above requirements.
> 
> ok. So may be let's do AQ command for just mac setting.
> 
> This scores down now for two reasons.
> a. Duplicate of existing 1.x feature
> b. requires AQ.
> 
> So, from RW mac we moved from 1.x cfg space to AQ. This mediation for 1.x is not good.
> And now it's not trivial either as it is not just simple *p_mac = X.
> Hence, #1 of non-trivial starts to looks less appealing.
> 
> Your point #3 about vendor to implement legacy behavior.
> If vendor needs to support legacy, vendor anyway needs to implement _HDR anyway in data path.
> and above MAC change, and feature provisioning.
> 
> For legacy there is no extra/special documentation.
> All the behavior listed in Legacy interfaces section for configuration register present applies here.
> 
> So, I don't see mac support is trivial by any means compared to proposed scheme for 1.x.
> Hence, comparing trivialness of two solutions seems same for your point #1 once you do mac plumbing.
> 
> Regarding #2 on nesting. I won't claim I understand this as your level of knowledge.
> If you are sauing only the VF is in VM as virtio PCI device to supporting nested guest, that doesn't have AQ, hence it doesn't work due above issues.

Nothing is tied to admin queue here btw - it's using admin commands.
And by the way, there's a simple way to make this work with nesting
down the road if we want to: add support for sending admin commands
using MMIO. Jason, if you want to solve nesting I think that's the best
way. Will address other use-cases too, not just legacy.


> Then yes, but than it is back to square one, where you need sequence #1 to #8 to be done + non-forward-looking spec changes on reset flow.
> 
> In that alternative, one can say, hey skip steps #1 to #5, and on step #8 doesn't have required feature bit, mark the device FAILED.
> But this is common case and its late in the init flow to discover it.
> 
> And now MAC cannot be set atomically either in nesting with just feature bit without ugly and non-trivial spec updates.
> And when one needs nesting with legacy, probably PV is better.
> 
> As Michael said,
> Overall isolating legacy to AQ for config, intx and by reusing 1.x's notification is good trade off where 1.x device level interface is kept as detached from the legacy as possible.
> 
> This is why the notification address query also was desired via AQ as proposed in v3, but it is small trade off if you think it should be discovered via PCI cap like v5.


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-11  0:27                                                                   ` Michael S. Tsirkin
@ 2023-06-11  2:08                                                                     ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-11  2:08 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Saturday, June 10, 2023 8:27 PM
> 
> Interesting this actually violates a spec recommendation:
> 
> 	If a device has successfully negotiated a set of features
> 	at least once (by accepting the FEATURES_OK \field{device
> 	status} bit during device initialization), then it SHOULD
> 	NOT fail re-negotiation of the same set of features after
> 	a device or system reset.  Failure to do so would interfere
> 	with resuming from suspend and error recovery.
>
This is how we have seen mlx5 device and it has evolved now to break free such limitation.

> Nothing is tied to admin queue here btw - it's using admin commands.

Sure.  It is admin command, presently using AQ. May be some other transport tomorrow.


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-11  2:08                                                                     ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-11  2:08 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Saturday, June 10, 2023 8:27 PM
> 
> Interesting this actually violates a spec recommendation:
> 
> 	If a device has successfully negotiated a set of features
> 	at least once (by accepting the FEATURES_OK \field{device
> 	status} bit during device initialization), then it SHOULD
> 	NOT fail re-negotiation of the same set of features after
> 	a device or system reset.  Failure to do so would interfere
> 	with resuming from suspend and error recovery.
>
This is how we have seen mlx5 device and it has evolved now to break free such limitation.

> Nothing is tied to admin queue here btw - it's using admin commands.

Sure.  It is admin command, presently using AQ. May be some other transport tomorrow.


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-11  2:08                                                                     ` Parav Pandit
@ 2023-06-11  7:14                                                                       ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-11  7:14 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 11, 2023 at 02:08:07AM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Saturday, June 10, 2023 8:27 PM
> > 
> > Interesting this actually violates a spec recommendation:
> > 
> > 	If a device has successfully negotiated a set of features
> > 	at least once (by accepting the FEATURES_OK \field{device
> > 	status} bit during device initialization), then it SHOULD
> > 	NOT fail re-negotiation of the same set of features after
> > 	a device or system reset.  Failure to do so would interfere
> > 	with resuming from suspend and error recovery.
> >
> This is how we have seen mlx5 device and it has evolved now to break free such limitation.

It's not conformant to that statement then :( It's a SHOULD which means
if you know exactly what you are doing, there could be exceptions.
In this case it's a SHOULD because it was added after 1.0 and
we did not find a way to negotiate this requirement since it's the feature
negotiation itself.


-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-11  7:14                                                                       ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-11  7:14 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 11, 2023 at 02:08:07AM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Saturday, June 10, 2023 8:27 PM
> > 
> > Interesting this actually violates a spec recommendation:
> > 
> > 	If a device has successfully negotiated a set of features
> > 	at least once (by accepting the FEATURES_OK \field{device
> > 	status} bit during device initialization), then it SHOULD
> > 	NOT fail re-negotiation of the same set of features after
> > 	a device or system reset.  Failure to do so would interfere
> > 	with resuming from suspend and error recovery.
> >
> This is how we have seen mlx5 device and it has evolved now to break free such limitation.

It's not conformant to that statement then :( It's a SHOULD which means
if you know exactly what you are doing, there could be exceptions.
In this case it's a SHOULD because it was added after 1.0 and
we did not find a way to negotiate this requirement since it's the feature
negotiation itself.


-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-11  7:14                                                                       ` Michael S. Tsirkin
@ 2023-06-11 12:54                                                                         ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-11 12:54 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 11, 2023 3:15 AM


> It's not conformant to that statement then :( It's a SHOULD which means if you
> know exactly what you are doing, there could be exceptions.
> In this case it's a SHOULD because it was added after 1.0 and we did not find a
> way to negotiate this requirement since it's the feature negotiation itself.

True. May be in future such device can update the revision id.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-11 12:54                                                                         ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-11 12:54 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 11, 2023 3:15 AM


> It's not conformant to that statement then :( It's a SHOULD which means if you
> know exactly what you are doing, there could be exceptions.
> In this case it's a SHOULD because it was added after 1.0 and we did not find a
> way to negotiate this requirement since it's the feature negotiation itself.

True. May be in future such device can update the revision id.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-11 12:54                                                                         ` Parav Pandit
@ 2023-06-11 20:09                                                                           ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-11 20:09 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 11, 2023 at 12:54:53PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 11, 2023 3:15 AM
> 
> 
> > It's not conformant to that statement then :( It's a SHOULD which means if you
> > know exactly what you are doing, there could be exceptions.
> > In this case it's a SHOULD because it was added after 1.0 and we did not find a
> > way to negotiate this requirement since it's the feature negotiation itself.
> 
> True. May be in future such device can update the revision id.

You can already change it but that doesn't imply anything at all,
in 1.0 revisions are vendor specific.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-11 20:09                                                                           ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-11 20:09 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 11, 2023 at 12:54:53PM +0000, Parav Pandit wrote:
> 
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 11, 2023 3:15 AM
> 
> 
> > It's not conformant to that statement then :( It's a SHOULD which means if you
> > know exactly what you are doing, there could be exceptions.
> > In this case it's a SHOULD because it was added after 1.0 and we did not find a
> > way to negotiate this requirement since it's the feature negotiation itself.
> 
> True. May be in future such device can update the revision id.

You can already change it but that doesn't imply anything at all,
in 1.0 revisions are vendor specific.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-11 20:09                                                                           ` Michael S. Tsirkin
@ 2023-06-11 20:17                                                                             ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-11 20:17 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 11, 2023 4:09 PM

> > > It's not conformant to that statement then :( It's a SHOULD which
> > > means if you know exactly what you are doing, there could be exceptions.
> > > In this case it's a SHOULD because it was added after 1.0 and we did
> > > not find a way to negotiate this requirement since it's the feature negotiation
> itself.
> >
> > True. May be in future such device can update the revision id.
> 
> You can already change it but that doesn't imply anything at all, in 1.0 revisions
> are vendor specific.

I was suggesting that when such a fundamental change is done which cannot be communicated via features bit or before the reset,
a new revision and attaching more advance/different behavior.
This way driver knows what difference to expect for new revision.

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-11 20:17                                                                             ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-11 20:17 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler


> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Sunday, June 11, 2023 4:09 PM

> > > It's not conformant to that statement then :( It's a SHOULD which
> > > means if you know exactly what you are doing, there could be exceptions.
> > > In this case it's a SHOULD because it was added after 1.0 and we did
> > > not find a way to negotiate this requirement since it's the feature negotiation
> itself.
> >
> > True. May be in future such device can update the revision id.
> 
> You can already change it but that doesn't imply anything at all, in 1.0 revisions
> are vendor specific.

I was suggesting that when such a fundamental change is done which cannot be communicated via features bit or before the reset,
a new revision and attaching more advance/different behavior.
This way driver knows what difference to expect for new revision.

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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-11 20:17                                                                             ` Parav Pandit
@ 2023-06-11 23:15                                                                               ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-11 23:15 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 11, 2023 at 08:17:56PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 11, 2023 4:09 PM
> 
> > > > It's not conformant to that statement then :( It's a SHOULD which
> > > > means if you know exactly what you are doing, there could be exceptions.
> > > > In this case it's a SHOULD because it was added after 1.0 and we did
> > > > not find a way to negotiate this requirement since it's the feature negotiation
> > itself.
> > >
> > > True. May be in future such device can update the revision id.
> > 
> > You can already change it but that doesn't imply anything at all, in 1.0 revisions
> > are vendor specific.
> 
> I was suggesting that when such a fundamental change is done which cannot be communicated via features bit or before the reset,
> a new revision and attaching more advance/different behavior.
> This way driver knows what difference to expect for new revision.

But you don't know which revision do existing devices use:
	Drivers MUST match any PCI Revision ID value.

we can come up with a mechanism, several ideas come to mind.
Before we bother, the actual need has to be understood.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-11 23:15                                                                               ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-11 23:15 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Wang, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 11, 2023 at 08:17:56PM +0000, Parav Pandit wrote:
> 
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Sunday, June 11, 2023 4:09 PM
> 
> > > > It's not conformant to that statement then :( It's a SHOULD which
> > > > means if you know exactly what you are doing, there could be exceptions.
> > > > In this case it's a SHOULD because it was added after 1.0 and we did
> > > > not find a way to negotiate this requirement since it's the feature negotiation
> > itself.
> > >
> > > True. May be in future such device can update the revision id.
> > 
> > You can already change it but that doesn't imply anything at all, in 1.0 revisions
> > are vendor specific.
> 
> I was suggesting that when such a fundamental change is done which cannot be communicated via features bit or before the reset,
> a new revision and attaching more advance/different behavior.
> This way driver knows what difference to expect for new revision.

But you don't know which revision do existing devices use:
	Drivers MUST match any PCI Revision ID value.

we can come up with a mechanism, several ideas come to mind.
Before we bother, the actual need has to be understood.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09 17:11                                                                 ` Parav Pandit
@ 2023-06-26  3:32                                                                   ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-26  3:32 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sat, Jun 10, 2023 at 1:12 AM Parav Pandit <parav@nvidia.com> wrote:
>
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Friday, June 9, 2023 3:22 AM
> >
> > On Fri, Jun 09, 2023 at 02:27:01PM +0800, Jason Wang wrote:
> > > > I would like to keep the stateful interactions of 1.x device outside of 0.9.5.
> > >
> > > I don't think this is a real problem, but let's see the drawbacks of
> > > this proposal:
> > >
> > > 1) non-trivial changes of full new transport alike ABI
> > > 2) can't work for nesting
> > > 3) require vendor to implement legacy behaviour which can't be
> > > documented precisely
> > > 4) require admin virtqueue to work
> > >
> > > We won't have the above issues if we use modern + legacy header/mac.
> > >
> > > Thanks
> >
> >
> > All this is true. But it's by design. It makes the legacy thing as isolated as
> > possible. Because let's be frank we won't be able to drop legacy support in like
> > 10 years. But hardware vendors will do that quickly if they can't sell hardware.
>
> I don't think above 4 points are true for below reasoning.
>
> Hypervisor flow without involving guest; first sanity round to figure out things can work:

Why is this sanity round a must?

> 1. reset the device
> 2. set ACK and DRIVER bit
> 3. read features and make sure _MAC, _HDR are supported.

Similar step is required even for AQ since the hypervisor needs to
know if legacy commands are supported there.

> 4. if not abort.
> 5. reset the device 2nd time so that guest can have right view of things.
>
> On guest access of legacy area:
> 6. reset the device
> 7. set ACK and DRIVER bit on guest request
> 8. read features and make sure _MAC, _HDR are offered
> 8.1 Hope for the best that on two completely unrelated device reset on #1 and #6, the device offers exact same feature bits.

Explained and discussed in another thread, this is a hard requirement
otherwise a lot of things would break.

> And mention this in the spec 1.x for rest of the future.
>
> We shouldn't be adding such a limitation to the spec.
> We have seen this with mlx5 device where 5 years ago one thought this cannot happen.
> And now with modern use case now features changes across two resets for mlx5 device.
> Baking such limitation in current spec for past 1.x is sub-optimal.
>
> ok, so to avoid baking such reset flow nasty things in spec, lets avoid flow of #1 to #5 in hypervisor.
> So, provision the device to support these new feature bits via AQ.
> So AQ is required for feature provisioning anyway.
>
> So, your point #4 is required in both methods and so it scores same as this proposal.
> Hence feature bit is not of an advantage.
>
> With _MAC now we need writable mac on 1.x config space.
> for 1.x writable mac has two requirements.
> 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)

For LEGACY_MAC, we don't need to be atomic. We manage to survive for
several years.

> 2. should be synchronous to know success/failure to know when it is effective

It's as simple as allowing mac in the device configuration space writable.

>
> Both are present on the CVQ, so yet add another duplicate 1.x scheme that fulfill above requirements.

I'm not sure how to define duplication, the legacy device
configuration space access via admin virtqueue is kind of a
duplication in this sense as well.

>
> ok. So may be let's do AQ command for just mac setting.
>
> This scores down now for two reasons.
> a. Duplicate of existing 1.x feature
> b. requires AQ.
>
> So, from RW mac we moved from 1.x cfg space to AQ. This mediation for 1.x is not good.

Modern drivers just won't negotiate LEGACY_MAC, so there's no mediation at all.

> And now it's not trivial either as it is not just simple *p_mac = X.
> Hence, #1 of non-trivial starts to looks less appealing.
>
> Your point #3 about vendor to implement legacy behavior.
> If vendor needs to support legacy, vendor anyway needs to implement _HDR anyway in data path.
> and above MAC change, and feature provisioning.

I think there are some misunderstandings here:

For legacy behaviour, I mainly meant the behaviour in the corner cases
that can't be documented (easily) by the spec since it is defined by
the code (e.g Linux drivers and Qemu). LEGACY_MAC/HDR doesn't belong
to those since the behaviour is well understood and defined in the
spec.

It's very hard to audit each corner case and it would easily result in
endless errata of the hardware. Modern devices have clearly defined
behaviour and it's easier to implement. It's never too late to fix
spec if we found a bug.

>
> For legacy there is no extra/special documentation.
> All the behavior listed in Legacy interfaces section for configuration register present applies here.

That's not true, the legacy section is the best effort since it's too
late to define (codes came before the spec).

>
> So, I don't see mac support is trivial by any means compared to proposed scheme for 1.x.
> Hence, comparing trivialness of two solutions seems same for your point #1 once you do mac plumbing.
>
> Regarding #2 on nesting. I won't claim I understand this as your level of knowledge.
> If you are sauing only the VF is in VM as virtio PCI device to supporting nested guest, that doesn't have AQ, hence it doesn't work due above issues.

This is the most common setup, no?

The major issues are the transport function is not self contained in a
device (function). This will cause a lot of trouble when trying to
implement nesting. E.g you need to assign or emulate SR-IOV from L1 to
L(N-1) in order to let L(N) to work.

Thanks

>
> Then yes, but than it is back to square one, where you need sequence #1 to #8 to be done + non-forward-looking spec changes on reset flow.
>
> In that alternative, one can say, hey skip steps #1 to #5, and on step #8 doesn't have required feature bit, mark the device FAILED.
> But this is common case and its late in the init flow to discover it.
>
> And now MAC cannot be set atomically either in nesting with just feature bit without ugly and non-trivial spec updates.
> And when one needs nesting with legacy, probably PV is better.
>
> As Michael said,
> Overall isolating legacy to AQ for config, intx and by reusing 1.x's notification is good trade off where 1.x device level interface is kept as detached from the legacy as possible.
>
> This is why the notification address query also was desired via AQ as proposed in v3, but it is small trade off if you think it should be discovered via PCI cap like v5.
>
> 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: virtio-comment-subscribe@lists.oasis-open.org
> Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
> List help: virtio-comment-help@lists.oasis-open.org
> 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: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-26  3:32                                                                   ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-26  3:32 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sat, Jun 10, 2023 at 1:12 AM Parav Pandit <parav@nvidia.com> wrote:
>
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: Friday, June 9, 2023 3:22 AM
> >
> > On Fri, Jun 09, 2023 at 02:27:01PM +0800, Jason Wang wrote:
> > > > I would like to keep the stateful interactions of 1.x device outside of 0.9.5.
> > >
> > > I don't think this is a real problem, but let's see the drawbacks of
> > > this proposal:
> > >
> > > 1) non-trivial changes of full new transport alike ABI
> > > 2) can't work for nesting
> > > 3) require vendor to implement legacy behaviour which can't be
> > > documented precisely
> > > 4) require admin virtqueue to work
> > >
> > > We won't have the above issues if we use modern + legacy header/mac.
> > >
> > > Thanks
> >
> >
> > All this is true. But it's by design. It makes the legacy thing as isolated as
> > possible. Because let's be frank we won't be able to drop legacy support in like
> > 10 years. But hardware vendors will do that quickly if they can't sell hardware.
>
> I don't think above 4 points are true for below reasoning.
>
> Hypervisor flow without involving guest; first sanity round to figure out things can work:

Why is this sanity round a must?

> 1. reset the device
> 2. set ACK and DRIVER bit
> 3. read features and make sure _MAC, _HDR are supported.

Similar step is required even for AQ since the hypervisor needs to
know if legacy commands are supported there.

> 4. if not abort.
> 5. reset the device 2nd time so that guest can have right view of things.
>
> On guest access of legacy area:
> 6. reset the device
> 7. set ACK and DRIVER bit on guest request
> 8. read features and make sure _MAC, _HDR are offered
> 8.1 Hope for the best that on two completely unrelated device reset on #1 and #6, the device offers exact same feature bits.

Explained and discussed in another thread, this is a hard requirement
otherwise a lot of things would break.

> And mention this in the spec 1.x for rest of the future.
>
> We shouldn't be adding such a limitation to the spec.
> We have seen this with mlx5 device where 5 years ago one thought this cannot happen.
> And now with modern use case now features changes across two resets for mlx5 device.
> Baking such limitation in current spec for past 1.x is sub-optimal.
>
> ok, so to avoid baking such reset flow nasty things in spec, lets avoid flow of #1 to #5 in hypervisor.
> So, provision the device to support these new feature bits via AQ.
> So AQ is required for feature provisioning anyway.
>
> So, your point #4 is required in both methods and so it scores same as this proposal.
> Hence feature bit is not of an advantage.
>
> With _MAC now we need writable mac on 1.x config space.
> for 1.x writable mac has two requirements.
> 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)

For LEGACY_MAC, we don't need to be atomic. We manage to survive for
several years.

> 2. should be synchronous to know success/failure to know when it is effective

It's as simple as allowing mac in the device configuration space writable.

>
> Both are present on the CVQ, so yet add another duplicate 1.x scheme that fulfill above requirements.

I'm not sure how to define duplication, the legacy device
configuration space access via admin virtqueue is kind of a
duplication in this sense as well.

>
> ok. So may be let's do AQ command for just mac setting.
>
> This scores down now for two reasons.
> a. Duplicate of existing 1.x feature
> b. requires AQ.
>
> So, from RW mac we moved from 1.x cfg space to AQ. This mediation for 1.x is not good.

Modern drivers just won't negotiate LEGACY_MAC, so there's no mediation at all.

> And now it's not trivial either as it is not just simple *p_mac = X.
> Hence, #1 of non-trivial starts to looks less appealing.
>
> Your point #3 about vendor to implement legacy behavior.
> If vendor needs to support legacy, vendor anyway needs to implement _HDR anyway in data path.
> and above MAC change, and feature provisioning.

I think there are some misunderstandings here:

For legacy behaviour, I mainly meant the behaviour in the corner cases
that can't be documented (easily) by the spec since it is defined by
the code (e.g Linux drivers and Qemu). LEGACY_MAC/HDR doesn't belong
to those since the behaviour is well understood and defined in the
spec.

It's very hard to audit each corner case and it would easily result in
endless errata of the hardware. Modern devices have clearly defined
behaviour and it's easier to implement. It's never too late to fix
spec if we found a bug.

>
> For legacy there is no extra/special documentation.
> All the behavior listed in Legacy interfaces section for configuration register present applies here.

That's not true, the legacy section is the best effort since it's too
late to define (codes came before the spec).

>
> So, I don't see mac support is trivial by any means compared to proposed scheme for 1.x.
> Hence, comparing trivialness of two solutions seems same for your point #1 once you do mac plumbing.
>
> Regarding #2 on nesting. I won't claim I understand this as your level of knowledge.
> If you are sauing only the VF is in VM as virtio PCI device to supporting nested guest, that doesn't have AQ, hence it doesn't work due above issues.

This is the most common setup, no?

The major issues are the transport function is not self contained in a
device (function). This will cause a lot of trouble when trying to
implement nesting. E.g you need to assign or emulate SR-IOV from L1 to
L(N-1) in order to let L(N) to work.

Thanks

>
> Then yes, but than it is back to square one, where you need sequence #1 to #8 to be done + non-forward-looking spec changes on reset flow.
>
> In that alternative, one can say, hey skip steps #1 to #5, and on step #8 doesn't have required feature bit, mark the device FAILED.
> But this is common case and its late in the init flow to discover it.
>
> And now MAC cannot be set atomically either in nesting with just feature bit without ugly and non-trivial spec updates.
> And when one needs nesting with legacy, probably PV is better.
>
> As Michael said,
> Overall isolating legacy to AQ for config, intx and by reusing 1.x's notification is good trade off where 1.x device level interface is kept as detached from the legacy as possible.
>
> This is why the notification address query also was desired via AQ as proposed in v3, but it is small trade off if you think it should be discovered via PCI cap like v5.
>
> 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: virtio-comment-subscribe@lists.oasis-open.org
> Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
> List help: virtio-comment-help@lists.oasis-open.org
> 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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-11  0:27                                                                   ` Michael S. Tsirkin
@ 2023-06-26  3:46                                                                     ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-26  3:46 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 11, 2023 at 8:27 AM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Fri, Jun 09, 2023 at 05:11:53PM +0000, Parav Pandit wrote:
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Friday, June 9, 2023 3:22 AM
> > >
> > > On Fri, Jun 09, 2023 at 02:27:01PM +0800, Jason Wang wrote:
> > > > > I would like to keep the stateful interactions of 1.x device outside of 0.9.5.
> > > >
> > > > I don't think this is a real problem, but let's see the drawbacks of
> > > > this proposal:
> > > >
> > > > 1) non-trivial changes of full new transport alike ABI
> > > > 2) can't work for nesting
> > > > 3) require vendor to implement legacy behaviour which can't be
> > > > documented precisely
> > > > 4) require admin virtqueue to work
> > > >
> > > > We won't have the above issues if we use modern + legacy header/mac.
> > > >
> > > > Thanks
> > >
> > >
> > > All this is true. But it's by design. It makes the legacy thing as isolated as
> > > possible. Because let's be frank we won't be able to drop legacy support in like
> > > 10 years. But hardware vendors will do that quickly if they can't sell hardware.
> >
> > I don't think above 4 points are true for below reasoning.
> >
> > Hypervisor flow without involving guest; first sanity round to figure out things can work:
> > 1. reset the device
> > 2. set ACK and DRIVER bit
> > 3. read features and make sure _MAC, _HDR are supported.
> > 4. if not abort.
> > 5. reset the device 2nd time so that guest can have right view of things.
> >
> > On guest access of legacy area:
> > 6. reset the device
> > 7. set ACK and DRIVER bit on guest request
> > 8. read features and make sure _MAC, _HDR are offered
> > 8.1 Hope for the best that on two completely unrelated device reset on #1 and #6, the device offers exact same feature bits.
> > And mention this in the spec 1.x for rest of the future.
>
> > We shouldn't be adding such a limitation to the spec.
> > We have seen this with mlx5 device where 5 years ago one thought this cannot happen.
> > And now with modern use case now features changes across two resets for mlx5 device.
>
> Interesting this actually violates a spec recommendation:
>
>         If a device has successfully negotiated a set of features
>         at least once (by accepting the FEATURES_OK \field{device
>         status} bit during device initialization), then it SHOULD
>         NOT fail re-negotiation of the same set of features after
>         a device or system reset.  Failure to do so would interfere
>         with resuming from suspend and error recovery.
>
>
> > Baking such limitation in current spec for past 1.x is sub-optimal.
> >
> > ok, so to avoid baking such reset flow nasty things in spec, lets avoid flow of #1 to #5 in hypervisor.
> > So, provision the device to support these new feature bits via AQ.
> > So AQ is required for feature provisioning anyway.
> >
> > So, your point #4 is required in both methods and so it scores same as this proposal.
> > Hence feature bit is not of an advantage.
> >
> > With _MAC now we need writable mac on 1.x config space.
> > for 1.x writable mac has two requirements.
> > 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
> > 2. should be synchronous to know success/failure to know when it is effective
> >
> > Both are present on the CVQ, so yet add another duplicate 1.x scheme that fulfill above requirements.
> >
> > ok. So may be let's do AQ command for just mac setting.
> >
> > This scores down now for two reasons.
> > a. Duplicate of existing 1.x feature
> > b. requires AQ.
> >
> > So, from RW mac we moved from 1.x cfg space to AQ. This mediation for 1.x is not good.
> > And now it's not trivial either as it is not just simple *p_mac = X.
> > Hence, #1 of non-trivial starts to looks less appealing.
> >
> > Your point #3 about vendor to implement legacy behavior.
> > If vendor needs to support legacy, vendor anyway needs to implement _HDR anyway in data path.
> > and above MAC change, and feature provisioning.
> >
> > For legacy there is no extra/special documentation.
> > All the behavior listed in Legacy interfaces section for configuration register present applies here.
> >
> > So, I don't see mac support is trivial by any means compared to proposed scheme for 1.x.
> > Hence, comparing trivialness of two solutions seems same for your point #1 once you do mac plumbing.
> >
> > Regarding #2 on nesting. I won't claim I understand this as your level of knowledge.
> > If you are sauing only the VF is in VM as virtio PCI device to supporting nested guest, that doesn't have AQ, hence it doesn't work due above issues.
>
> Nothing is tied to admin queue here btw - it's using admin commands.
> And by the way, there's a simple way to make this work with nesting
> down the road if we want to: add support for sending admin commands
> using MMIO. Jason, if you want to solve nesting I think that's the best
> way. Will address other use-cases too, not just legacy.

Probably, but then just for the legacy support it would be much easier
to allow legacy MMIO BAR in this case other than inventing new
capability for carrying admin commands.

And I found more issues:

1) The owner device itself is not a member of the group. We need to
relax this otherwise MMIO still requires a PF for example.
2) The admin command is variable length, which is kind of hard to be
implemented via a MMIO interface, we need tweak the spec to define a
maximum length or invent a way to probe the maximum length

Thanks

>
>
> > Then yes, but than it is back to square one, where you need sequence #1 to #8 to be done + non-forward-looking spec changes on reset flow.
> >
> > In that alternative, one can say, hey skip steps #1 to #5, and on step #8 doesn't have required feature bit, mark the device FAILED.
> > But this is common case and its late in the init flow to discover it.
> >
> > And now MAC cannot be set atomically either in nesting with just feature bit without ugly and non-trivial spec updates.
> > And when one needs nesting with legacy, probably PV is better.
> >
> > As Michael said,
> > Overall isolating legacy to AQ for config, intx and by reusing 1.x's notification is good trade off where 1.x device level interface is kept as detached from the legacy as possible.
> >
> > This is why the notification address query also was desired via AQ as proposed in v3, but it is small trade off if you think it should be discovered via PCI cap like v5.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-26  3:46                                                                     ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-26  3:46 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Sun, Jun 11, 2023 at 8:27 AM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Fri, Jun 09, 2023 at 05:11:53PM +0000, Parav Pandit wrote:
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Friday, June 9, 2023 3:22 AM
> > >
> > > On Fri, Jun 09, 2023 at 02:27:01PM +0800, Jason Wang wrote:
> > > > > I would like to keep the stateful interactions of 1.x device outside of 0.9.5.
> > > >
> > > > I don't think this is a real problem, but let's see the drawbacks of
> > > > this proposal:
> > > >
> > > > 1) non-trivial changes of full new transport alike ABI
> > > > 2) can't work for nesting
> > > > 3) require vendor to implement legacy behaviour which can't be
> > > > documented precisely
> > > > 4) require admin virtqueue to work
> > > >
> > > > We won't have the above issues if we use modern + legacy header/mac.
> > > >
> > > > Thanks
> > >
> > >
> > > All this is true. But it's by design. It makes the legacy thing as isolated as
> > > possible. Because let's be frank we won't be able to drop legacy support in like
> > > 10 years. But hardware vendors will do that quickly if they can't sell hardware.
> >
> > I don't think above 4 points are true for below reasoning.
> >
> > Hypervisor flow without involving guest; first sanity round to figure out things can work:
> > 1. reset the device
> > 2. set ACK and DRIVER bit
> > 3. read features and make sure _MAC, _HDR are supported.
> > 4. if not abort.
> > 5. reset the device 2nd time so that guest can have right view of things.
> >
> > On guest access of legacy area:
> > 6. reset the device
> > 7. set ACK and DRIVER bit on guest request
> > 8. read features and make sure _MAC, _HDR are offered
> > 8.1 Hope for the best that on two completely unrelated device reset on #1 and #6, the device offers exact same feature bits.
> > And mention this in the spec 1.x for rest of the future.
>
> > We shouldn't be adding such a limitation to the spec.
> > We have seen this with mlx5 device where 5 years ago one thought this cannot happen.
> > And now with modern use case now features changes across two resets for mlx5 device.
>
> Interesting this actually violates a spec recommendation:
>
>         If a device has successfully negotiated a set of features
>         at least once (by accepting the FEATURES_OK \field{device
>         status} bit during device initialization), then it SHOULD
>         NOT fail re-negotiation of the same set of features after
>         a device or system reset.  Failure to do so would interfere
>         with resuming from suspend and error recovery.
>
>
> > Baking such limitation in current spec for past 1.x is sub-optimal.
> >
> > ok, so to avoid baking such reset flow nasty things in spec, lets avoid flow of #1 to #5 in hypervisor.
> > So, provision the device to support these new feature bits via AQ.
> > So AQ is required for feature provisioning anyway.
> >
> > So, your point #4 is required in both methods and so it scores same as this proposal.
> > Hence feature bit is not of an advantage.
> >
> > With _MAC now we need writable mac on 1.x config space.
> > for 1.x writable mac has two requirements.
> > 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
> > 2. should be synchronous to know success/failure to know when it is effective
> >
> > Both are present on the CVQ, so yet add another duplicate 1.x scheme that fulfill above requirements.
> >
> > ok. So may be let's do AQ command for just mac setting.
> >
> > This scores down now for two reasons.
> > a. Duplicate of existing 1.x feature
> > b. requires AQ.
> >
> > So, from RW mac we moved from 1.x cfg space to AQ. This mediation for 1.x is not good.
> > And now it's not trivial either as it is not just simple *p_mac = X.
> > Hence, #1 of non-trivial starts to looks less appealing.
> >
> > Your point #3 about vendor to implement legacy behavior.
> > If vendor needs to support legacy, vendor anyway needs to implement _HDR anyway in data path.
> > and above MAC change, and feature provisioning.
> >
> > For legacy there is no extra/special documentation.
> > All the behavior listed in Legacy interfaces section for configuration register present applies here.
> >
> > So, I don't see mac support is trivial by any means compared to proposed scheme for 1.x.
> > Hence, comparing trivialness of two solutions seems same for your point #1 once you do mac plumbing.
> >
> > Regarding #2 on nesting. I won't claim I understand this as your level of knowledge.
> > If you are sauing only the VF is in VM as virtio PCI device to supporting nested guest, that doesn't have AQ, hence it doesn't work due above issues.
>
> Nothing is tied to admin queue here btw - it's using admin commands.
> And by the way, there's a simple way to make this work with nesting
> down the road if we want to: add support for sending admin commands
> using MMIO. Jason, if you want to solve nesting I think that's the best
> way. Will address other use-cases too, not just legacy.

Probably, but then just for the legacy support it would be much easier
to allow legacy MMIO BAR in this case other than inventing new
capability for carrying admin commands.

And I found more issues:

1) The owner device itself is not a member of the group. We need to
relax this otherwise MMIO still requires a PF for example.
2) The admin command is variable length, which is kind of hard to be
implemented via a MMIO interface, we need tweak the spec to define a
maximum length or invent a way to probe the maximum length

Thanks

>
>
> > Then yes, but than it is back to square one, where you need sequence #1 to #8 to be done + non-forward-looking spec changes on reset flow.
> >
> > In that alternative, one can say, hey skip steps #1 to #5, and on step #8 doesn't have required feature bit, mark the device FAILED.
> > But this is common case and its late in the init flow to discover it.
> >
> > And now MAC cannot be set atomically either in nesting with just feature bit without ugly and non-trivial spec updates.
> > And when one needs nesting with legacy, probably PV is better.
> >
> > As Michael said,
> > Overall isolating legacy to AQ for config, intx and by reusing 1.x's notification is good trade off where 1.x device level interface is kept as detached from the legacy as possible.
> >
> > This is why the notification address query also was desired via AQ as proposed in v3, but it is small trade off if you think it should be discovered via PCI cap like v5.
>


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  7:21                                                               ` Michael S. Tsirkin
@ 2023-06-26  3:50                                                                 ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-26  3:50 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 9, 2023 at 3:22 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Fri, Jun 09, 2023 at 02:27:01PM +0800, Jason Wang wrote:
> > > I would like to keep the stateful interactions of 1.x device outside of 0.9.5.
> >
> > I don't think this is a real problem, but let's see the drawbacks of
> > this proposal:
> >
> > 1) non-trivial changes of full new transport alike ABI
> > 2) can't work for nesting
> > 3) require vendor to implement legacy behaviour which can't be
> > documented precisely
> > 4) require admin virtqueue to work
> >
> > We won't have the above issues if we use modern + legacy header/mac.
> >
> > Thanks
>
>
> All this is true. But it's by design. It makes the legacy thing
> as isolated as possible.

Only the device ABI but not the implementation I think.

> Because let's be frank we won't be
> able to drop legacy support in like 10 years.

Another question is, current modern PCI layout could become "legacy"
in the future. So should then the hardware stick the two legacy
interfaces?

> But hardware
> vendors will do that quickly if they can't sell hardware.

It looks to me that producing a modern only device will be more quick and easy?

Thanks

>
> --
> 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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-26  3:50                                                                 ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-26  3:50 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 9, 2023 at 3:22 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Fri, Jun 09, 2023 at 02:27:01PM +0800, Jason Wang wrote:
> > > I would like to keep the stateful interactions of 1.x device outside of 0.9.5.
> >
> > I don't think this is a real problem, but let's see the drawbacks of
> > this proposal:
> >
> > 1) non-trivial changes of full new transport alike ABI
> > 2) can't work for nesting
> > 3) require vendor to implement legacy behaviour which can't be
> > documented precisely
> > 4) require admin virtqueue to work
> >
> > We won't have the above issues if we use modern + legacy header/mac.
> >
> > Thanks
>
>
> All this is true. But it's by design. It makes the legacy thing
> as isolated as possible.

Only the device ABI but not the implementation I think.

> Because let's be frank we won't be
> able to drop legacy support in like 10 years.

Another question is, current modern PCI layout could become "legacy"
in the future. So should then the hardware stick the two legacy
interfaces?

> But hardware
> vendors will do that quickly if they can't sell hardware.

It looks to me that producing a modern only device will be more quick and easy?

Thanks

>
> --
> MST
>


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-26  3:32                                                                   ` Jason Wang
@ 2023-06-26  3:51                                                                     ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-26  3:51 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Jason Wang <jasowang@redhat.com>
> Sent: Sunday, June 25, 2023 11:32 PM

> > Hypervisor flow without involving guest; first sanity round to figure out things
> can work:
> 
> Why is this sanity round a must?
> 
Because there is no point of failing it later when actual rw occurs.

> > 1. reset the device
> > 2. set ACK and DRIVER bit
> > 3. read features and make sure _MAC, _HDR are supported.
> 
> Similar step is required even for AQ since the hypervisor needs to know if legacy
> commands are supported there.
>
No. similar steps are not required on AQ because AQ support discovery is done once per owner device. Not for each member device.
 
> > 4. if not abort.
> > 5. reset the device 2nd time so that guest can have right view of things.
> >
> > On guest access of legacy area:
> > 6. reset the device
> > 7. set ACK and DRIVER bit on guest request 8. read features and make
> > sure _MAC, _HDR are offered
> > 8.1 Hope for the best that on two completely unrelated device reset on #1
> and #6, the device offers exact same feature bits.
> 
> Explained and discussed in another thread, this is a hard requirement otherwise
> a lot of things would break.
>
That limitation is for the past or current.
As we move forward there is no need to continue with such limitation.
There may be more work needed to overcome that limitation, but we don’t want to build on top of that limitation.
 
> > And mention this in the spec 1.x for rest of the future.
> >
> > We shouldn't be adding such a limitation to the spec.
> > We have seen this with mlx5 device where 5 years ago one thought this
> cannot happen.
> > And now with modern use case now features changes across two resets for
> mlx5 device.
> > Baking such limitation in current spec for past 1.x is sub-optimal.
> >
> > ok, so to avoid baking such reset flow nasty things in spec, lets avoid flow of
> #1 to #5 in hypervisor.
> > So, provision the device to support these new feature bits via AQ.
> > So AQ is required for feature provisioning anyway.
> >
> > So, your point #4 is required in both methods and so it scores same as this
> proposal.
> > Hence feature bit is not of an advantage.
> >
> > With _MAC now we need writable mac on 1.x config space.
> > for 1.x writable mac has two requirements.
> > 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
> 
> For LEGACY_MAC, we don't need to be atomic. We manage to survive for
> several years.
>
It was cited as issue in past discussed when you and Michael both asked to consider tvq.
What changed now?

The issue is that device hw needs implement special RW registers now for the mac for legacy.
This is the unwanted burden not needed, where AQ is better.

> > 2. should be synchronous to know success/failure to know when it is
> > effective
> 
> It's as simple as allowing mac in the device configuration space writable.
>
Not simple for hw at scale. AQ is superior that communicates rarely used information.
 
> >
> > Both are present on the CVQ, so yet add another duplicate 1.x scheme that
> fulfill above requirements.
> 
> I'm not sure how to define duplication, the legacy device configuration space
> access via admin virtqueue is kind of a duplication in this sense as well.
>
It only exists on AQ for legacy purpose.
The feature bit defined is not for legacy, hence its duplicated.

> >
> > ok. So may be let's do AQ command for just mac setting.
> >
> > This scores down now for two reasons.
> > a. Duplicate of existing 1.x feature
> > b. requires AQ.
> >
> > So, from RW mac we moved from 1.x cfg space to AQ. This mediation for 1.x is
> not good.
> 
> Modern drivers just won't negotiate LEGACY_MAC, so there's no mediation at
> all.
As feature, there is no need to prefix it with LEGACY because it’s a new feature.

> 
> > And now it's not trivial either as it is not just simple *p_mac = X.
> > Hence, #1 of non-trivial starts to looks less appealing.
> >
> > Your point #3 about vendor to implement legacy behavior.
> > If vendor needs to support legacy, vendor anyway needs to implement _HDR
> anyway in data path.
> > and above MAC change, and feature provisioning.
> 
> I think there are some misunderstandings here:
> 
> For legacy behaviour, I mainly meant the behaviour in the corner cases that
> can't be documented (easily) by the spec since it is defined by the code (e.g
> Linux drivers and Qemu). LEGACY_MAC/HDR doesn't belong to those since the
> behaviour is well understood and defined in the spec.
> 
> It's very hard to audit each corner case and it would easily result in endless
> errata of the hardware. Modern devices have clearly defined behaviour and it's
> easier to implement. It's never too late to fix spec if we found a bug.
>
I don’t see how that is avoided when one side has undefined corner case that is translated to well defined behavior.
It only means that piece will be in endless errata in sw.
It still scores same or less.
 
> >
> > For legacy there is no extra/special documentation.
> > All the behavior listed in Legacy interfaces section for configuration register
> present applies here.
> 
> That's not true, the legacy section is the best effort since it's too late to define
> (codes came before the spec).
>
One can added the missing documentation...

 
> >
> > So, I don't see mac support is trivial by any means compared to proposed
> scheme for 1.x.
> > Hence, comparing trivialness of two solutions seems same for your point #1
> once you do mac plumbing.
> >
> > Regarding #2 on nesting. I won't claim I understand this as your level of
> knowledge.
> > If you are sauing only the VF is in VM as virtio PCI device to supporting nested
> guest, that doesn't have AQ, hence it doesn't work due above issues.
> 
> This is the most common setup, no?
>
Depends on who see it.
We don’t see common setup for legacy or otherwise.
 
> The major issues are the transport function is not self contained in a device
> (function). This will cause a lot of trouble when trying to implement nesting. E.g
> you need to assign or emulate SR-IOV from L1 to
> L(N-1) in order to let L(N) to work.
>
Those who do nesting usually do assign the PF as well.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-26  3:51                                                                     ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-26  3:51 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Jason Wang <jasowang@redhat.com>
> Sent: Sunday, June 25, 2023 11:32 PM

> > Hypervisor flow without involving guest; first sanity round to figure out things
> can work:
> 
> Why is this sanity round a must?
> 
Because there is no point of failing it later when actual rw occurs.

> > 1. reset the device
> > 2. set ACK and DRIVER bit
> > 3. read features and make sure _MAC, _HDR are supported.
> 
> Similar step is required even for AQ since the hypervisor needs to know if legacy
> commands are supported there.
>
No. similar steps are not required on AQ because AQ support discovery is done once per owner device. Not for each member device.
 
> > 4. if not abort.
> > 5. reset the device 2nd time so that guest can have right view of things.
> >
> > On guest access of legacy area:
> > 6. reset the device
> > 7. set ACK and DRIVER bit on guest request 8. read features and make
> > sure _MAC, _HDR are offered
> > 8.1 Hope for the best that on two completely unrelated device reset on #1
> and #6, the device offers exact same feature bits.
> 
> Explained and discussed in another thread, this is a hard requirement otherwise
> a lot of things would break.
>
That limitation is for the past or current.
As we move forward there is no need to continue with such limitation.
There may be more work needed to overcome that limitation, but we don’t want to build on top of that limitation.
 
> > And mention this in the spec 1.x for rest of the future.
> >
> > We shouldn't be adding such a limitation to the spec.
> > We have seen this with mlx5 device where 5 years ago one thought this
> cannot happen.
> > And now with modern use case now features changes across two resets for
> mlx5 device.
> > Baking such limitation in current spec for past 1.x is sub-optimal.
> >
> > ok, so to avoid baking such reset flow nasty things in spec, lets avoid flow of
> #1 to #5 in hypervisor.
> > So, provision the device to support these new feature bits via AQ.
> > So AQ is required for feature provisioning anyway.
> >
> > So, your point #4 is required in both methods and so it scores same as this
> proposal.
> > Hence feature bit is not of an advantage.
> >
> > With _MAC now we need writable mac on 1.x config space.
> > for 1.x writable mac has two requirements.
> > 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
> 
> For LEGACY_MAC, we don't need to be atomic. We manage to survive for
> several years.
>
It was cited as issue in past discussed when you and Michael both asked to consider tvq.
What changed now?

The issue is that device hw needs implement special RW registers now for the mac for legacy.
This is the unwanted burden not needed, where AQ is better.

> > 2. should be synchronous to know success/failure to know when it is
> > effective
> 
> It's as simple as allowing mac in the device configuration space writable.
>
Not simple for hw at scale. AQ is superior that communicates rarely used information.
 
> >
> > Both are present on the CVQ, so yet add another duplicate 1.x scheme that
> fulfill above requirements.
> 
> I'm not sure how to define duplication, the legacy device configuration space
> access via admin virtqueue is kind of a duplication in this sense as well.
>
It only exists on AQ for legacy purpose.
The feature bit defined is not for legacy, hence its duplicated.

> >
> > ok. So may be let's do AQ command for just mac setting.
> >
> > This scores down now for two reasons.
> > a. Duplicate of existing 1.x feature
> > b. requires AQ.
> >
> > So, from RW mac we moved from 1.x cfg space to AQ. This mediation for 1.x is
> not good.
> 
> Modern drivers just won't negotiate LEGACY_MAC, so there's no mediation at
> all.
As feature, there is no need to prefix it with LEGACY because it’s a new feature.

> 
> > And now it's not trivial either as it is not just simple *p_mac = X.
> > Hence, #1 of non-trivial starts to looks less appealing.
> >
> > Your point #3 about vendor to implement legacy behavior.
> > If vendor needs to support legacy, vendor anyway needs to implement _HDR
> anyway in data path.
> > and above MAC change, and feature provisioning.
> 
> I think there are some misunderstandings here:
> 
> For legacy behaviour, I mainly meant the behaviour in the corner cases that
> can't be documented (easily) by the spec since it is defined by the code (e.g
> Linux drivers and Qemu). LEGACY_MAC/HDR doesn't belong to those since the
> behaviour is well understood and defined in the spec.
> 
> It's very hard to audit each corner case and it would easily result in endless
> errata of the hardware. Modern devices have clearly defined behaviour and it's
> easier to implement. It's never too late to fix spec if we found a bug.
>
I don’t see how that is avoided when one side has undefined corner case that is translated to well defined behavior.
It only means that piece will be in endless errata in sw.
It still scores same or less.
 
> >
> > For legacy there is no extra/special documentation.
> > All the behavior listed in Legacy interfaces section for configuration register
> present applies here.
> 
> That's not true, the legacy section is the best effort since it's too late to define
> (codes came before the spec).
>
One can added the missing documentation...

 
> >
> > So, I don't see mac support is trivial by any means compared to proposed
> scheme for 1.x.
> > Hence, comparing trivialness of two solutions seems same for your point #1
> once you do mac plumbing.
> >
> > Regarding #2 on nesting. I won't claim I understand this as your level of
> knowledge.
> > If you are sauing only the VF is in VM as virtio PCI device to supporting nested
> guest, that doesn't have AQ, hence it doesn't work due above issues.
> 
> This is the most common setup, no?
>
Depends on who see it.
We don’t see common setup for legacy or otherwise.
 
> The major issues are the transport function is not self contained in a device
> (function). This will cause a lot of trouble when trying to implement nesting. E.g
> you need to assign or emulate SR-IOV from L1 to
> L(N-1) in order to let L(N) to work.
>
Those who do nesting usually do assign the PF as well.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-26  3:50                                                                 ` [virtio-dev] " Jason Wang
@ 2023-06-26  3:55                                                                   ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-26  3:55 UTC (permalink / raw)
  To: Jason Wang, Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, Yishai Hadas,
	Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Jason Wang <jasowang@redhat.com>
> Sent: Sunday, June 25, 2023 11:50 PM
 
> > But hardware
> > vendors will do that quickly if they can't sell hardware.
> 
> It looks to me that producing a modern only device will be more quick and
> easy?
AQ based legacy is quick and easy as opposed to other methods captured in alternative section of the latest v6.

Working on v7 to continue over AQ.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-26  3:55                                                                   ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-26  3:55 UTC (permalink / raw)
  To: Jason Wang, Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, Yishai Hadas,
	Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Jason Wang <jasowang@redhat.com>
> Sent: Sunday, June 25, 2023 11:50 PM
 
> > But hardware
> > vendors will do that quickly if they can't sell hardware.
> 
> It looks to me that producing a modern only device will be more quick and
> easy?
AQ based legacy is quick and easy as opposed to other methods captured in alternative section of the latest v6.

Working on v7 to continue over AQ.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-09  7:15                                               ` [virtio-comment] " Michael S. Tsirkin
@ 2023-06-26  3:59                                                 ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-26  3:59 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 9, 2023 at 3:15 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Fri, Jun 09, 2023 at 10:06:43AM +0800, Jason Wang wrote:
> > On Thu, Jun 8, 2023 at 10:38 PM Parav Pandit <parav@nvidia.com> wrote:
> > >
> > >
> > > > From: Jason Wang <jasowang@redhat.com>
> > > > Sent: Wednesday, June 7, 2023 2:54 AM
> > >
> > > > Hypervisor can trap the legacy device configuration space write and convert it
> > > > to cvq commands.
> > > Michael already answered that cvq is not trapped; this is the main design goal we talked several times that it is passthrough device.
> >
> > Is this really a blocker? Wouldn't a new feature(_F_LEFACY_MAC) or cap
> > resolve this?
>
> Of course we can create a set of feature bits emulating legacy.
>
> > >
> > > So no point discussing this again.
> > >
> > > If you have any comments on v4, please let me know.
> > >
> > > Both the design points are addressed in v4.
> > > 1. To split to two commands for device and config area
> > > 2. Use pci cap to learn about notification region
> > >
> > > Since this ABI reflects what we agree on,
> >
> > I think not since you fail to explain why this approach is better than
> > simply adding new features like _F_LEGACY_HEADER and _F_LEGACY_MAC.
> >
> > Thanks
>
> I can explain, I think it's better for these reasons:
>
> - limit the scope. We started out with _F_LEGACY_HEADER
>   but now there's _F_LEGACY_MAC too. What about other
>   device types?

Fortunately, we only have a few types of legacy devices.

> Could be nasty surprises there too.

Yes, but this needs to be addressed no matter what kind of device ABI is chosen.

>   This way we just say "make legacy guests work" and
>   this is the problem of the hardware vendor not ours.

Probably, but we need to try our best to simplify the vendor's life.

>
> - limit the impact. We don't get to maintain the set of hacks
>   needed for legacy in the hypervisor

This is only true if the vendor fully understands the behaviour of the
legacy and implements it correctly which would be very hard. We would
end up with quirks in the hypervisor soon or later.

> - when some weird legacy
>   support requirement surfaces, it will be up to the vendor
>   to fix. HW vendors are also more agressive in deprecating
>   old hardware - they will just stop shipping new
>   hardware when there are no new customers and we can
>   stop adding new hacks.

But the hacks would be there forever if there's users.

>
> - test out admin command interface. This use-case is smaller
>   than full transport vq but similar enough that
>   we will learn valuable lessons from it.

Another issue is that the interface is designed to be PCI specific (at
least from its name) which may result in a strange mediation for MMIO
legacy guests.

>   For example, it already helped us find and correct
>   a design mistake where admin commands had 8 byte aligned length.
>   As another example, I am working on ability to report events to admin command
>   infrastructure which is currently missing.

If we want a MMIO interface for admin commands, it requires more
extensions for such kind of notification.

>   With that in place we will be able to add INT#x emulation for very old
>   guests.
>
>
>
> In short, this interface as you correctly point out is not the normal
> way we build interfaces since it is not modular and less flexible than
> individual feature bits.  However, for the legacy interface this might
> be a good thing.

Ok, I think I would not object to this proposal, but we should not
exclude the possibility of having things like LEGACY_HEADER in the
future.

Thanks

>
>
> > > I would want to raise for vote in coming days to be part of 1.3 in few days as we have more than 3 weeks to sort out non-ABI language part.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-26  3:59                                                 ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-26  3:59 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Fri, Jun 9, 2023 at 3:15 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Fri, Jun 09, 2023 at 10:06:43AM +0800, Jason Wang wrote:
> > On Thu, Jun 8, 2023 at 10:38 PM Parav Pandit <parav@nvidia.com> wrote:
> > >
> > >
> > > > From: Jason Wang <jasowang@redhat.com>
> > > > Sent: Wednesday, June 7, 2023 2:54 AM
> > >
> > > > Hypervisor can trap the legacy device configuration space write and convert it
> > > > to cvq commands.
> > > Michael already answered that cvq is not trapped; this is the main design goal we talked several times that it is passthrough device.
> >
> > Is this really a blocker? Wouldn't a new feature(_F_LEFACY_MAC) or cap
> > resolve this?
>
> Of course we can create a set of feature bits emulating legacy.
>
> > >
> > > So no point discussing this again.
> > >
> > > If you have any comments on v4, please let me know.
> > >
> > > Both the design points are addressed in v4.
> > > 1. To split to two commands for device and config area
> > > 2. Use pci cap to learn about notification region
> > >
> > > Since this ABI reflects what we agree on,
> >
> > I think not since you fail to explain why this approach is better than
> > simply adding new features like _F_LEGACY_HEADER and _F_LEGACY_MAC.
> >
> > Thanks
>
> I can explain, I think it's better for these reasons:
>
> - limit the scope. We started out with _F_LEGACY_HEADER
>   but now there's _F_LEGACY_MAC too. What about other
>   device types?

Fortunately, we only have a few types of legacy devices.

> Could be nasty surprises there too.

Yes, but this needs to be addressed no matter what kind of device ABI is chosen.

>   This way we just say "make legacy guests work" and
>   this is the problem of the hardware vendor not ours.

Probably, but we need to try our best to simplify the vendor's life.

>
> - limit the impact. We don't get to maintain the set of hacks
>   needed for legacy in the hypervisor

This is only true if the vendor fully understands the behaviour of the
legacy and implements it correctly which would be very hard. We would
end up with quirks in the hypervisor soon or later.

> - when some weird legacy
>   support requirement surfaces, it will be up to the vendor
>   to fix. HW vendors are also more agressive in deprecating
>   old hardware - they will just stop shipping new
>   hardware when there are no new customers and we can
>   stop adding new hacks.

But the hacks would be there forever if there's users.

>
> - test out admin command interface. This use-case is smaller
>   than full transport vq but similar enough that
>   we will learn valuable lessons from it.

Another issue is that the interface is designed to be PCI specific (at
least from its name) which may result in a strange mediation for MMIO
legacy guests.

>   For example, it already helped us find and correct
>   a design mistake where admin commands had 8 byte aligned length.
>   As another example, I am working on ability to report events to admin command
>   infrastructure which is currently missing.

If we want a MMIO interface for admin commands, it requires more
extensions for such kind of notification.

>   With that in place we will be able to add INT#x emulation for very old
>   guests.
>
>
>
> In short, this interface as you correctly point out is not the normal
> way we build interfaces since it is not modular and less flexible than
> individual feature bits.  However, for the legacy interface this might
> be a good thing.

Ok, I think I would not object to this proposal, but we should not
exclude the possibility of having things like LEGACY_HEADER in the
future.

Thanks

>
>
> > > I would want to raise for vote in coming days to be part of 1.3 in few days as we have more than 3 weeks to sort out non-ABI language part.
>


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-26  3:59                                                 ` [virtio-comment] " Jason Wang
@ 2023-06-26  4:04                                                   ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-26  4:04 UTC (permalink / raw)
  To: Jason Wang, Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, Yishai Hadas,
	Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: virtio-comment@lists.oasis-open.org <virtio-comment@lists.oasis-
> open.org> On Behalf Of Jason Wang
> Sent: Monday, June 26, 2023 12:00 AM

> >   This way we just say "make legacy guests work" and
> >   this is the problem of the hardware vendor not ours.
> 
> Probably, but we need to try our best to simplify the vendor's life.
>
> >
> > - limit the impact. We don't get to maintain the set of hacks
> >   needed for legacy in the hypervisor
> 
> This is only true if the vendor fully understands the behaviour of the legacy and
> implements it correctly which would be very hard. We would end up with quirks
> in the hypervisor soon or later.
> 
You can help vendor understand the legacy so that hypervisor don’t have the quirks. :)

> > - when some weird legacy
> >   support requirement surfaces, it will be up to the vendor
> >   to fix. HW vendors are also more agressive in deprecating
> >   old hardware - they will just stop shipping new
> >   hardware when there are no new customers and we can
> >   stop adding new hacks.
> 
> But the hacks would be there forever if there's users.
> 
> >
> > - test out admin command interface. This use-case is smaller
> >   than full transport vq but similar enough that
> >   we will learn valuable lessons from it.
> 
> Another issue is that the interface is designed to be PCI specific (at least from its
> name) which may result in a strange mediation for MMIO legacy guests.
> 
It is no different than AQ being only for the PCI today.
So far no user of MMIO legacy, may be in future it can be extended if required.

We don’t want legacy to be that grand either.

I am moving most things to generic section (instead of PCI) based on Michael's inputs.


> >   For example, it already helped us find and correct
> >   a design mistake where admin commands had 8 byte aligned length.
> >   As another example, I am working on ability to report events to admin
> command
> >   infrastructure which is currently missing.
> 
> If we want a MMIO interface for admin commands, it requires more extensions
> for such kind of notification.
> 
> >   With that in place we will be able to add INT#x emulation for very old
> >   guests.
> >
> >
> >
> > In short, this interface as you correctly point out is not the normal
> > way we build interfaces since it is not modular and less flexible than
> > individual feature bits.  However, for the legacy interface this might
> > be a good thing.
> 
> Ok, I think I would not object to this proposal, but we should not exclude the
> possibility of having things like LEGACY_HEADER in the future.

Thanks.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-26  4:04                                                   ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-26  4:04 UTC (permalink / raw)
  To: Jason Wang, Michael S. Tsirkin
  Cc: virtio-dev, cohuck, david.edmondson, sburla, Yishai Hadas,
	Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: virtio-comment@lists.oasis-open.org <virtio-comment@lists.oasis-
> open.org> On Behalf Of Jason Wang
> Sent: Monday, June 26, 2023 12:00 AM

> >   This way we just say "make legacy guests work" and
> >   this is the problem of the hardware vendor not ours.
> 
> Probably, but we need to try our best to simplify the vendor's life.
>
> >
> > - limit the impact. We don't get to maintain the set of hacks
> >   needed for legacy in the hypervisor
> 
> This is only true if the vendor fully understands the behaviour of the legacy and
> implements it correctly which would be very hard. We would end up with quirks
> in the hypervisor soon or later.
> 
You can help vendor understand the legacy so that hypervisor don’t have the quirks. :)

> > - when some weird legacy
> >   support requirement surfaces, it will be up to the vendor
> >   to fix. HW vendors are also more agressive in deprecating
> >   old hardware - they will just stop shipping new
> >   hardware when there are no new customers and we can
> >   stop adding new hacks.
> 
> But the hacks would be there forever if there's users.
> 
> >
> > - test out admin command interface. This use-case is smaller
> >   than full transport vq but similar enough that
> >   we will learn valuable lessons from it.
> 
> Another issue is that the interface is designed to be PCI specific (at least from its
> name) which may result in a strange mediation for MMIO legacy guests.
> 
It is no different than AQ being only for the PCI today.
So far no user of MMIO legacy, may be in future it can be extended if required.

We don’t want legacy to be that grand either.

I am moving most things to generic section (instead of PCI) based on Michael's inputs.


> >   For example, it already helped us find and correct
> >   a design mistake where admin commands had 8 byte aligned length.
> >   As another example, I am working on ability to report events to admin
> command
> >   infrastructure which is currently missing.
> 
> If we want a MMIO interface for admin commands, it requires more extensions
> for such kind of notification.
> 
> >   With that in place we will be able to add INT#x emulation for very old
> >   guests.
> >
> >
> >
> > In short, this interface as you correctly point out is not the normal
> > way we build interfaces since it is not modular and less flexible than
> > individual feature bits.  However, for the legacy interface this might
> > be a good thing.
> 
> Ok, I think I would not object to this proposal, but we should not exclude the
> possibility of having things like LEGACY_HEADER in the future.

Thanks.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-26  3:59                                                 ` [virtio-comment] " Jason Wang
@ 2023-06-26  7:13                                                   ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-26  7:13 UTC (permalink / raw)
  To: Jason Wang
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 26, 2023 at 11:59:42AM +0800, Jason Wang wrote:
> > - when some weird legacy
> >   support requirement surfaces, it will be up to the vendor
> >   to fix. HW vendors are also more agressive in deprecating
> >   old hardware - they will just stop shipping new
> >   hardware when there are no new customers and we can
> >   stop adding new hacks.
> 
> But the hacks would be there forever if there's users.

If they are in hardware, they won't - only as long as
hardware exists.

> >
> > - test out admin command interface. This use-case is smaller
> >   than full transport vq but similar enough that
> >   we will learn valuable lessons from it.
> 
> Another issue is that the interface is designed to be PCI specific (at
> least from its name) which may result in a strange mediation for MMIO
> legacy guests.


I doubt there's a way to make guests utilizing legacy MMIO work with
offloads - it's not widely used on x86 and other platforms have weaker
ordering.

> >   For example, it already helped us find and correct
> >   a design mistake where admin commands had 8 byte aligned length.
> >   As another example, I am working on ability to report events to admin command
> >   infrastructure which is currently missing.
> 
> If we want a MMIO interface for admin commands, it requires more
> extensions for such kind of notification.

Yes I don't know how that will work. Not sure what the
implication is though.


> >   With that in place we will be able to add INT#x emulation for very old
> >   guests.
> >
> >
> >
> > In short, this interface as you correctly point out is not the normal
> > way we build interfaces since it is not modular and less flexible than
> > individual feature bits.  However, for the legacy interface this might
> > be a good thing.
> 
> Ok, I think I would not object to this proposal, but we should not
> exclude the possibility of having things like LEGACY_HEADER in the
> future.
> 
> Thanks

Yes I always disliked that change. Feel free to propose it, I'll
support.

> >
> >
> > > > I would want to raise for vote in coming days to be part of 1.3 in few days as we have more than 3 weeks to sort out non-ABI language part.
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-26  7:13                                                   ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-26  7:13 UTC (permalink / raw)
  To: Jason Wang
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 26, 2023 at 11:59:42AM +0800, Jason Wang wrote:
> > - when some weird legacy
> >   support requirement surfaces, it will be up to the vendor
> >   to fix. HW vendors are also more agressive in deprecating
> >   old hardware - they will just stop shipping new
> >   hardware when there are no new customers and we can
> >   stop adding new hacks.
> 
> But the hacks would be there forever if there's users.

If they are in hardware, they won't - only as long as
hardware exists.

> >
> > - test out admin command interface. This use-case is smaller
> >   than full transport vq but similar enough that
> >   we will learn valuable lessons from it.
> 
> Another issue is that the interface is designed to be PCI specific (at
> least from its name) which may result in a strange mediation for MMIO
> legacy guests.


I doubt there's a way to make guests utilizing legacy MMIO work with
offloads - it's not widely used on x86 and other platforms have weaker
ordering.

> >   For example, it already helped us find and correct
> >   a design mistake where admin commands had 8 byte aligned length.
> >   As another example, I am working on ability to report events to admin command
> >   infrastructure which is currently missing.
> 
> If we want a MMIO interface for admin commands, it requires more
> extensions for such kind of notification.

Yes I don't know how that will work. Not sure what the
implication is though.


> >   With that in place we will be able to add INT#x emulation for very old
> >   guests.
> >
> >
> >
> > In short, this interface as you correctly point out is not the normal
> > way we build interfaces since it is not modular and less flexible than
> > individual feature bits.  However, for the legacy interface this might
> > be a good thing.
> 
> Ok, I think I would not object to this proposal, but we should not
> exclude the possibility of having things like LEGACY_HEADER in the
> future.
> 
> Thanks

Yes I always disliked that change. Feel free to propose it, I'll
support.

> >
> >
> > > > I would want to raise for vote in coming days to be part of 1.3 in few days as we have more than 3 weeks to sort out non-ABI language part.
> >


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-26  3:50                                                                 ` [virtio-dev] " Jason Wang
@ 2023-06-26 10:49                                                                   ` Michael S. Tsirkin
  -1 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-26 10:49 UTC (permalink / raw)
  To: Jason Wang
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 26, 2023 at 11:50:24AM +0800, Jason Wang wrote:
> > But hardware
> > vendors will do that quickly if they can't sell hardware.
> 
> It looks to me that producing a modern only device will be more quick and easy?
> 
> Thanks

Exactly, that's the point.

-- 
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-26 10:49                                                                   ` Michael S. Tsirkin
  0 siblings, 0 replies; 164+ messages in thread
From: Michael S. Tsirkin @ 2023-06-26 10:49 UTC (permalink / raw)
  To: Jason Wang
  Cc: Parav Pandit, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 26, 2023 at 11:50:24AM +0800, Jason Wang wrote:
> > But hardware
> > vendors will do that quickly if they can't sell hardware.
> 
> It looks to me that producing a modern only device will be more quick and easy?
> 
> Thanks

Exactly, that's the point.

-- 
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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-26  3:51                                                                     ` Parav Pandit
@ 2023-06-27  2:38                                                                       ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-27  2:38 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 26, 2023 at 11:52 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Sunday, June 25, 2023 11:32 PM
>
> > > Hypervisor flow without involving guest; first sanity round to figure out things
> > can work:
> >
> > Why is this sanity round a must?
> >
> Because there is no point of failing it later when actual rw occurs.

Even with admin virtqueue, the hypervisor should be ready for any
admin command failures somehow.

And with modern devices, the reset is not a must, the hypervisor can
just read device_features to check if _MAC/_HDR is there. And what's
more important, the hypervisor can know if the feature negotiation
succeeds or not. With legacy, there's no such way.

>
> > > 1. reset the device
> > > 2. set ACK and DRIVER bit
> > > 3. read features and make sure _MAC, _HDR are supported.
> >
> > Similar step is required even for AQ since the hypervisor needs to know if legacy
> > commands are supported there.
> >
> No. similar steps are not required on AQ because AQ support discovery is done once per owner device. Not for each member device.

This seems a topic beyond legacy. If both modern and transitional
devices are supported, a per device probing or provisioning is still
required. And if provisioning is supported, there's no need to probe
MAC/HDR.

>
> > > 4. if not abort.
> > > 5. reset the device 2nd time so that guest can have right view of things.
> > >
> > > On guest access of legacy area:
> > > 6. reset the device
> > > 7. set ACK and DRIVER bit on guest request 8. read features and make
> > > sure _MAC, _HDR are offered
> > > 8.1 Hope for the best that on two completely unrelated device reset on #1
> > and #6, the device offers exact same feature bits.
> >
> > Explained and discussed in another thread, this is a hard requirement otherwise
> > a lot of things would break.
> >
> That limitation is for the past or current.

You need at least a new feature bit.

> As we move forward there is no need to continue with such limitation.
> There may be more work needed to overcome that limitation, but we don’t want to build on top of that limitation.

Let's open a dedicated thread for this if necessary.

>
> > > And mention this in the spec 1.x for rest of the future.
> > >
> > > We shouldn't be adding such a limitation to the spec.
> > > We have seen this with mlx5 device where 5 years ago one thought this
> > cannot happen.
> > > And now with modern use case now features changes across two resets for
> > mlx5 device.
> > > Baking such limitation in current spec for past 1.x is sub-optimal.
> > >
> > > ok, so to avoid baking such reset flow nasty things in spec, lets avoid flow of
> > #1 to #5 in hypervisor.
> > > So, provision the device to support these new feature bits via AQ.
> > > So AQ is required for feature provisioning anyway.
> > >
> > > So, your point #4 is required in both methods and so it scores same as this
> > proposal.
> > > Hence feature bit is not of an advantage.
> > >
> > > With _MAC now we need writable mac on 1.x config space.
> > > for 1.x writable mac has two requirements.
> > > 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
> >
> > For LEGACY_MAC, we don't need to be atomic. We manage to survive for
> > several years.
> >
> It was cited as issue in past discussed when you and Michael both asked to consider tvq.
> What changed now?

Nothing changed, what I meant is: with admin virtqueue it could be
atomic or not.

>
> The issue is that device hw needs implement special RW registers now for the mac for legacy.
> This is the unwanted burden not needed, where AQ is better.

How can you solve the atomic issue in this case? The issue is the
driver where legacy guests write to device configuration space byte by
byte. Modern guests will use cvq.

>
> > > 2. should be synchronous to know success/failure to know when it is
> > > effective
> >
> > It's as simple as allowing mac in the device configuration space writable.
> >
> Not simple for hw at scale.

I don't understand, it uses modern device configuration space. How
does it matter with the scale of admin virtqueue?

> AQ is superior that communicates rarely used information.
>
> > >
> > > Both are present on the CVQ, so yet add another duplicate 1.x scheme that
> > fulfill above requirements.
> >
> > I'm not sure how to define duplication, the legacy device configuration space
> > access via admin virtqueue is kind of a duplication in this sense as well.
> >
> It only exists on AQ for legacy purpose.
> The feature bit defined is not for legacy, hence its duplicated.

It's for legacy mediation and what's more, it allows mac to be
configured without cvq.

>
> > >
> > > ok. So may be let's do AQ command for just mac setting.
> > >
> > > This scores down now for two reasons.
> > > a. Duplicate of existing 1.x feature
> > > b. requires AQ.
> > >
> > > So, from RW mac we moved from 1.x cfg space to AQ. This mediation for 1.x is
> > not good.
> >
> > Modern drivers just won't negotiate LEGACY_MAC, so there's no mediation at
> > all.
> As feature, there is no need to prefix it with LEGACY because it’s a new feature.
>
> >
> > > And now it's not trivial either as it is not just simple *p_mac = X.
> > > Hence, #1 of non-trivial starts to looks less appealing.
> > >
> > > Your point #3 about vendor to implement legacy behavior.
> > > If vendor needs to support legacy, vendor anyway needs to implement _HDR
> > anyway in data path.
> > > and above MAC change, and feature provisioning.
> >
> > I think there are some misunderstandings here:
> >
> > For legacy behaviour, I mainly meant the behaviour in the corner cases that
> > can't be documented (easily) by the spec since it is defined by the code (e.g
> > Linux drivers and Qemu). LEGACY_MAC/HDR doesn't belong to those since the
> > behaviour is well understood and defined in the spec.
> >
> > It's very hard to audit each corner case and it would easily result in endless
> > errata of the hardware. Modern devices have clearly defined behaviour and it's
> > easier to implement. It's never too late to fix spec if we found a bug.
> >
> I don’t see how that is avoided when one side has undefined corner case that is translated to well defined behavior.

Let me give you an example. The legacy device behaviour is basically
what Qemu codes did, by reusing the existing Qemu virtio device model
codes, most of the issues can be avoided.

> It only means that piece will be in endless errata in sw.

Errata in software is much more simpler/cheaper than hardware, isn't it?

> It still scores same or less.
>
> > >
> > > For legacy there is no extra/special documentation.
> > > All the behavior listed in Legacy interfaces section for configuration register
> > present applies here.
> >
> > That's not true, the legacy section is the best effort since it's too late to define
> > (codes came before the spec).
> >
> One can added the missing documentation...

It will be too late for the legacy, and it would be too hard since it
basically tries to describe the exact code behaviour. And there could
be a lot of very hard questions that need to be answered. E.g what
happens if a driver tries to use both modern and legacy interfaces?

>
>
> > >
> > > So, I don't see mac support is trivial by any means compared to proposed
> > scheme for 1.x.
> > > Hence, comparing trivialness of two solutions seems same for your point #1
> > once you do mac plumbing.
> > >
> > > Regarding #2 on nesting. I won't claim I understand this as your level of
> > knowledge.
> > > If you are sauing only the VF is in VM as virtio PCI device to supporting nested
> > guest, that doesn't have AQ, hence it doesn't work due above issues.
> >
> > This is the most common setup, no?
> >
> Depends on who see it.
> We don’t see common setup for legacy or otherwise.
>
> > The major issues are the transport function is not self contained in a device
> > (function). This will cause a lot of trouble when trying to implement nesting. E.g
> > you need to assign or emulate SR-IOV from L1 to
> > L(N-1) in order to let L(N) to work.
> >
> Those who do nesting usually do assign the PF as well.

This is not what I was told and it's not flexible.

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-27  2:38                                                                       ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-27  2:38 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 26, 2023 at 11:52 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Sunday, June 25, 2023 11:32 PM
>
> > > Hypervisor flow without involving guest; first sanity round to figure out things
> > can work:
> >
> > Why is this sanity round a must?
> >
> Because there is no point of failing it later when actual rw occurs.

Even with admin virtqueue, the hypervisor should be ready for any
admin command failures somehow.

And with modern devices, the reset is not a must, the hypervisor can
just read device_features to check if _MAC/_HDR is there. And what's
more important, the hypervisor can know if the feature negotiation
succeeds or not. With legacy, there's no such way.

>
> > > 1. reset the device
> > > 2. set ACK and DRIVER bit
> > > 3. read features and make sure _MAC, _HDR are supported.
> >
> > Similar step is required even for AQ since the hypervisor needs to know if legacy
> > commands are supported there.
> >
> No. similar steps are not required on AQ because AQ support discovery is done once per owner device. Not for each member device.

This seems a topic beyond legacy. If both modern and transitional
devices are supported, a per device probing or provisioning is still
required. And if provisioning is supported, there's no need to probe
MAC/HDR.

>
> > > 4. if not abort.
> > > 5. reset the device 2nd time so that guest can have right view of things.
> > >
> > > On guest access of legacy area:
> > > 6. reset the device
> > > 7. set ACK and DRIVER bit on guest request 8. read features and make
> > > sure _MAC, _HDR are offered
> > > 8.1 Hope for the best that on two completely unrelated device reset on #1
> > and #6, the device offers exact same feature bits.
> >
> > Explained and discussed in another thread, this is a hard requirement otherwise
> > a lot of things would break.
> >
> That limitation is for the past or current.

You need at least a new feature bit.

> As we move forward there is no need to continue with such limitation.
> There may be more work needed to overcome that limitation, but we don’t want to build on top of that limitation.

Let's open a dedicated thread for this if necessary.

>
> > > And mention this in the spec 1.x for rest of the future.
> > >
> > > We shouldn't be adding such a limitation to the spec.
> > > We have seen this with mlx5 device where 5 years ago one thought this
> > cannot happen.
> > > And now with modern use case now features changes across two resets for
> > mlx5 device.
> > > Baking such limitation in current spec for past 1.x is sub-optimal.
> > >
> > > ok, so to avoid baking such reset flow nasty things in spec, lets avoid flow of
> > #1 to #5 in hypervisor.
> > > So, provision the device to support these new feature bits via AQ.
> > > So AQ is required for feature provisioning anyway.
> > >
> > > So, your point #4 is required in both methods and so it scores same as this
> > proposal.
> > > Hence feature bit is not of an advantage.
> > >
> > > With _MAC now we need writable mac on 1.x config space.
> > > for 1.x writable mac has two requirements.
> > > 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
> >
> > For LEGACY_MAC, we don't need to be atomic. We manage to survive for
> > several years.
> >
> It was cited as issue in past discussed when you and Michael both asked to consider tvq.
> What changed now?

Nothing changed, what I meant is: with admin virtqueue it could be
atomic or not.

>
> The issue is that device hw needs implement special RW registers now for the mac for legacy.
> This is the unwanted burden not needed, where AQ is better.

How can you solve the atomic issue in this case? The issue is the
driver where legacy guests write to device configuration space byte by
byte. Modern guests will use cvq.

>
> > > 2. should be synchronous to know success/failure to know when it is
> > > effective
> >
> > It's as simple as allowing mac in the device configuration space writable.
> >
> Not simple for hw at scale.

I don't understand, it uses modern device configuration space. How
does it matter with the scale of admin virtqueue?

> AQ is superior that communicates rarely used information.
>
> > >
> > > Both are present on the CVQ, so yet add another duplicate 1.x scheme that
> > fulfill above requirements.
> >
> > I'm not sure how to define duplication, the legacy device configuration space
> > access via admin virtqueue is kind of a duplication in this sense as well.
> >
> It only exists on AQ for legacy purpose.
> The feature bit defined is not for legacy, hence its duplicated.

It's for legacy mediation and what's more, it allows mac to be
configured without cvq.

>
> > >
> > > ok. So may be let's do AQ command for just mac setting.
> > >
> > > This scores down now for two reasons.
> > > a. Duplicate of existing 1.x feature
> > > b. requires AQ.
> > >
> > > So, from RW mac we moved from 1.x cfg space to AQ. This mediation for 1.x is
> > not good.
> >
> > Modern drivers just won't negotiate LEGACY_MAC, so there's no mediation at
> > all.
> As feature, there is no need to prefix it with LEGACY because it’s a new feature.
>
> >
> > > And now it's not trivial either as it is not just simple *p_mac = X.
> > > Hence, #1 of non-trivial starts to looks less appealing.
> > >
> > > Your point #3 about vendor to implement legacy behavior.
> > > If vendor needs to support legacy, vendor anyway needs to implement _HDR
> > anyway in data path.
> > > and above MAC change, and feature provisioning.
> >
> > I think there are some misunderstandings here:
> >
> > For legacy behaviour, I mainly meant the behaviour in the corner cases that
> > can't be documented (easily) by the spec since it is defined by the code (e.g
> > Linux drivers and Qemu). LEGACY_MAC/HDR doesn't belong to those since the
> > behaviour is well understood and defined in the spec.
> >
> > It's very hard to audit each corner case and it would easily result in endless
> > errata of the hardware. Modern devices have clearly defined behaviour and it's
> > easier to implement. It's never too late to fix spec if we found a bug.
> >
> I don’t see how that is avoided when one side has undefined corner case that is translated to well defined behavior.

Let me give you an example. The legacy device behaviour is basically
what Qemu codes did, by reusing the existing Qemu virtio device model
codes, most of the issues can be avoided.

> It only means that piece will be in endless errata in sw.

Errata in software is much more simpler/cheaper than hardware, isn't it?

> It still scores same or less.
>
> > >
> > > For legacy there is no extra/special documentation.
> > > All the behavior listed in Legacy interfaces section for configuration register
> > present applies here.
> >
> > That's not true, the legacy section is the best effort since it's too late to define
> > (codes came before the spec).
> >
> One can added the missing documentation...

It will be too late for the legacy, and it would be too hard since it
basically tries to describe the exact code behaviour. And there could
be a lot of very hard questions that need to be answered. E.g what
happens if a driver tries to use both modern and legacy interfaces?

>
>
> > >
> > > So, I don't see mac support is trivial by any means compared to proposed
> > scheme for 1.x.
> > > Hence, comparing trivialness of two solutions seems same for your point #1
> > once you do mac plumbing.
> > >
> > > Regarding #2 on nesting. I won't claim I understand this as your level of
> > knowledge.
> > > If you are sauing only the VF is in VM as virtio PCI device to supporting nested
> > guest, that doesn't have AQ, hence it doesn't work due above issues.
> >
> > This is the most common setup, no?
> >
> Depends on who see it.
> We don’t see common setup for legacy or otherwise.
>
> > The major issues are the transport function is not self contained in a device
> > (function). This will cause a lot of trouble when trying to implement nesting. E.g
> > you need to assign or emulate SR-IOV from L1 to
> > L(N-1) in order to let L(N) to work.
> >
> Those who do nesting usually do assign the PF as well.

This is not what I was told and it's not flexible.

Thanks


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-26  4:04                                                   ` Parav Pandit
@ 2023-06-27  2:42                                                     ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-27  2:42 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 26, 2023 at 12:04 PM Parav Pandit <parav@nvidia.com> wrote:
>
>
>
> > From: virtio-comment@lists.oasis-open.org <virtio-comment@lists.oasis-
> > open.org> On Behalf Of Jason Wang
> > Sent: Monday, June 26, 2023 12:00 AM
>
> > >   This way we just say "make legacy guests work" and
> > >   this is the problem of the hardware vendor not ours.
> >
> > Probably, but we need to try our best to simplify the vendor's life.
> >
> > >
> > > - limit the impact. We don't get to maintain the set of hacks
> > >   needed for legacy in the hypervisor
> >
> > This is only true if the vendor fully understands the behaviour of the legacy and
> > implements it correctly which would be very hard. We would end up with quirks
> > in the hypervisor soon or later.
> >
> You can help vendor understand the legacy so that hypervisor don’t have the quirks. :)

I will try, but when trying to develop hardening for virtio drivers, I
feel it could be not an easy task when dealing with legacy devices
(with unexpected behaviours).

If we go with modern devices, our life will be much easier and that's
why I prefer to go with that way.

Thanks

>
> > > - when some weird legacy
> > >   support requirement surfaces, it will be up to the vendor
> > >   to fix. HW vendors are also more agressive in deprecating
> > >   old hardware - they will just stop shipping new
> > >   hardware when there are no new customers and we can
> > >   stop adding new hacks.
> >
> > But the hacks would be there forever if there's users.
> >
> > >
> > > - test out admin command interface. This use-case is smaller
> > >   than full transport vq but similar enough that
> > >   we will learn valuable lessons from it.
> >
> > Another issue is that the interface is designed to be PCI specific (at least from its
> > name) which may result in a strange mediation for MMIO legacy guests.
> >
> It is no different than AQ being only for the PCI today.
> So far no user of MMIO legacy, may be in future it can be extended if required.
>
> We don’t want legacy to be that grand either.
>
> I am moving most things to generic section (instead of PCI) based on Michael's inputs.
>
>
> > >   For example, it already helped us find and correct
> > >   a design mistake where admin commands had 8 byte aligned length.
> > >   As another example, I am working on ability to report events to admin
> > command
> > >   infrastructure which is currently missing.
> >
> > If we want a MMIO interface for admin commands, it requires more extensions
> > for such kind of notification.
> >
> > >   With that in place we will be able to add INT#x emulation for very old
> > >   guests.
> > >
> > >
> > >
> > > In short, this interface as you correctly point out is not the normal
> > > way we build interfaces since it is not modular and less flexible than
> > > individual feature bits.  However, for the legacy interface this might
> > > be a good thing.
> >
> > Ok, I think I would not object to this proposal, but we should not exclude the
> > possibility of having things like LEGACY_HEADER in the future.
>
> Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-27  2:42                                                     ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-27  2:42 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Mon, Jun 26, 2023 at 12:04 PM Parav Pandit <parav@nvidia.com> wrote:
>
>
>
> > From: virtio-comment@lists.oasis-open.org <virtio-comment@lists.oasis-
> > open.org> On Behalf Of Jason Wang
> > Sent: Monday, June 26, 2023 12:00 AM
>
> > >   This way we just say "make legacy guests work" and
> > >   this is the problem of the hardware vendor not ours.
> >
> > Probably, but we need to try our best to simplify the vendor's life.
> >
> > >
> > > - limit the impact. We don't get to maintain the set of hacks
> > >   needed for legacy in the hypervisor
> >
> > This is only true if the vendor fully understands the behaviour of the legacy and
> > implements it correctly which would be very hard. We would end up with quirks
> > in the hypervisor soon or later.
> >
> You can help vendor understand the legacy so that hypervisor don’t have the quirks. :)

I will try, but when trying to develop hardening for virtio drivers, I
feel it could be not an easy task when dealing with legacy devices
(with unexpected behaviours).

If we go with modern devices, our life will be much easier and that's
why I prefer to go with that way.

Thanks

>
> > > - when some weird legacy
> > >   support requirement surfaces, it will be up to the vendor
> > >   to fix. HW vendors are also more agressive in deprecating
> > >   old hardware - they will just stop shipping new
> > >   hardware when there are no new customers and we can
> > >   stop adding new hacks.
> >
> > But the hacks would be there forever if there's users.
> >
> > >
> > > - test out admin command interface. This use-case is smaller
> > >   than full transport vq but similar enough that
> > >   we will learn valuable lessons from it.
> >
> > Another issue is that the interface is designed to be PCI specific (at least from its
> > name) which may result in a strange mediation for MMIO legacy guests.
> >
> It is no different than AQ being only for the PCI today.
> So far no user of MMIO legacy, may be in future it can be extended if required.
>
> We don’t want legacy to be that grand either.
>
> I am moving most things to generic section (instead of PCI) based on Michael's inputs.
>
>
> > >   For example, it already helped us find and correct
> > >   a design mistake where admin commands had 8 byte aligned length.
> > >   As another example, I am working on ability to report events to admin
> > command
> > >   infrastructure which is currently missing.
> >
> > If we want a MMIO interface for admin commands, it requires more extensions
> > for such kind of notification.
> >
> > >   With that in place we will be able to add INT#x emulation for very old
> > >   guests.
> > >
> > >
> > >
> > > In short, this interface as you correctly point out is not the normal
> > > way we build interfaces since it is not modular and less flexible than
> > > individual feature bits.  However, for the legacy interface this might
> > > be a good thing.
> >
> > Ok, I think I would not object to this proposal, but we should not exclude the
> > possibility of having things like LEGACY_HEADER in the future.
>
> Thanks.


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-27  2:38                                                                       ` Jason Wang
@ 2023-06-27  3:17                                                                         ` Parav Pandit
  -1 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-27  3:17 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Jason Wang <jasowang@redhat.com>
> Sent: Monday, June 26, 2023 10:38 PM

> > >
> > Because there is no point of failing it later when actual rw occurs.
> 
> Even with admin virtqueue, the hypervisor should be ready for any admin
> command failures somehow.
>
Yes, device failures can happen regardless.
 
> And with modern devices, the reset is not a must, the hypervisor can just read
> device_features to check if _MAC/_HDR is there. 

> 
I read the spec differently as,
The driver MUST follow this sequence to initialize a device:
1. Reset the device.

> And what's more important,
> the hypervisor can know if the feature negotiation succeeds or not. With
> legacy, there's no such way.
Again, we are not fixing the legacy here.

> >
> > > > 1. reset the device
> > > > 2. set ACK and DRIVER bit
> > > > 3. read features and make sure _MAC, _HDR are supported.
> > >
> > > Similar step is required even for AQ since the hypervisor needs to
> > > know if legacy commands are supported there.
> > >
> > No. similar steps are not required on AQ because AQ support discovery is
> done once per owner device. Not for each member device.
> 
> This seems a topic beyond legacy. If both modern and transitional devices are
> supported, a per device probing or provisioning is still required. And if
> provisioning is supported, there's no need to probe MAC/HDR.
>
That is possible to rely on the AQ.
 > >
> > > > 4. if not abort.
> > > > 5. reset the device 2nd time so that guest can have right view of things.
> > > >
> > > > On guest access of legacy area:
> > > > 6. reset the device
> > > > 7. set ACK and DRIVER bit on guest request 8. read features and
> > > > make sure _MAC, _HDR are offered
> > > > 8.1 Hope for the best that on two completely unrelated device
> > > > reset on #1
> > > and #6, the device offers exact same feature bits.
> > >
> > > Explained and discussed in another thread, this is a hard
> > > requirement otherwise a lot of things would break.
> > >
> > That limitation is for the past or current.
> 
> You need at least a new feature bit.
> 
Not needed, current mechanism is just fine as there is member device driver to owner communication.

> > As we move forward there is no need to continue with such limitation.
> > There may be more work needed to overcome that limitation, but we don’t
> want to build on top of that limitation.
> 
> Let's open a dedicated thread for this if necessary.
>
Ok. We don’t want to have that assumption and build interface.
 
> >
> > > > And mention this in the spec 1.x for rest of the future.
> > > >
> > > > We shouldn't be adding such a limitation to the spec.
> > > > We have seen this with mlx5 device where 5 years ago one thought
> > > > this
> > > cannot happen.
> > > > And now with modern use case now features changes across two
> > > > resets for
> > > mlx5 device.
> > > > Baking such limitation in current spec for past 1.x is sub-optimal.
> > > >
> > > > ok, so to avoid baking such reset flow nasty things in spec, lets
> > > > avoid flow of
> > > #1 to #5 in hypervisor.
> > > > So, provision the device to support these new feature bits via AQ.
> > > > So AQ is required for feature provisioning anyway.
> > > >
> > > > So, your point #4 is required in both methods and so it scores
> > > > same as this
> > > proposal.
> > > > Hence feature bit is not of an advantage.
> > > >
> > > > With _MAC now we need writable mac on 1.x config space.
> > > > for 1.x writable mac has two requirements.
> > > > 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
> > >
> > > For LEGACY_MAC, we don't need to be atomic. We manage to survive for
> > > several years.
> > >
> > It was cited as issue in past discussed when you and Michael both asked to
> consider tvq.
> > What changed now?
> 
> Nothing changed, what I meant is: with admin virtqueue it could be atomic or
> not.
> 
I don’t know why you keep circling back on it.

Why do you ask below "how atomicity is achieved if it is not important?"

> >
> > The issue is that device hw needs implement special RW registers now for the
> mac for legacy.
> > This is the unwanted burden not needed, where AQ is better.
> 
> How can you solve the atomic issue in this case? The issue is the driver where
> legacy guests write to device configuration space byte by byte. 
You contradict yourself, above you say that we managed, here you say its issue.

It does write byte by byte, a hypervisor can collect 6 bytes and write all together in one go.

It seems that now the past issue of atomicity was raised and solved with AQ, you start to oppose that it...

> Modern guests will use cvq.
>
Sure.
 
> >
> > > > 2. should be synchronous to know success/failure to know when it
> > > > is effective
> > >
> > > It's as simple as allowing mac in the device configuration space writable.
> > >
> > Not simple for hw at scale.
> 
> I don't understand, it uses modern device configuration space. How does it
> matter with the scale of admin virtqueue?
> 
The new feature bit demands mac address in config space to be read write. Modern device doesnt have it as RW.
This burden is unnecessary to carry forward.
An AQ eliminates such heavy device side implementation.

> > AQ is superior that communicates rarely used information.
> >
> > > >
> > > > Both are present on the CVQ, so yet add another duplicate 1.x
> > > > scheme that
> > > fulfill above requirements.
> > >
> > > I'm not sure how to define duplication, the legacy device
> > > configuration space access via admin virtqueue is kind of a duplication in
> this sense as well.
> > >
> > It only exists on AQ for legacy purpose.
> > The feature bit defined is not for legacy, hence its duplicated.
> 
> It's for legacy mediation and what's more, it allows mac to be configured
> without cvq.
> 
This fundamental thing is not a gain, but a negative aspect to complicate the device PCI.
It even contradicts for current spec definition " Device configuration space is generally used for rarely-changing or initialization-time parameters".

> > I don’t see how that is avoided when one side has undefined corner case that
> is translated to well defined behavior.
> 
> Let me give you an example. The legacy device behaviour is basically what
> Qemu codes did, by reusing the existing Qemu virtio device model codes, most
> of the issues can be avoided.
>
You are welcome to document them in legacy interface section.
 
> > It only means that piece will be in endless errata in sw.
> 
> Errata in software is much more simpler/cheaper than hardware, isn't it?
> 
AQ has ability to implement things in less hw centric way.
And sw when necessary can always decide which AQ commands to use.
So it is more flexible.

> > It still scores same or less.
> >
> > > >
> > > > For legacy there is no extra/special documentation.
> > > > All the behavior listed in Legacy interfaces section for
> > > > configuration register
> > > present applies here.
> > >
> > > That's not true, the legacy section is the best effort since it's
> > > too late to define (codes came before the spec).
> > >
> > One can added the missing documentation...
> 
> It will be too late for the legacy, and it would be too hard since it basically tries
> to describe the exact code behaviour. And there could be a lot of very hard
> questions that need to be answered. E.g what happens if a driver tries to use
> both modern and legacy interfaces?
>
It is no different than what is defined already in transitional device.
No point repeating same questions again, please.

 
> >
> >
> > > >
> > > > So, I don't see mac support is trivial by any means compared to
> > > > proposed
> > > scheme for 1.x.
> > > > Hence, comparing trivialness of two solutions seems same for your
> > > > point #1
> > > once you do mac plumbing.
> > > >
> > > > Regarding #2 on nesting. I won't claim I understand this as your
> > > > level of
> > > knowledge.
> > > > If you are sauing only the VF is in VM as virtio PCI device to
> > > > supporting nested
> > > guest, that doesn't have AQ, hence it doesn't work due above issues.
> > >
> > > This is the most common setup, no?
> > >
> > Depends on who see it.
> > We don’t see common setup for legacy or otherwise.
> >
> > > The major issues are the transport function is not self contained in
> > > a device (function). This will cause a lot of trouble when trying to
> > > implement nesting. E.g you need to assign or emulate SR-IOV from L1
> > > to
> > > L(N-1) in order to let L(N) to work.
> > >
> > Those who do nesting usually do assign the PF as well.
> 
> This is not what I was told and it's not flexible.
One food type does not solve hunger for whole world.
So one can come up with more elaborate solution as time progresses, we are hoping that legacy doesnt reach to that point.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* RE: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-27  3:17                                                                         ` Parav Pandit
  0 siblings, 0 replies; 164+ messages in thread
From: Parav Pandit @ 2023-06-27  3:17 UTC (permalink / raw)
  To: Jason Wang
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler



> From: Jason Wang <jasowang@redhat.com>
> Sent: Monday, June 26, 2023 10:38 PM

> > >
> > Because there is no point of failing it later when actual rw occurs.
> 
> Even with admin virtqueue, the hypervisor should be ready for any admin
> command failures somehow.
>
Yes, device failures can happen regardless.
 
> And with modern devices, the reset is not a must, the hypervisor can just read
> device_features to check if _MAC/_HDR is there. 

> 
I read the spec differently as,
The driver MUST follow this sequence to initialize a device:
1. Reset the device.

> And what's more important,
> the hypervisor can know if the feature negotiation succeeds or not. With
> legacy, there's no such way.
Again, we are not fixing the legacy here.

> >
> > > > 1. reset the device
> > > > 2. set ACK and DRIVER bit
> > > > 3. read features and make sure _MAC, _HDR are supported.
> > >
> > > Similar step is required even for AQ since the hypervisor needs to
> > > know if legacy commands are supported there.
> > >
> > No. similar steps are not required on AQ because AQ support discovery is
> done once per owner device. Not for each member device.
> 
> This seems a topic beyond legacy. If both modern and transitional devices are
> supported, a per device probing or provisioning is still required. And if
> provisioning is supported, there's no need to probe MAC/HDR.
>
That is possible to rely on the AQ.
 > >
> > > > 4. if not abort.
> > > > 5. reset the device 2nd time so that guest can have right view of things.
> > > >
> > > > On guest access of legacy area:
> > > > 6. reset the device
> > > > 7. set ACK and DRIVER bit on guest request 8. read features and
> > > > make sure _MAC, _HDR are offered
> > > > 8.1 Hope for the best that on two completely unrelated device
> > > > reset on #1
> > > and #6, the device offers exact same feature bits.
> > >
> > > Explained and discussed in another thread, this is a hard
> > > requirement otherwise a lot of things would break.
> > >
> > That limitation is for the past or current.
> 
> You need at least a new feature bit.
> 
Not needed, current mechanism is just fine as there is member device driver to owner communication.

> > As we move forward there is no need to continue with such limitation.
> > There may be more work needed to overcome that limitation, but we don’t
> want to build on top of that limitation.
> 
> Let's open a dedicated thread for this if necessary.
>
Ok. We don’t want to have that assumption and build interface.
 
> >
> > > > And mention this in the spec 1.x for rest of the future.
> > > >
> > > > We shouldn't be adding such a limitation to the spec.
> > > > We have seen this with mlx5 device where 5 years ago one thought
> > > > this
> > > cannot happen.
> > > > And now with modern use case now features changes across two
> > > > resets for
> > > mlx5 device.
> > > > Baking such limitation in current spec for past 1.x is sub-optimal.
> > > >
> > > > ok, so to avoid baking such reset flow nasty things in spec, lets
> > > > avoid flow of
> > > #1 to #5 in hypervisor.
> > > > So, provision the device to support these new feature bits via AQ.
> > > > So AQ is required for feature provisioning anyway.
> > > >
> > > > So, your point #4 is required in both methods and so it scores
> > > > same as this
> > > proposal.
> > > > Hence feature bit is not of an advantage.
> > > >
> > > > With _MAC now we need writable mac on 1.x config space.
> > > > for 1.x writable mac has two requirements.
> > > > 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
> > >
> > > For LEGACY_MAC, we don't need to be atomic. We manage to survive for
> > > several years.
> > >
> > It was cited as issue in past discussed when you and Michael both asked to
> consider tvq.
> > What changed now?
> 
> Nothing changed, what I meant is: with admin virtqueue it could be atomic or
> not.
> 
I don’t know why you keep circling back on it.

Why do you ask below "how atomicity is achieved if it is not important?"

> >
> > The issue is that device hw needs implement special RW registers now for the
> mac for legacy.
> > This is the unwanted burden not needed, where AQ is better.
> 
> How can you solve the atomic issue in this case? The issue is the driver where
> legacy guests write to device configuration space byte by byte. 
You contradict yourself, above you say that we managed, here you say its issue.

It does write byte by byte, a hypervisor can collect 6 bytes and write all together in one go.

It seems that now the past issue of atomicity was raised and solved with AQ, you start to oppose that it...

> Modern guests will use cvq.
>
Sure.
 
> >
> > > > 2. should be synchronous to know success/failure to know when it
> > > > is effective
> > >
> > > It's as simple as allowing mac in the device configuration space writable.
> > >
> > Not simple for hw at scale.
> 
> I don't understand, it uses modern device configuration space. How does it
> matter with the scale of admin virtqueue?
> 
The new feature bit demands mac address in config space to be read write. Modern device doesnt have it as RW.
This burden is unnecessary to carry forward.
An AQ eliminates such heavy device side implementation.

> > AQ is superior that communicates rarely used information.
> >
> > > >
> > > > Both are present on the CVQ, so yet add another duplicate 1.x
> > > > scheme that
> > > fulfill above requirements.
> > >
> > > I'm not sure how to define duplication, the legacy device
> > > configuration space access via admin virtqueue is kind of a duplication in
> this sense as well.
> > >
> > It only exists on AQ for legacy purpose.
> > The feature bit defined is not for legacy, hence its duplicated.
> 
> It's for legacy mediation and what's more, it allows mac to be configured
> without cvq.
> 
This fundamental thing is not a gain, but a negative aspect to complicate the device PCI.
It even contradicts for current spec definition " Device configuration space is generally used for rarely-changing or initialization-time parameters".

> > I don’t see how that is avoided when one side has undefined corner case that
> is translated to well defined behavior.
> 
> Let me give you an example. The legacy device behaviour is basically what
> Qemu codes did, by reusing the existing Qemu virtio device model codes, most
> of the issues can be avoided.
>
You are welcome to document them in legacy interface section.
 
> > It only means that piece will be in endless errata in sw.
> 
> Errata in software is much more simpler/cheaper than hardware, isn't it?
> 
AQ has ability to implement things in less hw centric way.
And sw when necessary can always decide which AQ commands to use.
So it is more flexible.

> > It still scores same or less.
> >
> > > >
> > > > For legacy there is no extra/special documentation.
> > > > All the behavior listed in Legacy interfaces section for
> > > > configuration register
> > > present applies here.
> > >
> > > That's not true, the legacy section is the best effort since it's
> > > too late to define (codes came before the spec).
> > >
> > One can added the missing documentation...
> 
> It will be too late for the legacy, and it would be too hard since it basically tries
> to describe the exact code behaviour. And there could be a lot of very hard
> questions that need to be answered. E.g what happens if a driver tries to use
> both modern and legacy interfaces?
>
It is no different than what is defined already in transitional device.
No point repeating same questions again, please.

 
> >
> >
> > > >
> > > > So, I don't see mac support is trivial by any means compared to
> > > > proposed
> > > scheme for 1.x.
> > > > Hence, comparing trivialness of two solutions seems same for your
> > > > point #1
> > > once you do mac plumbing.
> > > >
> > > > Regarding #2 on nesting. I won't claim I understand this as your
> > > > level of
> > > knowledge.
> > > > If you are sauing only the VF is in VM as virtio PCI device to
> > > > supporting nested
> > > guest, that doesn't have AQ, hence it doesn't work due above issues.
> > >
> > > This is the most common setup, no?
> > >
> > Depends on who see it.
> > We don’t see common setup for legacy or otherwise.
> >
> > > The major issues are the transport function is not self contained in
> > > a device (function). This will cause a lot of trouble when trying to
> > > implement nesting. E.g you need to assign or emulate SR-IOV from L1
> > > to
> > > L(N-1) in order to let L(N) to work.
> > >
> > Those who do nesting usually do assign the PF as well.
> 
> This is not what I was told and it's not flexible.
One food type does not solve hunger for whole world.
So one can come up with more elaborate solution as time progresses, we are hoping that legacy doesnt reach to that point.

^ permalink raw reply	[flat|nested] 164+ messages in thread

* [virtio-dev] Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
  2023-06-27  3:17                                                                         ` Parav Pandit
@ 2023-06-27  4:33                                                                           ` Jason Wang
  -1 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-27  4:33 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Tue, Jun 27, 2023 at 11:17 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Monday, June 26, 2023 10:38 PM
>
> > > >
> > > Because there is no point of failing it later when actual rw occurs.
> >
> > Even with admin virtqueue, the hypervisor should be ready for any admin
> > command failures somehow.
> >
> Yes, device failures can happen regardless.
>
> > And with modern devices, the reset is not a must, the hypervisor can just read
> > device_features to check if _MAC/_HDR is there.
>
> >
> I read the spec differently as,
> The driver MUST follow this sequence to initialize a device:
> 1. Reset the device.

It's not the initialization, it's a probing of supported features.

>
> > And what's more important,
> > the hypervisor can know if the feature negotiation succeeds or not. With
> > legacy, there's no such way.
> Again, we are not fixing the legacy here.

I mean, it's not worse than failing silently in the legacy case so we
don't need to care.

>
> > >
> > > > > 1. reset the device
> > > > > 2. set ACK and DRIVER bit
> > > > > 3. read features and make sure _MAC, _HDR are supported.
> > > >
> > > > Similar step is required even for AQ since the hypervisor needs to
> > > > know if legacy commands are supported there.
> > > >
> > > No. similar steps are not required on AQ because AQ support discovery is
> > done once per owner device. Not for each member device.
> >
> > This seems a topic beyond legacy. If both modern and transitional devices are
> > supported, a per device probing or provisioning is still required. And if
> > provisioning is supported, there's no need to probe MAC/HDR.
> >
> That is possible to rely on the AQ.
>  > >
> > > > > 4. if not abort.
> > > > > 5. reset the device 2nd time so that guest can have right view of things.
> > > > >
> > > > > On guest access of legacy area:
> > > > > 6. reset the device
> > > > > 7. set ACK and DRIVER bit on guest request 8. read features and
> > > > > make sure _MAC, _HDR are offered
> > > > > 8.1 Hope for the best that on two completely unrelated device
> > > > > reset on #1
> > > > and #6, the device offers exact same feature bits.
> > > >
> > > > Explained and discussed in another thread, this is a hard
> > > > requirement otherwise a lot of things would break.
> > > >
> > > That limitation is for the past or current.
> >
> > You need at least a new feature bit.
> >
> Not needed, current mechanism is just fine as there is member device driver to owner communication.
>
> > > As we move forward there is no need to continue with such limitation.
> > > There may be more work needed to overcome that limitation, but we don’t
> > want to build on top of that limitation.
> >
> > Let's open a dedicated thread for this if necessary.
> >
> Ok. We don’t want to have that assumption and build interface.
>
> > >
> > > > > And mention this in the spec 1.x for rest of the future.
> > > > >
> > > > > We shouldn't be adding such a limitation to the spec.
> > > > > We have seen this with mlx5 device where 5 years ago one thought
> > > > > this
> > > > cannot happen.
> > > > > And now with modern use case now features changes across two
> > > > > resets for
> > > > mlx5 device.
> > > > > Baking such limitation in current spec for past 1.x is sub-optimal.
> > > > >
> > > > > ok, so to avoid baking such reset flow nasty things in spec, lets
> > > > > avoid flow of
> > > > #1 to #5 in hypervisor.
> > > > > So, provision the device to support these new feature bits via AQ.
> > > > > So AQ is required for feature provisioning anyway.
> > > > >
> > > > > So, your point #4 is required in both methods and so it scores
> > > > > same as this
> > > > proposal.
> > > > > Hence feature bit is not of an advantage.
> > > > >
> > > > > With _MAC now we need writable mac on 1.x config space.
> > > > > for 1.x writable mac has two requirements.
> > > > > 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
> > > >
> > > > For LEGACY_MAC, we don't need to be atomic. We manage to survive for
> > > > several years.
> > > >
> > > It was cited as issue in past discussed when you and Michael both asked to
> > consider tvq.
> > > What changed now?
> >
> > Nothing changed, what I meant is: with admin virtqueue it could be atomic or
> > not.
> >
> I don’t know why you keep circling back on it.
>
> Why do you ask below "how atomicity is achieved if it is not important?"
>
> > >
> > > The issue is that device hw needs implement special RW registers now for the
> > mac for legacy.
> > > This is the unwanted burden not needed, where AQ is better.
> >
> > How can you solve the atomic issue in this case? The issue is the driver where
> > legacy guests write to device configuration space byte by byte.
> You contradict yourself, above you say that we managed, here you say its issue.
>
> It does write byte by byte, a hypervisor can collect 6 bytes and write all together in one go.
>
> It seems that now the past issue of atomicity was raised and solved with AQ, you start to oppose that it...

Let me clarify:

Let's first look at the ABI solely:

+struct virtio_admin_cmd_ld_reg_wr_data {
+       u8 offset; /* Starting byte offset of the device register(s) to write */
+       u8 register[];
+};

For accessing mac, it could be atomic or not.

Hypervisor can try to collect 6 bytes for atomicy but again it's best
effort and may (for Linux) or may not work for all kinds of guests.

>
> > Modern guests will use cvq.
> >
> Sure.
>
> > >
> > > > > 2. should be synchronous to know success/failure to know when it
> > > > > is effective
> > > >
> > > > It's as simple as allowing mac in the device configuration space writable.
> > > >
> > > Not simple for hw at scale.
> >
> > I don't understand, it uses modern device configuration space. How does it
> > matter with the scale of admin virtqueue?
> >
> The new feature bit demands mac address in config space to be read write. Modern device doesnt have it as RW.
> This burden is unnecessary to carry forward.

How much burden if we just make 6 byte RW per device?

> An AQ eliminates such heavy device side implementation.
>
> > > AQ is superior that communicates rarely used information.
> > >
> > > > >
> > > > > Both are present on the CVQ, so yet add another duplicate 1.x
> > > > > scheme that
> > > > fulfill above requirements.
> > > >
> > > > I'm not sure how to define duplication, the legacy device
> > > > configuration space access via admin virtqueue is kind of a duplication in
> > this sense as well.
> > > >
> > > It only exists on AQ for legacy purpose.
> > > The feature bit defined is not for legacy, hence its duplicated.
> >
> > It's for legacy mediation and what's more, it allows mac to be configured
> > without cvq.
> >
> This fundamental thing is not a gain, but a negative aspect to complicate the device PCI.

Is this minor stuff more complicated than the entire admin virtqueue stuff?

The point is methodology, mediation on top of modern devices is
simpler, and a lot of other methods could be used if LEGACY_MAC
doesn't suffice.

> It even contradicts for current spec definition " Device configuration space is generally used for rarely-changing or initialization-time parameters".

I don't see how, mac is rarely changed, and for blocks we have
writeable stuffs like wce as well.

>
> > > I don’t see how that is avoided when one side has undefined corner case that
> > is translated to well defined behavior.
> >
> > Let me give you an example. The legacy device behaviour is basically what
> > Qemu codes did, by reusing the existing Qemu virtio device model codes, most
> > of the issues can be avoided.
> >
> You are welcome to document them in legacy interface section.

Well, you can't describe the behaviour of several kilo lines of code precisely.

>
> > > It only means that piece will be in endless errata in sw.
> >
> > Errata in software is much more simpler/cheaper than hardware, isn't it?
> >
> AQ has ability to implement things in less hw centric way.
> And sw when necessary can always decide which AQ commands to use.
> So it is more flexible.

A lot of examples have been demonstrated, software erratas is much
more flexible. It's really common to workaround hardware errata in
kernel or BIOS.

>
> > > It still scores same or less.
> > >
> > > > >
> > > > > For legacy there is no extra/special documentation.
> > > > > All the behavior listed in Legacy interfaces section for
> > > > > configuration register
> > > > present applies here.
> > > >
> > > > That's not true, the legacy section is the best effort since it's
> > > > too late to define (codes came before the spec).
> > > >
> > > One can added the missing documentation...
> >
> > It will be too late for the legacy, and it would be too hard since it basically tries
> > to describe the exact code behaviour. And there could be a lot of very hard
> > questions that need to be answered. E.g what happens if a driver tries to use
> > both modern and legacy interfaces?
> >
> It is no different than what is defined already in transitional device.

Can you show me where the spec answers this question?

Thanks

> No point repeating same questions again, please.
>
>
> > >
> > >
> > > > >
> > > > > So, I don't see mac support is trivial by any means compared to
> > > > > proposed
> > > > scheme for 1.x.
> > > > > Hence, comparing trivialness of two solutions seems same for your
> > > > > point #1
> > > > once you do mac plumbing.
> > > > >
> > > > > Regarding #2 on nesting. I won't claim I understand this as your
> > > > > level of
> > > > knowledge.
> > > > > If you are sauing only the VF is in VM as virtio PCI device to
> > > > > supporting nested
> > > > guest, that doesn't have AQ, hence it doesn't work due above issues.
> > > >
> > > > This is the most common setup, no?
> > > >
> > > Depends on who see it.
> > > We don’t see common setup for legacy or otherwise.
> > >
> > > > The major issues are the transport function is not self contained in
> > > > a device (function). This will cause a lot of trouble when trying to
> > > > implement nesting. E.g you need to assign or emulate SR-IOV from L1
> > > > to
> > > > L(N-1) in order to let L(N) to work.
> > > >
> > > Those who do nesting usually do assign the PF as well.
> >
> > This is not what I was told and it's not flexible.
> One food type does not solve hunger for whole world.
> So one can come up with more elaborate solution as time progresses, we are hoping that legacy doesnt reach to that point.


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


^ permalink raw reply	[flat|nested] 164+ messages in thread

* Re: [virtio-comment] Re: [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ
@ 2023-06-27  4:33                                                                           ` Jason Wang
  0 siblings, 0 replies; 164+ messages in thread
From: Jason Wang @ 2023-06-27  4:33 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Michael S. Tsirkin, virtio-dev, cohuck, david.edmondson, sburla,
	Yishai Hadas, Maor Gottlieb, virtio-comment, Shahaf Shuler

On Tue, Jun 27, 2023 at 11:17 AM Parav Pandit <parav@nvidia.com> wrote:
>
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Monday, June 26, 2023 10:38 PM
>
> > > >
> > > Because there is no point of failing it later when actual rw occurs.
> >
> > Even with admin virtqueue, the hypervisor should be ready for any admin
> > command failures somehow.
> >
> Yes, device failures can happen regardless.
>
> > And with modern devices, the reset is not a must, the hypervisor can just read
> > device_features to check if _MAC/_HDR is there.
>
> >
> I read the spec differently as,
> The driver MUST follow this sequence to initialize a device:
> 1. Reset the device.

It's not the initialization, it's a probing of supported features.

>
> > And what's more important,
> > the hypervisor can know if the feature negotiation succeeds or not. With
> > legacy, there's no such way.
> Again, we are not fixing the legacy here.

I mean, it's not worse than failing silently in the legacy case so we
don't need to care.

>
> > >
> > > > > 1. reset the device
> > > > > 2. set ACK and DRIVER bit
> > > > > 3. read features and make sure _MAC, _HDR are supported.
> > > >
> > > > Similar step is required even for AQ since the hypervisor needs to
> > > > know if legacy commands are supported there.
> > > >
> > > No. similar steps are not required on AQ because AQ support discovery is
> > done once per owner device. Not for each member device.
> >
> > This seems a topic beyond legacy. If both modern and transitional devices are
> > supported, a per device probing or provisioning is still required. And if
> > provisioning is supported, there's no need to probe MAC/HDR.
> >
> That is possible to rely on the AQ.
>  > >
> > > > > 4. if not abort.
> > > > > 5. reset the device 2nd time so that guest can have right view of things.
> > > > >
> > > > > On guest access of legacy area:
> > > > > 6. reset the device
> > > > > 7. set ACK and DRIVER bit on guest request 8. read features and
> > > > > make sure _MAC, _HDR are offered
> > > > > 8.1 Hope for the best that on two completely unrelated device
> > > > > reset on #1
> > > > and #6, the device offers exact same feature bits.
> > > >
> > > > Explained and discussed in another thread, this is a hard
> > > > requirement otherwise a lot of things would break.
> > > >
> > > That limitation is for the past or current.
> >
> > You need at least a new feature bit.
> >
> Not needed, current mechanism is just fine as there is member device driver to owner communication.
>
> > > As we move forward there is no need to continue with such limitation.
> > > There may be more work needed to overcome that limitation, but we don’t
> > want to build on top of that limitation.
> >
> > Let's open a dedicated thread for this if necessary.
> >
> Ok. We don’t want to have that assumption and build interface.
>
> > >
> > > > > And mention this in the spec 1.x for rest of the future.
> > > > >
> > > > > We shouldn't be adding such a limitation to the spec.
> > > > > We have seen this with mlx5 device where 5 years ago one thought
> > > > > this
> > > > cannot happen.
> > > > > And now with modern use case now features changes across two
> > > > > resets for
> > > > mlx5 device.
> > > > > Baking such limitation in current spec for past 1.x is sub-optimal.
> > > > >
> > > > > ok, so to avoid baking such reset flow nasty things in spec, lets
> > > > > avoid flow of
> > > > #1 to #5 in hypervisor.
> > > > > So, provision the device to support these new feature bits via AQ.
> > > > > So AQ is required for feature provisioning anyway.
> > > > >
> > > > > So, your point #4 is required in both methods and so it scores
> > > > > same as this
> > > > proposal.
> > > > > Hence feature bit is not of an advantage.
> > > > >
> > > > > With _MAC now we need writable mac on 1.x config space.
> > > > > for 1.x writable mac has two requirements.
> > > > > 1. It must be atomic (not for 0.9.5, but must for 1.x like CVQ)
> > > >
> > > > For LEGACY_MAC, we don't need to be atomic. We manage to survive for
> > > > several years.
> > > >
> > > It was cited as issue in past discussed when you and Michael both asked to
> > consider tvq.
> > > What changed now?
> >
> > Nothing changed, what I meant is: with admin virtqueue it could be atomic or
> > not.
> >
> I don’t know why you keep circling back on it.
>
> Why do you ask below "how atomicity is achieved if it is not important?"
>
> > >
> > > The issue is that device hw needs implement special RW registers now for the
> > mac for legacy.
> > > This is the unwanted burden not needed, where AQ is better.
> >
> > How can you solve the atomic issue in this case? The issue is the driver where
> > legacy guests write to device configuration space byte by byte.
> You contradict yourself, above you say that we managed, here you say its issue.
>
> It does write byte by byte, a hypervisor can collect 6 bytes and write all together in one go.
>
> It seems that now the past issue of atomicity was raised and solved with AQ, you start to oppose that it...

Let me clarify:

Let's first look at the ABI solely:

+struct virtio_admin_cmd_ld_reg_wr_data {
+       u8 offset; /* Starting byte offset of the device register(s) to write */
+       u8 register[];
+};

For accessing mac, it could be atomic or not.

Hypervisor can try to collect 6 bytes for atomicy but again it's best
effort and may (for Linux) or may not work for all kinds of guests.

>
> > Modern guests will use cvq.
> >
> Sure.
>
> > >
> > > > > 2. should be synchronous to know success/failure to know when it
> > > > > is effective
> > > >
> > > > It's as simple as allowing mac in the device configuration space writable.
> > > >
> > > Not simple for hw at scale.
> >
> > I don't understand, it uses modern device configuration space. How does it
> > matter with the scale of admin virtqueue?
> >
> The new feature bit demands mac address in config space to be read write. Modern device doesnt have it as RW.
> This burden is unnecessary to carry forward.

How much burden if we just make 6 byte RW per device?

> An AQ eliminates such heavy device side implementation.
>
> > > AQ is superior that communicates rarely used information.
> > >
> > > > >
> > > > > Both are present on the CVQ, so yet add another duplicate 1.x
> > > > > scheme that
> > > > fulfill above requirements.
> > > >
> > > > I'm not sure how to define duplication, the legacy device
> > > > configuration space access via admin virtqueue is kind of a duplication in
> > this sense as well.
> > > >
> > > It only exists on AQ for legacy purpose.
> > > The feature bit defined is not for legacy, hence its duplicated.
> >
> > It's for legacy mediation and what's more, it allows mac to be configured
> > without cvq.
> >
> This fundamental thing is not a gain, but a negative aspect to complicate the device PCI.

Is this minor stuff more complicated than the entire admin virtqueue stuff?

The point is methodology, mediation on top of modern devices is
simpler, and a lot of other methods could be used if LEGACY_MAC
doesn't suffice.

> It even contradicts for current spec definition " Device configuration space is generally used for rarely-changing or initialization-time parameters".

I don't see how, mac is rarely changed, and for blocks we have
writeable stuffs like wce as well.

>
> > > I don’t see how that is avoided when one side has undefined corner case that
> > is translated to well defined behavior.
> >
> > Let me give you an example. The legacy device behaviour is basically what
> > Qemu codes did, by reusing the existing Qemu virtio device model codes, most
> > of the issues can be avoided.
> >
> You are welcome to document them in legacy interface section.

Well, you can't describe the behaviour of several kilo lines of code precisely.

>
> > > It only means that piece will be in endless errata in sw.
> >
> > Errata in software is much more simpler/cheaper than hardware, isn't it?
> >
> AQ has ability to implement things in less hw centric way.
> And sw when necessary can always decide which AQ commands to use.
> So it is more flexible.

A lot of examples have been demonstrated, software erratas is much
more flexible. It's really common to workaround hardware errata in
kernel or BIOS.

>
> > > It still scores same or less.
> > >
> > > > >
> > > > > For legacy there is no extra/special documentation.
> > > > > All the behavior listed in Legacy interfaces section for
> > > > > configuration register
> > > > present applies here.
> > > >
> > > > That's not true, the legacy section is the best effort since it's
> > > > too late to define (codes came before the spec).
> > > >
> > > One can added the missing documentation...
> >
> > It will be too late for the legacy, and it would be too hard since it basically tries
> > to describe the exact code behaviour. And there could be a lot of very hard
> > questions that need to be answered. E.g what happens if a driver tries to use
> > both modern and legacy interfaces?
> >
> It is no different than what is defined already in transitional device.

Can you show me where the spec answers this question?

Thanks

> No point repeating same questions again, please.
>
>
> > >
> > >
> > > > >
> > > > > So, I don't see mac support is trivial by any means compared to
> > > > > proposed
> > > > scheme for 1.x.
> > > > > Hence, comparing trivialness of two solutions seems same for your
> > > > > point #1
> > > > once you do mac plumbing.
> > > > >
> > > > > Regarding #2 on nesting. I won't claim I understand this as your
> > > > > level of
> > > > knowledge.
> > > > > If you are sauing only the VF is in VM as virtio PCI device to
> > > > > supporting nested
> > > > guest, that doesn't have AQ, hence it doesn't work due above issues.
> > > >
> > > > This is the most common setup, no?
> > > >
> > > Depends on who see it.
> > > We don’t see common setup for legacy or otherwise.
> > >
> > > > The major issues are the transport function is not self contained in
> > > > a device (function). This will cause a lot of trouble when trying to
> > > > implement nesting. E.g you need to assign or emulate SR-IOV from L1
> > > > to
> > > > L(N-1) in order to let L(N) to work.
> > > >
> > > Those who do nesting usually do assign the PF as well.
> >
> > This is not what I was told and it's not flexible.
> One food type does not solve hunger for whole world.
> So one can come up with more elaborate solution as time progresses, we are hoping that legacy doesnt reach to that point.


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


^ permalink raw reply	[flat|nested] 164+ messages in thread

end of thread, other threads:[~2023-06-27  4:33 UTC | newest]

Thread overview: 164+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02 20:36 [virtio-dev] [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ Parav Pandit
2023-06-02 20:36 ` [virtio-comment] " Parav Pandit
2023-06-02 20:36 ` [virtio-dev] [PATCH v3 1/3] admin: Split opcode table rows with a line Parav Pandit
2023-06-02 20:36   ` [virtio-comment] " Parav Pandit
2023-06-02 20:36 ` [virtio-dev] [PATCH v3 2/3] transport-pci: Introduce legacy registers access commands Parav Pandit
2023-06-02 20:36   ` [virtio-comment] " Parav Pandit
2023-06-04 13:22   ` [virtio-dev] " Michael S. Tsirkin
2023-06-04 13:22     ` [virtio-comment] " Michael S. Tsirkin
2023-06-04 13:51     ` [virtio-dev] " Parav Pandit
2023-06-04 13:51       ` [virtio-comment] " Parav Pandit
2023-06-04 14:13       ` [virtio-dev] " Michael S. Tsirkin
2023-06-04 14:13         ` [virtio-comment] " Michael S. Tsirkin
2023-06-04 14:32         ` [virtio-dev] " Parav Pandit
2023-06-04 14:32           ` [virtio-comment] " Parav Pandit
2023-06-04 14:41           ` [virtio-comment] " Michael S. Tsirkin
2023-06-04 14:41             ` [virtio-dev] " Michael S. Tsirkin
2023-06-04 15:01             ` [virtio-dev] " Parav Pandit
2023-06-04 15:01               ` [virtio-comment] " Parav Pandit
2023-06-04 22:10               ` [virtio-dev] " Michael S. Tsirkin
2023-06-04 22:10                 ` [virtio-comment] " Michael S. Tsirkin
2023-06-04 23:57                 ` [virtio-dev] " Parav Pandit
2023-06-04 23:57                   ` [virtio-comment] " Parav Pandit
2023-06-08 18:34   ` [virtio-dev] " Michael S. Tsirkin
2023-06-08 18:34     ` [virtio-comment] " Michael S. Tsirkin
2023-06-08 18:55     ` [virtio-dev] " Parav Pandit
2023-06-08 18:55       ` [virtio-comment] " Parav Pandit
2023-06-08 19:00       ` [virtio-dev] " Michael S. Tsirkin
2023-06-08 19:00         ` [virtio-comment] " Michael S. Tsirkin
2023-06-08 19:04         ` [virtio-dev] " Parav Pandit
2023-06-08 19:04           ` [virtio-comment] " Parav Pandit
2023-06-02 20:36 ` [virtio-dev] [PATCH v3 3/3] transport-pci: Add legacy register access conformance section Parav Pandit
2023-06-02 20:36   ` [virtio-comment] " Parav Pandit
2023-06-04 13:34 ` [virtio-dev] Re: [PATCH v3 0/3] transport-pci: Introduce legacy registers access using AQ Michael S. Tsirkin
2023-06-04 13:34   ` [virtio-comment] " Michael S. Tsirkin
2023-06-04 13:41   ` [virtio-comment] " Parav Pandit
2023-06-04 13:41     ` [virtio-dev] " Parav Pandit
2023-06-04 13:55     ` [virtio-dev] " Michael S. Tsirkin
2023-06-04 13:55       ` [virtio-comment] " Michael S. Tsirkin
2023-06-04 14:10       ` [virtio-dev] " Parav Pandit
2023-06-04 14:10         ` [virtio-comment] " Parav Pandit
2023-06-04 14:23         ` [virtio-comment] " Michael S. Tsirkin
2023-06-04 14:23           ` [virtio-dev] " Michael S. Tsirkin
2023-06-04 14:48           ` [virtio-dev] " Parav Pandit
2023-06-04 14:48             ` [virtio-comment] " Parav Pandit
2023-06-04 14:53             ` [virtio-comment] " Michael S. Tsirkin
2023-06-04 14:53               ` [virtio-dev] " Michael S. Tsirkin
2023-06-04 15:07               ` [virtio-dev] " Parav Pandit
2023-06-04 15:07                 ` [virtio-comment] " Parav Pandit
2023-06-04 21:48                 ` [virtio-comment] " Michael S. Tsirkin
2023-06-04 21:48                   ` [virtio-dev] " Michael S. Tsirkin
2023-06-04 23:40                   ` [virtio-dev] " Parav Pandit
2023-06-04 23:40                     ` [virtio-comment] " Parav Pandit
2023-06-05  5:51                     ` [virtio-dev] " Michael S. Tsirkin
2023-06-05  5:51                       ` [virtio-comment] " Michael S. Tsirkin
2023-06-05 13:27                       ` [virtio-comment] " Parav Pandit
2023-06-05 13:27                         ` [virtio-dev] " Parav Pandit
2023-06-05 13:50                         ` [virtio-dev] " Michael S. Tsirkin
2023-06-05 13:50                           ` [virtio-comment] " Michael S. Tsirkin
2023-06-05 16:04                           ` [virtio-dev] " Parav Pandit
2023-06-05 16:04                             ` [virtio-comment] " Parav Pandit
2023-06-05 21:57                             ` [virtio-dev] " Michael S. Tsirkin
2023-06-05 21:57                               ` [virtio-comment] " Michael S. Tsirkin
2023-06-05 22:12                               ` [virtio-dev] " Parav Pandit
2023-06-05 22:12                                 ` [virtio-comment] " Parav Pandit
2023-06-06 11:56                                 ` Michael S. Tsirkin
2023-06-06 11:56                                   ` [virtio-comment] " Michael S. Tsirkin
2023-06-06 20:15                                   ` Parav Pandit
2023-06-06 20:15                                     ` [virtio-comment] " Parav Pandit
2023-06-07  2:27                                   ` Jason Wang
2023-06-07  2:27                                     ` [virtio-comment] " Jason Wang
2023-06-07  3:05                                     ` Parav Pandit
2023-06-07  3:05                                       ` [virtio-comment] " Parav Pandit
2023-06-07  6:54                                       ` Jason Wang
2023-06-07  6:54                                         ` [virtio-comment] " Jason Wang
2023-06-07  8:54                                         ` Michael S. Tsirkin
2023-06-07  8:54                                           ` [virtio-comment] " Michael S. Tsirkin
2023-06-08 14:38                                         ` Parav Pandit
2023-06-08 14:38                                           ` [virtio-comment] " Parav Pandit
2023-06-08 14:44                                           ` Michael S. Tsirkin
2023-06-08 14:44                                             ` [virtio-comment] " Michael S. Tsirkin
2023-06-08 14:53                                             ` Parav Pandit
2023-06-08 14:53                                               ` [virtio-comment] " Parav Pandit
2023-06-08 15:03                                               ` Michael S. Tsirkin
2023-06-08 15:03                                                 ` [virtio-comment] " Michael S. Tsirkin
2023-06-08 15:16                                                 ` Parav Pandit
2023-06-08 15:16                                                   ` [virtio-comment] " Parav Pandit
2023-06-08 18:03                                                   ` Michael S. Tsirkin
2023-06-08 18:03                                                     ` [virtio-comment] " Michael S. Tsirkin
2023-06-08 18:11                                                     ` Parav Pandit
2023-06-08 18:11                                                       ` [virtio-comment] " Parav Pandit
2023-06-08 18:31                                                   ` Michael S. Tsirkin
2023-06-08 18:31                                                     ` [virtio-comment] " Michael S. Tsirkin
2023-06-08 19:00                                                     ` Parav Pandit
2023-06-08 19:00                                                       ` [virtio-comment] " Parav Pandit
2023-06-08 19:03                                                       ` Michael S. Tsirkin
2023-06-08 19:03                                                         ` [virtio-comment] " Michael S. Tsirkin
2023-06-08 19:12                                                         ` Parav Pandit
2023-06-08 19:12                                                           ` [virtio-comment] " Parav Pandit
2023-06-09  2:06                                           ` Jason Wang
2023-06-09  2:06                                             ` [virtio-comment] " Jason Wang
2023-06-09  2:29                                             ` Parav Pandit
2023-06-09  2:29                                               ` [virtio-comment] " Parav Pandit
2023-06-09  2:42                                               ` Jason Wang
2023-06-09  2:42                                                 ` [virtio-comment] " Jason Wang
2023-06-09  2:53                                                 ` Parav Pandit
2023-06-09  2:53                                                   ` [virtio-comment] " Parav Pandit
2023-06-09  2:56                                                   ` Jason Wang
2023-06-09  2:56                                                     ` [virtio-comment] " Jason Wang
2023-06-09  2:58                                                     ` [virtio-dev] " Parav Pandit
2023-06-09  2:58                                                       ` Parav Pandit
2023-06-09  3:02                                                       ` [virtio-dev] " Jason Wang
2023-06-09  3:02                                                         ` Jason Wang
2023-06-09  3:25                                                         ` [virtio-dev] " Parav Pandit
2023-06-09  3:25                                                           ` Parav Pandit
2023-06-09  6:27                                                           ` [virtio-dev] " Jason Wang
2023-06-09  6:27                                                             ` Jason Wang
2023-06-09  7:21                                                             ` [virtio-dev] " Michael S. Tsirkin
2023-06-09  7:21                                                               ` Michael S. Tsirkin
2023-06-09 17:11                                                               ` [virtio-dev] " Parav Pandit
2023-06-09 17:11                                                                 ` Parav Pandit
2023-06-11  0:27                                                                 ` [virtio-dev] " Michael S. Tsirkin
2023-06-11  0:27                                                                   ` Michael S. Tsirkin
2023-06-11  2:08                                                                   ` [virtio-dev] " Parav Pandit
2023-06-11  2:08                                                                     ` Parav Pandit
2023-06-11  7:14                                                                     ` [virtio-dev] " Michael S. Tsirkin
2023-06-11  7:14                                                                       ` Michael S. Tsirkin
2023-06-11 12:54                                                                       ` [virtio-dev] " Parav Pandit
2023-06-11 12:54                                                                         ` Parav Pandit
2023-06-11 20:09                                                                         ` [virtio-dev] " Michael S. Tsirkin
2023-06-11 20:09                                                                           ` Michael S. Tsirkin
2023-06-11 20:17                                                                           ` [virtio-dev] " Parav Pandit
2023-06-11 20:17                                                                             ` Parav Pandit
2023-06-11 23:15                                                                             ` [virtio-dev] " Michael S. Tsirkin
2023-06-11 23:15                                                                               ` Michael S. Tsirkin
2023-06-26  3:46                                                                   ` [virtio-dev] " Jason Wang
2023-06-26  3:46                                                                     ` Jason Wang
2023-06-26  3:32                                                                 ` [virtio-dev] " Jason Wang
2023-06-26  3:32                                                                   ` Jason Wang
2023-06-26  3:51                                                                   ` [virtio-dev] " Parav Pandit
2023-06-26  3:51                                                                     ` Parav Pandit
2023-06-27  2:38                                                                     ` [virtio-dev] " Jason Wang
2023-06-27  2:38                                                                       ` Jason Wang
2023-06-27  3:17                                                                       ` [virtio-dev] " Parav Pandit
2023-06-27  3:17                                                                         ` Parav Pandit
2023-06-27  4:33                                                                         ` [virtio-dev] " Jason Wang
2023-06-27  4:33                                                                           ` Jason Wang
2023-06-26  3:50                                                               ` Jason Wang
2023-06-26  3:50                                                                 ` [virtio-dev] " Jason Wang
2023-06-26  3:55                                                                 ` [virtio-dev] " Parav Pandit
2023-06-26  3:55                                                                   ` Parav Pandit
2023-06-26 10:49                                                                 ` [virtio-dev] " Michael S. Tsirkin
2023-06-26 10:49                                                                   ` Michael S. Tsirkin
2023-06-09  7:15                                             ` Michael S. Tsirkin
2023-06-09  7:15                                               ` [virtio-comment] " Michael S. Tsirkin
2023-06-26  3:59                                               ` Jason Wang
2023-06-26  3:59                                                 ` [virtio-comment] " Jason Wang
2023-06-26  4:04                                                 ` [virtio-dev] " Parav Pandit
2023-06-26  4:04                                                   ` Parav Pandit
2023-06-27  2:42                                                   ` [virtio-dev] " Jason Wang
2023-06-27  2:42                                                     ` Jason Wang
2023-06-26  7:13                                                 ` Michael S. Tsirkin
2023-06-26  7:13                                                   ` [virtio-comment] " Michael S. Tsirkin
2023-06-07  8:57                                     ` Michael S. Tsirkin
2023-06-07  8:57                                       ` [virtio-comment] " Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.