Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8ce057e authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Marcelo Tosatti
Browse files

KVM: improve comment on rcu use in irqfd_deassign



The RCU use in kvm_irqfd_deassign is tricky: we have rcu_assign_pointer
but no synchronize_rcu: synchronize_rcu is done by kvm_irq_routing_update
which we share a spinlock with.

Fix up a comment in an attempt to make this clearer.

Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 676646ee
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -313,8 +313,9 @@ kvm_irqfd_deassign(struct kvm *kvm, int fd, int gsi)
		if (irqfd->eventfd == eventfd && irqfd->gsi == gsi) {
		if (irqfd->eventfd == eventfd && irqfd->gsi == gsi) {
			/*
			/*
			 * This rcu_assign_pointer is needed for when
			 * This rcu_assign_pointer is needed for when
			 * another thread calls kvm_irqfd_update before
			 * another thread calls kvm_irq_routing_update before
			 * we flush workqueue below.
			 * we flush workqueue below (we synchronize with
			 * kvm_irq_routing_update using irqfds.lock).
			 * It is paired with synchronize_rcu done by caller
			 * It is paired with synchronize_rcu done by caller
			 * of that function.
			 * of that function.
			 */
			 */