[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 26/50] kvm: require JOIN_MEMORY_REGIONS_WORKS
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 26/50] kvm: require JOIN_MEMORY_REGIONS_WORKS |
Date: |
Tue, 19 Sep 2017 14:29:15 +0200 |
From: David Hildenbrand <address@hidden>
We already require DESTROY_MEMORY_REGION_WORKS, JOIN_MEMORY_REGIONS_WORKS
was added just half a year later.
In addition, with flatview overlapping memory regions are first
removed before adding the changed one. So we can't really detect joining
memory regions this way.
Let's just get rid of this special handling.
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
accel/kvm/kvm-all.c | 42 +-----------------------------------------
1 file changed, 1 insertion(+), 41 deletions(-)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index f85553a..985b179 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -79,7 +79,6 @@ struct KVMState
int coalesced_mmio;
struct kvm_coalesced_mmio_ring *coalesced_mmio_ring;
bool coalesced_flush_in_progress;
- int broken_set_mem_region;
int vcpu_events;
int robust_singlestep;
int debugregs;
@@ -127,6 +126,7 @@ static bool kvm_immediate_exit;
static const KVMCapabilityInfo kvm_required_capabilites[] = {
KVM_CAP_INFO(USER_MEMORY),
KVM_CAP_INFO(DESTROY_MEMORY_REGION_WORKS),
+ KVM_CAP_INFO(JOIN_MEMORY_REGIONS_WORKS),
KVM_CAP_LAST_INFO
};
@@ -696,7 +696,6 @@ kvm_check_extension_list(KVMState *s, const
KVMCapabilityInfo *list)
static void kvm_set_phys_mem(KVMMemoryListener *kml,
MemoryRegionSection *section, bool add)
{
- KVMState *s = kvm_state;
KVMSlot *mem, old;
int err;
MemoryRegion *mr = section->mr;
@@ -763,35 +762,6 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml,
abort();
}
- /* Workaround for older KVM versions: we can't join slots, even not by
- * unregistering the previous ones and then registering the larger
- * slot. We have to maintain the existing fragmentation. Sigh.
- *
- * This workaround assumes that the new slot starts at the same
- * address as the first existing one. If not or if some overlapping
- * slot comes around later, we will fail (not seen in practice so far)
- * - and actually require a recent KVM version. */
- if (s->broken_set_mem_region &&
- old.start_addr == start_addr && old.memory_size < size && add) {
- mem = kvm_alloc_slot(kml);
- mem->memory_size = old.memory_size;
- mem->start_addr = old.start_addr;
- mem->ram = old.ram;
- mem->flags = kvm_mem_flags(mr);
-
- err = kvm_set_user_memory_region(kml, mem);
- if (err) {
- fprintf(stderr, "%s: error updating slot: %s\n", __func__,
- strerror(-err));
- abort();
- }
-
- start_addr += old.memory_size;
- ram += old.memory_size;
- size -= old.memory_size;
- continue;
- }
-
/* register prefix slot */
if (old.start_addr < start_addr) {
mem = kvm_alloc_slot(kml);
@@ -833,10 +803,6 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml,
}
}
- /* in case the KVM bug workaround already "consumed" the new slot */
- if (!size) {
- return;
- }
if (!add) {
return;
}
@@ -1692,12 +1658,6 @@ static int kvm_init(MachineState *ms)
s->coalesced_mmio = kvm_check_extension(s, KVM_CAP_COALESCED_MMIO);
- s->broken_set_mem_region = 1;
- ret = kvm_check_extension(s, KVM_CAP_JOIN_MEMORY_REGIONS_WORKS);
- if (ret > 0) {
- s->broken_set_mem_region = 0;
- }
-
#ifdef KVM_CAP_VCPU_EVENTS
s->vcpu_events = kvm_check_extension(s, KVM_CAP_VCPU_EVENTS);
#endif
--
1.8.3.1
- [Qemu-devel] [PULL 29/50] kvm: we never have overlapping slots in kvm_set_phys_mem(), (continued)
- [Qemu-devel] [PULL 29/50] kvm: we never have overlapping slots in kvm_set_phys_mem(), Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 30/50] kvm: kvm_log_start/stop are only called with known sections, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 28/50] kvm: use start + size for memory ranges, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 21/50] i386/kvm: advertise Hyper-V frequency MSRs, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 22/50] MAINTAINERS: update email, add missing test entry for megasas, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 24/50] scsi/esp: Rename the ESP macro to ESP_STATE, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 27/50] kvm: factor out alignment of memory section, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 31/50] kvm: kvm_log_sync() is only called with known memory sections, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 25/50] multiboot: validate multiboot header address values, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 32/50] test-qga: add missing qemu-ga tool dependency, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 26/50] kvm: require JOIN_MEMORY_REGIONS_WORKS,
Paolo Bonzini <=
- [Qemu-devel] [PULL 23/50] memory: Rename queue to mrqueue (memory region queue), Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 13/50] scsi: move non-emulation specific code to scsi/, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 33/50] hw/i386: Improve some of the warning messages, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 35/50] Convert single line fprintf(.../n) to warn_report(), Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 38/50] target/mips: Convert VM clock update prints to warn_report, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 36/50] Convert multi-line fprintf() to warn_report(), Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 34/50] Convert remaining error_report() to warn_report(), Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 42/50] hyperv: add header with protocol definitions, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 37/50] General warn report fixups, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 43/50] update-linux-headers: prepare for hyperv.h removal, Paolo Bonzini, 2017/09/19