diff options
Diffstat (limited to 'arch/x86/kvm/i8254.c')
-rw-r--r-- | arch/x86/kvm/i8254.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 405f2620392f..d68f99df690c 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c | |||
@@ -344,7 +344,7 @@ static void create_pit_timer(struct kvm *kvm, u32 val, int is_period) | |||
344 | struct kvm_timer *pt = &ps->pit_timer; | 344 | struct kvm_timer *pt = &ps->pit_timer; |
345 | s64 interval; | 345 | s64 interval; |
346 | 346 | ||
347 | if (!irqchip_in_kernel(kvm)) | 347 | if (!irqchip_in_kernel(kvm) || ps->flags & KVM_PIT_FLAGS_HPET_LEGACY) |
348 | return; | 348 | return; |
349 | 349 | ||
350 | interval = muldiv64(val, NSEC_PER_SEC, KVM_PIT_FREQ); | 350 | interval = muldiv64(val, NSEC_PER_SEC, KVM_PIT_FREQ); |
@@ -397,15 +397,11 @@ static void pit_load_count(struct kvm *kvm, int channel, u32 val) | |||
397 | case 1: | 397 | case 1: |
398 | /* FIXME: enhance mode 4 precision */ | 398 | /* FIXME: enhance mode 4 precision */ |
399 | case 4: | 399 | case 4: |
400 | if (!(ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)) { | 400 | create_pit_timer(kvm, val, 0); |
401 | create_pit_timer(kvm, val, 0); | ||
402 | } | ||
403 | break; | 401 | break; |
404 | case 2: | 402 | case 2: |
405 | case 3: | 403 | case 3: |
406 | if (!(ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)){ | 404 | create_pit_timer(kvm, val, 1); |
407 | create_pit_timer(kvm, val, 1); | ||
408 | } | ||
409 | break; | 405 | break; |
410 | default: | 406 | default: |
411 | destroy_pit_timer(kvm->arch.vpit); | 407 | destroy_pit_timer(kvm->arch.vpit); |