xref: /OK3568_Linux_fs/kernel/drivers/iommu/intel/Kconfig (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0-only
2*4882a593Smuzhiyun# Intel IOMMU support
3*4882a593Smuzhiyunconfig DMAR_TABLE
4*4882a593Smuzhiyun	bool
5*4882a593Smuzhiyun
6*4882a593Smuzhiyunconfig INTEL_IOMMU
7*4882a593Smuzhiyun	bool "Support for Intel IOMMU using DMA Remapping Devices"
8*4882a593Smuzhiyun	depends on PCI_MSI && ACPI && (X86 || IA64)
9*4882a593Smuzhiyun	select DMA_OPS
10*4882a593Smuzhiyun	select IOMMU_API
11*4882a593Smuzhiyun	select IOMMU_IOVA
12*4882a593Smuzhiyun	select NEED_DMA_MAP_STATE
13*4882a593Smuzhiyun	select DMAR_TABLE
14*4882a593Smuzhiyun	select SWIOTLB
15*4882a593Smuzhiyun	select IOASID
16*4882a593Smuzhiyun	help
17*4882a593Smuzhiyun	  DMA remapping (DMAR) devices support enables independent address
18*4882a593Smuzhiyun	  translations for Direct Memory Access (DMA) from devices.
19*4882a593Smuzhiyun	  These DMA remapping devices are reported via ACPI tables
20*4882a593Smuzhiyun	  and include PCI device scope covered by these DMA
21*4882a593Smuzhiyun	  remapping devices.
22*4882a593Smuzhiyun
23*4882a593Smuzhiyunconfig INTEL_IOMMU_DEBUGFS
24*4882a593Smuzhiyun	bool "Export Intel IOMMU internals in Debugfs"
25*4882a593Smuzhiyun	depends on INTEL_IOMMU && IOMMU_DEBUGFS
26*4882a593Smuzhiyun	help
27*4882a593Smuzhiyun	  !!!WARNING!!!
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun	  DO NOT ENABLE THIS OPTION UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!!!
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun	  Expose Intel IOMMU internals in Debugfs.
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun	  This option is -NOT- intended for production environments, and should
34*4882a593Smuzhiyun	  only be enabled for debugging Intel IOMMU.
35*4882a593Smuzhiyun
36*4882a593Smuzhiyunconfig INTEL_IOMMU_SVM
37*4882a593Smuzhiyun	bool "Support for Shared Virtual Memory with Intel IOMMU"
38*4882a593Smuzhiyun	depends on INTEL_IOMMU && X86_64
39*4882a593Smuzhiyun	select PCI_PASID
40*4882a593Smuzhiyun	select PCI_PRI
41*4882a593Smuzhiyun	select MMU_NOTIFIER
42*4882a593Smuzhiyun	select IOASID
43*4882a593Smuzhiyun	help
44*4882a593Smuzhiyun	  Shared Virtual Memory (SVM) provides a facility for devices
45*4882a593Smuzhiyun	  to access DMA resources through process address space by
46*4882a593Smuzhiyun	  means of a Process Address Space ID (PASID).
47*4882a593Smuzhiyun
48*4882a593Smuzhiyunconfig INTEL_IOMMU_DEFAULT_ON
49*4882a593Smuzhiyun	def_bool y
50*4882a593Smuzhiyun	prompt "Enable Intel DMA Remapping Devices by default"
51*4882a593Smuzhiyun	depends on INTEL_IOMMU
52*4882a593Smuzhiyun	help
53*4882a593Smuzhiyun	  Selecting this option will enable a DMAR device at boot time if
54*4882a593Smuzhiyun	  one is found. If this option is not selected, DMAR support can
55*4882a593Smuzhiyun	  be enabled by passing intel_iommu=on to the kernel.
56*4882a593Smuzhiyun
57*4882a593Smuzhiyunconfig INTEL_IOMMU_BROKEN_GFX_WA
58*4882a593Smuzhiyun	bool "Workaround broken graphics drivers (going away soon)"
59*4882a593Smuzhiyun	depends on INTEL_IOMMU && BROKEN && X86
60*4882a593Smuzhiyun	help
61*4882a593Smuzhiyun	  Current Graphics drivers tend to use physical address
62*4882a593Smuzhiyun	  for DMA and avoid using DMA APIs. Setting this config
63*4882a593Smuzhiyun	  option permits the IOMMU driver to set a unity map for
64*4882a593Smuzhiyun	  all the OS-visible memory. Hence the driver can continue
65*4882a593Smuzhiyun	  to use physical addresses for DMA, at least until this
66*4882a593Smuzhiyun	  option is removed in the 2.6.32 kernel.
67*4882a593Smuzhiyun
68*4882a593Smuzhiyunconfig INTEL_IOMMU_FLOPPY_WA
69*4882a593Smuzhiyun	def_bool y
70*4882a593Smuzhiyun	depends on INTEL_IOMMU && X86
71*4882a593Smuzhiyun	help
72*4882a593Smuzhiyun	  Floppy disk drivers are known to bypass DMA API calls
73*4882a593Smuzhiyun	  thereby failing to work when IOMMU is enabled. This
74*4882a593Smuzhiyun	  workaround will setup a 1:1 mapping for the first
75*4882a593Smuzhiyun	  16MiB to make floppy (an ISA device) work.
76*4882a593Smuzhiyun
77*4882a593Smuzhiyunconfig INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
78*4882a593Smuzhiyun	bool "Enable Intel IOMMU scalable mode by default"
79*4882a593Smuzhiyun	depends on INTEL_IOMMU
80*4882a593Smuzhiyun	help
81*4882a593Smuzhiyun	  Selecting this option will enable by default the scalable mode if
82*4882a593Smuzhiyun	  hardware presents the capability. The scalable mode is defined in
83*4882a593Smuzhiyun	  VT-d 3.0. The scalable mode capability could be checked by reading
84*4882a593Smuzhiyun	  /sys/devices/virtual/iommu/dmar*/intel-iommu/ecap. If this option
85*4882a593Smuzhiyun	  is not selected, scalable mode support could also be enabled by
86*4882a593Smuzhiyun	  passing intel_iommu=sm_on to the kernel. If not sure, please use
87*4882a593Smuzhiyun	  the default value.
88