diff options
author | Laurent Vivier <Laurent.Vivier@bull.net> | 2008-05-30 10:05:53 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-07-20 05:42:30 -0400 |
commit | 92760499d01ef91518119908eb9b8798b6c9bd3f (patch) | |
tree | a6bd80fbad82589eb5aa98f81edda4537bc1f625 /virt/kvm/kvm_main.c | |
parent | 131d82791b628d4aeafd94ddc74a9b68f3d15a83 (diff) |
KVM: kvm_io_device: extend in_range() to manage len and write attribute
Modify member in_range() of structure kvm_io_device to pass length and the type
of the I/O (write or read).
This modification allows to use kvm_io_device with coalesced MMIO.
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r-- | virt/kvm/kvm_main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 83a0e5ce6037..9330fad2b918 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -1350,14 +1350,15 @@ void kvm_io_bus_destroy(struct kvm_io_bus *bus) | |||
1350 | } | 1350 | } |
1351 | } | 1351 | } |
1352 | 1352 | ||
1353 | struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus, gpa_t addr) | 1353 | struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus, |
1354 | gpa_t addr, int len, int is_write) | ||
1354 | { | 1355 | { |
1355 | int i; | 1356 | int i; |
1356 | 1357 | ||
1357 | for (i = 0; i < bus->dev_count; i++) { | 1358 | for (i = 0; i < bus->dev_count; i++) { |
1358 | struct kvm_io_device *pos = bus->devs[i]; | 1359 | struct kvm_io_device *pos = bus->devs[i]; |
1359 | 1360 | ||
1360 | if (pos->in_range(pos, addr)) | 1361 | if (pos->in_range(pos, addr, len, is_write)) |
1361 | return pos; | 1362 | return pos; |
1362 | } | 1363 | } |
1363 | 1364 | ||