Skip to content

Commit 85c94dc

Browse files
jgunthorpeAlex Williamson
authored andcommitted
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>
1 parent ca4ddaa commit 85c94dc

6 files changed

Lines changed: 26 additions & 26 deletions

File tree

drivers/vfio/Kconfig

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
# SPDX-License-Identifier: GPL-2.0-only
2+
menuconfig VFIO
3+
tristate "VFIO Non-Privileged userspace driver framework"
4+
select IOMMU_API
5+
select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64)
6+
help
7+
VFIO provides a framework for secure userspace device drivers.
8+
See Documentation/driver-api/vfio.rst for more details.
9+
10+
If you don't know what to do here, say N.
11+
12+
if VFIO
213
config VFIO_IOMMU_TYPE1
314
tristate
4-
depends on VFIO
515
default n
616

717
config VFIO_IOMMU_SPAPR_TCE
818
tristate
9-
depends on VFIO && SPAPR_TCE_IOMMU
19+
depends on SPAPR_TCE_IOMMU
1020
default VFIO
1121

1222
config VFIO_SPAPR_EEH
@@ -16,23 +26,11 @@ config VFIO_SPAPR_EEH
1626

1727
config VFIO_VIRQFD
1828
tristate
19-
depends on VFIO
2029
select EVENTFD
2130
default n
2231

23-
menuconfig VFIO
24-
tristate "VFIO Non-Privileged userspace driver framework"
25-
select IOMMU_API
26-
select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64)
27-
help
28-
VFIO provides a framework for secure userspace device drivers.
29-
See Documentation/driver-api/vfio.rst for more details.
30-
31-
If you don't know what to do here, say N.
32-
3332
config VFIO_NOIOMMU
3433
bool "VFIO No-IOMMU support"
35-
depends on VFIO
3634
help
3735
VFIO is built on the ability to isolate devices using the IOMMU.
3836
Only with an IOMMU can userspace access to DMA capable devices be
@@ -49,4 +47,6 @@ source "drivers/vfio/pci/Kconfig"
4947
source "drivers/vfio/platform/Kconfig"
5048
source "drivers/vfio/mdev/Kconfig"
5149
source "drivers/vfio/fsl-mc/Kconfig"
50+
endif
51+
5252
source "virt/lib/Kconfig"

drivers/vfio/fsl-mc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
config VFIO_FSL_MC
22
tristate "VFIO support for QorIQ DPAA2 fsl-mc bus devices"
3-
depends on VFIO && FSL_MC_BUS
3+
depends on FSL_MC_BUS
44
select EVENTFD
55
help
66
Driver to enable support for the VFIO QorIQ DPAA2 fsl-mc

drivers/vfio/mdev/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
config VFIO_MDEV
44
tristate "Mediated device driver framework"
5-
depends on VFIO
65
default n
76
help
87
Provides a framework to virtualize devices.

drivers/vfio/pci/Kconfig

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
config VFIO_PCI
33
tristate "VFIO support for PCI devices"
4-
depends on VFIO && PCI
4+
depends on PCI
55
depends on MMU
66
select VFIO_VIRQFD
77
select IRQ_BYPASS_MANAGER
@@ -11,9 +11,10 @@ config VFIO_PCI
1111

1212
If you don't know what to do here, say N.
1313

14+
if VFIO_PCI
1415
config VFIO_PCI_VGA
1516
bool "VFIO PCI support for VGA devices"
16-
depends on VFIO_PCI && X86 && VGA_ARB
17+
depends on X86 && VGA_ARB
1718
help
1819
Support for VGA extension to VFIO PCI. This exposes an additional
1920
region on VGA devices for accessing legacy VGA addresses used by
@@ -22,16 +23,14 @@ config VFIO_PCI_VGA
2223
If you don't know what to do here, say N.
2324

2425
config VFIO_PCI_MMAP
25-
depends on VFIO_PCI
2626
def_bool y if !S390
2727

2828
config VFIO_PCI_INTX
29-
depends on VFIO_PCI
3029
def_bool y if !S390
3130

3231
config VFIO_PCI_IGD
3332
bool "VFIO PCI extensions for Intel graphics (GVT-d)"
34-
depends on VFIO_PCI && X86
33+
depends on X86
3534
default y
3635
help
3736
Support for Intel IGD specific extensions to enable direct
@@ -40,3 +39,5 @@ config VFIO_PCI_IGD
4039
and LPC bridge config space.
4140

4241
To enable Intel IGD assignment through vfio-pci, say Y.
42+
43+
endif

drivers/vfio/platform/Kconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
config VFIO_PLATFORM
33
tristate "VFIO support for platform devices"
4-
depends on VFIO && (ARM || ARM64 || COMPILE_TEST)
4+
depends on ARM || ARM64 || COMPILE_TEST
55
select VFIO_VIRQFD
66
help
77
Support for platform devices with VFIO. This is required to make
@@ -10,9 +10,10 @@ config VFIO_PLATFORM
1010

1111
If you don't know what to do here, say N.
1212

13+
if VFIO_PLATFORM
1314
config VFIO_AMBA
1415
tristate "VFIO support for AMBA devices"
15-
depends on VFIO_PLATFORM && (ARM_AMBA || COMPILE_TEST)
16+
depends on ARM_AMBA || COMPILE_TEST
1617
help
1718
Support for ARM AMBA devices with VFIO. This is required to make
1819
use of ARM AMBA devices present on the system using the VFIO
@@ -21,3 +22,4 @@ config VFIO_AMBA
2122
If you don't know what to do here, say N.
2223

2324
source "drivers/vfio/platform/reset/Kconfig"
25+
endif

drivers/vfio/platform/reset/Kconfig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
config VFIO_PLATFORM_CALXEDAXGMAC_RESET
33
tristate "VFIO support for calxeda xgmac reset"
4-
depends on VFIO_PLATFORM
54
help
65
Enables the VFIO platform driver to handle reset for Calxeda xgmac
76

87
If you don't know what to do here, say N.
98

109
config VFIO_PLATFORM_AMDXGBE_RESET
1110
tristate "VFIO support for AMD XGBE reset"
12-
depends on VFIO_PLATFORM
1311
help
1412
Enables the VFIO platform driver to handle reset for AMD XGBE
1513

1614
If you don't know what to do here, say N.
1715

1816
config VFIO_PLATFORM_BCMFLEXRM_RESET
1917
tristate "VFIO support for Broadcom FlexRM reset"
20-
depends on VFIO_PLATFORM && (ARCH_BCM_IPROC || COMPILE_TEST)
18+
depends on ARCH_BCM_IPROC || COMPILE_TEST
2119
default ARCH_BCM_IPROC
2220
help
2321
Enables the VFIO platform driver to handle reset for Broadcom FlexRM

0 commit comments

Comments
 (0)