From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org, Gleb Natapov <gleb@redhat.com>
Subject: [PATCH 3/4] KVM: Simplify kvm_pit_timer
Date: Thu, 26 Jul 2012 18:01:52 +0300 [thread overview]
Message-ID: <1343314913-6727-4-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1343314913-6727-1-git-send-email-avi@redhat.com>
'timer_mode_mask' is unused
'tscdeadline' is unused
't_ops' only adds needless indirection
'vcpu' is unused
Remove.
Signed-off-by: Avi Kivity <avi@redhat.com>
---
arch/x86/kvm/i8254.c | 14 +-------------
arch/x86/kvm/i8254.h | 8 --------
2 files changed, 1 insertion(+), 21 deletions(-)
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index 1d8e757..a9e187a 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -272,17 +272,6 @@ static void destroy_pit_timer(struct kvm_pit *pit)
flush_kthread_work(&pit->expired);
}
-static bool kpit_is_periodic(struct kvm_pit_timer *ktimer)
-{
- struct kvm_kpit_state *ps = container_of(ktimer, struct kvm_kpit_state,
- pit_timer);
- return ps->is_periodic;
-}
-
-static struct kvm_pit_timer_ops kpit_ops = {
- .is_periodic = kpit_is_periodic,
-};
-
static void pit_do_work(struct kthread_work *work)
{
struct kvm_pit *pit = container_of(work, struct kvm_pit, expired);
@@ -330,7 +319,7 @@ static enum hrtimer_restart pit_timer_fn(struct hrtimer *data)
queue_kthread_work(&pt->worker, &pt->expired);
}
- if (ktimer->t_ops->is_periodic(ktimer)) {
+ if (pt->pit_state.is_periodic) {
hrtimer_add_expires_ns(&ktimer->timer, ktimer->period);
return HRTIMER_RESTART;
} else
@@ -357,7 +346,6 @@ static void create_pit_timer(struct kvm *kvm, u32 val, int is_period)
ps->is_periodic = is_period;
pt->timer.function = pit_timer_fn;
- pt->t_ops = &kpit_ops;
pt->kvm = ps->pit->kvm;
atomic_set(&pt->pending, 0);
diff --git a/arch/x86/kvm/i8254.h b/arch/x86/kvm/i8254.h
index 3351816..c9bbcb8 100644
--- a/arch/x86/kvm/i8254.h
+++ b/arch/x86/kvm/i8254.h
@@ -24,17 +24,9 @@ struct kvm_kpit_channel_state {
struct kvm_pit_timer {
struct hrtimer timer;
s64 period; /* unit: ns */
- u32 timer_mode_mask;
- u64 tscdeadline;
atomic_t pending; /* accumulated triggered timers */
bool reinject;
- struct kvm_pit_timer_ops *t_ops;
struct kvm *kvm;
- struct kvm_vcpu *vcpu;
-};
-
-struct kvm_pit_timer_ops {
- bool (*is_periodic)(struct kvm_pit_timer *);
};
struct kvm_kpit_state {
--
1.7.11.3
next prev parent reply other threads:[~2012-07-26 15:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-26 15:01 [PATCH 0/4] kvm_timer cleanup Avi Kivity
2012-07-26 15:01 ` [PATCH 1/4] KVM: Remove internal timer abstraction Avi Kivity
2012-07-26 15:01 ` [PATCH 2/4] KVM: Simplify kvm_timer Avi Kivity
2012-07-26 15:01 ` Avi Kivity [this message]
2012-07-26 15:01 ` [PATCH 4/4] KVM: fold kvm_pit_timer into kvm_kpit_state Avi Kivity
2012-08-01 3:21 ` [PATCH 0/4] kvm_timer cleanup Marcelo Tosatti
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=1343314913-6727-4-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/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.