diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2012-03-20 14:31:38 +0200 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-04-12 19:01:41 -0300 |
commit | 4b8f1c88e9de2ded754b12a967a93d395bed1245 (patch) | |
tree | 1d868d3e0c6027c70b60771b29f50988c0ad1c52 /kvm-all.c | |
parent | 56b9ead234439317629054fa370c547c652ab09a (diff) |
kvm: allow arbitrarily sized mmio ioeventfd
We use a 2 byte ioeventfd for virtio memory,
add support for this.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r-- | kvm-all.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -747,10 +747,10 @@ static void kvm_mem_ioeventfd_add(MemoryRegionSection *section, { int r; - assert(match_data && section->size == 4); + assert(match_data && section->size <= 8); - r = kvm_set_ioeventfd_mmio_long(fd, section->offset_within_address_space, - data, true); + r = kvm_set_ioeventfd_mmio(fd, section->offset_within_address_space, + data, true, section->size); if (r < 0) { abort(); } @@ -761,8 +761,8 @@ static void kvm_mem_ioeventfd_del(MemoryRegionSection *section, { int r; - r = kvm_set_ioeventfd_mmio_long(fd, section->offset_within_address_space, - data, false); + r = kvm_set_ioeventfd_mmio(fd, section->offset_within_address_space, + data, false, section->size); if (r < 0) { abort(); } @@ -1642,14 +1642,15 @@ int kvm_set_signal_mask(CPUArchState *env, const sigset_t *sigset) return r; } -int kvm_set_ioeventfd_mmio_long(int fd, uint32_t addr, uint32_t val, bool assign) +int kvm_set_ioeventfd_mmio(int fd, uint32_t addr, uint32_t val, bool assign, + uint32_t size) { int ret; struct kvm_ioeventfd iofd; iofd.datamatch = val; iofd.addr = addr; - iofd.len = 4; + iofd.len = size; iofd.flags = KVM_IOEVENTFD_FLAG_DATAMATCH; iofd.fd = fd; |