From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Hilber <peter.hilber@oss.qualcomm.com>
Cc: virtio-comment@lists.linux.dev,
Trilok Soni <trilok.soni@oss.qualcomm.com>
Subject: Re: [PATCH 1/1] transport-mmio: Add v3, which polls for reset completion
Date: Thu, 26 Mar 2026 19:13:59 -0400 [thread overview]
Message-ID: <20260326191118-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260204115022.1930-2-peter.hilber@oss.qualcomm.com>
On Wed, Feb 04, 2026 at 12:50:22PM +0100, Peter Hilber wrote:
> Let devices using the MMIO transport avoid stalling the driver (virtual)
> CPU during device reset, which requires introducing a new MMIO transport
> version.
>
> Unlike the PCI transport, the MMIO transport does not require the driver
> to poll for reset completion. This requires a device using the MMIO
> transport to complete reset during the write of 0 to the Status
> register. Device reset may take more than 100 ms if it involves
> terminating ongoing device activity which accesses driver memory. When
> the (virtual) CPU writing 0 to the Status register needs to be stalled
> during this, this 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 complete during the write to the Status register.
>
> For clarity, also add some related requirements for v2. These
> requirements are implied by the rest of the specification and therefore
> do not alter the v2 semantics.
>
> With MMIO transport v3, reset essentially works as with the PCI
> transport, and the change is therefore not expected to cause problems.
>
> Existing devices with MMIO transport v2 are not required to implement
> v3, which will not work with current drivers. Drivers have to support
> the MMIO transport versions of the used devices. Portable MMIO transport
> drivers should therefore support both v2 and v3, which is simple.
>
> Signed-off-by: Peter Hilber <peter.hilber@oss.qualcomm.com>
> ---
> transport-mmio.tex | 26 +++++++++++++++++++++++---
> 1 file changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/transport-mmio.tex b/transport-mmio.tex
> index 94a93a1..6504a6b 100644
> --- a/transport-mmio.tex
> +++ b/transport-mmio.tex
> @@ -64,7 +64,8 @@ \subsection{MMIO Device Register Layout}\label{sec:Virtio Transport Options / Vi
> }
> \hline
> \mmioreg{Version}{Device version number}{0x004}{R}{%
> - 0x2.
> + 0x2 or 0x3. With version 0x3, the driver waits until it reads 0 from the
> + \field{Status} register before considering a reset complete.
> \begin{note}
> Legacy devices (see \ref{sec:Virtio Transport Options / Virtio Over MMIO / Legacy interface}~\nameref{sec:Virtio Transport Options / Virtio Over MMIO / Legacy interface}) used 0x1.
> \end{note}
But this means there's no way to support existing (non polling) and new (polling)
drivers both in the same hypervisor:
/* Check device version */
vm_dev->version = readl(vm_dev->base + VIRTIO_MMIO_VERSION);
if (vm_dev->version < 1 || vm_dev->version > 2) {
dev_err(&pdev->dev, "Version %ld not supported!\n",
vm_dev->version);
rc = -ENXIO;
goto free_vm_dev;
}
Don't we want to?
--
MST
next prev parent reply other threads:[~2026-03-26 23:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 11:50 [PATCH 0/1] transport-mmio: Add optional reset completion polling Peter Hilber
2026-02-04 11:50 ` [PATCH 1/1] transport-mmio: Add v3, which polls for reset completion Peter Hilber
2026-03-26 18:44 ` Matias Ezequiel Vara Larsen
2026-03-27 18:26 ` Peter Hilber
2026-03-26 23:13 ` Michael S. Tsirkin [this message]
2026-03-27 18:47 ` Peter Hilber
2026-03-10 12:32 ` [PATCH 0/1] transport-mmio: Add optional reset completion polling Peter Hilber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260326191118-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=peter.hilber@oss.qualcomm.com \
--cc=trilok.soni@oss.qualcomm.com \
--cc=virtio-comment@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.