From: Marcelo Tosatti <mtosatti@redhat.com>
To: kvm@vger.kernel.org
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Subject: [patch 5/7] kvm-tpr-opt: remove dead code
Date: Mon, 08 Mar 2010 21:47:09 -0300 [thread overview]
Message-ID: <20100309004834.786355886@redhat.com> (raw)
In-Reply-To: 20100309004704.049355766@redhat.com
[-- Attachment #1: kvm-tpr-start-cleanup --]
[-- Type: text/plain, Size: 3130 bytes --]
Simplify code around kvm_enable_tpr_access_reporting.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Index: qemu-kvm-tpr/qemu-kvm-x86.c
===================================================================
--- qemu-kvm-tpr.orig/qemu-kvm-x86.c
+++ qemu-kvm-tpr/qemu-kvm-x86.c
@@ -597,30 +597,16 @@ int kvm_get_shadow_pages(kvm_context_t k
}
#ifdef KVM_CAP_VAPIC
-
-static int tpr_access_reporting(CPUState *env, int enabled)
-{
- 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)
+static 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,
@@ -1319,7 +1305,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;
Index: qemu-kvm-tpr/qemu-kvm.h
===================================================================
--- qemu-kvm-tpr.orig/qemu-kvm.h
+++ qemu-kvm-tpr/qemu-kvm.h
@@ -601,27 +601,6 @@ int kvm_get_pit2(kvm_context_t kvm, stru
#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);
Index: qemu-kvm-tpr/kvm-tpr-opt.c
===================================================================
--- qemu-kvm-tpr.orig/kvm-tpr-opt.c
+++ qemu-kvm-tpr/kvm-tpr-opt.c
@@ -318,11 +318,6 @@ void kvm_tpr_access_report(CPUState *env
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;
next prev parent reply other threads:[~2010-03-09 0:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-09 0:47 [patch 0/7] kvm-tpr-opt cleanups Marcelo Tosatti
2010-03-09 0:47 ` [patch 1/7] qemu-kvm: move vapic enablement to kvm_arch_load_regs Marcelo Tosatti
2010-03-09 0:47 ` [patch 2/7] kvm-tpr-opt: use device_init Marcelo Tosatti
2010-03-09 0:47 ` [patch 3/7] kvm-tpr-opt: qemu-kvm.h -> kvm.h Marcelo Tosatti
2010-03-09 0:47 ` [patch 4/7] kvm-tpr-opt: clean up usage of bios_enabled Marcelo Tosatti
2010-03-09 0:47 ` Marcelo Tosatti [this message]
2010-03-09 0:47 ` [patch 6/7] kvm-tpr-opt: replace kvm_get_{s,r}egs usage with cpu_synchronize_state Marcelo Tosatti
2010-03-09 0:47 ` [patch 7/7] kvm-tpr-opt: rename env->update_vapic Marcelo Tosatti
2010-03-09 13:18 ` [patch 0/7] kvm-tpr-opt cleanups Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100309004834.786355886@redhat.com \
--to=mtosatti@redhat.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.