diff options
author | David Hildenbrand <david@redhat.com> | 2017-09-11 19:49:30 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-09-19 14:09:33 +0200 |
commit | 2747e7167214f23b255b64654815aeb3f74b1296 (patch) | |
tree | fbf5d84338e4dd977a0930569ccfb996a616be76 /accel/kvm | |
parent | 5ea69c2e36148e5b5607f0919756c12c9637039b (diff) | |
download | qemu-2747e7167214f23b255b64654815aeb3f74b1296.zip qemu-2747e7167214f23b255b64654815aeb3f74b1296.tar.gz qemu-2747e7167214f23b255b64654815aeb3f74b1296.tar.bz2 |
kvm: use start + size for memory ranges
Convert kvm_lookup_matching_slot().
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20170911174933.20789-4-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel/kvm')
-rw-r--r-- | accel/kvm/kvm-all.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index e0d100b..88b0e63 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -172,7 +172,7 @@ static KVMSlot *kvm_alloc_slot(KVMMemoryListener *kml) static KVMSlot *kvm_lookup_matching_slot(KVMMemoryListener *kml, hwaddr start_addr, - hwaddr end_addr) + hwaddr size) { KVMState *s = kvm_state; int i; @@ -180,8 +180,7 @@ static KVMSlot *kvm_lookup_matching_slot(KVMMemoryListener *kml, for (i = 0; i < s->nr_slots; i++) { KVMSlot *mem = &kml->slots[i]; - if (start_addr == mem->start_addr && - end_addr == mem->start_addr + mem->memory_size) { + if (start_addr == mem->start_addr && size == mem->memory_size) { return mem; } } @@ -414,7 +413,7 @@ static int kvm_section_update_flags(KVMMemoryListener *kml, { hwaddr phys_addr = section->offset_within_address_space; ram_addr_t size = int128_get64(section->size); - KVMSlot *mem = kvm_lookup_matching_slot(kml, phys_addr, phys_addr + size); + KVMSlot *mem = kvm_lookup_matching_slot(kml, phys_addr, size); if (mem == NULL) { return 0; |