aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 0edc366ecf89..594606526620 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2512,19 +2512,25 @@ void kvm_io_bus_destroy(struct kvm_io_bus *bus)
2512 } 2512 }
2513} 2513}
2514 2514
2515struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus, 2515/* kvm_io_bus_write - called under kvm->slots_lock */
2516 gpa_t addr, int len, int is_write) 2516int kvm_io_bus_write(struct kvm_io_bus *bus, gpa_t addr,
2517 int len, const void *val)
2517{ 2518{
2518 int i; 2519 int i;
2520 for (i = 0; i < bus->dev_count; i++)
2521 if (!kvm_iodevice_write(bus->devs[i], addr, len, val))
2522 return 0;
2523 return -EOPNOTSUPP;
2524}
2519 2525
2520 for (i = 0; i < bus->dev_count; i++) { 2526/* kvm_io_bus_read - called under kvm->slots_lock */
2521 struct kvm_io_device *pos = bus->devs[i]; 2527int kvm_io_bus_read(struct kvm_io_bus *bus, gpa_t addr, int len, void *val)
2522 2528{
2523 if (kvm_iodevice_in_range(pos, addr, len, is_write)) 2529 int i;
2524 return pos; 2530 for (i = 0; i < bus->dev_count; i++)
2525 } 2531 if (!kvm_iodevice_read(bus->devs[i], addr, len, val))
2526 2532 return 0;
2527 return NULL; 2533 return -EOPNOTSUPP;
2528} 2534}
2529 2535
2530void kvm_io_bus_register_dev(struct kvm *kvm, struct kvm_io_bus *bus, 2536void kvm_io_bus_register_dev(struct kvm *kvm, struct kvm_io_bus *bus,