All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Thierry <julien.thierry@arm.com>
To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu
Cc: will.deacon@arm.com, kraxel@redhat.com
Subject: [PATCH kvmtool v2 01/13] ioeventfd: Fix removal of ioeventfd
Date: Thu, 10 Jan 2019 14:12:38 +0000	[thread overview]
Message-ID: <1547129570-14351-2-git-send-email-julien.thierry@arm.com> (raw)
In-Reply-To: <1547129570-14351-1-git-send-email-julien.thierry@arm.com>

From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>

Fix three bugs that prevent removal of ioeventfds in KVM. Store the
flags in the right structure, check the datamatch parameter, and pass
the fd to KVM.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
---
 ioeventfd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ioeventfd.c b/ioeventfd.c
index 14453b8..3ae8267 100644
--- a/ioeventfd.c
+++ b/ioeventfd.c
@@ -172,7 +172,7 @@ int ioeventfd__add_event(struct ioevent *ioevent, int flags)
 		}
 	}
 
-	ioevent->flags = kvm_ioevent.flags;
+	new_ioevent->flags = kvm_ioevent.flags;
 	list_add_tail(&new_ioevent->list, &used_ioevents);
 
 	return 0;
@@ -192,7 +192,8 @@ int ioeventfd__del_event(u64 addr, u64 datamatch)
 		return -ENOSYS;
 
 	list_for_each_entry(ioevent, &used_ioevents, list) {
-		if (ioevent->io_addr == addr) {
+		if (ioevent->io_addr == addr &&
+		    ioevent->datamatch == datamatch) {
 			found = 1;
 			break;
 		}
@@ -202,6 +203,7 @@ int ioeventfd__del_event(u64 addr, u64 datamatch)
 		return -ENOENT;
 
 	kvm_ioevent = (struct kvm_ioeventfd) {
+		.fd			= ioevent->fd,
 		.addr			= ioevent->io_addr,
 		.len			= ioevent->io_len,
 		.datamatch		= ioevent->datamatch,
-- 
1.9.1

  reply	other threads:[~2019-01-10 14:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10 14:12 [PATCH kvmtool v2 00/13] Implement reset of virtio devices Julien Thierry
2019-01-10 14:12 ` Julien Thierry [this message]
2019-01-10 14:12 ` [PATCH kvmtool v2 02/13] virtio: Implement notify_status Julien Thierry
2019-01-10 14:12 ` [PATCH kvmtool v2 03/13] virtio: Add get_vq_count() callback Julien Thierry
2019-01-10 14:12 ` [PATCH kvmtool v2 04/13] virtio: Add get_vq() callback Julien Thierry
2019-01-10 14:12 ` [PATCH kvmtool v2 05/13] virtio: Add exit_vq() callback Julien Thierry
2019-01-10 14:12 ` [PATCH kvmtool v2 06/13] virtio: Add reset() callback Julien Thierry
2019-01-10 14:12 ` [PATCH kvmtool v2 07/13] net/uip: Add exit function Julien Thierry
2019-01-10 14:12 ` [PATCH kvmtool v2 08/13] virtio/net: Clean virtqueue state Julien Thierry
2019-01-10 14:12 ` [PATCH kvmtool v2 09/13] virtio/net: Implement device and virtqueue reset Julien Thierry
2019-01-10 14:12 ` [PATCH kvmtool v2 10/13] virtio/blk: Reset virtqueue Julien Thierry
2019-01-10 14:12 ` [PATCH kvmtool v2 11/13] threadpool: Add cancel() function Julien Thierry
2019-01-10 14:12 ` [PATCH kvmtool v2 12/13] virtio/p9: Implement reset Julien Thierry
2019-01-10 14:12 ` [PATCH kvmtool v2 13/13] virtio/console: " Julien Thierry
2019-01-22  7:07 ` [PATCH kvmtool v2 00/13] Implement reset of virtio devices Will Deacon
2019-01-22 11:51   ` Jean-Philippe Brucker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1547129570-14351-2-git-send-email-julien.thierry@arm.com \
    --to=julien.thierry@arm.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.