1. 01 Jun, 2022 3 commits
    • Ard Biesheuvel's avatar
      efi: clean up Kconfig dependencies on CONFIG_EFI · 75ed63d9
      Ard Biesheuvel authored
      Geert reports that the new option CONFIG_EFI_DISABLE_RUNTIME is user
      visible even when EFI support is disabled, which is unnecessary and
      clutters the Kconfig interface.
      
      So let's move this option into the existing Kconfig submenu that already
      depends on CONFIG_EFI, and while at it, give some other options the same
      treatment.
      
      Also clean up a small wart where the efi/ subdirectory is listed twice.
      Let's just list it unconditionally so that both EFI and UEFI_CPER based
      pieces will be built independently (the latter only depends on the
      former on !X86)
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      75ed63d9
    • Ard Biesheuvel's avatar
      efi/x86: libstub: Make DXE calls mixed mode safe · 31f1a0ed
      Ard Biesheuvel authored
      The newly added DXE calls use 64-bit quantities, which means we need to
      marshall them explicitly when running in mixed mode. Currently, we get
      away without it because we just bail when GetMemorySpaceDescriptor()
      fails, which is guaranteed to happen due to the function argument mixup.
      
      Let's fix this properly, though, by defining the macros that describe
      how to marshall the arguments. While at it, drop an incorrect cast on a
      status variable.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      31f1a0ed
    • Lukas Bulwahn's avatar
      efi: x86: Fix config name for setting the NX-compatibility flag in the PE header · ca209f8b
      Lukas Bulwahn authored
      Commit 21b68da7bf4a ("efi: x86: Set the NX-compatibility flag in the PE
      header") intends to set the compatibility flag, i.e.,
      IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, but this ifdef is actually dead as
      the CONFIG_DXE_MEM_ATTRIBUTES Kconfig option does not exist.
      
      The config is actually called EFI_DXE_MEM_ATTRIBUTES. Adjust the ifdef
      to use the intended config name.
      
      The issue was identified with ./scripts/checkkconfigsymbols.py.
      
      Fixes: 21b68da7bf4a ("efi: x86: Set the NX-compatibility flag in the PE header")
      Signed-off-by: default avatarLukas Bulwahn <lukas.bulwahn@gmail.com>
      Link: https://lore.kernel.org/r/20220601115043.7678-1-lukas.bulwahn@gmail.comSigned-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      ca209f8b
  2. 28 May, 2022 1 commit
  3. 19 May, 2022 1 commit
  4. 06 May, 2022 1 commit
    • Ard Biesheuvel's avatar
      efi: stub: prefer mirrored memory for randomized allocations · a6cfe03c
      Ard Biesheuvel authored
      If the system exposes memory regions with the EFI_MORE_RELIABLE
      attribute, it is implied that it is intended to be used for allocations
      that are relatively important, such as the kernel's static image.
      
      Since efi_random_alloc() is mostly (only) used for allocating space for
      the kernel image, let's update it to take this into account, and
      disregard all memory without the EFI_MORE_RELIABLE attribute if there is
      sufficient memory available that does have this attribute.
      
      Note that this change only affects booting with randomization enabled.
      In other cases, the EFI stub runs the kernel image in place unless its
      placement is unsuitable for some reason (i.e., misaligned, or its BSS
      overlaps with another allocation), and it is left to the bootloader to
      ensure that the kernel was loaded into EFI_MORE_RELIABLE memory if this
      is desired.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      a6cfe03c
  5. 03 May, 2022 5 commits
  6. 13 Apr, 2022 6 commits
  7. 03 Apr, 2022 8 commits
  8. 02 Apr, 2022 15 commits