On Thu, Sep 30, 2021 at 06:32:07PM +0300, Max Gurtovoy wrote:
The device just got FLR'd and it should be in a clean state andJust prior to open device the vfio pci layer will generate a FLR torunning also mean that the device doesn't have a clue on its internal state
the function so we expect that post open_device has a fresh from reset
fully running device state.
? or running means unfreezed and unquiesced ?
operating. Think the VM is booting for the first time.
I don't know what this means, when the resuming bit is set theyou should feed the device way before that.No, I mean it will take all the migration data that has been uploadeddriver will see RESUMING toggle off so it will trigger aYou mean stop serialization ?
de-serialization
through the migration region and de-serialize it into active device
state.
migration data buffer is wiped and userspace should beging loading
it. When the resuming bit is cleared whatever is in the migration
buffer is deserialized into the current device internal state.
It is the opposite of saving. When the saving bit is set the current
device state is serialized into the migration buffer and userspace and
reads it out.
1. you initialize at _RUNNING bit == 001b. No problem.Running means the device state chanages independently, the controlled
2. state stream arrives, migration SW raise _RESUMING bit. should it be 101b
or 100b ? for now it's 100b. But according to your statement is should be
101b (invalid today) since device state can change. right ?
change of the device state via deserializing the migration buffer is
different. Both running and saving commands need running to be zero.
ie commands that are marked invalid in the uapi comment are rejected
at the start - and that is probably the core helper we should provide.
3. Then you should indicate that all the state was serialized to the deviceState is not loaded into the device until the resuming bit is
(actually to all the pci devices). 100b mean RESUMING and not RUNNING so
maybe this can say RESUMED and state can't change now ?
cleared. There is no RESUMED state until we incorporate Artem's
proposal for an additional bit eg 1001b - running with DMA master
disabled.
Jason