xref: /linux/drivers/firmware/efi/Kconfig (revision 06d07429858317ded2db7986113a9e0129cd599b)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
204851772SMatt Flemingmenu "EFI (Extensible Firmware Interface) Support"
304851772SMatt Fleming	depends on EFI
404851772SMatt Fleming
53846c158SPeter Jonesconfig EFI_ESRT
63846c158SPeter Jones	bool
7cf8e8658SArd Biesheuvel	depends on EFI
83846c158SPeter Jones	default y
93846c158SPeter Jones
1004851772SMatt Flemingconfig EFI_VARS_PSTORE
1104851772SMatt Fleming	tristate "Register efivars backend for pstore"
12232f4eb6SArd Biesheuvel	depends on PSTORE
1385974825SArd Biesheuvel	select UCS2_STRING
1404851772SMatt Fleming	default y
1504851772SMatt Fleming	help
1604851772SMatt Fleming	  Say Y here to enable use efivars as a backend to pstore. This
1704851772SMatt Fleming	  will allow writing console messages, crash dumps, or anything
1804851772SMatt Fleming	  else supported by pstore to EFI variables.
1904851772SMatt Fleming
2004851772SMatt Flemingconfig EFI_VARS_PSTORE_DEFAULT_DISABLE
2104851772SMatt Fleming	bool "Disable using efivars as a pstore backend by default"
2204851772SMatt Fleming	depends on EFI_VARS_PSTORE
2304851772SMatt Fleming	default n
2404851772SMatt Fleming	help
2504851772SMatt Fleming	  Saying Y here will disable the use of efivars as a storage
2604851772SMatt Fleming	  backend for pstore by default. This setting can be overridden
2704851772SMatt Fleming	  using the efivars module's pstore_disable parameter.
2804851772SMatt Fleming
29b617c526SDan Williamsconfig EFI_SOFT_RESERVE
30b617c526SDan Williams	bool "Reserve EFI Specific Purpose Memory"
31b617c526SDan Williams	depends on EFI && EFI_STUB && ACPI_HMAT
32b617c526SDan Williams	default ACPI_HMAT
33b617c526SDan Williams	help
34b617c526SDan Williams	  On systems that have mixed performance classes of memory EFI
35b617c526SDan Williams	  may indicate specific purpose memory with an attribute (See
36b617c526SDan Williams	  EFI_MEMORY_SP in UEFI 2.8). A memory range tagged with this
37b617c526SDan Williams	  attribute may have unique performance characteristics compared
38b617c526SDan Williams	  to the system's general purpose "System RAM" pool. On the
39b617c526SDan Williams	  expectation that such memory has application specific usage,
40b617c526SDan Williams	  and its base EFI memory type is "conventional" answer Y to
41b617c526SDan Williams	  arrange for the kernel to reserve it as a "Soft Reserved"
42b617c526SDan Williams	  resource, and set aside for direct-access (device-dax) by
43b617c526SDan Williams	  default. The memory range can later be optionally assigned to
44b617c526SDan Williams	  the page allocator by system administrator policy via the
45b617c526SDan Williams	  device-dax kmem facility. Say N to have the kernel treat this
46b617c526SDan Williams	  memory as "System RAM" by default.
47b617c526SDan Williams
48b617c526SDan Williams	  If unsure, say Y.
49b617c526SDan Williams
5082e0d6d7SBaskov Evgeniyconfig EFI_DXE_MEM_ATTRIBUTES
5182e0d6d7SBaskov Evgeniy	bool "Adjust memory attributes in EFISTUB"
5282e0d6d7SBaskov Evgeniy	depends on EFI && EFI_STUB && X86
5382e0d6d7SBaskov Evgeniy	default y
5482e0d6d7SBaskov Evgeniy	help
5582e0d6d7SBaskov Evgeniy	  UEFI specification does not guarantee all memory to be
5682e0d6d7SBaskov Evgeniy	  accessible for both write and execute as the kernel expects
5782e0d6d7SBaskov Evgeniy	  it to be.
5882e0d6d7SBaskov Evgeniy	  Use DXE services to check and alter memory protection
5982e0d6d7SBaskov Evgeniy	  attributes during boot via EFISTUB to ensure that memory
6082e0d6d7SBaskov Evgeniy	  ranges used by the kernel are writable and executable.
6182e0d6d7SBaskov Evgeniy
620302f71cSMark Salterconfig EFI_PARAMS_FROM_FDT
630302f71cSMark Salter	bool
640302f71cSMark Salter	help
650302f71cSMark Salter	  Select this config option from the architecture Kconfig if
660302f71cSMark Salter	  the EFI runtime support gets system table address, memory
670302f71cSMark Salter          map address, and other parameters from the device tree.
680302f71cSMark Salter
69022ee6c5SArd Biesheuvelconfig EFI_RUNTIME_WRAPPERS
70022ee6c5SArd Biesheuvel	bool
71022ee6c5SArd Biesheuvel
722e0eb483SAtish Patraconfig EFI_GENERIC_STUB
73f4f75ad5SArd Biesheuvel	bool
74f4f75ad5SArd Biesheuvel
75a0509109SArd Biesheuvelconfig EFI_ZBOOT
76a0509109SArd Biesheuvel	bool "Enable the generic EFI decompressor"
77a0509109SArd Biesheuvel	depends on EFI_GENERIC_STUB && !ARM
78a0509109SArd Biesheuvel	select HAVE_KERNEL_GZIP
79a0509109SArd Biesheuvel	select HAVE_KERNEL_LZ4
80a0509109SArd Biesheuvel	select HAVE_KERNEL_LZMA
81a0509109SArd Biesheuvel	select HAVE_KERNEL_LZO
82a0509109SArd Biesheuvel	select HAVE_KERNEL_XZ
83a0509109SArd Biesheuvel	select HAVE_KERNEL_ZSTD
84a0509109SArd Biesheuvel	help
85a0509109SArd Biesheuvel	  Create the bootable image as an EFI application that carries the
86a0509109SArd Biesheuvel	  actual kernel image in compressed form, and decompresses it into
87a0509109SArd Biesheuvel	  memory before executing it via LoadImage/StartImage EFI boot service
88a0509109SArd Biesheuvel	  calls. For compatibility with non-EFI loaders, the payload can be
89a0509109SArd Biesheuvel	  decompressed and executed by the loader as well, provided that the
90a0509109SArd Biesheuvel	  loader implements the decompression algorithm and that non-EFI boot
91a0509109SArd Biesheuvel	  is supported by the encapsulated image. (The compression algorithm
92a0509109SArd Biesheuvel	  used is described in the zboot image header)
93a0509109SArd Biesheuvel
943d7ee348SArd Biesheuvelconfig EFI_ARMSTUB_DTB_LOADER
953d7ee348SArd Biesheuvel	bool "Enable the DTB loader"
96ead384d9SHuacai Chen	depends on EFI_GENERIC_STUB && !RISCV && !LOONGARCH
97d3109593SScott Branden	default y
983d7ee348SArd Biesheuvel	help
993d7ee348SArd Biesheuvel	  Select this config option to add support for the dtb= command
1003d7ee348SArd Biesheuvel	  line parameter, allowing a device tree blob to be loaded into
1013d7ee348SArd Biesheuvel	  memory from the EFI System Partition by the stub.
1023d7ee348SArd Biesheuvel
103d3109593SScott Branden	  If the device tree is provided by the platform or by
104d3109593SScott Branden	  the bootloader this option may not be needed.
105d3109593SScott Branden	  But, for various development reasons and to maintain existing
106d3109593SScott Branden	  functionality for bootloaders that do not have such support
107d3109593SScott Branden	  this option is necessary.
1083d7ee348SArd Biesheuvel
10906f7d4a1SCompostella, Jeremyconfig EFI_BOOTLOADER_CONTROL
11006f7d4a1SCompostella, Jeremy	tristate "EFI Bootloader Control"
111416581e4SArd Biesheuvel	select UCS2_STRING
11206f7d4a1SCompostella, Jeremy	default n
113a7f7f624SMasahiro Yamada	help
11406f7d4a1SCompostella, Jeremy	  This module installs a reboot hook, such that if reboot() is
11506f7d4a1SCompostella, Jeremy	  invoked with a string argument NNN, "NNN" is copied to the
11606f7d4a1SCompostella, Jeremy	  "LoaderEntryOneShot" EFI variable, to be read by the
11706f7d4a1SCompostella, Jeremy	  bootloader. If the string matches one of the boot labels
11806f7d4a1SCompostella, Jeremy	  defined in its configuration, the bootloader will boot once
11906f7d4a1SCompostella, Jeremy	  to that label. The "LoaderEntryRebootReason" EFI variable is
12006f7d4a1SCompostella, Jeremy	  set with the reboot reason: "reboot" or "shutdown". The
12106f7d4a1SCompostella, Jeremy	  bootloader reads this reboot reason and takes particular
12206f7d4a1SCompostella, Jeremy	  action according to its policy.
12306f7d4a1SCompostella, Jeremy
12465117f1aSKweh, Hock Leongconfig EFI_CAPSULE_LOADER
12565117f1aSKweh, Hock Leong	tristate "EFI capsule loader"
126cf8e8658SArd Biesheuvel	depends on EFI
12765117f1aSKweh, Hock Leong	help
12865117f1aSKweh, Hock Leong	  This option exposes a loader interface "/dev/efi_capsule_loader" for
12965117f1aSKweh, Hock Leong	  users to load EFI capsules. This driver requires working runtime
13065117f1aSKweh, Hock Leong	  capsule support in the firmware, which many OEMs do not provide.
13165117f1aSKweh, Hock Leong
13265117f1aSKweh, Hock Leong	  Most users should say N.
13365117f1aSKweh, Hock Leong
1342959c95dSJan Kiszkaconfig EFI_CAPSULE_QUIRK_QUARK_CSH
1351ae83c5cSMasahiro Yamada	bool "Add support for Quark capsules with non-standard headers"
1362959c95dSJan Kiszka	depends on X86 && !64BIT
1372959c95dSJan Kiszka	select EFI_CAPSULE_LOADER
1382959c95dSJan Kiszka	default y
1392959c95dSJan Kiszka	help
1402959c95dSJan Kiszka	  Add support for processing Quark X1000 EFI capsules, whose header
1412959c95dSJan Kiszka	  layout deviates from the layout mandated by the UEFI specification.
1422959c95dSJan Kiszka
143ff6301daSIvan Huconfig EFI_TEST
144ff6301daSIvan Hu	tristate "EFI Runtime Service Tests Support"
145ff6301daSIvan Hu	depends on EFI
146ff6301daSIvan Hu	default n
147ff6301daSIvan Hu	help
148ff6301daSIvan Hu	  This driver uses the efi.<service> function pointers directly instead
149ff6301daSIvan Hu	  of going through the efivar API, because it is not trying to test the
150ff6301daSIvan Hu	  kernel subsystem, just for testing the UEFI runtime service
151ff6301daSIvan Hu	  interfaces which are provided by the firmware. This driver is used
152ff6301daSIvan Hu	  by the Firmware Test Suite (FWTS) for testing the UEFI runtime
153ff6301daSIvan Hu	  interfaces readiness of the firmware.
154ff6301daSIvan Hu	  Details for FWTS are available from:
155ff6301daSIvan Hu	  <https://wiki.ubuntu.com/FirmwareTestSuite>
156ff6301daSIvan Hu
157ff6301daSIvan Hu	  Say Y here to enable the runtime services support via /dev/efi_test.
158ff6301daSIvan Hu	  If unsure, say N.
159ff6301daSIvan Hu
16075ed63d9SArd Biesheuvelconfig EFI_DEV_PATH_PARSER
16175ed63d9SArd Biesheuvel	bool
16275ed63d9SArd Biesheuvel
16358c5475aSLukas Wunnerconfig APPLE_PROPERTIES
16458c5475aSLukas Wunner	bool "Apple Device Properties"
16558c5475aSLukas Wunner	depends on EFI_STUB && X86
16658c5475aSLukas Wunner	select EFI_DEV_PATH_PARSER
16758c5475aSLukas Wunner	select UCS2_STRING
16858c5475aSLukas Wunner	help
16958c5475aSLukas Wunner	  Retrieve properties from EFI on Apple Macs and assign them to
17058c5475aSLukas Wunner	  devices, allowing for improved support of Apple hardware.
17158c5475aSLukas Wunner	  Properties that would otherwise be missing include the
17258c5475aSLukas Wunner	  Thunderbolt Device ROM and GPU configuration data.
17358c5475aSLukas Wunner
17458c5475aSLukas Wunner	  If unsure, say Y if you have a Mac.  Otherwise N.
17558c5475aSLukas Wunner
176ccc829baSMatthew Garrettconfig RESET_ATTACK_MITIGATION
177ccc829baSMatthew Garrett	bool "Reset memory attack mitigation"
178ccc829baSMatthew Garrett	depends on EFI_STUB
179ccc829baSMatthew Garrett	help
180ccc829baSMatthew Garrett	  Request that the firmware clear the contents of RAM after a reboot
181ccc829baSMatthew Garrett	  using the TCG Platform Reset Attack Mitigation specification. This
182ccc829baSMatthew Garrett	  protects against an attacker forcibly rebooting the system while it
183ccc829baSMatthew Garrett	  still contains secrets in RAM, booting another OS and extracting the
184a5c03c31SMatthew Garrett	  secrets. This should only be enabled when userland is configured to
185a5c03c31SMatthew Garrett	  clear the MemoryOverwriteRequest flag on clean shutdown after secrets
186a5c03c31SMatthew Garrett	  have been evicted, since otherwise it will trigger even on clean
187a5c03c31SMatthew Garrett	  reboots.
188ccc829baSMatthew Garrett
1891c5fecb6SNarendra Kconfig EFI_RCI2_TABLE
1901c5fecb6SNarendra K	bool "EFI Runtime Configuration Interface Table Version 2 Support"
1910b6b30c6SNarendra K	depends on X86 || COMPILE_TEST
1921c5fecb6SNarendra K	help
1931c5fecb6SNarendra K	  Displays the content of the Runtime Configuration Interface
1941c5fecb6SNarendra K	  Table version 2 on Dell EMC PowerEdge systems as a binary
1951c5fecb6SNarendra K	  attribute 'rci2' under /sys/firmware/efi/tables directory.
1961c5fecb6SNarendra K
1971c5fecb6SNarendra K	  RCI2 table contains BIOS HII in XML format and is used to populate
1981c5fecb6SNarendra K	  BIOS setup page in Dell EMC OpenManage Server Administrator tool.
1991c5fecb6SNarendra K	  The BIOS setup page contains BIOS tokens which can be configured.
2001c5fecb6SNarendra K
2011c5fecb6SNarendra K	  Say Y here for Dell EMC PowerEdge systems.
2021c5fecb6SNarendra K
2034444f854SMatthew Garrettconfig EFI_DISABLE_PCI_DMA
2044444f854SMatthew Garrett       bool "Clear Busmaster bit on PCI bridges during ExitBootServices()"
2054444f854SMatthew Garrett       help
2064444f854SMatthew Garrett	  Disable the busmaster bit in the control register on all PCI bridges
2074444f854SMatthew Garrett	  while calling ExitBootServices() and passing control to the runtime
2084444f854SMatthew Garrett	  kernel. System firmware may configure the IOMMU to prevent malicious
2094444f854SMatthew Garrett	  PCI devices from being able to attack the OS via DMA. However, since
2104444f854SMatthew Garrett	  firmware can't guarantee that the OS is IOMMU-aware, it will tear
2114444f854SMatthew Garrett	  down IOMMU configuration when ExitBootServices() is called. This
2124444f854SMatthew Garrett	  leaves a window between where a hostile device could still cause
2134444f854SMatthew Garrett	  damage before Linux configures the IOMMU again.
2144444f854SMatthew Garrett
2154444f854SMatthew Garrett	  If you say Y here, the EFI stub will clear the busmaster bit on all
2164444f854SMatthew Garrett	  PCI bridges before ExitBootServices() is called. This will prevent
2174444f854SMatthew Garrett	  any malicious PCI devices from being able to perform DMA until the
2184444f854SMatthew Garrett	  kernel reenables busmastering after configuring the IOMMU.
2194444f854SMatthew Garrett
2204444f854SMatthew Garrett	  This option will cause failures with some poorly behaved hardware
2214444f854SMatthew Garrett	  and should not be enabled without testing. The kernel commandline
2224444f854SMatthew Garrett	  options "efi=disable_early_pci_dma" or "efi=no_disable_early_pci_dma"
2234444f854SMatthew Garrett	  may be used to override this option.
2244444f854SMatthew Garrett
22569c1f396SArd Biesheuvelconfig EFI_EARLYCON
22669c1f396SArd Biesheuvel	def_bool y
227cf8e8658SArd Biesheuvel	depends on SERIAL_EARLYCON && !ARM
22869c1f396SArd Biesheuvel	select FONT_SUPPORT
22969c1f396SArd Biesheuvel	select ARCH_USE_MEMREMAP_PROT
230435d1a47SPeter Jones
231435d1a47SPeter Jonesconfig EFI_CUSTOM_SSDT_OVERLAYS
232435d1a47SPeter Jones	bool "Load custom ACPI SSDT overlay from an EFI variable"
23375ed63d9SArd Biesheuvel	depends on ACPI
234435d1a47SPeter Jones	default ACPI_TABLE_UPGRADE
235435d1a47SPeter Jones	help
236435d1a47SPeter Jones	  Allow loading of an ACPI SSDT overlay from an EFI variable specified
237435d1a47SPeter Jones	  by a kernel command line option.
238435d1a47SPeter Jones
239435d1a47SPeter Jones	  See Documentation/admin-guide/acpi/ssdt-overlays.rst for more
240435d1a47SPeter Jones	  information.
241a031651fSJavier Martinez Canillas
242a031651fSJavier Martinez Canillasconfig EFI_DISABLE_RUNTIME
243a031651fSJavier Martinez Canillas	bool "Disable EFI runtime services support by default"
244a031651fSJavier Martinez Canillas	default y if PREEMPT_RT
245a031651fSJavier Martinez Canillas	help
246a031651fSJavier Martinez Canillas	  Allow to disable the EFI runtime services support by default. This can
247a031651fSJavier Martinez Canillas	  already be achieved by using the efi=noruntime option, but it could be
248a031651fSJavier Martinez Canillas	  useful to have this default without any kernel command line parameter.
249a031651fSJavier Martinez Canillas
250a031651fSJavier Martinez Canillas	  The EFI runtime services are disabled by default when PREEMPT_RT is
251a031651fSJavier Martinez Canillas	  enabled, because measurements have shown that some EFI functions calls
252a031651fSJavier Martinez Canillas	  might take too much time to complete, causing large latencies which is
253a031651fSJavier Martinez Canillas	  an issue for Real-Time kernels.
254a031651fSJavier Martinez Canillas
255a031651fSJavier Martinez Canillas	  This default can be overridden by using the efi=runtime option.
25612274189SDov Murik
25712274189SDov Murikconfig EFI_COCO_SECRET
25812274189SDov Murik	bool "EFI Confidential Computing Secret Area Support"
25912274189SDov Murik	help
26012274189SDov Murik	  Confidential Computing platforms (such as AMD SEV) allow the
26112274189SDov Murik	  Guest Owner to securely inject secrets during guest VM launch.
26212274189SDov Murik	  The secrets are placed in a designated EFI reserved memory area.
26312274189SDov Murik
26412274189SDov Murik	  In order to use the secrets in the kernel, the location of the secret
26512274189SDov Murik	  area (as published in the EFI config table) must be kept.
26612274189SDov Murik
26712274189SDov Murik	  If you say Y here, the address of the EFI secret area will be kept
26812274189SDov Murik	  for usage inside the kernel.  This will allow the
26912274189SDov Murik	  virt/coco/efi_secret module to access the secrets, which in turn
27012274189SDov Murik	  allows userspace programs to access the injected secrets.
27175ed63d9SArd Biesheuvel
272745e3ed8SKirill A. Shutemovconfig UNACCEPTED_MEMORY
273745e3ed8SKirill A. Shutemov	bool
274745e3ed8SKirill A. Shutemov	depends on EFI_STUB
275745e3ed8SKirill A. Shutemov	help
276745e3ed8SKirill A. Shutemov	   Some Virtual Machine platforms, such as Intel TDX, require
277745e3ed8SKirill A. Shutemov	   some memory to be "accepted" by the guest before it can be used.
278745e3ed8SKirill A. Shutemov	   This mechanism helps prevent malicious hosts from making changes
279745e3ed8SKirill A. Shutemov	   to guest memory.
280745e3ed8SKirill A. Shutemov
281745e3ed8SKirill A. Shutemov	   UEFI specification v2.9 introduced EFI_UNACCEPTED_MEMORY memory type.
282745e3ed8SKirill A. Shutemov
283745e3ed8SKirill A. Shutemov	   This option adds support for unaccepted memory and makes such memory
284745e3ed8SKirill A. Shutemov	   usable by the kernel.
285745e3ed8SKirill A. Shutemov
28675ed63d9SArd Biesheuvelconfig EFI_EMBEDDED_FIRMWARE
28775ed63d9SArd Biesheuvel	bool
28875ed63d9SArd Biesheuvel	select CRYPTO_LIB_SHA256
28975ed63d9SArd Biesheuvel
29075ed63d9SArd Biesheuvelendmenu
29175ed63d9SArd Biesheuvel
29275ed63d9SArd Biesheuvelconfig UEFI_CPER
29375ed63d9SArd Biesheuvel	bool
29475ed63d9SArd Biesheuvel
29575ed63d9SArd Biesheuvelconfig UEFI_CPER_ARM
29675ed63d9SArd Biesheuvel	bool
29775ed63d9SArd Biesheuvel	depends on UEFI_CPER && ( ARM || ARM64 )
29875ed63d9SArd Biesheuvel	default y
29975ed63d9SArd Biesheuvel
30075ed63d9SArd Biesheuvelconfig UEFI_CPER_X86
30175ed63d9SArd Biesheuvel	bool
30275ed63d9SArd Biesheuvel	depends on UEFI_CPER && X86
30375ed63d9SArd Biesheuvel	default y
304*c44b6be6SMasahisa Kojima
305*c44b6be6SMasahisa Kojimaconfig TEE_STMM_EFI
306*c44b6be6SMasahisa Kojima	tristate "TEE-based EFI runtime variable service driver"
307*c44b6be6SMasahisa Kojima	depends on EFI && OPTEE
308*c44b6be6SMasahisa Kojima	help
309*c44b6be6SMasahisa Kojima	  Select this config option if TEE is compiled to include StandAloneMM
310*c44b6be6SMasahisa Kojima	  as a separate secure partition. It has the ability to check and store
311*c44b6be6SMasahisa Kojima	  EFI variables on an RPMB or any other non-volatile medium used by
312*c44b6be6SMasahisa Kojima	  StandAloneMM.
313*c44b6be6SMasahisa Kojima
314*c44b6be6SMasahisa Kojima	  Enabling this will change the EFI runtime services from the firmware
315*c44b6be6SMasahisa Kojima	  provided functions to TEE calls.
316*c44b6be6SMasahisa Kojima
317*c44b6be6SMasahisa Kojima	  To compile this driver as a module, choose M here: the module
318*c44b6be6SMasahisa Kojima	  will be called tee_stmm_efi.
319