aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCam Macdonell <cam@cs.ualberta.ca>2010-07-26 18:10:59 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2010-10-11 16:33:25 -0500
commit089c6725207b66d6f9fe52eb6a7e9befe135da28 (patch)
tree6b317cd18f8ed0ce53b6d3c7f5d1665301f351a9 /kvm-all.c
parentDevice specification for shared memory PCI device (diff)
downloadqemu-kvm-089c6725207b66d6f9fe52eb6a7e9befe135da28.tar.gz
qemu-kvm-089c6725207b66d6f9fe52eb6a7e9befe135da28.tar.bz2
qemu-kvm-089c6725207b66d6f9fe52eb6a7e9befe135da28.zip
Add function to assign ioeventfd to MMIO.
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 44f1a3d8765b19ee88ca493e8e13cefb6ee50cbe)
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/kvm-all.c b/kvm-all.c
index 7635f2f89..d9a5dd05a 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1241,6 +1241,38 @@ int kvm_set_signal_mask(CPUState *env, const sigset_t *sigset)
return r;
}
+int kvm_set_ioeventfd_mmio_long(int fd, uint32_t addr, uint32_t val, bool assign)
+{
+#ifdef KVM_IOEVENTFD
+ int ret;
+ struct kvm_ioeventfd iofd;
+
+ iofd.datamatch = val;
+ iofd.addr = addr;
+ iofd.len = 4;
+ iofd.flags = KVM_IOEVENTFD_FLAG_DATAMATCH;
+ iofd.fd = fd;
+
+ if (!kvm_enabled()) {
+ return -ENOSYS;
+ }
+
+ if (!assign) {
+ iofd.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN;
+ }
+
+ ret = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &iofd);
+
+ if (ret < 0) {
+ return -errno;
+ }
+
+ return 0;
+#else
+ return -ENOSYS;
+#endif
+}
+
int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val, bool assign)
{
#ifdef KVM_IOEVENTFD