diff options
-rw-r--r-- | arch/ia64/kvm/Makefile | 4 | ||||
-rw-r--r-- | arch/ia64/kvm/kvm-ia64.c | 9 | ||||
-rw-r--r-- | include/linux/kvm.h | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/arch/ia64/kvm/Makefile b/arch/ia64/kvm/Makefile index 3b1a1c156ef9..cf37f8f490c0 100644 --- a/arch/ia64/kvm/Makefile +++ b/arch/ia64/kvm/Makefile | |||
@@ -46,6 +46,10 @@ EXTRA_AFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/ | |||
46 | common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \ | 46 | common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \ |
47 | coalesced_mmio.o irq_comm.o) | 47 | coalesced_mmio.o irq_comm.o) |
48 | 48 | ||
49 | ifeq ($(CONFIG_DMAR),y) | ||
50 | common-objs += $(addprefix ../../../virt/kvm/, vtd.o) | ||
51 | endif | ||
52 | |||
49 | kvm-objs := $(common-objs) kvm-ia64.o kvm_fw.o | 53 | kvm-objs := $(common-objs) kvm-ia64.o kvm_fw.o |
50 | obj-$(CONFIG_KVM) += kvm.o | 54 | obj-$(CONFIG_KVM) += kvm.o |
51 | 55 | ||
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index 3df82f3fe547..c0699f0e35a9 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/bitops.h> | 31 | #include <linux/bitops.h> |
32 | #include <linux/hrtimer.h> | 32 | #include <linux/hrtimer.h> |
33 | #include <linux/uaccess.h> | 33 | #include <linux/uaccess.h> |
34 | #include <linux/intel-iommu.h> | ||
34 | 35 | ||
35 | #include <asm/pgtable.h> | 36 | #include <asm/pgtable.h> |
36 | #include <asm/gcc_intrin.h> | 37 | #include <asm/gcc_intrin.h> |
@@ -187,6 +188,9 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
187 | case KVM_CAP_COALESCED_MMIO: | 188 | case KVM_CAP_COALESCED_MMIO: |
188 | r = KVM_COALESCED_MMIO_PAGE_OFFSET; | 189 | r = KVM_COALESCED_MMIO_PAGE_OFFSET; |
189 | break; | 190 | break; |
191 | case KVM_CAP_IOMMU: | ||
192 | r = intel_iommu_found(); | ||
193 | break; | ||
190 | default: | 194 | default: |
191 | r = 0; | 195 | r = 0; |
192 | } | 196 | } |
@@ -773,6 +777,7 @@ static void kvm_init_vm(struct kvm *kvm) | |||
773 | */ | 777 | */ |
774 | kvm_build_io_pmt(kvm); | 778 | kvm_build_io_pmt(kvm); |
775 | 779 | ||
780 | INIT_LIST_HEAD(&kvm->arch.assigned_dev_head); | ||
776 | } | 781 | } |
777 | 782 | ||
778 | struct kvm *kvm_arch_create_vm(void) | 783 | struct kvm *kvm_arch_create_vm(void) |
@@ -1336,6 +1341,10 @@ static void kvm_release_vm_pages(struct kvm *kvm) | |||
1336 | 1341 | ||
1337 | void kvm_arch_destroy_vm(struct kvm *kvm) | 1342 | void kvm_arch_destroy_vm(struct kvm *kvm) |
1338 | { | 1343 | { |
1344 | kvm_iommu_unmap_guest(kvm); | ||
1345 | #ifdef KVM_CAP_DEVICE_ASSIGNMENT | ||
1346 | kvm_free_all_assigned_devices(kvm); | ||
1347 | #endif | ||
1339 | kfree(kvm->arch.vioapic); | 1348 | kfree(kvm->arch.vioapic); |
1340 | kvm_release_vm_pages(kvm); | 1349 | kvm_release_vm_pages(kvm); |
1341 | kvm_free_physmem(kvm); | 1350 | kvm_free_physmem(kvm); |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 9acf34a6dfbb..797fcd781242 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -383,7 +383,7 @@ struct kvm_trace_rec { | |||
383 | #define KVM_CAP_MP_STATE 14 | 383 | #define KVM_CAP_MP_STATE 14 |
384 | #define KVM_CAP_COALESCED_MMIO 15 | 384 | #define KVM_CAP_COALESCED_MMIO 15 |
385 | #define KVM_CAP_SYNC_MMU 16 /* Changes to host mmap are reflected in guest */ | 385 | #define KVM_CAP_SYNC_MMU 16 /* Changes to host mmap are reflected in guest */ |
386 | #ifdef CONFIG_X86 | 386 | #if defined(CONFIG_X86)||defined(CONFIG_IA64) |
387 | #define KVM_CAP_DEVICE_ASSIGNMENT 17 | 387 | #define KVM_CAP_DEVICE_ASSIGNMENT 17 |
388 | #endif | 388 | #endif |
389 | #define KVM_CAP_IOMMU 18 | 389 | #define KVM_CAP_IOMMU 18 |