• Tony Krowiak's avatar
    s390/vfio-ap: introduce shadow APCB · 49b0109f
    Tony Krowiak authored
    The APCB is a field within the CRYCB that provides the AP configuration
    to a KVM guest. Let's introduce a shadow copy of the KVM guest's APCB and
    maintain it for the lifespan of the guest.
    
    The shadow APCB serves the following purposes:
    
    1. The shadow APCB can be maintained even when the mediated device is not
       currently in use by a KVM guest. Since the mediated device's AP
       configuration is filtered to ensure that no AP queues are passed through
       to the KVM guest that are not bound to the vfio_ap device driver or
       available to the host, the mediated device's AP configuration may differ
       from the guest's. Having a shadow of a guest's APCB allows us to provide
       a sysfs interface to view the guest's APCB even if the mediated device
       is not currently passed through to a KVM guest. This can aid in
       problem determination when the guest is unexpectedly missing AP
       resources.
    
    2. If filtering was done in-place for the real APCB, the guest could pick
       up a transient state. Doing the filtering on a shadow and transferring
       the AP configuration to the real APCB after the guest is started or when
       AP resources are assigned to or unassigned from the mediated device, or
       when the host configuration changes, the guest's AP configuration will
       never be in a transient state.
    Signed-off-by: default avatarTony Krowiak <akrowiak@linux.ibm.com>
    Reviewed-by: default avatarHalil Pasic <pasic@linux.ibm.com>
    Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
    49b0109f
vfio_ap_ops.c 45.4 KB