[PATCH v2 0/1] transport-mmio: Add optional reset completion polling

Peter Hilber <[email protected]> Thu, 16 Apr 2026 18:52:55 +0200
Newsgroups dev.linux.lists.virtio-comment
Message-ID <[email protected]>
Let devices using the MMIO transport avoid stalling the driver (virtual)
CPU during device reset, which requires introducing a new MMIO transport
version. This proposal is similar to [1], but simpler.

v2, after discussion on the mailing list, describes some edge cases
differently and rewords some requirements.

If the device reset includes terminating device activity which may
interfere with the driver, the reset should always have completed by the
time the driver considers the reset complete. After device reset, the
driver may free previously exposed buffers. Per the current MMIO transport
specification, the device must hence complete the reset during the write of
zero to the Status register. If terminating the device activity takes long,
the (virtual) CPU doing this write to the Status register must be stalled
for extended time, which may violate real-time requirements (including
those for hypervisor trap-and-emulate).

Address this by introducing a new MMIO transport version, v3, where the
driver must poll for reset completion, and, hence, the device reset does
not have to finish during the write of zero to the Status register. Polling
for an operation to finish is a pattern also used for the PCI transport
device reset, device suspend, and MMIO transport QueueReset writes.

Unlike [1], this proposal does not require a reset-in-progress status bit.
Unlike [1], devices cannot indicate that the reset failed, which appears
unneeded.

This proposal has been verified with proof-of-concept implementations for
the Linux kernel and EDK2 OVMF Virtio drivers (supporting v2 and v3), and
for the QEMU Virtio devices.

[1] https://www.mail-archive.com/[email protected]/msg07677.html

v2:

- Add summary of MMIO v3 to Version register description (Matias)

- Align requirements on Status register transition to zero with transport-
  independent requirements (Matias)

- Change requirements relating to reset when status is already zero
  (Matias)

- In the commit message, document when v3 devices may be incompatible with
  v2 drivers (as per reply to Michael)

- Improve wording; refer to "zero" rather than "0"

Signed-off-by: Peter Hilber <[email protected]>


Peter Hilber (1):
  transport-mmio: Add v3, which polls for reset completion

 transport-mmio.tex | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)


base-commit: 5187698cc6f40fd2f2a714ca3faa6e998c5fc231
-- 
2.43.0