linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] fix circular lockdep when staring SE guest
@ 2021-02-09 19:48 Tony Krowiak
  2021-02-09 19:48 ` [PATCH 1/1] s390/vfio-ap: fix circular lockdep when setting/clearing crypto masks Tony Krowiak
  0 siblings, 1 reply; 14+ messages in thread
From: Tony Krowiak @ 2021-02-09 19:48 UTC (permalink / raw)
  To: linux-s390, linux-kernel, kvm
  Cc: stable, borntraeger, cohuck, kwankhede, pbonzini,
	alex.williamson, pasic, Tony Krowiak

Patch f21916ec4826 ("s390/vfio-ap: clean up vfio_ap resources when KVM
pointer invalidated") introduced a change that results in a circular
locking dependency when a Secure Execution guest that is configured with
crypto devices is started. The problem resulted due to the fact that the
patch moved the setting of the guest's AP masks within the protection of
the matrix_dev->lock when the vfio_ap driver is notified that the KVM 
pointer has been set. Since it is not critical that setting/clearing of
the guest's AP masks when the driver is notified, the masks will not be
updated under the matrix_dev->lock. The lock is necessary for the
setting/unsetting of the KVM pointer, however, so that will remain in
place. 

The dependency chain for the circular lockdep resolved by this patch 
is:

#2	vfio_ap_mdev_group_notifier:	kvm->lock
					matrix_dev->lock

#1:	handle_pqap:			matrix_dev->lock
	kvm_vcpu_ioctl:			vcpu->mutex

#0:	kvm_s390_cpus_to_pv:		vcpu->mutex
	kvm_vm_ioctl:  			kvm->lock   

Tony Krowiak (1):
  s390/vfio-ap: fix circular lockdep when setting/clearing crypto masks

 drivers/s390/crypto/vfio_ap_ops.c | 75 ++++++++++++++++++-------------
 1 file changed, 45 insertions(+), 30 deletions(-)

-- 
2.21.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-02-11 19:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 19:48 [PATCH 0/1] fix circular lockdep when staring SE guest Tony Krowiak
2021-02-09 19:48 ` [PATCH 1/1] s390/vfio-ap: fix circular lockdep when setting/clearing crypto masks Tony Krowiak
2021-02-10 10:53   ` Cornelia Huck
2021-02-10 15:24     ` Halil Pasic
2021-02-10 15:32       ` Halil Pasic
2021-02-10 22:05         ` Tony Krowiak
2021-02-10 22:46           ` Halil Pasic
2021-02-11 14:21             ` Tony Krowiak
2021-02-11 16:47               ` Halil Pasic
2021-02-11 19:18                 ` Tony Krowiak
2021-02-10 22:03       ` Tony Krowiak
2021-02-10 20:34     ` Tony Krowiak
2021-02-11 12:23       ` Cornelia Huck
2021-02-11 14:38         ` Tony Krowiak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).