Kconfig 12 KB

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