xref: /linux/drivers/firmware/efi/Kconfig (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1# SPDX-License-Identifier: GPL-2.0-only
2menu "EFI (Extensible Firmware Interface) Support"
3	depends on EFI
4
5config EFI_ESRT
6	bool
7	depends on EFI
8	default y
9
10config EFI_VARS_PSTORE
11	tristate "Register efivars backend for pstore"
12	depends on PSTORE
13	select UCS2_STRING
14	default y
15	help
16	  Say Y here to enable use efivars as a backend to pstore. This
17	  will allow writing console messages, crash dumps, or anything
18	  else supported by pstore to EFI variables.
19
20config EFI_VARS_PSTORE_DEFAULT_DISABLE
21	bool "Disable using efivars as a pstore backend by default"
22	depends on EFI_VARS_PSTORE
23	default n
24	help
25	  Saying Y here will disable the use of efivars as a storage
26	  backend for pstore by default. This setting can be overridden
27	  using the efivars module's pstore_disable parameter.
28
29config EFI_SOFT_RESERVE
30	bool "Reserve EFI Specific Purpose Memory"
31	depends on EFI && EFI_STUB && ACPI_HMAT
32	default ACPI_HMAT
33	help
34	  On systems that have mixed performance classes of memory EFI
35	  may indicate specific purpose memory with an attribute (See
36	  EFI_MEMORY_SP in UEFI 2.8). A memory range tagged with this
37	  attribute may have unique performance characteristics compared
38	  to the system's general purpose "System RAM" pool. On the
39	  expectation that such memory has application specific usage,
40	  and its base EFI memory type is "conventional" answer Y to
41	  arrange for the kernel to reserve it as a "Soft Reserved"
42	  resource, and set aside for direct-access (device-dax) by
43	  default. The memory range can later be optionally assigned to
44	  the page allocator by system administrator policy via the
45	  device-dax kmem facility. Say N to have the kernel treat this
46	  memory as "System RAM" by default.
47
48	  If unsure, say Y.
49
50config EFI_DXE_MEM_ATTRIBUTES
51	bool "Adjust memory attributes in EFISTUB"
52	depends on EFI && EFI_STUB && X86
53	default y
54	help
55	  UEFI specification does not guarantee all memory to be
56	  accessible for both write and execute as the kernel expects
57	  it to be.
58	  Use DXE services to check and alter memory protection
59	  attributes during boot via EFISTUB to ensure that memory
60	  ranges used by the kernel are writable and executable.
61
62config EFI_PARAMS_FROM_FDT
63	bool
64	help
65	  Select this config option from the architecture Kconfig if
66	  the EFI runtime support gets system table address, memory
67          map address, and other parameters from the device tree.
68
69config EFI_RUNTIME_WRAPPERS
70	bool
71
72config EFI_GENERIC_STUB
73	bool
74
75config EFI_ZBOOT
76	bool "Enable the generic EFI decompressor"
77	depends on EFI_GENERIC_STUB && !ARM
78	select HAVE_KERNEL_GZIP
79	select HAVE_KERNEL_LZ4
80	select HAVE_KERNEL_LZMA
81	select HAVE_KERNEL_LZO
82	select HAVE_KERNEL_XZ
83	select HAVE_KERNEL_ZSTD
84	help
85	  Create the bootable image as an EFI application that carries the
86	  actual kernel image in compressed form, and decompresses it into
87	  memory before executing it. For compatibility with non-EFI loaders,
88	  the payload can be decompressed and executed by the loader as well,
89	  provided that the loader implements the decompression algorithm.
90	  (The compression algorithm used is described in the zboot header)
91
92config EFI_ARMSTUB_DTB_LOADER
93	bool "Enable the DTB loader"
94	depends on EFI_GENERIC_STUB && !RISCV && !LOONGARCH
95	default y
96	help
97	  Select this config option to add support for the dtb= command
98	  line parameter, allowing a device tree blob to be loaded into
99	  memory from the EFI System Partition by the stub.
100
101	  If the device tree is provided by the platform or by
102	  the bootloader this option may not be needed.
103	  But, for various development reasons and to maintain existing
104	  functionality for bootloaders that do not have such support
105	  this option is necessary.
106
107config EFI_BOOTLOADER_CONTROL
108	tristate "EFI Bootloader Control"
109	select UCS2_STRING
110	default n
111	help
112	  This module installs a reboot hook, such that if reboot() is
113	  invoked with a string argument NNN, "NNN" is copied to the
114	  "LoaderEntryOneShot" EFI variable, to be read by the
115	  bootloader. If the string matches one of the boot labels
116	  defined in its configuration, the bootloader will boot once
117	  to that label. The "LoaderEntryRebootReason" EFI variable is
118	  set with the reboot reason: "reboot" or "shutdown". The
119	  bootloader reads this reboot reason and takes particular
120	  action according to its policy.
121
122config EFI_CAPSULE_LOADER
123	tristate "EFI capsule loader"
124	depends on EFI
125	help
126	  This option exposes a loader interface "/dev/efi_capsule_loader" for
127	  users to load EFI capsules. This driver requires working runtime
128	  capsule support in the firmware, which many OEMs do not provide.
129
130	  Most users should say N.
131
132config EFI_CAPSULE_QUIRK_QUARK_CSH
133	bool "Add support for Quark capsules with non-standard headers"
134	depends on X86 && !64BIT
135	select EFI_CAPSULE_LOADER
136	default y
137	help
138	  Add support for processing Quark X1000 EFI capsules, whose header
139	  layout deviates from the layout mandated by the UEFI specification.
140
141config EFI_TEST
142	tristate "EFI Runtime Service Tests Support"
143	depends on EFI
144	default n
145	help
146	  This driver uses the efi.<service> function pointers directly instead
147	  of going through the efivar API, because it is not trying to test the
148	  kernel subsystem, just for testing the UEFI runtime service
149	  interfaces which are provided by the firmware. This driver is used
150	  by the Firmware Test Suite (FWTS) for testing the UEFI runtime
151	  interfaces readiness of the firmware.
152	  Details for FWTS are available from:
153	  <https://wiki.ubuntu.com/FirmwareTestSuite>
154
155	  Say Y here to enable the runtime services support via /dev/efi_test.
156	  If unsure, say N.
157
158config EFI_DEV_PATH_PARSER
159	bool
160
161config APPLE_PROPERTIES
162	bool "Apple Device Properties"
163	depends on EFI_STUB && X86
164	select EFI_DEV_PATH_PARSER
165	select UCS2_STRING
166	help
167	  Retrieve properties from EFI on Apple Macs and assign them to
168	  devices, allowing for improved support of Apple hardware.
169	  Properties that would otherwise be missing include the
170	  Thunderbolt Device ROM and GPU configuration data.
171
172	  If unsure, say Y if you have a Mac.  Otherwise N.
173
174config RESET_ATTACK_MITIGATION
175	bool "Reset memory attack mitigation"
176	depends on EFI_STUB
177	help
178	  Request that the firmware clear the contents of RAM after a reboot
179	  using the TCG Platform Reset Attack Mitigation specification. This
180	  protects against an attacker forcibly rebooting the system while it
181	  still contains secrets in RAM, booting another OS and extracting the
182	  secrets. This should only be enabled when userland is configured to
183	  clear the MemoryOverwriteRequest flag on clean shutdown after secrets
184	  have been evicted, since otherwise it will trigger even on clean
185	  reboots.
186
187config EFI_RCI2_TABLE
188	bool "EFI Runtime Configuration Interface Table Version 2 Support"
189	depends on X86 || COMPILE_TEST
190	help
191	  Displays the content of the Runtime Configuration Interface
192	  Table version 2 on Dell EMC PowerEdge systems as a binary
193	  attribute 'rci2' under /sys/firmware/efi/tables directory.
194
195	  RCI2 table contains BIOS HII in XML format and is used to populate
196	  BIOS setup page in Dell EMC OpenManage Server Administrator tool.
197	  The BIOS setup page contains BIOS tokens which can be configured.
198
199	  Say Y here for Dell EMC PowerEdge systems.
200
201config EFI_DISABLE_PCI_DMA
202       bool "Clear Busmaster bit on PCI bridges during ExitBootServices()"
203       help
204	  Disable the busmaster bit in the control register on all PCI bridges
205	  while calling ExitBootServices() and passing control to the runtime
206	  kernel. System firmware may configure the IOMMU to prevent malicious
207	  PCI devices from being able to attack the OS via DMA. However, since
208	  firmware can't guarantee that the OS is IOMMU-aware, it will tear
209	  down IOMMU configuration when ExitBootServices() is called. This
210	  leaves a window between where a hostile device could still cause
211	  damage before Linux configures the IOMMU again.
212
213	  If you say Y here, the EFI stub will clear the busmaster bit on all
214	  PCI bridges before ExitBootServices() is called. This will prevent
215	  any malicious PCI devices from being able to perform DMA until the
216	  kernel reenables busmastering after configuring the IOMMU.
217
218	  This option will cause failures with some poorly behaved hardware
219	  and should not be enabled without testing. The kernel commandline
220	  options "efi=disable_early_pci_dma" or "efi=no_disable_early_pci_dma"
221	  may be used to override this option.
222
223config EFI_EARLYCON
224	def_bool y
225	depends on SERIAL_EARLYCON && !ARM
226	select FONT_SUPPORT
227	select ARCH_USE_MEMREMAP_PROT
228
229config EFI_CUSTOM_SSDT_OVERLAYS
230	bool "Load custom ACPI SSDT overlay from an EFI variable"
231	depends on ACPI
232	default ACPI_TABLE_UPGRADE
233	help
234	  Allow loading of an ACPI SSDT overlay from an EFI variable specified
235	  by a kernel command line option.
236
237	  See Documentation/admin-guide/acpi/ssdt-overlays.rst for more
238	  information.
239
240config EFI_DISABLE_RUNTIME
241	bool "Disable EFI runtime services support by default"
242	default y if PREEMPT_RT
243	help
244	  Allow to disable the EFI runtime services support by default. This can
245	  already be achieved by using the efi=noruntime option, but it could be
246	  useful to have this default without any kernel command line parameter.
247
248	  The EFI runtime services are disabled by default when PREEMPT_RT is
249	  enabled, because measurements have shown that some EFI functions calls
250	  might take too much time to complete, causing large latencies which is
251	  an issue for Real-Time kernels.
252
253	  This default can be overridden by using the efi=runtime option.
254
255config EFI_COCO_SECRET
256	bool "EFI Confidential Computing Secret Area Support"
257	help
258	  Confidential Computing platforms (such as AMD SEV) allow the
259	  Guest Owner to securely inject secrets during guest VM launch.
260	  The secrets are placed in a designated EFI reserved memory area.
261
262	  In order to use the secrets in the kernel, the location of the secret
263	  area (as published in the EFI config table) must be kept.
264
265	  If you say Y here, the address of the EFI secret area will be kept
266	  for usage inside the kernel.  This will allow the
267	  virt/coco/efi_secret module to access the secrets, which in turn
268	  allows userspace programs to access the injected secrets.
269
270config UNACCEPTED_MEMORY
271	bool
272	depends on EFI_STUB
273	help
274	   Some Virtual Machine platforms, such as Intel TDX, require
275	   some memory to be "accepted" by the guest before it can be used.
276	   This mechanism helps prevent malicious hosts from making changes
277	   to guest memory.
278
279	   UEFI specification v2.9 introduced EFI_UNACCEPTED_MEMORY memory type.
280
281	   This option adds support for unaccepted memory and makes such memory
282	   usable by the kernel.
283
284config EFI_EMBEDDED_FIRMWARE
285	bool
286	select CRYPTO_LIB_SHA256
287
288endmenu
289
290config UEFI_CPER
291	bool
292
293config UEFI_CPER_ARM
294	bool
295	depends on UEFI_CPER && ( ARM || ARM64 )
296	default y
297
298config UEFI_CPER_X86
299	bool
300	depends on UEFI_CPER && X86
301	default y
302
303config TEE_STMM_EFI
304	tristate "TEE-based EFI runtime variable service driver"
305	depends on EFI && OPTEE
306	help
307	  Select this config option if TEE is compiled to include StandAloneMM
308	  as a separate secure partition. It has the ability to check and store
309	  EFI variables on an RPMB or any other non-volatile medium used by
310	  StandAloneMM.
311
312	  Enabling this will change the EFI runtime services from the firmware
313	  provided functions to TEE calls.
314
315	  To compile this driver as a module, choose M here: the module
316	  will be called tee_stmm_efi.
317