Skip to content

Commit

Permalink
KVM: fix spurious interrupt with irqfd
Browse files Browse the repository at this point in the history
kvm didn't clear irqfd counter on deassign, as a result we could get a
spurious interrupt when irqfd is assigned back. this leads to poor
performance and, in theory, guest crash.

Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
mstsirkin authored and matosatti committed Jan 25, 2010
1 parent cb289d6 commit b6a114d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion virt/kvm/eventfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ static void
irqfd_shutdown(struct work_struct *work)
{
struct _irqfd *irqfd = container_of(work, struct _irqfd, shutdown);
u64 cnt;

/*
* Synchronize with the wait-queue and unhook ourselves to prevent
* further events.
*/
remove_wait_queue(irqfd->wqh, &irqfd->wait);
eventfd_ctx_remove_wait_queue(irqfd->eventfd, &irqfd->wait, &cnt);

/*
* We know no new events will be scheduled at this point, so block
Expand Down

0 comments on commit b6a114d

Please sign in to comment.