On Tue, 26 Jun 2018 13:04:12 +0200...snip...
Pierre Morel <pmorel@xxxxxxxxxxxxx> wrote:
On 19/06/2018 16:00, Cornelia Huck wrote:
On Thu, 14 Jun 2018 10:06:31 +0200
Pierre Morel<pmorel@xxxxxxxxxxxxx> wrote:
Yes but it is related to the software handling the device and not to the device.The goal of the state machine is to describe the device driver state.I don't think there really is such a thing as "device driver state" (or
Not the device state which is hold by the CIO level.
maybe I don't understand what you mean by it). The state is attached to
the individual device, isn't it?
No, when the mdev is created the VM is not started.
I think this has lead to some confusion since I tried to keep the oldHm, isn't that transition happening when the mdev is created?
naming convention.
So, I agree that a state named "NON_INIT" or "UNCONFIGUED" would be better
to distinguish it from the device state "NOT_OPERATIONAL"
Also, we need to be careful with the virtual machine vs. guestAbsolutely.
terminology. The only thing that has an impact from the guest is when
it does I/O and when an interrupt is generated as a result (i.e., the
IDLE/BUSY transitions). The other transitions are triggered by virtual
machine setup.
When the device is bound to the driver, the device driver------------------------------------------------------------This is basically "device is bound to driver, but no mdev has been set
| STANDBYÂÂÂÂÂÂÂÂÂ | A guest is associated but not started |
up".
is still in NOT_OPERATIONAL state.
The transition to STANDBY is done when the virtual machine starts and
opens the mediated device.
Note that the device is still not usable until it is reseted.
...snip...
Now you are talking about the driver :) This should probably be doneNow you have managed to confuse me completely... isn't the firmware
for the other states as well.Ill update the description to make clear that the state is the
driver state (device driver) and not the device state.
The device state is handled by the firmware.
only handling the (real) subchannel state?
It might be good to combine the two.Isn't that rather "an mdev is created"?No, ONLINE is triggered by VFIO_RESET, after the mdev has been created
and when the VM is started or restarted by QEMU.
I see that I did not do a good job describing what triggers the events.
I will try again in a dedicated document.
How can something be operational if the device is not? It could be in aI think we have a confusion between the sub-channel being non operational| |ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ |What happens if the subchannel is not operational when we try to get it
|ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ | triggered by: vfio_resetÂÂÂÂÂÂÂÂÂÂÂÂÂ |
|ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ | action: enable SCÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ |
|ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ | state on success: IDLEÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ |
| | state on error : STANDBY |
ready? Can it go to NOT_OPERATIONAL in that case?
and the device driver being non operational.
Here, the device driver is operational, even the device may not.
state like the ccw device's disconnected state, but it's certainly not
ready for requests.
For the VM perspective, if the device is not operational we send a RESET.Ah, do you mean 'subchannel enabled'? I was thinking about 'device
For the guest perspective we can do what ever instruction we needs to
get the device operational, therefor we need the driver to be operational
to process the instruction.
dead, we get cc 3 or somesuch'.
See above. I think we'll get a notification from the common I/O layer,I think this is the duty of the guest to handle this kind of thing.| | state on error : IDLE |Should there be any way to drop to NOT_OPERATIONAL as well? We'll
probably get a notification from the common I/O layer if that happens,
though.
The device driver must stay operational.
and it probably makes sense to inject the same notification (CRW) into
the guest.
As long as we do update it some time before we need the information, ok.This is the common I/O layer's sch_event callback. That can meanI think it should be ignored in STANDBY as we did not even
different things:
- Something regarding the paths to the device changed. We can translate
that to "schib updated".
- Device is gone. This is a different situation; we may either try to
implement the disconnected state, or we may give up the device.
Also, can't we get this event in QUIESCING or STANDBY as well?
start to use the sub-channel we have no information on it
at that moment.
In QUIESCING we may have to handle it for internal purposeIt depends. We either get a deferred cc 3, or a machine check (but no
to make sure to shutdown smoothly.
I will work on this again.
(Still this OFFLINE refactoring)
AFAIK yes, it is an asynchronous event.| |ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ |As said, we may want some different handling for "device gone"
|ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ | triggered by: sch_eventÂÂÂÂÂÂÂÂÂÂÂÂÂÂ |
| | action: Store the SCHIB in IO region |
|ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ | state on success: no changeÂÂÂÂÂÂÂÂÂÂ |
situations.
Also, what happens if we get that event in BUSY? Is the I/O still
running?
It can happen during BUSY.
However AFAIU we still get an IRQ even we get the device gone
during I/O operation.
interrupt).