@@ -152,11 +152,6 @@ int kvm_arch_create(kvm_context_t kvm)
return r;
}
- r = kvm_init_coalesced_mmio(kvm);
- if (r < 0) {
- return r;
- }
-
uname(&utsname);
lm_capable_kernel = strcmp(utsname.machine, "x86_64") == 0;
@@ -495,20 +495,6 @@ int kvm_inject_nmi(CPUState *env)
#endif
}
-int kvm_init_coalesced_mmio(kvm_context_t kvm)
-{
- int r = 0;
- kvm_state->coalesced_mmio = 0;
-#ifdef KVM_CAP_COALESCED_MMIO
- r = kvm_ioctl(kvm_state, KVM_CHECK_EXTENSION, KVM_CAP_COALESCED_MMIO);
- if (r > 0) {
- kvm_state->coalesced_mmio = r;
- return 0;
- }
-#endif
- return r;
-}
-
#ifdef KVM_CAP_DEVICE_ASSIGNMENT
int kvm_assign_pci_device(kvm_context_t kvm,
struct kvm_assigned_pci_dev *assigned_dev)
@@ -1419,6 +1405,12 @@ static int kvm_create_context(void)
return r;
}
+ kvm_state->coalesced_mmio = 0;
+#ifdef KVM_CAP_COALESCED_MMIO
+ kvm_state->coalesced_mmio =
+ kvm_check_extension(kvm_state, KVM_CAP_COALESCED_MMIO);
+#endif
+
kvm_state->vcpu_events = 0;
#ifdef KVM_CAP_VCPU_EVENTS
kvm_state->vcpu_events = kvm_check_extension(kvm_state, KVM_CAP_VCPU_EVENTS);
@@ -200,15 +200,6 @@ int kvm_inject_nmi(CPUState *env);
#endif
-/*!
- * \brief Initialize coalesced MMIO
- *
- * Check for coalesced MMIO capability and store in context
- *
- * \param kvm Pointer to the current kvm_context
- */
-int kvm_init_coalesced_mmio(kvm_context_t kvm);
-
#ifdef KVM_CAP_PIT
#if defined(__i386__) || defined(__x86_64__)