* [PATCH] qemu-kvm: remove unused setupcpuid
@ 2010-11-23 14:54 Michael S. Tsirkin
2010-11-29 14:42 ` Marcelo Tosatti
0 siblings, 1 reply; 2+ messages in thread
From: Michael S. Tsirkin @ 2010-11-23 14:54 UTC (permalink / raw)
To: kvm, avi
kvm_setup_cpuid seems unused, so remove it.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] qemu-kvm: remove unused setupcpuid
2010-11-23 14:54 [PATCH] qemu-kvm: remove unused setupcpuid Michael S. Tsirkin
@ 2010-11-29 14:42 ` Marcelo Tosatti
0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Tosatti @ 2010-11-29 14:42 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: kvm, avi
On Tue, Nov 23, 2010 at 04:54:42PM +0200, Michael S. Tsirkin wrote:
> kvm_setup_cpuid seems unused, so remove it.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-29 15:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-23 14:54 [PATCH] qemu-kvm: remove unused setupcpuid Michael S. Tsirkin
2010-11-29 14:42 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox