virtio config access races
Subsystems (2)
Michael S. Tsirkin
maintainerIt looks like there's a problem in the way virtio config currently
works: if driver reads config in probe routine, config subsequently can change before core sets DRIVER_OK. This will not cause an interrupt and so this event is lost. Maybe we should document that devices should delay such events until after DRIVER_OK?
Signature · 1 line
MST
Quoted 6 lines · Michael S. Tsirkin
It looks like there's a problem in the way virtio config currently
works: if driver reads config in probe routine, config subsequently can change before core setsDRIVER_OK. This will not cause an interrupt and so this event is lost. Maybe we should document that devices should delay such events until afterDRIVER_OK?
The device is currently defined to be active from the time we acknowledge the features (which means we may get a spurious interrupt before we probe, I think). We abuse this for virtio_blk for example, where we add_disk() inside the probe function.
Hmm, the changed interrupt is live from find_vqs, right? Perhaps we should leave it to drivers to set that up in the right order.
Thoughts?
Rusty.
Quoted 6 lines · Michael S. Tsirkin
It looks like there's a problem in the way virtio config currently
works: if driver reads config in probe routine, config subsequently can change before core setsDRIVER_OK. This will not cause an interrupt and so this event is lost. Maybe we should document that devices should delay such events until afterDRIVER_OK?
The device is currently defined to be active from the time we acknowledge the features (which means we may get a spurious interrupt before we probe, I think). We abuse this for virtio_blk for example, where we add_disk() inside the probe function.
Hmm, the changed interrupt is live from find_vqs, right? Perhaps we should leave it to drivers to set that up in the right order.
Thoughts?
Rusty.