xref: /OK3568_Linux_fs/kernel/drivers/firmware/efi/Kconfig (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0-only
2*4882a593Smuzhiyunmenu "EFI (Extensible Firmware Interface) Support"
3*4882a593Smuzhiyun	depends on EFI
4*4882a593Smuzhiyun
5*4882a593Smuzhiyunconfig EFI_VARS
6*4882a593Smuzhiyun	tristate "EFI Variable Support via sysfs"
7*4882a593Smuzhiyun	depends on EFI && (X86 || IA64)
8*4882a593Smuzhiyun	default n
9*4882a593Smuzhiyun	help
10*4882a593Smuzhiyun	  If you say Y here, you are able to get EFI (Extensible Firmware
11*4882a593Smuzhiyun	  Interface) variable information via sysfs.  You may read,
12*4882a593Smuzhiyun	  write, create, and destroy EFI variables through this interface.
13*4882a593Smuzhiyun	  Note that this driver is only retained for compatibility with
14*4882a593Smuzhiyun	  legacy users: new users should use the efivarfs filesystem
15*4882a593Smuzhiyun	  instead.
16*4882a593Smuzhiyun
17*4882a593Smuzhiyunconfig EFI_ESRT
18*4882a593Smuzhiyun	bool
19*4882a593Smuzhiyun	depends on EFI && !IA64
20*4882a593Smuzhiyun	default y
21*4882a593Smuzhiyun
22*4882a593Smuzhiyunconfig EFI_VARS_PSTORE
23*4882a593Smuzhiyun	tristate "Register efivars backend for pstore"
24*4882a593Smuzhiyun	depends on PSTORE
25*4882a593Smuzhiyun	default y
26*4882a593Smuzhiyun	help
27*4882a593Smuzhiyun	  Say Y here to enable use efivars as a backend to pstore. This
28*4882a593Smuzhiyun	  will allow writing console messages, crash dumps, or anything
29*4882a593Smuzhiyun	  else supported by pstore to EFI variables.
30*4882a593Smuzhiyun
31*4882a593Smuzhiyunconfig EFI_VARS_PSTORE_DEFAULT_DISABLE
32*4882a593Smuzhiyun	bool "Disable using efivars as a pstore backend by default"
33*4882a593Smuzhiyun	depends on EFI_VARS_PSTORE
34*4882a593Smuzhiyun	default n
35*4882a593Smuzhiyun	help
36*4882a593Smuzhiyun	  Saying Y here will disable the use of efivars as a storage
37*4882a593Smuzhiyun	  backend for pstore by default. This setting can be overridden
38*4882a593Smuzhiyun	  using the efivars module's pstore_disable parameter.
39*4882a593Smuzhiyun
40*4882a593Smuzhiyunconfig EFI_RUNTIME_MAP
41*4882a593Smuzhiyun	bool "Export efi runtime maps to sysfs"
42*4882a593Smuzhiyun	depends on X86 && EFI && KEXEC_CORE
43*4882a593Smuzhiyun	default y
44*4882a593Smuzhiyun	help
45*4882a593Smuzhiyun	  Export efi runtime memory maps to /sys/firmware/efi/runtime-map.
46*4882a593Smuzhiyun	  That memory map is used for example by kexec to set up efi virtual
47*4882a593Smuzhiyun	  mapping the 2nd kernel, but can also be used for debugging purposes.
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun	  See also Documentation/ABI/testing/sysfs-firmware-efi-runtime-map.
50*4882a593Smuzhiyun
51*4882a593Smuzhiyunconfig EFI_FAKE_MEMMAP
52*4882a593Smuzhiyun	bool "Enable EFI fake memory map"
53*4882a593Smuzhiyun	depends on EFI && X86
54*4882a593Smuzhiyun	default n
55*4882a593Smuzhiyun	help
56*4882a593Smuzhiyun	  Saying Y here will enable "efi_fake_mem" boot option.
57*4882a593Smuzhiyun	  By specifying this parameter, you can add arbitrary attribute
58*4882a593Smuzhiyun	  to specific memory range by updating original (firmware provided)
59*4882a593Smuzhiyun	  EFI memmap.
60*4882a593Smuzhiyun	  This is useful for debugging of EFI memmap related feature.
61*4882a593Smuzhiyun	  e.g. Address Range Mirroring feature.
62*4882a593Smuzhiyun
63*4882a593Smuzhiyunconfig EFI_MAX_FAKE_MEM
64*4882a593Smuzhiyun	int "maximum allowable number of ranges in efi_fake_mem boot option"
65*4882a593Smuzhiyun	depends on EFI_FAKE_MEMMAP
66*4882a593Smuzhiyun	range 1 128
67*4882a593Smuzhiyun	default 8
68*4882a593Smuzhiyun	help
69*4882a593Smuzhiyun	  Maximum allowable number of ranges in efi_fake_mem boot option.
70*4882a593Smuzhiyun	  Ranges can be set up to this value using comma-separated list.
71*4882a593Smuzhiyun	  The default value is 8.
72*4882a593Smuzhiyun
73*4882a593Smuzhiyunconfig EFI_SOFT_RESERVE
74*4882a593Smuzhiyun	bool "Reserve EFI Specific Purpose Memory"
75*4882a593Smuzhiyun	depends on EFI && EFI_STUB && ACPI_HMAT
76*4882a593Smuzhiyun	default ACPI_HMAT
77*4882a593Smuzhiyun	help
78*4882a593Smuzhiyun	  On systems that have mixed performance classes of memory EFI
79*4882a593Smuzhiyun	  may indicate specific purpose memory with an attribute (See
80*4882a593Smuzhiyun	  EFI_MEMORY_SP in UEFI 2.8). A memory range tagged with this
81*4882a593Smuzhiyun	  attribute may have unique performance characteristics compared
82*4882a593Smuzhiyun	  to the system's general purpose "System RAM" pool. On the
83*4882a593Smuzhiyun	  expectation that such memory has application specific usage,
84*4882a593Smuzhiyun	  and its base EFI memory type is "conventional" answer Y to
85*4882a593Smuzhiyun	  arrange for the kernel to reserve it as a "Soft Reserved"
86*4882a593Smuzhiyun	  resource, and set aside for direct-access (device-dax) by
87*4882a593Smuzhiyun	  default. The memory range can later be optionally assigned to
88*4882a593Smuzhiyun	  the page allocator by system administrator policy via the
89*4882a593Smuzhiyun	  device-dax kmem facility. Say N to have the kernel treat this
90*4882a593Smuzhiyun	  memory as "System RAM" by default.
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun	  If unsure, say Y.
93*4882a593Smuzhiyun
94*4882a593Smuzhiyunconfig EFI_PARAMS_FROM_FDT
95*4882a593Smuzhiyun	bool
96*4882a593Smuzhiyun	help
97*4882a593Smuzhiyun	  Select this config option from the architecture Kconfig if
98*4882a593Smuzhiyun	  the EFI runtime support gets system table address, memory
99*4882a593Smuzhiyun          map address, and other parameters from the device tree.
100*4882a593Smuzhiyun
101*4882a593Smuzhiyunconfig EFI_RUNTIME_WRAPPERS
102*4882a593Smuzhiyun	bool
103*4882a593Smuzhiyun
104*4882a593Smuzhiyunconfig EFI_GENERIC_STUB
105*4882a593Smuzhiyun	bool
106*4882a593Smuzhiyun
107*4882a593Smuzhiyunconfig EFI_ARMSTUB_DTB_LOADER
108*4882a593Smuzhiyun	bool "Enable the DTB loader"
109*4882a593Smuzhiyun	depends on EFI_GENERIC_STUB && !RISCV
110*4882a593Smuzhiyun	default y
111*4882a593Smuzhiyun	help
112*4882a593Smuzhiyun	  Select this config option to add support for the dtb= command
113*4882a593Smuzhiyun	  line parameter, allowing a device tree blob to be loaded into
114*4882a593Smuzhiyun	  memory from the EFI System Partition by the stub.
115*4882a593Smuzhiyun
116*4882a593Smuzhiyun	  If the device tree is provided by the platform or by
117*4882a593Smuzhiyun	  the bootloader this option may not be needed.
118*4882a593Smuzhiyun	  But, for various development reasons and to maintain existing
119*4882a593Smuzhiyun	  functionality for bootloaders that do not have such support
120*4882a593Smuzhiyun	  this option is necessary.
121*4882a593Smuzhiyun
122*4882a593Smuzhiyunconfig EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER
123*4882a593Smuzhiyun	bool "Enable the command line initrd loader" if !X86
124*4882a593Smuzhiyun	depends on EFI_STUB && (EFI_GENERIC_STUB || X86)
125*4882a593Smuzhiyun	default y
126*4882a593Smuzhiyun	depends on !RISCV
127*4882a593Smuzhiyun	help
128*4882a593Smuzhiyun	  Select this config option to add support for the initrd= command
129*4882a593Smuzhiyun	  line parameter, allowing an initrd that resides on the same volume
130*4882a593Smuzhiyun	  as the kernel image to be loaded into memory.
131*4882a593Smuzhiyun
132*4882a593Smuzhiyun	  This method is deprecated.
133*4882a593Smuzhiyun
134*4882a593Smuzhiyunconfig EFI_BOOTLOADER_CONTROL
135*4882a593Smuzhiyun	tristate "EFI Bootloader Control"
136*4882a593Smuzhiyun	default n
137*4882a593Smuzhiyun	help
138*4882a593Smuzhiyun	  This module installs a reboot hook, such that if reboot() is
139*4882a593Smuzhiyun	  invoked with a string argument NNN, "NNN" is copied to the
140*4882a593Smuzhiyun	  "LoaderEntryOneShot" EFI variable, to be read by the
141*4882a593Smuzhiyun	  bootloader. If the string matches one of the boot labels
142*4882a593Smuzhiyun	  defined in its configuration, the bootloader will boot once
143*4882a593Smuzhiyun	  to that label. The "LoaderEntryRebootReason" EFI variable is
144*4882a593Smuzhiyun	  set with the reboot reason: "reboot" or "shutdown". The
145*4882a593Smuzhiyun	  bootloader reads this reboot reason and takes particular
146*4882a593Smuzhiyun	  action according to its policy.
147*4882a593Smuzhiyun
148*4882a593Smuzhiyunconfig EFI_CAPSULE_LOADER
149*4882a593Smuzhiyun	tristate "EFI capsule loader"
150*4882a593Smuzhiyun	depends on EFI
151*4882a593Smuzhiyun	help
152*4882a593Smuzhiyun	  This option exposes a loader interface "/dev/efi_capsule_loader" for
153*4882a593Smuzhiyun	  users to load EFI capsules. This driver requires working runtime
154*4882a593Smuzhiyun	  capsule support in the firmware, which many OEMs do not provide.
155*4882a593Smuzhiyun
156*4882a593Smuzhiyun	  Most users should say N.
157*4882a593Smuzhiyun
158*4882a593Smuzhiyunconfig EFI_CAPSULE_QUIRK_QUARK_CSH
159*4882a593Smuzhiyun	bool "Add support for Quark capsules with non-standard headers"
160*4882a593Smuzhiyun	depends on X86 && !64BIT
161*4882a593Smuzhiyun	select EFI_CAPSULE_LOADER
162*4882a593Smuzhiyun	default y
163*4882a593Smuzhiyun	help
164*4882a593Smuzhiyun	  Add support for processing Quark X1000 EFI capsules, whose header
165*4882a593Smuzhiyun	  layout deviates from the layout mandated by the UEFI specification.
166*4882a593Smuzhiyun
167*4882a593Smuzhiyunconfig EFI_TEST
168*4882a593Smuzhiyun	tristate "EFI Runtime Service Tests Support"
169*4882a593Smuzhiyun	depends on EFI
170*4882a593Smuzhiyun	default n
171*4882a593Smuzhiyun	help
172*4882a593Smuzhiyun	  This driver uses the efi.<service> function pointers directly instead
173*4882a593Smuzhiyun	  of going through the efivar API, because it is not trying to test the
174*4882a593Smuzhiyun	  kernel subsystem, just for testing the UEFI runtime service
175*4882a593Smuzhiyun	  interfaces which are provided by the firmware. This driver is used
176*4882a593Smuzhiyun	  by the Firmware Test Suite (FWTS) for testing the UEFI runtime
177*4882a593Smuzhiyun	  interfaces readiness of the firmware.
178*4882a593Smuzhiyun	  Details for FWTS are available from:
179*4882a593Smuzhiyun	  <https://wiki.ubuntu.com/FirmwareTestSuite>
180*4882a593Smuzhiyun
181*4882a593Smuzhiyun	  Say Y here to enable the runtime services support via /dev/efi_test.
182*4882a593Smuzhiyun	  If unsure, say N.
183*4882a593Smuzhiyun
184*4882a593Smuzhiyunconfig APPLE_PROPERTIES
185*4882a593Smuzhiyun	bool "Apple Device Properties"
186*4882a593Smuzhiyun	depends on EFI_STUB && X86
187*4882a593Smuzhiyun	select EFI_DEV_PATH_PARSER
188*4882a593Smuzhiyun	select UCS2_STRING
189*4882a593Smuzhiyun	help
190*4882a593Smuzhiyun	  Retrieve properties from EFI on Apple Macs and assign them to
191*4882a593Smuzhiyun	  devices, allowing for improved support of Apple hardware.
192*4882a593Smuzhiyun	  Properties that would otherwise be missing include the
193*4882a593Smuzhiyun	  Thunderbolt Device ROM and GPU configuration data.
194*4882a593Smuzhiyun
195*4882a593Smuzhiyun	  If unsure, say Y if you have a Mac.  Otherwise N.
196*4882a593Smuzhiyun
197*4882a593Smuzhiyunconfig RESET_ATTACK_MITIGATION
198*4882a593Smuzhiyun	bool "Reset memory attack mitigation"
199*4882a593Smuzhiyun	depends on EFI_STUB
200*4882a593Smuzhiyun	help
201*4882a593Smuzhiyun	  Request that the firmware clear the contents of RAM after a reboot
202*4882a593Smuzhiyun	  using the TCG Platform Reset Attack Mitigation specification. This
203*4882a593Smuzhiyun	  protects against an attacker forcibly rebooting the system while it
204*4882a593Smuzhiyun	  still contains secrets in RAM, booting another OS and extracting the
205*4882a593Smuzhiyun	  secrets. This should only be enabled when userland is configured to
206*4882a593Smuzhiyun	  clear the MemoryOverwriteRequest flag on clean shutdown after secrets
207*4882a593Smuzhiyun	  have been evicted, since otherwise it will trigger even on clean
208*4882a593Smuzhiyun	  reboots.
209*4882a593Smuzhiyun
210*4882a593Smuzhiyunconfig EFI_RCI2_TABLE
211*4882a593Smuzhiyun	bool "EFI Runtime Configuration Interface Table Version 2 Support"
212*4882a593Smuzhiyun	depends on X86 || COMPILE_TEST
213*4882a593Smuzhiyun	help
214*4882a593Smuzhiyun	  Displays the content of the Runtime Configuration Interface
215*4882a593Smuzhiyun	  Table version 2 on Dell EMC PowerEdge systems as a binary
216*4882a593Smuzhiyun	  attribute 'rci2' under /sys/firmware/efi/tables directory.
217*4882a593Smuzhiyun
218*4882a593Smuzhiyun	  RCI2 table contains BIOS HII in XML format and is used to populate
219*4882a593Smuzhiyun	  BIOS setup page in Dell EMC OpenManage Server Administrator tool.
220*4882a593Smuzhiyun	  The BIOS setup page contains BIOS tokens which can be configured.
221*4882a593Smuzhiyun
222*4882a593Smuzhiyun	  Say Y here for Dell EMC PowerEdge systems.
223*4882a593Smuzhiyun
224*4882a593Smuzhiyunconfig EFI_DISABLE_PCI_DMA
225*4882a593Smuzhiyun       bool "Clear Busmaster bit on PCI bridges during ExitBootServices()"
226*4882a593Smuzhiyun       help
227*4882a593Smuzhiyun	  Disable the busmaster bit in the control register on all PCI bridges
228*4882a593Smuzhiyun	  while calling ExitBootServices() and passing control to the runtime
229*4882a593Smuzhiyun	  kernel. System firmware may configure the IOMMU to prevent malicious
230*4882a593Smuzhiyun	  PCI devices from being able to attack the OS via DMA. However, since
231*4882a593Smuzhiyun	  firmware can't guarantee that the OS is IOMMU-aware, it will tear
232*4882a593Smuzhiyun	  down IOMMU configuration when ExitBootServices() is called. This
233*4882a593Smuzhiyun	  leaves a window between where a hostile device could still cause
234*4882a593Smuzhiyun	  damage before Linux configures the IOMMU again.
235*4882a593Smuzhiyun
236*4882a593Smuzhiyun	  If you say Y here, the EFI stub will clear the busmaster bit on all
237*4882a593Smuzhiyun	  PCI bridges before ExitBootServices() is called. This will prevent
238*4882a593Smuzhiyun	  any malicious PCI devices from being able to perform DMA until the
239*4882a593Smuzhiyun	  kernel reenables busmastering after configuring the IOMMU.
240*4882a593Smuzhiyun
241*4882a593Smuzhiyun	  This option will cause failures with some poorly behaved hardware
242*4882a593Smuzhiyun	  and should not be enabled without testing. The kernel commandline
243*4882a593Smuzhiyun	  options "efi=disable_early_pci_dma" or "efi=no_disable_early_pci_dma"
244*4882a593Smuzhiyun	  may be used to override this option.
245*4882a593Smuzhiyun
246*4882a593Smuzhiyunendmenu
247*4882a593Smuzhiyun
248*4882a593Smuzhiyunconfig EFI_EMBEDDED_FIRMWARE
249*4882a593Smuzhiyun	bool
250*4882a593Smuzhiyun	depends on EFI
251*4882a593Smuzhiyun	select CRYPTO_LIB_SHA256
252*4882a593Smuzhiyun
253*4882a593Smuzhiyunconfig UEFI_CPER
254*4882a593Smuzhiyun	bool
255*4882a593Smuzhiyun
256*4882a593Smuzhiyunconfig UEFI_CPER_ARM
257*4882a593Smuzhiyun	bool
258*4882a593Smuzhiyun	depends on UEFI_CPER && ( ARM || ARM64 )
259*4882a593Smuzhiyun	default y
260*4882a593Smuzhiyun
261*4882a593Smuzhiyunconfig UEFI_CPER_X86
262*4882a593Smuzhiyun	bool
263*4882a593Smuzhiyun	depends on UEFI_CPER && X86
264*4882a593Smuzhiyun	default y
265*4882a593Smuzhiyun
266*4882a593Smuzhiyunconfig EFI_DEV_PATH_PARSER
267*4882a593Smuzhiyun	bool
268*4882a593Smuzhiyun	depends on ACPI
269*4882a593Smuzhiyun	default n
270*4882a593Smuzhiyun
271*4882a593Smuzhiyunconfig EFI_EARLYCON
272*4882a593Smuzhiyun	def_bool y
273*4882a593Smuzhiyun	depends on EFI && SERIAL_EARLYCON && !ARM && !IA64
274*4882a593Smuzhiyun	select FONT_SUPPORT
275*4882a593Smuzhiyun	select ARCH_USE_MEMREMAP_PROT
276*4882a593Smuzhiyun
277*4882a593Smuzhiyunconfig EFI_CUSTOM_SSDT_OVERLAYS
278*4882a593Smuzhiyun	bool "Load custom ACPI SSDT overlay from an EFI variable"
279*4882a593Smuzhiyun	depends on EFI && ACPI
280*4882a593Smuzhiyun	default ACPI_TABLE_UPGRADE
281*4882a593Smuzhiyun	help
282*4882a593Smuzhiyun	  Allow loading of an ACPI SSDT overlay from an EFI variable specified
283*4882a593Smuzhiyun	  by a kernel command line option.
284*4882a593Smuzhiyun
285*4882a593Smuzhiyun	  See Documentation/admin-guide/acpi/ssdt-overlays.rst for more
286*4882a593Smuzhiyun	  information.
287