[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/4] kvm: support any size for pio eventfd
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PATCH 2/4] kvm: support any size for pio eventfd |
Date: |
Wed, 3 Apr 2013 11:59:36 +0300 |
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
kvm-all.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index ca9775d..589e37c 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -500,8 +500,8 @@ int kvm_check_extension(KVMState *s, unsigned int extension)
return ret;
}
-static int kvm_set_ioeventfd_mmio(int fd, uint32_t addr, uint32_t val, bool
assign,
- uint32_t size)
+static int kvm_set_ioeventfd_mmio(int fd, uint32_t addr, uint32_t val,
+ bool assign, uint32_t size)
{
int ret;
struct kvm_ioeventfd iofd;
@@ -529,13 +529,13 @@ static int kvm_set_ioeventfd_mmio(int fd, uint32_t addr,
uint32_t val, bool assi
return 0;
}
-static int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val,
- bool assign)
+static int kvm_set_ioeventfd_pio(int fd, uint16_t addr, uint16_t val,
+ bool assign, uint32_t size)
{
struct kvm_ioeventfd kick = {
.datamatch = val,
.addr = addr,
- .len = 2,
+ .len = size,
.flags = KVM_IOEVENTFD_FLAG_DATAMATCH | KVM_IOEVENTFD_FLAG_PIO,
.fd = fd,
};
@@ -571,7 +571,7 @@ static int kvm_check_many_ioeventfds(void)
if (ioeventfds[i] < 0) {
break;
}
- ret = kvm_set_ioeventfd_pio_word(ioeventfds[i], 0, i, true);
+ ret = kvm_set_ioeventfd_pio(ioeventfds[i], 0, i, true, 2);
if (ret < 0) {
close(ioeventfds[i]);
break;
@@ -582,7 +582,7 @@ static int kvm_check_many_ioeventfds(void)
ret = i == ARRAY_SIZE(ioeventfds);
while (i-- > 0) {
- kvm_set_ioeventfd_pio_word(ioeventfds[i], 0, i, false);
+ kvm_set_ioeventfd_pio(ioeventfds[i], 0, i, false, 2);
close(ioeventfds[i]);
}
return ret;
@@ -834,10 +834,10 @@ static void kvm_io_ioeventfd_add(MemoryListener *listener,
int fd = event_notifier_get_fd(e);
int r;
- assert(match_data && section->size == 2);
+ assert(match_data && section->size <= 8);
- r = kvm_set_ioeventfd_pio_word(fd, section->offset_within_address_space,
- data, true);
+ r = kvm_set_ioeventfd_pio(fd, section->offset_within_address_space,
+ data, true, section->size);
if (r < 0) {
abort();
}
@@ -852,8 +852,8 @@ static void kvm_io_ioeventfd_del(MemoryListener *listener,
int fd = event_notifier_get_fd(e);
int r;
- r = kvm_set_ioeventfd_pio_word(fd, section->offset_within_address_space,
- data, false);
+ r = kvm_set_ioeventfd_pio(fd, section->offset_within_address_space,
+ data, false, section->size);
if (r < 0) {
abort();
}
--
MST
- [Qemu-devel] [PATCH 0/4] kvm-unittests: add pci PORT IO and MMIO speed tests, Michael S. Tsirkin, 2013/04/03
- [Qemu-devel] [PATCH 1/4] kvm: remove unused APIs, Michael S. Tsirkin, 2013/04/03
- [Qemu-devel] [PATCH 2/4] kvm: support any size for pio eventfd,
Michael S. Tsirkin <=
- [Qemu-devel] [PATCH 3/4] kvm: support non datamatch ioeventfd, Michael S. Tsirkin, 2013/04/03
- [Qemu-devel] [PATCH 4/4] pci: add pci test device, Michael S. Tsirkin, 2013/04/03
- Re: [Qemu-devel] [PATCH 4/4] pci: add pci test device, Paolo Bonzini, 2013/04/03
- Re: [Qemu-devel] [PATCH 4/4] pci: add pci test device, Michael S. Tsirkin, 2013/04/03
- Re: [Qemu-devel] [PATCH 4/4] pci: add pci test device, Paolo Bonzini, 2013/04/03
- Re: [Qemu-devel] [PATCH 4/4] pci: add pci test device, Michael S. Tsirkin, 2013/04/03
- Re: [Qemu-devel] [PATCH 4/4] pci: add pci test device, Paolo Bonzini, 2013/04/03
- Re: [Qemu-devel] [PATCH 4/4] pci: add pci test device, Michael S. Tsirkin, 2013/04/03
- Re: [Qemu-devel] [PATCH 4/4] pci: add pci test device, Paolo Bonzini, 2013/04/03
- Re: [Qemu-devel] [PATCH 4/4] pci: add pci test device, Michael S. Tsirkin, 2013/04/03