Commit 56c82a03 authored by Jean-Philippe Brucker's avatar Jean-Philippe Brucker Committed by Will Deacon
Browse files

ioeventfd: Fix removal of ioeventfd



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: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: default avatarJulien Thierry <julien.thierry@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 9afefd6c
...@@ -172,7 +172,7 @@ int ioeventfd__add_event(struct ioevent *ioevent, int flags) ...@@ -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); list_add_tail(&new_ioevent->list, &used_ioevents);
return 0; return 0;
...@@ -192,7 +192,8 @@ int ioeventfd__del_event(u64 addr, u64 datamatch) ...@@ -192,7 +192,8 @@ int ioeventfd__del_event(u64 addr, u64 datamatch)
return -ENOSYS; return -ENOSYS;
list_for_each_entry(ioevent, &used_ioevents, list) { list_for_each_entry(ioevent, &used_ioevents, list) {
if (ioevent->io_addr == addr) { if (ioevent->io_addr == addr &&
ioevent->datamatch == datamatch) {
found = 1; found = 1;
break; break;
} }
...@@ -202,6 +203,7 @@ int ioeventfd__del_event(u64 addr, u64 datamatch) ...@@ -202,6 +203,7 @@ int ioeventfd__del_event(u64 addr, u64 datamatch)
return -ENOENT; return -ENOENT;
kvm_ioevent = (struct kvm_ioeventfd) { kvm_ioevent = (struct kvm_ioeventfd) {
.fd = ioevent->fd,
.addr = ioevent->io_addr, .addr = ioevent->io_addr,
.len = ioevent->io_len, .len = ioevent->io_len,
.datamatch = ioevent->datamatch, .datamatch = ioevent->datamatch,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment