]> git.ipfire.org Git - thirdparty/linux.git/commit
s390/vfio-ap: add s390dbf logging to the vfio_ap_irq_enable function
authorTony Krowiak <akrowiak@linux.ibm.com>
Tue, 4 Jan 2022 20:44:13 +0000 (15:44 -0500)
committerVasily Gorbik <gor@linux.ibm.com>
Sun, 6 Feb 2022 22:31:29 +0000 (23:31 +0100)
commit783f0a3ccd79477b159c6ef2104f9cff765215d9
tree1a7acaa28144d16c96aabff36caa3a51dc4ec61c
parent68f554b7d250b632d5fa17063f84c618c48b32a8
s390/vfio-ap: add s390dbf logging to the vfio_ap_irq_enable function

This patch adds s390dbf logging to the function that executes 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 vfio_ap_irq_enable function sets status response code 06
(notification indicator byte address (nib) invalid) in the status word
when the vfio_pin_pages function - called to pin the page containing the
nib - returns an error or a different number of pages pinned than
requested.

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.

In addition to logging a warning for the situation above, this patch adds
the following:

* A function to validate the nib address invoked prior to calling the
  vfio_pin_pages function. This allows for logging a message informing
  the reader of the reason the page containing the nib can not be pinned
  if the nib address is not valid. Response code 06 (invalid nib address)
  will be set in the status word returned to the guest from the
  instruction.

* Checks the return value from the kvm_s390_gisc_register and logs a
  message informing the reader of the failure. Status response code 08
  (invalid gisa) will be set in the status word returned to the guest from
  the PQAP(AQIC) instruction.

* Checks the status response code returned from execution of the PQAP(AQIC)
  instruction and if it indicates an error, logs a message informing the
  reader.

Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
drivers/s390/crypto/ap_bus.h
drivers/s390/crypto/vfio_ap_ops.c