diff options
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index bf78d6522d3d..c33a4578132c 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/kvm_host.h> | 17 | #include <linux/kvm_host.h> |
18 | #include "irq.h" | 18 | #include "irq.h" |
19 | #include "mmu.h" | 19 | #include "mmu.h" |
20 | #include "i8254.h" | ||
20 | 21 | ||
21 | #include <linux/clocksource.h> | 22 | #include <linux/clocksource.h> |
22 | #include <linux/kvm.h> | 23 | #include <linux/kvm.h> |
@@ -818,6 +819,7 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
818 | case KVM_CAP_SET_TSS_ADDR: | 819 | case KVM_CAP_SET_TSS_ADDR: |
819 | case KVM_CAP_EXT_CPUID: | 820 | case KVM_CAP_EXT_CPUID: |
820 | case KVM_CAP_CLOCKSOURCE: | 821 | case KVM_CAP_CLOCKSOURCE: |
822 | case KVM_CAP_PIT: | ||
821 | r = 1; | 823 | r = 1; |
822 | break; | 824 | break; |
823 | case KVM_CAP_VAPIC: | 825 | case KVM_CAP_VAPIC: |
@@ -1594,6 +1596,12 @@ long kvm_arch_vm_ioctl(struct file *filp, | |||
1594 | } else | 1596 | } else |
1595 | goto out; | 1597 | goto out; |
1596 | break; | 1598 | break; |
1599 | case KVM_CREATE_PIT: | ||
1600 | r = -ENOMEM; | ||
1601 | kvm->arch.vpit = kvm_create_pit(kvm); | ||
1602 | if (kvm->arch.vpit) | ||
1603 | r = 0; | ||
1604 | break; | ||
1597 | case KVM_IRQ_LINE: { | 1605 | case KVM_IRQ_LINE: { |
1598 | struct kvm_irq_level irq_event; | 1606 | struct kvm_irq_level irq_event; |
1599 | 1607 | ||
@@ -3372,6 +3380,7 @@ static void kvm_free_vcpus(struct kvm *kvm) | |||
3372 | 3380 | ||
3373 | void kvm_arch_destroy_vm(struct kvm *kvm) | 3381 | void kvm_arch_destroy_vm(struct kvm *kvm) |
3374 | { | 3382 | { |
3383 | kvm_free_pit(kvm); | ||
3375 | kfree(kvm->arch.vpic); | 3384 | kfree(kvm->arch.vpic); |
3376 | kfree(kvm->arch.vioapic); | 3385 | kfree(kvm->arch.vioapic); |
3377 | kvm_free_vcpus(kvm); | 3386 | kvm_free_vcpus(kvm); |