Description: kernel: zcrypt: reinit ap queue state machine
Symptom: Zcrypt ap queue device not operational at host level after a
kvm guest used it.
Problem: The vfio device driver when receiving an ap queue device does additional resets thereby removing the registration for interrupts for the ap device done by the ap bus core
code. So when later the vfio driver releases the device and
one of the default zcrypt drivers takes care of the device
the interrupt registration needs to get renewed. The current
code does no renew and result is that requests send into such
a queue will never see a reply processed - the application hangs.
Solution: This patch adds a function which resets the aq queue state machine for the ap queue device and triggers the walk through
the initial states (which are reset and registration for interrupts). This function is now called before the driver's
probe function is invoked.
When the association between driver and device is released,
the driver's remove function is called. The current implementation calls a ap queue function ap_queue_remove(). This invokation has been moved to the ap
bus function to make the probe / remove pair for ap bus and drivers more symmetric.
Reproduction: Set up an kvm guest to use one or more ap queues in pass-through mode. Start the guest. Stop the guest. Reassign
the ap resources back to the host system. Run an application
which uses exactly this ap resources. Without the fix, the application hangs; with the fix the application should run
fine.
Upstream commit(s):
104f708fd1241b22f808bdf066ab67dc5a051de5
Available on kernel.org
Description: kernel: zcrypt: reinit ap queue state machine
Symptom: Zcrypt ap queue device not operational at host level after a
kvm guest used it.
Problem: The vfio device driver when receiving an ap queue device does
additional resets thereby removing the registration for
interrupts for the ap device done by the ap bus core
hangs.
code. So when later the vfio driver releases the device and
one of the default zcrypt drivers takes care of the device
the interrupt registration needs to get renewed. The current
code does no renew and result is that requests send into such
a queue will never see a reply processed - the application
Solution: This patch adds a function which resets the aq queue state
machine for the ap queue device and triggers the walk through
interrupts) . This function is now called before the driver's
implementation calls a ap queue function
ap_queue_ remove( ). This invokation has been moved to the ap
drivers more symmetric.
the initial states (which are reset and registration for
probe function is invoked.
When the association between driver and device is released,
the driver's remove function is called. The current
bus function to make the probe / remove pair for ap bus and
Reproduction: Set up an kvm guest to use one or more ap queues in
pass-through mode. Start the guest. Stop the guest. Reassign
application hangs; with the fix the application should run
the ap resources back to the host system. Run an application
which uses exactly this ap resources. Without the fix, the
fine.
Upstream commit(s): 2f808bdf066ab67 dc5a051de5
104f708fd1241b2
Available on kernel.org