summaryrefslogtreecommitdiff
path: root/qemu-kvm-x86.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2010-03-08 21:47:09 -0300
committerAvi Kivity <avi@redhat.com>2010-03-09 15:16:19 +0200
commit2907ee2f054aafea3e09024ebd8461ce6ae08c71 (patch)
tree517b19d05c814da4a77ad4c021848e605feb50f0 /qemu-kvm-x86.c
parent6d05fec72a3b94eba4318c3a2811dacecf31a6d2 (diff)
kvm-tpr-opt: remove dead code
Simplify code around kvm_enable_tpr_access_reporting. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'qemu-kvm-x86.c')
-rw-r--r--qemu-kvm-x86.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index b2052a1ce..ad217bfe0 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -597,30 +597,16 @@ int kvm_get_shadow_pages(kvm_context_t kvm, unsigned int *nrshadow_pages)
}
#ifdef KVM_CAP_VAPIC
-
-static int tpr_access_reporting(CPUState *env, int enabled)
+static int kvm_enable_tpr_access_reporting(CPUState *env)
{
- int r;
- struct kvm_tpr_access_ctl tac = {
- .enabled = enabled,
- };
-
- r = kvm_ioctl(kvm_state, KVM_CHECK_EXTENSION, KVM_CAP_VAPIC);
- if (r <= 0)
- return -ENOSYS;
- return kvm_vcpu_ioctl(env, KVM_TPR_ACCESS_REPORTING, &tac);
-}
-
-int kvm_enable_tpr_access_reporting(CPUState *env)
-{
- return tpr_access_reporting(env, 1);
-}
+ int r;
+ struct kvm_tpr_access_ctl tac = { .enabled = 1 };
-int kvm_disable_tpr_access_reporting(CPUState *env)
-{
- return tpr_access_reporting(env, 0);
+ r = kvm_ioctl(env->kvm_state, KVM_CHECK_EXTENSION, KVM_CAP_VAPIC);
+ if (r <= 0)
+ return -ENOSYS;
+ return kvm_vcpu_ioctl(env, KVM_TPR_ACCESS_REPORTING, &tac);
}
-
#endif
int kvm_qemu_create_memory_alias(uint64_t phys_start,
@@ -1360,7 +1346,7 @@ int kvm_arch_init_vcpu(CPUState *cenv)
#endif
#ifdef KVM_EXIT_TPR_ACCESS
- kvm_tpr_vcpu_start(cenv);
+ kvm_enable_tpr_access_reporting(cenv);
#endif
kvm_reset_mpstate(cenv);
return 0;