• Tony Krowiak's avatar
    s390/vfio-ap: reset queues filtered from the guest's AP config · f848cba7
    Tony Krowiak authored
    When filtering the adapters from the configuration profile for a guest to
    create or update a guest's AP configuration, if the APID of an adapter and
    the APQI of a domain identify a queue device that is not bound to the
    vfio_ap device driver, the APID of the adapter will be filtered because an
    individual APQN can not be filtered due to the fact the APQNs are assigned
    to an AP configuration as a matrix of APIDs and APQIs. Consequently, a
    guest will not have access to all of the queues associated with the
    filtered adapter. If the queues are subsequently made available again to
    the guest, they should re-appear in a reset state; so, let's make sure all
    queues associated with an adapter unplugged from the guest are reset.
    
    In order to identify the set of queues that need to be reset, let's allow a
    vfio_ap_queue object to be simultaneously stored in both a hashtable and a
    list: A hashtable used to store all of the queues assigned
    to a matrix mdev; and/or, a list used to store a subset of the queues that
    need to be reset. For example, when an adapter is hot unplugged from a
    guest, all guest queues associated with that adapter must be reset. Since
    that may be a subset of those assigned to the matrix mdev, they can be
    stored in a list that can be passed to the vfio_ap_mdev_reset_queues
    function.
    Signed-off-by: default avatarTony Krowiak <akrowiak@linux.ibm.com>
    Acked-by: default avatarHalil Pasic <pasic@linux.ibm.com>
    Fixes: 48cae940 ("s390/vfio-ap: refresh guest's APCB by filtering AP resources assigned to mdev")
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20240115185441.31526-5-akrowiak@linux.ibm.comSigned-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
    f848cba7
vfio_ap_private.h 5.64 KB