Skip to content

Commit c51f8c6

Browse files
Tony Krowiakhcahca
authored andcommitted
s390/vfio-ap: allow deconfigured queue to be passed through to a guest
When a queue is reset, the status response code returned from the reset operation is stored in the reset_rc field of the vfio_ap_queue structure representing the queue being reset. This field is later used to decide whether the queue should be passed through to a guest. If the reset_rc field is a non-zero value, the queue will be filtered from the list of queues passed through. When an adapter is deconfigured, all queues associated with that adapter are reset. That being the case, it is not necessary to filter those queues; so, if the status response code returned from a reset operation indicates the queue is deconfigured, the reset_rc field of the vfio_ap_queue structure will be set to zero so it will be passed through (i.e., not filtered). Signed-off-by: Tony Krowiak <[email protected]> Reviewed-by: Jason J. Herne <[email protected]> Acked-by: Halil Pasic <[email protected]> Tested-by: Viktor Mihajlovski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Carstens <[email protected]>
1 parent 411b010 commit c51f8c6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/s390/crypto/vfio_ap_ops.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,9 +1677,11 @@ static int vfio_ap_mdev_reset_queue(struct vfio_ap_queue *q)
16771677
case AP_RESPONSE_DECONFIGURED:
16781678
/*
16791679
* When an AP adapter is deconfigured, the associated
1680-
* queues are reset, so let's return a value indicating the reset
1681-
* completed successfully.
1680+
* queues are reset, so let's set the status response code to 0
1681+
* so the queue may be passed through (i.e., not filtered) and
1682+
* return a value indicating the reset completed successfully.
16821683
*/
1684+
q->reset_rc = 0;
16831685
ret = 0;
16841686
vfio_ap_free_aqic_resources(q);
16851687
break;

0 commit comments

Comments
 (0)