summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kvm-tpr-opt.c5
-rw-r--r--qemu-kvm-x86.c30
-rw-r--r--qemu-kvm.h22
3 files changed, 8 insertions, 49 deletions
diff --git a/kvm-tpr-opt.c b/kvm-tpr-opt.c
index c7439d45e..9557ef4e6 100644
--- a/kvm-tpr-opt.c
+++ b/kvm-tpr-opt.c
@@ -318,11 +318,6 @@ void kvm_tpr_access_report(CPUState *env, uint64_t rip, int is_write)
patch_instruction(env, rip);
}
-void kvm_tpr_vcpu_start(CPUState *env)
-{
- kvm_enable_tpr_access_reporting(env);
-}
-
static void tpr_save(QEMUFile *f, void *s)
{
int i;
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;
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 1616180a4..f5db9e6dd 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -601,27 +601,6 @@ int kvm_get_pit2(kvm_context_t kvm, struct kvm_pit_state2 *ps2);
#ifdef KVM_CAP_VAPIC
-/*!
- * \brief Enable kernel tpr access reporting
- *
- * When tpr access reporting is enabled, the kernel will call the
- * ->tpr_access() callback every time the guest vcpu accesses the tpr.
- *
- * \param kvm Pointer to the current kvm_context
- * \param vcpu vcpu to enable tpr access reporting on
- */
-int kvm_enable_tpr_access_reporting(CPUState *env);
-
-/*!
- * \brief Disable kernel tpr access reporting
- *
- * Undoes the effect of kvm_enable_tpr_access_reporting().
- *
- * \param kvm Pointer to the current kvm_context
- * \param vcpu vcpu to disable tpr access reporting on
- */
-int kvm_disable_tpr_access_reporting(CPUState *env);
-
int kvm_enable_vapic(CPUState *env, uint64_t vapic);
#endif
@@ -895,7 +874,6 @@ void qemu_kvm_aio_wait_end(void);
void qemu_kvm_notify_work(void);
void kvm_tpr_access_report(CPUState *env, uint64_t rip, int is_write);
-void kvm_tpr_vcpu_start(CPUState *env);
int qemu_kvm_get_dirty_pages(unsigned long phys_addr, void *buf);