[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/8] kvm: Conditionally apply workaround for KVM slo
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 1/8] kvm: Conditionally apply workaround for KVM slot handling bug |
Date: |
Fri, 01 May 2009 23:17:19 +0200 |
User-agent: |
StGIT/0.14.2 |
Only apply the workaround for broken slot joining in KVM when the
capability was not found that signals the corresponding fix existence.
Signed-off-by: Jan Kiszka <address@hidden>
---
kvm-all.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index 36659a9..cde3c5b 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -57,6 +57,7 @@ struct KVMState
int fd;
int vmfd;
int coalesced_mmio;
+ int broken_set_mem_region;
#ifdef KVM_CAP_SET_GUEST_DEBUG
struct kvm_sw_breakpoint_head kvm_sw_breakpoints;
#endif
@@ -398,6 +399,14 @@ int kvm_init(int smp_cpus)
s->coalesced_mmio = ret;
#endif
+ s->broken_set_mem_region = 1;
+#ifdef KVM_CAP_JOIN_MEMORY_REGIONS_WORKS
+ ret = kvm_ioctl(s, KVM_CHECK_EXTENSION, KVM_CAP_JOIN_MEMORY_REGIONS_WORKS);
+ if (ret > 0) {
+ s->broken_set_mem_region = 0;
+ }
+#endif
+
ret = kvm_arch_init(s, smp_cpus);
if (ret < 0)
goto err;
@@ -631,7 +640,8 @@ void kvm_set_phys_mem(target_phys_addr_t start_addr,
* 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 (old.start_addr == start_addr && old.memory_size < size &&
+ if (s->broken_set_mem_region &&
+ old.start_addr == start_addr && old.memory_size < size &&
flags < IO_MEM_UNASSIGNED) {
mem = kvm_alloc_slot(s);
mem->memory_size = old.memory_size;
- [Qemu-devel] [PATCH 0/8] kvm: Fixes, cleanups and live migration, Jan Kiszka, 2009/05/01
- [Qemu-devel] [PATCH 1/8] kvm: Conditionally apply workaround for KVM slot handling bug,
Jan Kiszka <=
- [Qemu-devel] [PATCH 2/8] kvm: Introduce kvm_set_migration_log, Jan Kiszka, 2009/05/01
- [Qemu-devel] [PATCH 4/8] kvm: Rework dirty bitmap synchronization, Jan Kiszka, 2009/05/01
- [Qemu-devel] [PATCH 3/8] kvm: Fix dirty log temporary buffer size, Jan Kiszka, 2009/05/01
- [Qemu-devel] [PATCH 6/8] kvm: Fix framebuffer dirty log sync, Jan Kiszka, 2009/05/01
- [Qemu-devel] [PATCH 5/8] kvm: Add missing bits to support live migration, Jan Kiszka, 2009/05/01
- [Qemu-devel] [PATCH 8/8] kvm: Rework VCPU reset, Jan Kiszka, 2009/05/01