[COMMIT master] qemu-kvm: remove unused setupcpuid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michael S. Tsirkin <mst@xxxxxxxxxx>

kvm_setup_cpuid seems unused, so remove it.

Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx>

diff --git a/kvm/libkvm/libkvm-x86.c b/kvm/libkvm/libkvm-x86.c
index f1aef76..2b12408 100644
--- a/kvm/libkvm/libkvm-x86.c
+++ b/kvm/libkvm/libkvm-x86.c
@@ -466,45 +466,6 @@ __u64 kvm_get_cr8(kvm_context_t kvm, int vcpu)
 	return kvm->run[vcpu]->cr8;
 }
 
-int kvm_setup_cpuid(kvm_context_t kvm, int vcpu, int nent,
-		    struct kvm_cpuid_entry *entries)
-{
-	struct kvm_cpuid *cpuid;
-	int r;
-
-	cpuid = malloc(sizeof(*cpuid) + nent * sizeof(*entries));
-	if (!cpuid)
-		return -ENOMEM;
-
-	cpuid->nent = nent;
-	memcpy(cpuid->entries, entries, nent * sizeof(*entries));
-	r = ioctl(kvm->vcpu_fd[vcpu], KVM_SET_CPUID, cpuid);
-
-	free(cpuid);
-	return r;
-}
-
-int kvm_setup_cpuid2(kvm_context_t kvm, int vcpu, int nent,
-		     struct kvm_cpuid_entry2 *entries)
-{
-	struct kvm_cpuid2 *cpuid;
-	int r;
-
-	cpuid = malloc(sizeof(*cpuid) + nent * sizeof(*entries));
-	if (!cpuid)
-		return -ENOMEM;
-
-	cpuid->nent = nent;
-	memcpy(cpuid->entries, entries, nent * sizeof(*entries));
-	r = ioctl(kvm->vcpu_fd[vcpu], KVM_SET_CPUID2, cpuid);
-	if (r == -1) {
-		fprintf(stderr, "kvm_setup_cpuid2: %m\n");
-		r = -errno;
-	}
-	free(cpuid);
-	return r;
-}
-
 int kvm_set_shadow_pages(kvm_context_t kvm, unsigned int nrshadow_pages)
 {
 #ifdef KVM_CAP_MMU_SHADOW_CACHE_CONTROL
diff --git a/kvm/libkvm/libkvm.h b/kvm/libkvm/libkvm.h
index 4821a1e..a70945d 100644
--- a/kvm/libkvm/libkvm.h
+++ b/kvm/libkvm/libkvm.h
@@ -359,36 +359,6 @@ int kvm_set_guest_debug(kvm_context_t, int vcpu, struct kvm_guest_debug *dbg);
 
 #if defined(__i386__) || defined(__x86_64__)
 /*!
- * \brief Setup a vcpu's cpuid instruction emulation
- *
- * Set up a table of cpuid function to cpuid outputs.\n
- *
- * \param kvm Pointer to the current kvm_context
- * \param vcpu Which virtual CPU should be initialized
- * \param nent number of entries to be installed
- * \param entries cpuid function entries table
- * \return 0 on success, or -errno on error
- */
-int kvm_setup_cpuid(kvm_context_t kvm, int vcpu, int nent,
-		    struct kvm_cpuid_entry *entries);
-
-/*!
- * \brief Setup a vcpu's cpuid instruction emulation
- *
- * Set up a table of cpuid function to cpuid outputs.
- * This call replaces the older kvm_setup_cpuid interface by adding a few
- * parameters to support cpuid functions that have sub-leaf values.
- *
- * \param kvm Pointer to the current kvm_context
- * \param vcpu Which virtual CPU should be initialized
- * \param nent number of entries to be installed
- * \param entries cpuid function entries table
- * \return 0 on success, or -errno on error
- */
-int kvm_setup_cpuid2(kvm_context_t kvm, int vcpu, int nent,
-		     struct kvm_cpuid_entry2 *entries);
-
-/*!
  * \brief Setting the number of shadow pages to be allocated to the vm
  *
  * \param kvm pointer to kvm_context
diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index 20b7d6d..672bcbf 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -418,37 +418,6 @@ static void kvm_set_cr8(CPUState *env, uint64_t cr8)
     env->kvm_run->cr8 = cr8;
 }
 
-int kvm_setup_cpuid(CPUState *env, int nent,
-                    struct kvm_cpuid_entry *entries)
-{
-    struct kvm_cpuid *cpuid;
-    int r;
-
-    cpuid = qemu_malloc(sizeof(*cpuid) + nent * sizeof(*entries));
-
-    cpuid->nent = nent;
-    memcpy(cpuid->entries, entries, nent * sizeof(*entries));
-    r = kvm_vcpu_ioctl(env, KVM_SET_CPUID, cpuid);
-
-    free(cpuid);
-    return r;
-}
-
-int kvm_setup_cpuid2(CPUState *env, int nent,
-                     struct kvm_cpuid_entry2 *entries)
-{
-    struct kvm_cpuid2 *cpuid;
-    int r;
-
-    cpuid = qemu_malloc(sizeof(*cpuid) + nent * sizeof(*entries));
-
-    cpuid->nent = nent;
-    memcpy(cpuid->entries, entries, nent * sizeof(*entries));
-    r = kvm_vcpu_ioctl(env, KVM_SET_CPUID2, cpuid);
-    free(cpuid);
-    return r;
-}
-
 int kvm_set_shadow_pages(kvm_context_t kvm, unsigned int nrshadow_pages)
 {
 #ifdef KVM_CAP_MMU_SHADOW_CACHE_CONTROL
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 0f3fb50..7e6edfb 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -219,6 +219,7 @@ int kvm_get_mpstate(CPUState *env, struct kvm_mp_state *mp_state);
 int kvm_set_mpstate(CPUState *env, struct kvm_mp_state *mp_state);
 #endif
 
+#if defined(__i386__) || defined(__x86_64__)
 /*!
  * \brief Simulate an external vectored interrupt
  *
@@ -231,36 +232,6 @@ int kvm_set_mpstate(CPUState *env, struct kvm_mp_state *mp_state);
  */
 int kvm_inject_irq(CPUState *env, unsigned irq);
 
-#if defined(__i386__) || defined(__x86_64__)
-/*!
- * \brief Setup a vcpu's cpuid instruction emulation
- *
- * Set up a table of cpuid function to cpuid outputs.\n
- *
- * \param kvm Pointer to the current kvm_context
- * \param vcpu Which virtual CPU should be initialized
- * \param nent number of entries to be installed
- * \param entries cpuid function entries table
- * \return 0 on success, or -errno on error
- */
-int kvm_setup_cpuid(CPUState *env, int nent,
-                    struct kvm_cpuid_entry *entries);
-
-/*!
- * \brief Setup a vcpu's cpuid instruction emulation
- *
- * Set up a table of cpuid function to cpuid outputs.
- * This call replaces the older kvm_setup_cpuid interface by adding a few
- * parameters to support cpuid functions that have sub-leaf values.
- *
- * \param kvm Pointer to the current kvm_context
- * \param vcpu Which virtual CPU should be initialized
- * \param nent number of entries to be installed
- * \param entries cpuid function entries table
- * \return 0 on success, or -errno on error
- */
-int kvm_setup_cpuid2(CPUState *env, int nent,
-                     struct kvm_cpuid_entry2 *entries);
 
 /*!
  * \brief Setting the number of shadow pages to be allocated to the vm
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM Development]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Walks]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux