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

vfio: Use kconfig if XX/endif blocks instead of repeating 'depends on'

This results in less kconfig wordage and a simpler understanding of the
required "depends on" to create the menu structure.

The next patch increases the nesting level a lot so this is a nice
preparatory simplification.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://lore.kernel.org/r/20210826103912.128972-13-yishaih@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

authored by

Jason Gunthorpe and committed by
Alex Williamson
85c94dcf ca4ddaac

+34 -34
+22 -22
drivers/vfio/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - config VFIO_IOMMU_TYPE1 3 - tristate 4 - depends on VFIO 5 - default n 6 - 7 - config VFIO_IOMMU_SPAPR_TCE 8 - tristate 9 - depends on VFIO && SPAPR_TCE_IOMMU 10 - default VFIO 11 - 12 - config VFIO_SPAPR_EEH 13 - tristate 14 - depends on EEH && VFIO_IOMMU_SPAPR_TCE 15 - default VFIO 16 - 17 - config VFIO_VIRQFD 18 - tristate 19 - depends on VFIO 20 - select EVENTFD 21 - default n 22 - 23 2 menuconfig VFIO 24 3 tristate "VFIO Non-Privileged userspace driver framework" 25 4 select IOMMU_API ··· 9 30 10 31 If you don't know what to do here, say N. 11 32 33 + if VFIO 34 + config VFIO_IOMMU_TYPE1 35 + tristate 36 + default n 37 + 38 + config VFIO_IOMMU_SPAPR_TCE 39 + tristate 40 + depends on SPAPR_TCE_IOMMU 41 + default VFIO 42 + 43 + config VFIO_SPAPR_EEH 44 + tristate 45 + depends on EEH && VFIO_IOMMU_SPAPR_TCE 46 + default VFIO 47 + 48 + config VFIO_VIRQFD 49 + tristate 50 + select EVENTFD 51 + default n 52 + 12 53 config VFIO_NOIOMMU 13 54 bool "VFIO No-IOMMU support" 14 - depends on VFIO 15 55 help 16 56 VFIO is built on the ability to isolate devices using the IOMMU. 17 57 Only with an IOMMU can userspace access to DMA capable devices be ··· 47 49 source "drivers/vfio/platform/Kconfig" 48 50 source "drivers/vfio/mdev/Kconfig" 49 51 source "drivers/vfio/fsl-mc/Kconfig" 52 + endif 53 + 50 54 source "virt/lib/Kconfig"
+1 -1
drivers/vfio/fsl-mc/Kconfig
··· 1 1 config VFIO_FSL_MC 2 2 tristate "VFIO support for QorIQ DPAA2 fsl-mc bus devices" 3 - depends on VFIO && FSL_MC_BUS 3 + depends on FSL_MC_BUS 4 4 select EVENTFD 5 5 help 6 6 Driver to enable support for the VFIO QorIQ DPAA2 fsl-mc
-1
drivers/vfio/mdev/Kconfig
··· 2 2 3 3 config VFIO_MDEV 4 4 tristate "Mediated device driver framework" 5 - depends on VFIO 6 5 default n 7 6 help 8 7 Provides a framework to virtualize devices.
+6 -5
drivers/vfio/pci/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 config VFIO_PCI 3 3 tristate "VFIO support for PCI devices" 4 - depends on VFIO && PCI 4 + depends on PCI 5 5 depends on MMU 6 6 select VFIO_VIRQFD 7 7 select IRQ_BYPASS_MANAGER ··· 11 11 12 12 If you don't know what to do here, say N. 13 13 14 + if VFIO_PCI 14 15 config VFIO_PCI_VGA 15 16 bool "VFIO PCI support for VGA devices" 16 - depends on VFIO_PCI && X86 && VGA_ARB 17 + depends on X86 && VGA_ARB 17 18 help 18 19 Support for VGA extension to VFIO PCI. This exposes an additional 19 20 region on VGA devices for accessing legacy VGA addresses used by ··· 23 22 If you don't know what to do here, say N. 24 23 25 24 config VFIO_PCI_MMAP 26 - depends on VFIO_PCI 27 25 def_bool y if !S390 28 26 29 27 config VFIO_PCI_INTX 30 - depends on VFIO_PCI 31 28 def_bool y if !S390 32 29 33 30 config VFIO_PCI_IGD 34 31 bool "VFIO PCI extensions for Intel graphics (GVT-d)" 35 - depends on VFIO_PCI && X86 32 + depends on X86 36 33 default y 37 34 help 38 35 Support for Intel IGD specific extensions to enable direct ··· 39 40 and LPC bridge config space. 40 41 41 42 To enable Intel IGD assignment through vfio-pci, say Y. 43 + 44 + endif
+4 -2
drivers/vfio/platform/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 config VFIO_PLATFORM 3 3 tristate "VFIO support for platform devices" 4 - depends on VFIO && (ARM || ARM64 || COMPILE_TEST) 4 + depends on ARM || ARM64 || COMPILE_TEST 5 5 select VFIO_VIRQFD 6 6 help 7 7 Support for platform devices with VFIO. This is required to make ··· 10 10 11 11 If you don't know what to do here, say N. 12 12 13 + if VFIO_PLATFORM 13 14 config VFIO_AMBA 14 15 tristate "VFIO support for AMBA devices" 15 - depends on VFIO_PLATFORM && (ARM_AMBA || COMPILE_TEST) 16 + depends on ARM_AMBA || COMPILE_TEST 16 17 help 17 18 Support for ARM AMBA devices with VFIO. This is required to make 18 19 use of ARM AMBA devices present on the system using the VFIO ··· 22 21 If you don't know what to do here, say N. 23 22 24 23 source "drivers/vfio/platform/reset/Kconfig" 24 + endif
+1 -3
drivers/vfio/platform/reset/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 config VFIO_PLATFORM_CALXEDAXGMAC_RESET 3 3 tristate "VFIO support for calxeda xgmac reset" 4 - depends on VFIO_PLATFORM 5 4 help 6 5 Enables the VFIO platform driver to handle reset for Calxeda xgmac 7 6 ··· 8 9 9 10 config VFIO_PLATFORM_AMDXGBE_RESET 10 11 tristate "VFIO support for AMD XGBE reset" 11 - depends on VFIO_PLATFORM 12 12 help 13 13 Enables the VFIO platform driver to handle reset for AMD XGBE 14 14 ··· 15 17 16 18 config VFIO_PLATFORM_BCMFLEXRM_RESET 17 19 tristate "VFIO support for Broadcom FlexRM reset" 18 - depends on VFIO_PLATFORM && (ARCH_BCM_IPROC || COMPILE_TEST) 20 + depends on ARCH_BCM_IPROC || COMPILE_TEST 19 21 default ARCH_BCM_IPROC 20 22 help 21 23 Enables the VFIO platform driver to handle reset for Broadcom FlexRM