From 59cd205cea89716f742205e091a9ca9d6111ddd8 Mon Sep 17 00:00:00 2001 From: rusty Date: Mon, 12 May 2014 01:57:51 +0000 Subject: VIRTIO-98: Add DEVICE_NEEDS_RESET. As passed at meeting 2014-05-06: https://lists.oasis-open.org/archives/virtio/201405/msg00016.html Signed-off-by: Rusty Russell git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@367 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652 --- content.tex | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'content.tex') diff --git a/content.tex b/content.tex index 83d1afd..aff2d5b 100644 --- a/content.tex +++ b/content.tex @@ -40,6 +40,9 @@ following bits are defined: \item[DRIVER_OK (4)] Indicates that the driver is set up and ready to drive the device. +\item[DEVICE_NEEDS_RESET (64)] Indicates that the device has experienced + an error from which it can't recover. + \item[FAILED (128)] Indicates that something went wrong in the guest, and it has given up on the device. This could be an internal error, or the driver didn't like the device for some reason, or @@ -56,11 +59,24 @@ The driver MUST NOT clear a \field{device status} bit. If the driver sets the FAILED bit, the driver MUST later reset the device before attempting to re-initialize. +The driver SHOULD NOT rely on completion of operations of a +device if DEVICE_NEEDS_RESET is set. +\begin{note} +For example, the driver can't assume requests in flight will be +completed if DEVICE_NEEDS_RESET is set, nor can it assume that +they have not been completed. A good implementation will try to +recover by issuing a reset. +\end{note} + \devicenormative{\subsection}{Device Status Field}{Basic Facilities of a Virtio Device / Device Status Field} The device MUST initialize \field{device status} to 0 upon reset. The device MUST NOT consume buffers or notify the driver before DRIVER_OK. +\label{sec:Basic Facilities of a Virtio Device / Device Status Field / DEVICE_NEEDS_RESET}The device SHOULD set DEVICE_NEEDS_RESET when it enters an error state +that a reset is needed. After it sets DEVICE_NEEDS_RESET, the device +MUST send a device configuration change notification to the driver. + \section{Feature Bits}\label{sec:Basic Facilities of a Virtio Device / Feature Bits} Each virtio device offers all the features it understands. During @@ -902,6 +918,9 @@ for (;;) { For devices where the device-specific configuration information can be changed, an interrupt is delivered when a device-specific configuration change occurs. +In addition, this interrupt is triggered by the device setting +DEVICE_NEEDS_RESET (see \ref{sec:Basic Facilities of a Virtio Device / Device Status Field / DEVICE_NEEDS_RESET}). + \section{Device Cleanup}\label{sec:General Initialization And Device Operation / Device Cleanup} Once the driver has set the DRIVER_OK status bit, all the configured -- cgit v1.2.3