xref: /linux/drivers/firmware/efi/Kconfig (revision 859748255b43460685e93a1f8a40b8cdc3be02f2)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
204851772SMatt Flemingmenu "EFI (Extensible Firmware Interface) Support"
304851772SMatt Fleming	depends on EFI
404851772SMatt Fleming
504851772SMatt Flemingconfig EFI_VARS
604851772SMatt Fleming	tristate "EFI Variable Support via sysfs"
7963fabf3SArd Biesheuvel	depends on EFI && (X86 || IA64)
804851772SMatt Fleming	default n
904851772SMatt Fleming	help
1004851772SMatt Fleming	  If you say Y here, you are able to get EFI (Extensible Firmware
1104851772SMatt Fleming	  Interface) variable information via sysfs.  You may read,
1204851772SMatt Fleming	  write, create, and destroy EFI variables through this interface.
13963fabf3SArd Biesheuvel	  Note that this driver is only retained for compatibility with
14963fabf3SArd Biesheuvel	  legacy users: new users should use the efivarfs filesystem
15963fabf3SArd Biesheuvel	  instead.
1604851772SMatt Fleming
173846c158SPeter Jonesconfig EFI_ESRT
183846c158SPeter Jones	bool
193846c158SPeter Jones	depends on EFI && !IA64
203846c158SPeter Jones	default y
213846c158SPeter Jones
2204851772SMatt Flemingconfig EFI_VARS_PSTORE
2304851772SMatt Fleming	tristate "Register efivars backend for pstore"
24232f4eb6SArd Biesheuvel	depends on PSTORE
25*85974825SArd Biesheuvel	select UCS2_STRING
2604851772SMatt Fleming	default y
2704851772SMatt Fleming	help
2804851772SMatt Fleming	  Say Y here to enable use efivars as a backend to pstore. This
2904851772SMatt Fleming	  will allow writing console messages, crash dumps, or anything
3004851772SMatt Fleming	  else supported by pstore to EFI variables.
3104851772SMatt Fleming
3204851772SMatt Flemingconfig EFI_VARS_PSTORE_DEFAULT_DISABLE
3304851772SMatt Fleming	bool "Disable using efivars as a pstore backend by default"
3404851772SMatt Fleming	depends on EFI_VARS_PSTORE
3504851772SMatt Fleming	default n
3604851772SMatt Fleming	help
3704851772SMatt Fleming	  Saying Y here will disable the use of efivars as a storage
3804851772SMatt Fleming	  backend for pstore by default. This setting can be overridden
3904851772SMatt Fleming	  using the efivars module's pstore_disable parameter.
4004851772SMatt Fleming
41926172d4SDave Youngconfig EFI_RUNTIME_MAP
42926172d4SDave Young	bool "Export efi runtime maps to sysfs"
432965faa5SDave Young	depends on X86 && EFI && KEXEC_CORE
44926172d4SDave Young	default y
45926172d4SDave Young	help
46926172d4SDave Young	  Export efi runtime memory maps to /sys/firmware/efi/runtime-map.
47926172d4SDave Young	  That memory map is used for example by kexec to set up efi virtual
48926172d4SDave Young	  mapping the 2nd kernel, but can also be used for debugging purposes.
49926172d4SDave Young
50926172d4SDave Young	  See also Documentation/ABI/testing/sysfs-firmware-efi-runtime-map.
51926172d4SDave Young
520f96a99dSTaku Izumiconfig EFI_FAKE_MEMMAP
530f96a99dSTaku Izumi	bool "Enable EFI fake memory map"
540f96a99dSTaku Izumi	depends on EFI && X86
550f96a99dSTaku Izumi	default n
560f96a99dSTaku Izumi	help
570f96a99dSTaku Izumi	  Saying Y here will enable "efi_fake_mem" boot option.
580f96a99dSTaku Izumi	  By specifying this parameter, you can add arbitrary attribute
590f96a99dSTaku Izumi	  to specific memory range by updating original (firmware provided)
600f96a99dSTaku Izumi	  EFI memmap.
610f96a99dSTaku Izumi	  This is useful for debugging of EFI memmap related feature.
620f96a99dSTaku Izumi	  e.g. Address Range Mirroring feature.
630f96a99dSTaku Izumi
640f96a99dSTaku Izumiconfig EFI_MAX_FAKE_MEM
650f96a99dSTaku Izumi	int "maximum allowable number of ranges in efi_fake_mem boot option"
660f96a99dSTaku Izumi	depends on EFI_FAKE_MEMMAP
670f96a99dSTaku Izumi	range 1 128
680f96a99dSTaku Izumi	default 8
690f96a99dSTaku Izumi	help
700f96a99dSTaku Izumi	  Maximum allowable number of ranges in efi_fake_mem boot option.
710f96a99dSTaku Izumi	  Ranges can be set up to this value using comma-separated list.
720f96a99dSTaku Izumi	  The default value is 8.
730f96a99dSTaku Izumi
74b617c526SDan Williamsconfig EFI_SOFT_RESERVE
75b617c526SDan Williams	bool "Reserve EFI Specific Purpose Memory"
76b617c526SDan Williams	depends on EFI && EFI_STUB && ACPI_HMAT
77b617c526SDan Williams	default ACPI_HMAT
78b617c526SDan Williams	help
79b617c526SDan Williams	  On systems that have mixed performance classes of memory EFI
80b617c526SDan Williams	  may indicate specific purpose memory with an attribute (See
81b617c526SDan Williams	  EFI_MEMORY_SP in UEFI 2.8). A memory range tagged with this
82b617c526SDan Williams	  attribute may have unique performance characteristics compared
83b617c526SDan Williams	  to the system's general purpose "System RAM" pool. On the
84b617c526SDan Williams	  expectation that such memory has application specific usage,
85b617c526SDan Williams	  and its base EFI memory type is "conventional" answer Y to
86b617c526SDan Williams	  arrange for the kernel to reserve it as a "Soft Reserved"
87b617c526SDan Williams	  resource, and set aside for direct-access (device-dax) by
88b617c526SDan Williams	  default. The memory range can later be optionally assigned to
89b617c526SDan Williams	  the page allocator by system administrator policy via the
90b617c526SDan Williams	  device-dax kmem facility. Say N to have the kernel treat this
91b617c526SDan Williams	  memory as "System RAM" by default.
92b617c526SDan Williams
93b617c526SDan Williams	  If unsure, say Y.
94b617c526SDan Williams
9582e0d6d7SBaskov Evgeniyconfig EFI_DXE_MEM_ATTRIBUTES
9682e0d6d7SBaskov Evgeniy	bool "Adjust memory attributes in EFISTUB"
9782e0d6d7SBaskov Evgeniy	depends on EFI && EFI_STUB && X86
9882e0d6d7SBaskov Evgeniy	default y
9982e0d6d7SBaskov Evgeniy	help
10082e0d6d7SBaskov Evgeniy	  UEFI specification does not guarantee all memory to be
10182e0d6d7SBaskov Evgeniy	  accessible for both write and execute as the kernel expects
10282e0d6d7SBaskov Evgeniy	  it to be.
10382e0d6d7SBaskov Evgeniy	  Use DXE services to check and alter memory protection
10482e0d6d7SBaskov Evgeniy	  attributes during boot via EFISTUB to ensure that memory
10582e0d6d7SBaskov Evgeniy	  ranges used by the kernel are writable and executable.
10682e0d6d7SBaskov Evgeniy
1070302f71cSMark Salterconfig EFI_PARAMS_FROM_FDT
1080302f71cSMark Salter	bool
1090302f71cSMark Salter	help
1100302f71cSMark Salter	  Select this config option from the architecture Kconfig if
1110302f71cSMark Salter	  the EFI runtime support gets system table address, memory
1120302f71cSMark Salter          map address, and other parameters from the device tree.
1130302f71cSMark Salter
114022ee6c5SArd Biesheuvelconfig EFI_RUNTIME_WRAPPERS
115022ee6c5SArd Biesheuvel	bool
116022ee6c5SArd Biesheuvel
1172e0eb483SAtish Patraconfig EFI_GENERIC_STUB
118f4f75ad5SArd Biesheuvel	bool
119f4f75ad5SArd Biesheuvel
1203d7ee348SArd Biesheuvelconfig EFI_ARMSTUB_DTB_LOADER
1213d7ee348SArd Biesheuvel	bool "Enable the DTB loader"
122d7071743SAtish Patra	depends on EFI_GENERIC_STUB && !RISCV
123d3109593SScott Branden	default y
1243d7ee348SArd Biesheuvel	help
1253d7ee348SArd Biesheuvel	  Select this config option to add support for the dtb= command
1263d7ee348SArd Biesheuvel	  line parameter, allowing a device tree blob to be loaded into
1273d7ee348SArd Biesheuvel	  memory from the EFI System Partition by the stub.
1283d7ee348SArd Biesheuvel
129d3109593SScott Branden	  If the device tree is provided by the platform or by
130d3109593SScott Branden	  the bootloader this option may not be needed.
131d3109593SScott Branden	  But, for various development reasons and to maintain existing
132d3109593SScott Branden	  functionality for bootloaders that do not have such support
133d3109593SScott Branden	  this option is necessary.
1343d7ee348SArd Biesheuvel
135cf6b8366SArd Biesheuvelconfig EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER
1364da0b2b7SArd Biesheuvel	bool "Enable the command line initrd loader" if !X86
1374da0b2b7SArd Biesheuvel	depends on EFI_STUB && (EFI_GENERIC_STUB || X86)
1386edcf9dcSGeert Uytterhoeven	default y if X86
139d7071743SAtish Patra	depends on !RISCV
140cf6b8366SArd Biesheuvel	help
141cf6b8366SArd Biesheuvel	  Select this config option to add support for the initrd= command
142cf6b8366SArd Biesheuvel	  line parameter, allowing an initrd that resides on the same volume
143cf6b8366SArd Biesheuvel	  as the kernel image to be loaded into memory.
144cf6b8366SArd Biesheuvel
145cf6b8366SArd Biesheuvel	  This method is deprecated.
146cf6b8366SArd Biesheuvel
14706f7d4a1SCompostella, Jeremyconfig EFI_BOOTLOADER_CONTROL
14806f7d4a1SCompostella, Jeremy	tristate "EFI Bootloader Control"
149416581e4SArd Biesheuvel	select UCS2_STRING
15006f7d4a1SCompostella, Jeremy	default n
151a7f7f624SMasahiro Yamada	help
15206f7d4a1SCompostella, Jeremy	  This module installs a reboot hook, such that if reboot() is
15306f7d4a1SCompostella, Jeremy	  invoked with a string argument NNN, "NNN" is copied to the
15406f7d4a1SCompostella, Jeremy	  "LoaderEntryOneShot" EFI variable, to be read by the
15506f7d4a1SCompostella, Jeremy	  bootloader. If the string matches one of the boot labels
15606f7d4a1SCompostella, Jeremy	  defined in its configuration, the bootloader will boot once
15706f7d4a1SCompostella, Jeremy	  to that label. The "LoaderEntryRebootReason" EFI variable is
15806f7d4a1SCompostella, Jeremy	  set with the reboot reason: "reboot" or "shutdown". The
15906f7d4a1SCompostella, Jeremy	  bootloader reads this reboot reason and takes particular
16006f7d4a1SCompostella, Jeremy	  action according to its policy.
16106f7d4a1SCompostella, Jeremy
16265117f1aSKweh, Hock Leongconfig EFI_CAPSULE_LOADER
16365117f1aSKweh, Hock Leong	tristate "EFI capsule loader"
164e0a6aa30SArd Biesheuvel	depends on EFI && !IA64
16565117f1aSKweh, Hock Leong	help
16665117f1aSKweh, Hock Leong	  This option exposes a loader interface "/dev/efi_capsule_loader" for
16765117f1aSKweh, Hock Leong	  users to load EFI capsules. This driver requires working runtime
16865117f1aSKweh, Hock Leong	  capsule support in the firmware, which many OEMs do not provide.
16965117f1aSKweh, Hock Leong
17065117f1aSKweh, Hock Leong	  Most users should say N.
17165117f1aSKweh, Hock Leong
1722959c95dSJan Kiszkaconfig EFI_CAPSULE_QUIRK_QUARK_CSH
1731ae83c5cSMasahiro Yamada	bool "Add support for Quark capsules with non-standard headers"
1742959c95dSJan Kiszka	depends on X86 && !64BIT
1752959c95dSJan Kiszka	select EFI_CAPSULE_LOADER
1762959c95dSJan Kiszka	default y
1772959c95dSJan Kiszka	help
1782959c95dSJan Kiszka	  Add support for processing Quark X1000 EFI capsules, whose header
1792959c95dSJan Kiszka	  layout deviates from the layout mandated by the UEFI specification.
1802959c95dSJan Kiszka
181ff6301daSIvan Huconfig EFI_TEST
182ff6301daSIvan Hu	tristate "EFI Runtime Service Tests Support"
183ff6301daSIvan Hu	depends on EFI
184ff6301daSIvan Hu	default n
185ff6301daSIvan Hu	help
186ff6301daSIvan Hu	  This driver uses the efi.<service> function pointers directly instead
187ff6301daSIvan Hu	  of going through the efivar API, because it is not trying to test the
188ff6301daSIvan Hu	  kernel subsystem, just for testing the UEFI runtime service
189ff6301daSIvan Hu	  interfaces which are provided by the firmware. This driver is used
190ff6301daSIvan Hu	  by the Firmware Test Suite (FWTS) for testing the UEFI runtime
191ff6301daSIvan Hu	  interfaces readiness of the firmware.
192ff6301daSIvan Hu	  Details for FWTS are available from:
193ff6301daSIvan Hu	  <https://wiki.ubuntu.com/FirmwareTestSuite>
194ff6301daSIvan Hu
195ff6301daSIvan Hu	  Say Y here to enable the runtime services support via /dev/efi_test.
196ff6301daSIvan Hu	  If unsure, say N.
197ff6301daSIvan Hu
19875ed63d9SArd Biesheuvelconfig EFI_DEV_PATH_PARSER
19975ed63d9SArd Biesheuvel	bool
20075ed63d9SArd Biesheuvel
20158c5475aSLukas Wunnerconfig APPLE_PROPERTIES
20258c5475aSLukas Wunner	bool "Apple Device Properties"
20358c5475aSLukas Wunner	depends on EFI_STUB && X86
20458c5475aSLukas Wunner	select EFI_DEV_PATH_PARSER
20558c5475aSLukas Wunner	select UCS2_STRING
20658c5475aSLukas Wunner	help
20758c5475aSLukas Wunner	  Retrieve properties from EFI on Apple Macs and assign them to
20858c5475aSLukas Wunner	  devices, allowing for improved support of Apple hardware.
20958c5475aSLukas Wunner	  Properties that would otherwise be missing include the
21058c5475aSLukas Wunner	  Thunderbolt Device ROM and GPU configuration data.
21158c5475aSLukas Wunner
21258c5475aSLukas Wunner	  If unsure, say Y if you have a Mac.  Otherwise N.
21358c5475aSLukas Wunner
214ccc829baSMatthew Garrettconfig RESET_ATTACK_MITIGATION
215ccc829baSMatthew Garrett	bool "Reset memory attack mitigation"
216ccc829baSMatthew Garrett	depends on EFI_STUB
217ccc829baSMatthew Garrett	help
218ccc829baSMatthew Garrett	  Request that the firmware clear the contents of RAM after a reboot
219ccc829baSMatthew Garrett	  using the TCG Platform Reset Attack Mitigation specification. This
220ccc829baSMatthew Garrett	  protects against an attacker forcibly rebooting the system while it
221ccc829baSMatthew Garrett	  still contains secrets in RAM, booting another OS and extracting the
222a5c03c31SMatthew Garrett	  secrets. This should only be enabled when userland is configured to
223a5c03c31SMatthew Garrett	  clear the MemoryOverwriteRequest flag on clean shutdown after secrets
224a5c03c31SMatthew Garrett	  have been evicted, since otherwise it will trigger even on clean
225a5c03c31SMatthew Garrett	  reboots.
226ccc829baSMatthew Garrett
2271c5fecb6SNarendra Kconfig EFI_RCI2_TABLE
2281c5fecb6SNarendra K	bool "EFI Runtime Configuration Interface Table Version 2 Support"
2290b6b30c6SNarendra K	depends on X86 || COMPILE_TEST
2301c5fecb6SNarendra K	help
2311c5fecb6SNarendra K	  Displays the content of the Runtime Configuration Interface
2321c5fecb6SNarendra K	  Table version 2 on Dell EMC PowerEdge systems as a binary
2331c5fecb6SNarendra K	  attribute 'rci2' under /sys/firmware/efi/tables directory.
2341c5fecb6SNarendra K
2351c5fecb6SNarendra K	  RCI2 table contains BIOS HII in XML format and is used to populate
2361c5fecb6SNarendra K	  BIOS setup page in Dell EMC OpenManage Server Administrator tool.
2371c5fecb6SNarendra K	  The BIOS setup page contains BIOS tokens which can be configured.
2381c5fecb6SNarendra K
2391c5fecb6SNarendra K	  Say Y here for Dell EMC PowerEdge systems.
2401c5fecb6SNarendra K
2414444f854SMatthew Garrettconfig EFI_DISABLE_PCI_DMA
2424444f854SMatthew Garrett       bool "Clear Busmaster bit on PCI bridges during ExitBootServices()"
2434444f854SMatthew Garrett       help
2444444f854SMatthew Garrett	  Disable the busmaster bit in the control register on all PCI bridges
2454444f854SMatthew Garrett	  while calling ExitBootServices() and passing control to the runtime
2464444f854SMatthew Garrett	  kernel. System firmware may configure the IOMMU to prevent malicious
2474444f854SMatthew Garrett	  PCI devices from being able to attack the OS via DMA. However, since
2484444f854SMatthew Garrett	  firmware can't guarantee that the OS is IOMMU-aware, it will tear
2494444f854SMatthew Garrett	  down IOMMU configuration when ExitBootServices() is called. This
2504444f854SMatthew Garrett	  leaves a window between where a hostile device could still cause
2514444f854SMatthew Garrett	  damage before Linux configures the IOMMU again.
2524444f854SMatthew Garrett
2534444f854SMatthew Garrett	  If you say Y here, the EFI stub will clear the busmaster bit on all
2544444f854SMatthew Garrett	  PCI bridges before ExitBootServices() is called. This will prevent
2554444f854SMatthew Garrett	  any malicious PCI devices from being able to perform DMA until the
2564444f854SMatthew Garrett	  kernel reenables busmastering after configuring the IOMMU.
2574444f854SMatthew Garrett
2584444f854SMatthew Garrett	  This option will cause failures with some poorly behaved hardware
2594444f854SMatthew Garrett	  and should not be enabled without testing. The kernel commandline
2604444f854SMatthew Garrett	  options "efi=disable_early_pci_dma" or "efi=no_disable_early_pci_dma"
2614444f854SMatthew Garrett	  may be used to override this option.
2624444f854SMatthew Garrett
26369c1f396SArd Biesheuvelconfig EFI_EARLYCON
26469c1f396SArd Biesheuvel	def_bool y
26575ed63d9SArd Biesheuvel	depends on SERIAL_EARLYCON && !ARM && !IA64
26669c1f396SArd Biesheuvel	select FONT_SUPPORT
26769c1f396SArd Biesheuvel	select ARCH_USE_MEMREMAP_PROT
268435d1a47SPeter Jones
269435d1a47SPeter Jonesconfig EFI_CUSTOM_SSDT_OVERLAYS
270435d1a47SPeter Jones	bool "Load custom ACPI SSDT overlay from an EFI variable"
27175ed63d9SArd Biesheuvel	depends on ACPI
272435d1a47SPeter Jones	default ACPI_TABLE_UPGRADE
273435d1a47SPeter Jones	help
274435d1a47SPeter Jones	  Allow loading of an ACPI SSDT overlay from an EFI variable specified
275435d1a47SPeter Jones	  by a kernel command line option.
276435d1a47SPeter Jones
277435d1a47SPeter Jones	  See Documentation/admin-guide/acpi/ssdt-overlays.rst for more
278435d1a47SPeter Jones	  information.
279a031651fSJavier Martinez Canillas
280a031651fSJavier Martinez Canillasconfig EFI_DISABLE_RUNTIME
281a031651fSJavier Martinez Canillas	bool "Disable EFI runtime services support by default"
282a031651fSJavier Martinez Canillas	default y if PREEMPT_RT
283a031651fSJavier Martinez Canillas	help
284a031651fSJavier Martinez Canillas	  Allow to disable the EFI runtime services support by default. This can
285a031651fSJavier Martinez Canillas	  already be achieved by using the efi=noruntime option, but it could be
286a031651fSJavier Martinez Canillas	  useful to have this default without any kernel command line parameter.
287a031651fSJavier Martinez Canillas
288a031651fSJavier Martinez Canillas	  The EFI runtime services are disabled by default when PREEMPT_RT is
289a031651fSJavier Martinez Canillas	  enabled, because measurements have shown that some EFI functions calls
290a031651fSJavier Martinez Canillas	  might take too much time to complete, causing large latencies which is
291a031651fSJavier Martinez Canillas	  an issue for Real-Time kernels.
292a031651fSJavier Martinez Canillas
293a031651fSJavier Martinez Canillas	  This default can be overridden by using the efi=runtime option.
29412274189SDov Murik
29512274189SDov Murikconfig EFI_COCO_SECRET
29612274189SDov Murik	bool "EFI Confidential Computing Secret Area Support"
29712274189SDov Murik	help
29812274189SDov Murik	  Confidential Computing platforms (such as AMD SEV) allow the
29912274189SDov Murik	  Guest Owner to securely inject secrets during guest VM launch.
30012274189SDov Murik	  The secrets are placed in a designated EFI reserved memory area.
30112274189SDov Murik
30212274189SDov Murik	  In order to use the secrets in the kernel, the location of the secret
30312274189SDov Murik	  area (as published in the EFI config table) must be kept.
30412274189SDov Murik
30512274189SDov Murik	  If you say Y here, the address of the EFI secret area will be kept
30612274189SDov Murik	  for usage inside the kernel.  This will allow the
30712274189SDov Murik	  virt/coco/efi_secret module to access the secrets, which in turn
30812274189SDov Murik	  allows userspace programs to access the injected secrets.
30975ed63d9SArd Biesheuvel
31075ed63d9SArd Biesheuvelconfig EFI_EMBEDDED_FIRMWARE
31175ed63d9SArd Biesheuvel	bool
31275ed63d9SArd Biesheuvel	select CRYPTO_LIB_SHA256
31375ed63d9SArd Biesheuvel
31475ed63d9SArd Biesheuvelendmenu
31575ed63d9SArd Biesheuvel
31675ed63d9SArd Biesheuvelconfig UEFI_CPER
31775ed63d9SArd Biesheuvel	bool
31875ed63d9SArd Biesheuvel
31975ed63d9SArd Biesheuvelconfig UEFI_CPER_ARM
32075ed63d9SArd Biesheuvel	bool
32175ed63d9SArd Biesheuvel	depends on UEFI_CPER && ( ARM || ARM64 )
32275ed63d9SArd Biesheuvel	default y
32375ed63d9SArd Biesheuvel
32475ed63d9SArd Biesheuvelconfig UEFI_CPER_X86
32575ed63d9SArd Biesheuvel	bool
32675ed63d9SArd Biesheuvel	depends on UEFI_CPER && X86
32775ed63d9SArd Biesheuvel	default y
328