18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_cimenu "EFI (Extensible Firmware Interface) Support"
38c2ecf20Sopenharmony_ci	depends on EFI
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciconfig EFI_VARS
68c2ecf20Sopenharmony_ci	tristate "EFI Variable Support via sysfs"
78c2ecf20Sopenharmony_ci	depends on EFI && (X86 || IA64)
88c2ecf20Sopenharmony_ci	default n
98c2ecf20Sopenharmony_ci	help
108c2ecf20Sopenharmony_ci	  If you say Y here, you are able to get EFI (Extensible Firmware
118c2ecf20Sopenharmony_ci	  Interface) variable information via sysfs.  You may read,
128c2ecf20Sopenharmony_ci	  write, create, and destroy EFI variables through this interface.
138c2ecf20Sopenharmony_ci	  Note that this driver is only retained for compatibility with
148c2ecf20Sopenharmony_ci	  legacy users: new users should use the efivarfs filesystem
158c2ecf20Sopenharmony_ci	  instead.
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciconfig EFI_ESRT
188c2ecf20Sopenharmony_ci	bool
198c2ecf20Sopenharmony_ci	depends on EFI && !IA64
208c2ecf20Sopenharmony_ci	default y
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciconfig EFI_VARS_PSTORE
238c2ecf20Sopenharmony_ci	tristate "Register efivars backend for pstore"
248c2ecf20Sopenharmony_ci	depends on PSTORE
258c2ecf20Sopenharmony_ci	default y
268c2ecf20Sopenharmony_ci	help
278c2ecf20Sopenharmony_ci	  Say Y here to enable use efivars as a backend to pstore. This
288c2ecf20Sopenharmony_ci	  will allow writing console messages, crash dumps, or anything
298c2ecf20Sopenharmony_ci	  else supported by pstore to EFI variables.
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciconfig EFI_VARS_PSTORE_DEFAULT_DISABLE
328c2ecf20Sopenharmony_ci	bool "Disable using efivars as a pstore backend by default"
338c2ecf20Sopenharmony_ci	depends on EFI_VARS_PSTORE
348c2ecf20Sopenharmony_ci	default n
358c2ecf20Sopenharmony_ci	help
368c2ecf20Sopenharmony_ci	  Saying Y here will disable the use of efivars as a storage
378c2ecf20Sopenharmony_ci	  backend for pstore by default. This setting can be overridden
388c2ecf20Sopenharmony_ci	  using the efivars module's pstore_disable parameter.
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciconfig EFI_RUNTIME_MAP
418c2ecf20Sopenharmony_ci	bool "Export efi runtime maps to sysfs"
428c2ecf20Sopenharmony_ci	depends on X86 && EFI && KEXEC_CORE
438c2ecf20Sopenharmony_ci	default y
448c2ecf20Sopenharmony_ci	help
458c2ecf20Sopenharmony_ci	  Export efi runtime memory maps to /sys/firmware/efi/runtime-map.
468c2ecf20Sopenharmony_ci	  That memory map is used for example by kexec to set up efi virtual
478c2ecf20Sopenharmony_ci	  mapping the 2nd kernel, but can also be used for debugging purposes.
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci	  See also Documentation/ABI/testing/sysfs-firmware-efi-runtime-map.
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciconfig EFI_FAKE_MEMMAP
528c2ecf20Sopenharmony_ci	bool "Enable EFI fake memory map"
538c2ecf20Sopenharmony_ci	depends on EFI && X86
548c2ecf20Sopenharmony_ci	default n
558c2ecf20Sopenharmony_ci	help
568c2ecf20Sopenharmony_ci	  Saying Y here will enable "efi_fake_mem" boot option.
578c2ecf20Sopenharmony_ci	  By specifying this parameter, you can add arbitrary attribute
588c2ecf20Sopenharmony_ci	  to specific memory range by updating original (firmware provided)
598c2ecf20Sopenharmony_ci	  EFI memmap.
608c2ecf20Sopenharmony_ci	  This is useful for debugging of EFI memmap related feature.
618c2ecf20Sopenharmony_ci	  e.g. Address Range Mirroring feature.
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ciconfig EFI_MAX_FAKE_MEM
648c2ecf20Sopenharmony_ci	int "maximum allowable number of ranges in efi_fake_mem boot option"
658c2ecf20Sopenharmony_ci	depends on EFI_FAKE_MEMMAP
668c2ecf20Sopenharmony_ci	range 1 128
678c2ecf20Sopenharmony_ci	default 8
688c2ecf20Sopenharmony_ci	help
698c2ecf20Sopenharmony_ci	  Maximum allowable number of ranges in efi_fake_mem boot option.
708c2ecf20Sopenharmony_ci	  Ranges can be set up to this value using comma-separated list.
718c2ecf20Sopenharmony_ci	  The default value is 8.
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ciconfig EFI_SOFT_RESERVE
748c2ecf20Sopenharmony_ci	bool "Reserve EFI Specific Purpose Memory"
758c2ecf20Sopenharmony_ci	depends on EFI && EFI_STUB && ACPI_HMAT
768c2ecf20Sopenharmony_ci	default ACPI_HMAT
778c2ecf20Sopenharmony_ci	help
788c2ecf20Sopenharmony_ci	  On systems that have mixed performance classes of memory EFI
798c2ecf20Sopenharmony_ci	  may indicate specific purpose memory with an attribute (See
808c2ecf20Sopenharmony_ci	  EFI_MEMORY_SP in UEFI 2.8). A memory range tagged with this
818c2ecf20Sopenharmony_ci	  attribute may have unique performance characteristics compared
828c2ecf20Sopenharmony_ci	  to the system's general purpose "System RAM" pool. On the
838c2ecf20Sopenharmony_ci	  expectation that such memory has application specific usage,
848c2ecf20Sopenharmony_ci	  and its base EFI memory type is "conventional" answer Y to
858c2ecf20Sopenharmony_ci	  arrange for the kernel to reserve it as a "Soft Reserved"
868c2ecf20Sopenharmony_ci	  resource, and set aside for direct-access (device-dax) by
878c2ecf20Sopenharmony_ci	  default. The memory range can later be optionally assigned to
888c2ecf20Sopenharmony_ci	  the page allocator by system administrator policy via the
898c2ecf20Sopenharmony_ci	  device-dax kmem facility. Say N to have the kernel treat this
908c2ecf20Sopenharmony_ci	  memory as "System RAM" by default.
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci	  If unsure, say Y.
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ciconfig EFI_PARAMS_FROM_FDT
958c2ecf20Sopenharmony_ci	bool
968c2ecf20Sopenharmony_ci	help
978c2ecf20Sopenharmony_ci	  Select this config option from the architecture Kconfig if
988c2ecf20Sopenharmony_ci	  the EFI runtime support gets system table address, memory
998c2ecf20Sopenharmony_ci          map address, and other parameters from the device tree.
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ciconfig EFI_RUNTIME_WRAPPERS
1028c2ecf20Sopenharmony_ci	bool
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ciconfig EFI_GENERIC_STUB
1058c2ecf20Sopenharmony_ci	bool
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ciconfig EFI_ARMSTUB_DTB_LOADER
1088c2ecf20Sopenharmony_ci	bool "Enable the DTB loader"
1098c2ecf20Sopenharmony_ci	depends on EFI_GENERIC_STUB && !RISCV && !LOONGARCH
1108c2ecf20Sopenharmony_ci	default y
1118c2ecf20Sopenharmony_ci	help
1128c2ecf20Sopenharmony_ci	  Select this config option to add support for the dtb= command
1138c2ecf20Sopenharmony_ci	  line parameter, allowing a device tree blob to be loaded into
1148c2ecf20Sopenharmony_ci	  memory from the EFI System Partition by the stub.
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci	  If the device tree is provided by the platform or by
1178c2ecf20Sopenharmony_ci	  the bootloader this option may not be needed.
1188c2ecf20Sopenharmony_ci	  But, for various development reasons and to maintain existing
1198c2ecf20Sopenharmony_ci	  functionality for bootloaders that do not have such support
1208c2ecf20Sopenharmony_ci	  this option is necessary.
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ciconfig EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER
1238c2ecf20Sopenharmony_ci	bool "Enable the command line initrd loader" if !X86
1248c2ecf20Sopenharmony_ci	depends on EFI_STUB && (EFI_GENERIC_STUB || X86)
1258c2ecf20Sopenharmony_ci	default y
1268c2ecf20Sopenharmony_ci	help
1278c2ecf20Sopenharmony_ci	  Select this config option to add support for the initrd= command
1288c2ecf20Sopenharmony_ci	  line parameter, allowing an initrd to be loaded into memory that
1298c2ecf20Sopenharmony_ci	  resides on a file system backed by an implementation of
1308c2ecf20Sopenharmony_ci	  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL.
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci	  This method has been superseded by the simpler LoadFile2 based
1338c2ecf20Sopenharmony_ci	  initrd loading method, but the initrd= loader is retained as it
1348c2ecf20Sopenharmony_ci	  can be used from the UEFI Shell or other generic loaders that
1358c2ecf20Sopenharmony_ci	  don't implement the Linux specific LoadFile2 method.
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ciconfig EFI_BOOTLOADER_CONTROL
1388c2ecf20Sopenharmony_ci	tristate "EFI Bootloader Control"
1398c2ecf20Sopenharmony_ci	default n
1408c2ecf20Sopenharmony_ci	help
1418c2ecf20Sopenharmony_ci	  This module installs a reboot hook, such that if reboot() is
1428c2ecf20Sopenharmony_ci	  invoked with a string argument NNN, "NNN" is copied to the
1438c2ecf20Sopenharmony_ci	  "LoaderEntryOneShot" EFI variable, to be read by the
1448c2ecf20Sopenharmony_ci	  bootloader. If the string matches one of the boot labels
1458c2ecf20Sopenharmony_ci	  defined in its configuration, the bootloader will boot once
1468c2ecf20Sopenharmony_ci	  to that label. The "LoaderEntryRebootReason" EFI variable is
1478c2ecf20Sopenharmony_ci	  set with the reboot reason: "reboot" or "shutdown". The
1488c2ecf20Sopenharmony_ci	  bootloader reads this reboot reason and takes particular
1498c2ecf20Sopenharmony_ci	  action according to its policy.
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ciconfig EFI_CAPSULE_LOADER
1528c2ecf20Sopenharmony_ci	tristate "EFI capsule loader"
1538c2ecf20Sopenharmony_ci	depends on EFI
1548c2ecf20Sopenharmony_ci	help
1558c2ecf20Sopenharmony_ci	  This option exposes a loader interface "/dev/efi_capsule_loader" for
1568c2ecf20Sopenharmony_ci	  users to load EFI capsules. This driver requires working runtime
1578c2ecf20Sopenharmony_ci	  capsule support in the firmware, which many OEMs do not provide.
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci	  Most users should say N.
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ciconfig EFI_CAPSULE_QUIRK_QUARK_CSH
1628c2ecf20Sopenharmony_ci	bool "Add support for Quark capsules with non-standard headers"
1638c2ecf20Sopenharmony_ci	depends on X86 && !64BIT
1648c2ecf20Sopenharmony_ci	select EFI_CAPSULE_LOADER
1658c2ecf20Sopenharmony_ci	default y
1668c2ecf20Sopenharmony_ci	help
1678c2ecf20Sopenharmony_ci	  Add support for processing Quark X1000 EFI capsules, whose header
1688c2ecf20Sopenharmony_ci	  layout deviates from the layout mandated by the UEFI specification.
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ciconfig EFI_TEST
1718c2ecf20Sopenharmony_ci	tristate "EFI Runtime Service Tests Support"
1728c2ecf20Sopenharmony_ci	depends on EFI
1738c2ecf20Sopenharmony_ci	default n
1748c2ecf20Sopenharmony_ci	help
1758c2ecf20Sopenharmony_ci	  This driver uses the efi.<service> function pointers directly instead
1768c2ecf20Sopenharmony_ci	  of going through the efivar API, because it is not trying to test the
1778c2ecf20Sopenharmony_ci	  kernel subsystem, just for testing the UEFI runtime service
1788c2ecf20Sopenharmony_ci	  interfaces which are provided by the firmware. This driver is used
1798c2ecf20Sopenharmony_ci	  by the Firmware Test Suite (FWTS) for testing the UEFI runtime
1808c2ecf20Sopenharmony_ci	  interfaces readiness of the firmware.
1818c2ecf20Sopenharmony_ci	  Details for FWTS are available from:
1828c2ecf20Sopenharmony_ci	  <https://wiki.ubuntu.com/FirmwareTestSuite>
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci	  Say Y here to enable the runtime services support via /dev/efi_test.
1858c2ecf20Sopenharmony_ci	  If unsure, say N.
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ciconfig APPLE_PROPERTIES
1888c2ecf20Sopenharmony_ci	bool "Apple Device Properties"
1898c2ecf20Sopenharmony_ci	depends on EFI_STUB && X86
1908c2ecf20Sopenharmony_ci	select EFI_DEV_PATH_PARSER
1918c2ecf20Sopenharmony_ci	select UCS2_STRING
1928c2ecf20Sopenharmony_ci	help
1938c2ecf20Sopenharmony_ci	  Retrieve properties from EFI on Apple Macs and assign them to
1948c2ecf20Sopenharmony_ci	  devices, allowing for improved support of Apple hardware.
1958c2ecf20Sopenharmony_ci	  Properties that would otherwise be missing include the
1968c2ecf20Sopenharmony_ci	  Thunderbolt Device ROM and GPU configuration data.
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci	  If unsure, say Y if you have a Mac.  Otherwise N.
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ciconfig RESET_ATTACK_MITIGATION
2018c2ecf20Sopenharmony_ci	bool "Reset memory attack mitigation"
2028c2ecf20Sopenharmony_ci	depends on EFI_STUB
2038c2ecf20Sopenharmony_ci	help
2048c2ecf20Sopenharmony_ci	  Request that the firmware clear the contents of RAM after a reboot
2058c2ecf20Sopenharmony_ci	  using the TCG Platform Reset Attack Mitigation specification. This
2068c2ecf20Sopenharmony_ci	  protects against an attacker forcibly rebooting the system while it
2078c2ecf20Sopenharmony_ci	  still contains secrets in RAM, booting another OS and extracting the
2088c2ecf20Sopenharmony_ci	  secrets. This should only be enabled when userland is configured to
2098c2ecf20Sopenharmony_ci	  clear the MemoryOverwriteRequest flag on clean shutdown after secrets
2108c2ecf20Sopenharmony_ci	  have been evicted, since otherwise it will trigger even on clean
2118c2ecf20Sopenharmony_ci	  reboots.
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ciconfig EFI_RCI2_TABLE
2148c2ecf20Sopenharmony_ci	bool "EFI Runtime Configuration Interface Table Version 2 Support"
2158c2ecf20Sopenharmony_ci	depends on X86 || COMPILE_TEST
2168c2ecf20Sopenharmony_ci	help
2178c2ecf20Sopenharmony_ci	  Displays the content of the Runtime Configuration Interface
2188c2ecf20Sopenharmony_ci	  Table version 2 on Dell EMC PowerEdge systems as a binary
2198c2ecf20Sopenharmony_ci	  attribute 'rci2' under /sys/firmware/efi/tables directory.
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci	  RCI2 table contains BIOS HII in XML format and is used to populate
2228c2ecf20Sopenharmony_ci	  BIOS setup page in Dell EMC OpenManage Server Administrator tool.
2238c2ecf20Sopenharmony_ci	  The BIOS setup page contains BIOS tokens which can be configured.
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci	  Say Y here for Dell EMC PowerEdge systems.
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ciconfig EFI_DISABLE_PCI_DMA
2288c2ecf20Sopenharmony_ci       bool "Clear Busmaster bit on PCI bridges during ExitBootServices()"
2298c2ecf20Sopenharmony_ci       help
2308c2ecf20Sopenharmony_ci	  Disable the busmaster bit in the control register on all PCI bridges
2318c2ecf20Sopenharmony_ci	  while calling ExitBootServices() and passing control to the runtime
2328c2ecf20Sopenharmony_ci	  kernel. System firmware may configure the IOMMU to prevent malicious
2338c2ecf20Sopenharmony_ci	  PCI devices from being able to attack the OS via DMA. However, since
2348c2ecf20Sopenharmony_ci	  firmware can't guarantee that the OS is IOMMU-aware, it will tear
2358c2ecf20Sopenharmony_ci	  down IOMMU configuration when ExitBootServices() is called. This
2368c2ecf20Sopenharmony_ci	  leaves a window between where a hostile device could still cause
2378c2ecf20Sopenharmony_ci	  damage before Linux configures the IOMMU again.
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_ci	  If you say Y here, the EFI stub will clear the busmaster bit on all
2408c2ecf20Sopenharmony_ci	  PCI bridges before ExitBootServices() is called. This will prevent
2418c2ecf20Sopenharmony_ci	  any malicious PCI devices from being able to perform DMA until the
2428c2ecf20Sopenharmony_ci	  kernel reenables busmastering after configuring the IOMMU.
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci	  This option will cause failures with some poorly behaved hardware
2458c2ecf20Sopenharmony_ci	  and should not be enabled without testing. The kernel commandline
2468c2ecf20Sopenharmony_ci	  options "efi=disable_early_pci_dma" or "efi=no_disable_early_pci_dma"
2478c2ecf20Sopenharmony_ci	  may be used to override this option.
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ciendmenu
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ciconfig EFI_EMBEDDED_FIRMWARE
2528c2ecf20Sopenharmony_ci	bool
2538c2ecf20Sopenharmony_ci	depends on EFI
2548c2ecf20Sopenharmony_ci	select CRYPTO_LIB_SHA256
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ciconfig UEFI_CPER
2578c2ecf20Sopenharmony_ci	bool
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ciconfig UEFI_CPER_ARM
2608c2ecf20Sopenharmony_ci	bool
2618c2ecf20Sopenharmony_ci	depends on UEFI_CPER && ( ARM || ARM64 )
2628c2ecf20Sopenharmony_ci	default y
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_ciconfig UEFI_CPER_X86
2658c2ecf20Sopenharmony_ci	bool
2668c2ecf20Sopenharmony_ci	depends on UEFI_CPER && X86
2678c2ecf20Sopenharmony_ci	default y
2688c2ecf20Sopenharmony_ci
2698c2ecf20Sopenharmony_ciconfig EFI_DEV_PATH_PARSER
2708c2ecf20Sopenharmony_ci	bool
2718c2ecf20Sopenharmony_ci	depends on ACPI
2728c2ecf20Sopenharmony_ci	default n
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ciconfig EFI_EARLYCON
2758c2ecf20Sopenharmony_ci	def_bool y
2768c2ecf20Sopenharmony_ci	depends on EFI && SERIAL_EARLYCON && !ARM && !IA64
2778c2ecf20Sopenharmony_ci	select FONT_SUPPORT
2788c2ecf20Sopenharmony_ci	select ARCH_USE_MEMREMAP_PROT
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ciconfig EFI_CUSTOM_SSDT_OVERLAYS
2818c2ecf20Sopenharmony_ci	bool "Load custom ACPI SSDT overlay from an EFI variable"
2828c2ecf20Sopenharmony_ci	depends on EFI && ACPI
2838c2ecf20Sopenharmony_ci	default ACPI_TABLE_UPGRADE
2848c2ecf20Sopenharmony_ci	help
2858c2ecf20Sopenharmony_ci	  Allow loading of an ACPI SSDT overlay from an EFI variable specified
2868c2ecf20Sopenharmony_ci	  by a kernel command line option.
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_ci	  See Documentation/admin-guide/acpi/ssdt-overlays.rst for more
2898c2ecf20Sopenharmony_ci	  information.
290