[v2,0/6] s390/vfio-ap: reset queues removed from guest's AP configuration

Message ID 20231212212522.307893-1-akrowiak@linux.ibm.com
Headers
Series s390/vfio-ap: reset queues removed from guest's AP configuration |

Message

Anthony Krowiak Dec. 12, 2023, 9:25 p.m. UTC
  All queues removed from a guest's AP configuration must be reset so when
they are subsequently made available again to a guest, they re-appear in a
reset state. There are some scenarios where this is not the case. For 
example, if a queue device that is passed through to a guest is unbound 
from the vfio_ap device driver, the adapter to which the queue is attached
will be removed from the guest's AP configuration. Doing so implicitly
removes all queues associated with that adapter because the AP architecture
precludes removing a single queue. Those queues also need to be reset.

This patch series ensures that all queues removed from a guest's AP
configuration are reset for all possible scenarios.

Changelog v1=> v2:
-----------------
* Restored Halil's Acked-by and Reviewed-by tags (Halil)

* Restored Halil's code refactor of reset_queues_for_apids function in 
  patch 4

Tony Krowiak (6):
  s390/vfio-ap: always filter entire AP matrix
  s390/vfio-ap: loop over the shadow APCB when filtering guest's AP
    configuration
  s390/vfio-ap: let 'on_scan_complete' callback filter matrix and update
    guest's APCB
  s390/vfio-ap: reset queues filtered from the guest's AP config
  s390/vfio-ap: reset queues associated with adapter for queue unbound
    from driver
  s390/vfio-ap: do not reset queue removed from host config

 drivers/s390/crypto/vfio_ap_ops.c     | 268 +++++++++++++++++---------
 drivers/s390/crypto/vfio_ap_private.h |  11 +-
 2 files changed, 184 insertions(+), 95 deletions(-)
  

Comments

Anthony Krowiak Jan. 2, 2024, 4:26 p.m. UTC | #1
PING! Happy New Year!

On 12/12/23 4:25 PM, Tony Krowiak wrote:
> All queues removed from a guest's AP configuration must be reset so when
> they are subsequently made available again to a guest, they re-appear in a
> reset state. There are some scenarios where this is not the case. For
> example, if a queue device that is passed through to a guest is unbound
> from the vfio_ap device driver, the adapter to which the queue is attached
> will be removed from the guest's AP configuration. Doing so implicitly
> removes all queues associated with that adapter because the AP architecture
> precludes removing a single queue. Those queues also need to be reset.
>
> This patch series ensures that all queues removed from a guest's AP
> configuration are reset for all possible scenarios.
>
> Changelog v1=> v2:
> -----------------
> * Restored Halil's Acked-by and Reviewed-by tags (Halil)
>
> * Restored Halil's code refactor of reset_queues_for_apids function in
>    patch 4
>
> Tony Krowiak (6):
>    s390/vfio-ap: always filter entire AP matrix
>    s390/vfio-ap: loop over the shadow APCB when filtering guest's AP
>      configuration
>    s390/vfio-ap: let 'on_scan_complete' callback filter matrix and update
>      guest's APCB
>    s390/vfio-ap: reset queues filtered from the guest's AP config
>    s390/vfio-ap: reset queues associated with adapter for queue unbound
>      from driver
>    s390/vfio-ap: do not reset queue removed from host config
>
>   drivers/s390/crypto/vfio_ap_ops.c     | 268 +++++++++++++++++---------
>   drivers/s390/crypto/vfio_ap_private.h |  11 +-
>   2 files changed, 184 insertions(+), 95 deletions(-)
>
  
Anthony Krowiak Jan. 8, 2024, 4:52 p.m. UTC | #2
PING!

On 12/12/23 4:25 PM, Tony Krowiak wrote:
> All queues removed from a guest's AP configuration must be reset so when
> they are subsequently made available again to a guest, they re-appear in a
> reset state. There are some scenarios where this is not the case. For
> example, if a queue device that is passed through to a guest is unbound
> from the vfio_ap device driver, the adapter to which the queue is attached
> will be removed from the guest's AP configuration. Doing so implicitly
> removes all queues associated with that adapter because the AP architecture
> precludes removing a single queue. Those queues also need to be reset.
>
> This patch series ensures that all queues removed from a guest's AP
> configuration are reset for all possible scenarios.
>
> Changelog v1=> v2:
> -----------------
> * Restored Halil's Acked-by and Reviewed-by tags (Halil)
>
> * Restored Halil's code refactor of reset_queues_for_apids function in
>    patch 4
>
> Tony Krowiak (6):
>    s390/vfio-ap: always filter entire AP matrix
>    s390/vfio-ap: loop over the shadow APCB when filtering guest's AP
>      configuration
>    s390/vfio-ap: let 'on_scan_complete' callback filter matrix and update
>      guest's APCB
>    s390/vfio-ap: reset queues filtered from the guest's AP config
>    s390/vfio-ap: reset queues associated with adapter for queue unbound
>      from driver
>    s390/vfio-ap: do not reset queue removed from host config
>
>   drivers/s390/crypto/vfio_ap_ops.c     | 268 +++++++++++++++++---------
>   drivers/s390/crypto/vfio_ap_private.h |  11 +-
>   2 files changed, 184 insertions(+), 95 deletions(-)
>
  
Janosch Frank Jan. 9, 2024, 8:27 a.m. UTC | #3
On 1/8/24 17:52, Anthony Krowiak wrote:
> PING!
> 
You're waiting for review of the last patch, right?
  
Anthony Krowiak Jan. 9, 2024, 4:41 p.m. UTC | #4
On 1/9/24 3:27 AM, Janosch Frank wrote:
> On 1/8/24 17:52, Anthony Krowiak wrote:
>> PING!
>>
> You're waiting for review of the last patch, right?


Patch 6/6 does not have an r-b, so yes, that is one thing. The other's 
have been reviewed internally with some receiving only an acked-by, so I 
guess I'm looking for a final blessing so they can be merged. If I'm not 
mistaken, the primary problem for which theses patches were created - 
i.e., not resetting all queues when an adapter is removed from the guest 
- will cause unique problems for SE guests that are bound/associated. 
That being the case, I think these patches need to be merged sooner 
rather than later.