qemu-kvm: remove unused setupcpuid
PATCH 1/1 qemu-kvm: remove unused setupcpuid
kvm_setup_cpuid seems unused, so remove it.
Signed-off-by Michael S. Tsirkin <[email protected]>
kvm/libkvm/libkvm-x86.c +0 -39
@@ -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
kvm/libkvm/libkvm.h +0 -30
@@ -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
qemu-kvm-x86.c +0 -31
@@ -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
qemu-kvm.h +1 -30
@@ -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
Marcelo Tosatti
AppliedQuoted 3 lines · Michael S. Tsirkin
kvm_setup_cpuidseems unused, so remove it.Signed-off-by Michael S. Tsirkin <[email protected]>
Applied, thanks.