• Tony Krowiak's avatar
    s390/vfio-ap: add s390dbf logging to the handle_pqap function · 68f554b7
    Tony Krowiak authored
    This patch adds s390dbf logging to the function that handles interception
    of the PQAP(AQIC) instruction. Several items of data are validated before
    ultimately calling the functions that execute the PQAP(AQIC) instruction on
    behalf of the guest to which the queue for which interrupts are being
    enabled or disabled is attached.
    
    Currently, the handle_pqap function sets status response code 01 (queue not
    available) in the status word that is normally returned from the
    PQAP(AQIC) instruction under the following conditions:
    
    * Set when the function pointer to the handler is not set in the
      kvm_s390_crypto object (i.e., the PQAP hook is not registered).
    
    * Set when the KVM pointer is not set in the ap_matrix_mdev object
      (i.e., the matrix mdev is not passed through to a guest).
    
    * Set when the queue for which interrupts are being enabled or
      disabled is either not bound to the vfio_ap device driver or not assigned
      to the matrix mdev.
    
    Setting the response code returned to userspace without also logging a
    message in the kernel makes it impossible to determine whether the response
    was due to an error detected by the vfio_ap device driver or because the
    response code was returned by the firmware in response to the PQAP(AQIC)
    instruction, so this patch logs a message to the s390dbf log for the
    vfio_ap device driver for each of the situations described above.
    Signed-off-by: default avatarTony Krowiak <akrowiak@linux.ibm.com>
    Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
    Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    68f554b7
vfio_ap_ops.c 39.9 KB