Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

virtio: expose for non-virtualization users too

virtio has been so far used only in the context of virtualization,
and the virtio Kconfig was sourced directly by the relevant arch
Kconfigs when VIRTUALIZATION was selected.

Now that we start using virtio for inter-processor communications,
we need to source the virtio Kconfig outside of the virtualization
scope too.

Moreover, some architectures might use virtio for both virtualization
and inter-processor communications, so directly sourcing virtio
might yield unexpected results due to conflicting selections.

The simple solution offered by this patch is to always source virtio's
Kconfig in drivers/Kconfig, and remove it from the appropriate arch
Kconfigs. Additionally, a virtio menu entry has been added so virtio
drivers don't show up in the general drivers menu.

This way anyone can use virtio, though it's arguably less accessible
(and neat!) for virtualization users now.

Note: some architectures (mips and sh) seem to have a VIRTUALIZATION
menu merely for sourcing virtio's Kconfig, so that menu is removed too.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

authored by

Ohad Ben-Cohen and committed by
Rusty Russell
e7254219 bbd9d6f7

+5 -37
-1
arch/ia64/kvm/Kconfig
··· 49 49 extensions. 50 50 51 51 source drivers/vhost/Kconfig 52 - source drivers/virtio/Kconfig 53 52 54 53 endif # VIRTUALIZATION
-16
arch/mips/Kconfig
··· 2493 2493 2494 2494 source "crypto/Kconfig" 2495 2495 2496 - menuconfig VIRTUALIZATION 2497 - bool "Virtualization" 2498 - default n 2499 - ---help--- 2500 - Say Y here to get to see options for using your Linux host to run other 2501 - operating systems inside virtual machines (guests). 2502 - This option alone does not add any kernel code. 2503 - 2504 - If you say N, all options in this submenu will be skipped and disabled. 2505 - 2506 - if VIRTUALIZATION 2507 - 2508 - source drivers/virtio/Kconfig 2509 - 2510 - endif # VIRTUALIZATION 2511 - 2512 2496 source "lib/Kconfig"
-1
arch/powerpc/kvm/Kconfig
··· 99 99 If unsure, say N. 100 100 101 101 source drivers/vhost/Kconfig 102 - source drivers/virtio/Kconfig 103 102 104 103 endif # VIRTUALIZATION
-1
arch/s390/kvm/Kconfig
··· 37 37 # OK, it's a little counter-intuitive to do this, but it puts it neatly under 38 38 # the virtualization menu. 39 39 source drivers/vhost/Kconfig 40 - source drivers/virtio/Kconfig 41 40 42 41 endif # VIRTUALIZATION
-16
arch/sh/Kconfig
··· 897 897 898 898 source "crypto/Kconfig" 899 899 900 - menuconfig VIRTUALIZATION 901 - bool "Virtualization" 902 - default n 903 - ---help--- 904 - Say Y here to get to see options for using your Linux host to run other 905 - operating systems inside virtual machines (guests). 906 - This option alone does not add any kernel code. 907 - 908 - If you say N, all options in this submenu will be skipped and disabled. 909 - 910 - if VIRTUALIZATION 911 - 912 - source drivers/virtio/Kconfig 913 - 914 - endif # VIRTUALIZATION 915 - 916 900 source "lib/Kconfig"
-1
arch/tile/kvm/Kconfig
··· 33 33 If unsure, say N. 34 34 35 35 source drivers/vhost/Kconfig 36 - source drivers/virtio/Kconfig 37 36 38 37 endif # VIRTUALIZATION
-1
arch/x86/kvm/Kconfig
··· 76 76 # the virtualization menu. 77 77 source drivers/vhost/Kconfig 78 78 source drivers/lguest/Kconfig 79 - source drivers/virtio/Kconfig 80 79 81 80 endif # VIRTUALIZATION
+2
drivers/Kconfig
··· 112 112 113 113 source "drivers/vlynq/Kconfig" 114 114 115 + source "drivers/virtio/Kconfig" 116 + 115 117 source "drivers/xen/Kconfig" 116 118 117 119 source "drivers/staging/Kconfig"
+3
drivers/virtio/Kconfig
··· 7 7 tristate 8 8 depends on VIRTIO 9 9 10 + menu "Virtio drivers" 11 + 10 12 config VIRTIO_PCI 11 13 tristate "PCI driver for virtio devices (EXPERIMENTAL)" 12 14 depends on PCI && EXPERIMENTAL ··· 35 33 36 34 If unsure, say M. 37 35 36 + endmenu