diff options
author | Clark Williams <williams@redhat.com> | 2012-01-05 12:51:32 -0600 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-01-05 12:51:32 -0600 |
commit | d76fe430665fac3f44ee88958713ecc524fd778d (patch) | |
tree | 00206c8b11eb2084d38eeccfe4b41f5e89fb779c /arch/x86/kvm/i8254.c | |
parent | 63076d7f7f7f2650e5d0a4fa5dd2c412a255c237 (diff) | |
parent | 805a6af8dba5dfdd35ec35dc52ec0122400b2610 (diff) |
Merge commit 'v3.2' into rt-3.2-rt9v3.2-rt9
Diffstat (limited to 'arch/x86/kvm/i8254.c')
-rw-r--r-- | arch/x86/kvm/i8254.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 76e3f1cd0369..405f2620392f 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -338,11 +338,15 @@ static enum hrtimer_restart pit_timer_fn(struct hrtimer *data) return HRTIMER_NORESTART; } -static void create_pit_timer(struct kvm_kpit_state *ps, u32 val, int is_period) +static void create_pit_timer(struct kvm *kvm, u32 val, int is_period) { + struct kvm_kpit_state *ps = &kvm->arch.vpit->pit_state; struct kvm_timer *pt = &ps->pit_timer; s64 interval; + if (!irqchip_in_kernel(kvm)) + return; + interval = muldiv64(val, NSEC_PER_SEC, KVM_PIT_FREQ); pr_debug("create pit timer, interval is %llu nsec\n", interval); @@ -394,13 +398,13 @@ static void pit_load_count(struct kvm *kvm, int channel, u32 val) /* FIXME: enhance mode 4 precision */ case 4: if (!(ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)) { - create_pit_timer(ps, val, 0); + create_pit_timer(kvm, val, 0); } break; case 2: case 3: if (!(ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)){ - create_pit_timer(ps, val, 1); + create_pit_timer(kvm, val, 1); } break; default: |