xref: /linux-6.15/drivers/pci/Kconfig (revision a474d3fb)
1# SPDX-License-Identifier: GPL-2.0
2#
3# PCI configuration
4#
5
6# select this to offer the PCI prompt
7config HAVE_PCI
8	bool
9
10# select this to unconditionally force on PCI support
11config FORCE_PCI
12	bool
13	select HAVE_PCI
14	select PCI
15
16menuconfig PCI
17	bool "PCI support"
18	depends on HAVE_PCI
19	help
20	  This option enables support for the PCI local bus, including
21	  support for PCI-X and the foundations for PCI Express support.
22	  Say 'Y' here unless you know what you are doing.
23
24if PCI
25
26config PCI_DOMAINS
27	bool
28	depends on PCI
29
30config PCI_DOMAINS_GENERIC
31	bool
32	select PCI_DOMAINS
33
34config PCI_SYSCALL
35	bool
36
37source "drivers/pci/pcie/Kconfig"
38
39config PCI_MSI
40	bool "Message Signaled Interrupts (MSI and MSI-X)"
41	select GENERIC_MSI_IRQ_DOMAIN
42	select GENERIC_MSI_IRQ
43	help
44	   This allows device drivers to enable MSI (Message Signaled
45	   Interrupts).  Message Signaled Interrupts enable a device to
46	   generate an interrupt using an inbound Memory Write on its
47	   PCI bus instead of asserting a device IRQ pin.
48
49	   Use of PCI MSI interrupts can be disabled at kernel boot time
50	   by using the 'pci=nomsi' option.  This disables MSI for the
51	   entire system.
52
53	   If you don't know what to do here, say Y.
54
55config PCI_MSI_ARCH_FALLBACKS
56	bool
57
58config PCI_QUIRKS
59	default y
60	bool "Enable PCI quirk workarounds" if EXPERT
61	help
62	  This enables workarounds for various PCI chipset bugs/quirks.
63	  Disable this only if your target machine is unaffected by PCI
64	  quirks.
65
66config PCI_DEBUG
67	bool "PCI Debugging"
68	depends on DEBUG_KERNEL
69	help
70	  Say Y here if you want the PCI core to produce a bunch of debug
71	  messages to the system log.  Select this if you are having a
72	  problem with PCI support and want to see more of what is going on.
73
74	  When in doubt, say N.
75
76config PCI_REALLOC_ENABLE_AUTO
77	bool "Enable PCI resource re-allocation detection"
78	depends on PCI_IOV
79	help
80	  Say Y here if you want the PCI core to detect if PCI resource
81	  re-allocation needs to be enabled. You can always use pci=realloc=on
82	  or pci=realloc=off to override it.  It will automatically
83	  re-allocate PCI resources if SR-IOV BARs have not been allocated by
84	  the BIOS.
85
86	  When in doubt, say N.
87
88config PCI_STUB
89	tristate "PCI Stub driver"
90	help
91	  Say Y or M here if you want be able to reserve a PCI device
92	  when it is going to be assigned to a guest operating system.
93
94	  When in doubt, say N.
95
96config PCI_PF_STUB
97	tristate "PCI PF Stub driver"
98	depends on PCI_IOV
99	help
100	  Say Y or M here if you want to enable support for devices that
101	  require SR-IOV support, while at the same time the PF (Physical
102	  Function) itself is not providing any actual services on the
103	  host itself such as storage or networking.
104
105	  When in doubt, say N.
106
107config XEN_PCIDEV_FRONTEND
108	tristate "Xen PCI Frontend"
109	depends on XEN_PV
110	select PCI_XEN
111	select XEN_XENBUS_FRONTEND
112	default y
113	help
114	  The PCI device frontend driver allows the kernel to import arbitrary
115	  PCI devices from a PCI backend to support PCI driver domains.
116
117config PCI_ATS
118	bool
119
120config PCI_DOE
121	bool
122
123config PCI_ECAM
124	bool
125
126config PCI_LOCKLESS_CONFIG
127	bool
128
129config PCI_BRIDGE_EMUL
130	bool
131
132config PCI_IOV
133	bool "PCI IOV support"
134	select PCI_ATS
135	help
136	  I/O Virtualization is a PCI feature supported by some devices
137	  which allows them to create virtual devices which share their
138	  physical resources.
139
140	  If unsure, say N.
141
142config PCI_PRI
143	bool "PCI PRI support"
144	select PCI_ATS
145	help
146	  PRI is the PCI Page Request Interface. It allows PCI devices that are
147	  behind an IOMMU to recover from page faults.
148
149	  If unsure, say N.
150
151config PCI_PASID
152	bool "PCI PASID support"
153	select PCI_ATS
154	help
155	  Process Address Space Identifiers (PASIDs) can be used by PCI devices
156	  to access more than one IO address space at the same time. To make
157	  use of this feature an IOMMU is required which also supports PASIDs.
158	  Select this option if you have such an IOMMU and want to compile the
159	  driver for it into your kernel.
160
161	  If unsure, say N.
162
163config PCI_P2PDMA
164	bool "PCI peer-to-peer transfer support"
165	depends on ZONE_DEVICE
166	#
167	# The need for the scatterlist DMA bus address flag means PCI P2PDMA
168	# requires 64bit
169	#
170	depends on 64BIT
171	select GENERIC_ALLOCATOR
172	help
173	  Enableѕ drivers to do PCI peer-to-peer transactions to and from
174	  BARs that are exposed in other devices that are the part of
175	  the hierarchy where peer-to-peer DMA is guaranteed by the PCI
176	  specification to work (ie. anything below a single PCI bridge).
177
178	  Many PCIe root complexes do not support P2P transactions and
179	  it's hard to tell which support it at all, so at this time,
180	  P2P DMA transactions must be between devices behind the same root
181	  port.
182
183	  If unsure, say N.
184
185config PCI_LABEL
186	def_bool y if (DMI || ACPI)
187	select NLS
188
189config PCI_HYPERV
190	tristate "Hyper-V PCI Frontend"
191	depends on ((X86 && X86_64) || ARM64) && HYPERV && PCI_MSI && SYSFS
192	select PCI_HYPERV_INTERFACE
193	help
194	  The PCI device frontend driver allows the kernel to import arbitrary
195	  PCI devices from a PCI backend to support PCI driver domains.
196
197choice
198	prompt "PCI Express hierarchy optimization setting"
199	default PCIE_BUS_DEFAULT
200	depends on PCI && EXPERT
201	help
202	  MPS (Max Payload Size) and MRRS (Max Read Request Size) are PCIe
203	  device parameters that affect performance and the ability to
204	  support hotplug and peer-to-peer DMA.
205
206	  The following choices set the MPS and MRRS optimization strategy
207	  at compile-time.  The choices are the same as those offered for
208	  the kernel command-line parameter 'pci', i.e.,
209	  'pci=pcie_bus_tune_off', 'pci=pcie_bus_safe',
210	  'pci=pcie_bus_perf', and 'pci=pcie_bus_peer2peer'.
211
212	  This is a compile-time setting and can be overridden by the above
213	  command-line parameters.  If unsure, choose PCIE_BUS_DEFAULT.
214
215config PCIE_BUS_TUNE_OFF
216	bool "Tune Off"
217	depends on PCI
218	help
219	  Use the BIOS defaults; don't touch MPS at all.  This is the same
220	  as booting with 'pci=pcie_bus_tune_off'.
221
222config PCIE_BUS_DEFAULT
223	bool "Default"
224	depends on PCI
225	help
226	  Default choice; ensure that the MPS matches upstream bridge.
227
228config PCIE_BUS_SAFE
229	bool "Safe"
230	depends on PCI
231	help
232	  Use largest MPS that boot-time devices support.  If you have a
233	  closed system with no possibility of adding new devices, this
234	  will use the largest MPS that's supported by all devices.  This
235	  is the same as booting with 'pci=pcie_bus_safe'.
236
237config PCIE_BUS_PERFORMANCE
238	bool "Performance"
239	depends on PCI
240	help
241	  Use MPS and MRRS for best performance.  Ensure that a given
242	  device's MPS is no larger than its parent MPS, which allows us to
243	  keep all switches/bridges to the max MPS supported by their
244	  parent.  This is the same as booting with 'pci=pcie_bus_perf'.
245
246config PCIE_BUS_PEER2PEER
247	bool "Peer2peer"
248	depends on PCI
249	help
250	  Set MPS = 128 for all devices.  MPS configuration effected by the
251	  other options could cause the MPS on one root port to be
252	  different than that of the MPS on another, which may cause
253	  hot-added devices or peer-to-peer DMA to fail.  Set MPS to the
254	  smallest possible value (128B) system-wide to avoid these issues.
255	  This is the same as booting with 'pci=pcie_bus_peer2peer'.
256
257endchoice
258
259config VGA_ARB
260	bool "VGA Arbitration" if EXPERT
261	default y
262	depends on (PCI && !S390)
263	help
264	  Some "legacy" VGA devices implemented on PCI typically have the same
265	  hard-decoded addresses as they did on ISA. When multiple PCI devices
266	  are accessed at same time they need some kind of coordination. Please
267	  see Documentation/gpu/vgaarbiter.rst for more details. Select this to
268	  enable VGA arbiter.
269
270config VGA_ARB_MAX_GPUS
271	int "Maximum number of GPUs"
272	default 16
273	depends on VGA_ARB
274	help
275	  Reserves space in the kernel to maintain resource locking for
276	  multiple GPUS.  The overhead for each GPU is very small.
277
278source "drivers/pci/hotplug/Kconfig"
279source "drivers/pci/controller/Kconfig"
280source "drivers/pci/endpoint/Kconfig"
281source "drivers/pci/switch/Kconfig"
282
283endif
284