1. 26 7月, 2022 3 次提交
  2. 23 7月, 2022 1 次提交
  3. 21 7月, 2022 1 次提交
  4. 24 5月, 2022 1 次提交
  5. 12 5月, 2022 2 次提交
  6. 21 4月, 2022 1 次提交
  7. 28 3月, 2022 1 次提交
    • T
      s390/vfio-ap: fix kernel doc and signature of group notifier functions · 71078220
      Tony Krowiak 提交于
      The vfio_ap device driver registers a group notifier function to handle
      the VFIO_GROUP_NOTIFY_SET_KVM event signalling the KVM pointer has been
      set or cleared. There are two helper functions invoked by the handler
      function: One called when the KVM pointer has been set, and the other
      when the pointer is cleared.
      
      The kernel doc for both of these functions contains a comment introduced
      by commit 0cc00c8d (s390/vfio-ap: fix circular lockdep when
      setting/clearing crypto masks) that is no longer valid. This patch removes
      this comment from the kernel doc of each helper function.
      
      Commit 86956e70 (s390/vfio-ap: replace open coded locks for
      VFIO_GROUP_NOTIFY_SET_KVM notification) added a parameter to the signature
      of the helper function that handles the event indicating the KVM pointer
      has been cleared. The parameter added was the KVM pointer itself.
      One of the function's primary purposes is to clear the KVM pointer from the
      ap_matrix_mdev instance in which it is stored. Since the callers of this
      function derive the KVM pointer passed to the function from the
      ap_matrix_mdev object itself, it is completely unnecessary to include this
      parameter in the function's signature since it can simply be retrieved from
      the ap_matrix_mdev object which is also passed in. This patch removes the
      KVM pointer from the function's signature.
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      71078220
  8. 07 2月, 2022 2 次提交
    • T
      s390/vfio-ap: add s390dbf logging to the vfio_ap_irq_enable function · 783f0a3c
      Tony Krowiak 提交于
      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: NTony Krowiak <akrowiak@linux.ibm.com>
      Reviewed-by: NMatthew Rosato <mjrosato@linux.ibm.com>
      Acked-by: NHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      783f0a3c
    • T
      s390/vfio-ap: add s390dbf logging to the handle_pqap function · 68f554b7
      Tony Krowiak 提交于
      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: NTony Krowiak <akrowiak@linux.ibm.com>
      Reviewed-by: NMatthew Rosato <mjrosato@linux.ibm.com>
      Acked-by: NHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      68f554b7
  9. 26 10月, 2021 1 次提交
  10. 01 10月, 2021 1 次提交
  11. 25 9月, 2021 1 次提交
  12. 26 8月, 2021 1 次提交
  13. 25 8月, 2021 3 次提交
  14. 11 8月, 2021 1 次提交
  15. 21 6月, 2021 1 次提交
  16. 13 4月, 2021 2 次提交
  17. 05 4月, 2021 1 次提交
    • T
      s390/vfio-ap: fix circular lockdep when setting/clearing crypto masks · 0cc00c8d
      Tony Krowiak 提交于
      This patch fixes a lockdep splat introduced by commit f21916ec
      ("s390/vfio-ap: clean up vfio_ap resources when KVM pointer invalidated").
      The lockdep splat only occurs when starting a Secure Execution guest.
      Crypto virtualization (vfio_ap) is not yet supported for SE guests;
      however, in order to avoid this problem when support becomes available,
      this fix is being provided.
      
      The circular locking dependency was introduced when the setting of the
      masks in the guest's APCB was executed while holding the matrix_dev->lock.
      While the lock is definitely needed to protect the setting/unsetting of the
      matrix_mdev->kvm pointer, it is not necessarily critical for setting the
      masks; so, the matrix_dev->lock will be released while the masks are being
      set or cleared.
      
      Keep in mind, however, that another process that takes the matrix_dev->lock
      can get control while the masks in the guest's APCB are being set or
      cleared as a result of the driver being notified that the KVM pointer
      has been set or unset. This could result in invalid access to the
      matrix_mdev->kvm pointer by the intervening process. To avoid this
      scenario, two new fields are being added to the ap_matrix_mdev struct:
      
      struct ap_matrix_mdev {
      	...
      	bool kvm_busy;
      	wait_queue_head_t wait_for_kvm;
         ...
      };
      
      The functions that handle notification that the KVM pointer value has
      been set or cleared will set the kvm_busy flag to true until they are done
      processing at which time they will set it to false and wake up the tasks on
      the matrix_mdev->wait_for_kvm wait queue. Functions that require
      access to matrix_mdev->kvm will sleep on the wait queue until they are
      awakened at which time they can safely access the matrix_mdev->kvm
      field.
      
      Fixes: f21916ec ("s390/vfio-ap: clean up vfio_ap resources when KVM pointer invalidated")
      Cc: stable@vger.kernel.org
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Signed-off-by: NHeiko Carstens <hca@linux.ibm.com>
      0cc00c8d
  18. 08 3月, 2021 1 次提交
  19. 27 1月, 2021 2 次提交
  20. 25 3月, 2020 1 次提交
  21. 05 9月, 2019 1 次提交
  22. 12 7月, 2019 1 次提交
  23. 02 7月, 2019 2 次提交
  24. 22 2月, 2019 1 次提交
  25. 08 10月, 2018 1 次提交
  26. 05 10月, 2018 1 次提交
  27. 28 9月, 2018 4 次提交
  28. 27 9月, 2018 1 次提交