diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2013-04-16 15:49:18 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-04-28 05:58:56 -0400 |
commit | 2a5bab1004729f3302c776e53ee7c895b98bb1ce (patch) | |
tree | 281519b89e9f766a3d83c6978850e9eb72b3e0df /arch/x86/kvm | |
parent | 064d1afaa5a60fc391d0b4b77599fc8f63f99cd3 (diff) |
kvm: Allow build-time configuration of KVM device assignment
We hope to at some point deprecate KVM legacy device assignment in
favor of VFIO-based assignment. Towards that end, allow legacy
device assignment to be deconfigured.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/Kconfig | 13 | ||||
-rw-r--r-- | arch/x86/kvm/Makefile | 5 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 6 |
3 files changed, 18 insertions, 6 deletions
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 9d50efdb719d..a47a3e54b964 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig | |||
@@ -21,8 +21,6 @@ config KVM | |||
21 | tristate "Kernel-based Virtual Machine (KVM) support" | 21 | tristate "Kernel-based Virtual Machine (KVM) support" |
22 | depends on HAVE_KVM | 22 | depends on HAVE_KVM |
23 | depends on HIGH_RES_TIMERS | 23 | depends on HIGH_RES_TIMERS |
24 | # for device assignment: | ||
25 | depends on PCI | ||
26 | # for TASKSTATS/TASK_DELAY_ACCT: | 24 | # for TASKSTATS/TASK_DELAY_ACCT: |
27 | depends on NET | 25 | depends on NET |
28 | select PREEMPT_NOTIFIERS | 26 | select PREEMPT_NOTIFIERS |
@@ -83,6 +81,17 @@ config KVM_MMU_AUDIT | |||
83 | This option adds a R/W kVM module parameter 'mmu_audit', which allows | 81 | This option adds a R/W kVM module parameter 'mmu_audit', which allows |
84 | audit KVM MMU at runtime. | 82 | audit KVM MMU at runtime. |
85 | 83 | ||
84 | config KVM_DEVICE_ASSIGNMENT | ||
85 | bool "KVM legacy PCI device assignment support" | ||
86 | depends on KVM && PCI && IOMMU_API | ||
87 | default y | ||
88 | ---help--- | ||
89 | Provide support for legacy PCI device assignment through KVM. The | ||
90 | kernel now also supports a full featured userspace device driver | ||
91 | framework through VFIO, which supersedes much of this support. | ||
92 | |||
93 | If unsure, say Y. | ||
94 | |||
86 | # OK, it's a little counter-intuitive to do this, but it puts it neatly under | 95 | # OK, it's a little counter-intuitive to do this, but it puts it neatly under |
87 | # the virtualization menu. | 96 | # the virtualization menu. |
88 | source drivers/vhost/Kconfig | 97 | source drivers/vhost/Kconfig |
diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile index a797b8e43ade..d609e1d84048 100644 --- a/arch/x86/kvm/Makefile +++ b/arch/x86/kvm/Makefile | |||
@@ -7,8 +7,9 @@ CFLAGS_vmx.o := -I. | |||
7 | 7 | ||
8 | kvm-y += $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \ | 8 | kvm-y += $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \ |
9 | coalesced_mmio.o irq_comm.o eventfd.o \ | 9 | coalesced_mmio.o irq_comm.o eventfd.o \ |
10 | assigned-dev.o irqchip.o) | 10 | irqchip.o) |
11 | kvm-$(CONFIG_IOMMU_API) += $(addprefix ../../../virt/kvm/, iommu.o) | 11 | kvm-$(CONFIG_KVM_DEVICE_ASSIGNMENT) += $(addprefix ../../../virt/kvm/, \ |
12 | assigned-dev.o iommu.o) | ||
12 | kvm-$(CONFIG_KVM_ASYNC_PF) += $(addprefix ../../../virt/kvm/, async_pf.o) | 13 | kvm-$(CONFIG_KVM_ASYNC_PF) += $(addprefix ../../../virt/kvm/, async_pf.o) |
13 | 14 | ||
14 | kvm-y += x86.o mmu.o emulate.o i8259.o irq.o lapic.o \ | 15 | kvm-y += x86.o mmu.o emulate.o i8259.o irq.o lapic.o \ |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 145b1c81011b..8747fef7fd59 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -2501,7 +2501,6 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
2501 | case KVM_CAP_USER_NMI: | 2501 | case KVM_CAP_USER_NMI: |
2502 | case KVM_CAP_REINJECT_CONTROL: | 2502 | case KVM_CAP_REINJECT_CONTROL: |
2503 | case KVM_CAP_IRQ_INJECT_STATUS: | 2503 | case KVM_CAP_IRQ_INJECT_STATUS: |
2504 | case KVM_CAP_ASSIGN_DEV_IRQ: | ||
2505 | case KVM_CAP_IRQFD: | 2504 | case KVM_CAP_IRQFD: |
2506 | case KVM_CAP_IOEVENTFD: | 2505 | case KVM_CAP_IOEVENTFD: |
2507 | case KVM_CAP_PIT2: | 2506 | case KVM_CAP_PIT2: |
@@ -2519,9 +2518,12 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
2519 | case KVM_CAP_XSAVE: | 2518 | case KVM_CAP_XSAVE: |
2520 | case KVM_CAP_ASYNC_PF: | 2519 | case KVM_CAP_ASYNC_PF: |
2521 | case KVM_CAP_GET_TSC_KHZ: | 2520 | case KVM_CAP_GET_TSC_KHZ: |
2522 | case KVM_CAP_PCI_2_3: | ||
2523 | case KVM_CAP_KVMCLOCK_CTRL: | 2521 | case KVM_CAP_KVMCLOCK_CTRL: |
2524 | case KVM_CAP_READONLY_MEM: | 2522 | case KVM_CAP_READONLY_MEM: |
2523 | #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT | ||
2524 | case KVM_CAP_ASSIGN_DEV_IRQ: | ||
2525 | case KVM_CAP_PCI_2_3: | ||
2526 | #endif | ||
2525 | r = 1; | 2527 | r = 1; |
2526 | break; | 2528 | break; |
2527 | case KVM_CAP_COALESCED_MMIO: | 2529 | case KVM_CAP_COALESCED_MMIO: |