1. 27 9月, 2022 3 次提交
    • A
      efi: libstub: unify initrd loading between architectures · f4dc7fff
      Ard Biesheuvel 提交于
      Use a EFI configuration table to pass the initrd to the core kernel,
      instead of per-arch methods. This cleans up the code considerably, and
      should make it easier for architectures to get rid of their reliance on
      DT for doing EFI boot in the future.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      f4dc7fff
    • A
      efi: libstub: simplify efi_get_memory_map() and struct efi_boot_memmap · eab31265
      Ard Biesheuvel 提交于
      Currently, struct efi_boot_memmap is a struct that is passed around
      between callers of efi_get_memory_map() and the users of the resulting
      data, and which carries pointers to various variables whose values are
      provided by the EFI GetMemoryMap() boot service.
      
      This is overly complex, and it is much easier to carry these values in
      the struct itself. So turn the struct into one that carries these data
      items directly, including a flex array for the variable number of EFI
      memory descriptors that the boot service may return.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      eab31265
    • A
      efi: libstub: avoid efi_get_memory_map() for allocating the virt map · f80d2604
      Ard Biesheuvel 提交于
      The virt map is a set of efi_memory_desc_t descriptors that are passed
      to SetVirtualAddressMap() to inform the firmware about the desired
      virtual mapping of the regions marked as EFI_MEMORY_RUNTIME. The only
      reason we currently call the efi_get_memory_map() helper is that it
      gives us an allocation that is guaranteed to be of sufficient size.
      However, efi_get_memory_map() has grown some additional complexity over
      the years, and today, we're actually better off calling the EFI boot
      service directly with a zero size, which tells us how much memory should
      be enough for the virt map.
      
      While at it, avoid creating the VA map allocation if we will not be
      using it anyway, i.e., if efi_novamap is true.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      f80d2604
  2. 19 5月, 2022 1 次提交
  3. 03 5月, 2022 2 次提交
  4. 22 11月, 2021 2 次提交
  5. 20 1月, 2021 2 次提交
  6. 09 12月, 2020 1 次提交
  7. 05 11月, 2020 1 次提交
  8. 17 9月, 2020 1 次提交
  9. 16 9月, 2020 3 次提交
  10. 09 7月, 2020 1 次提交
  11. 17 6月, 2020 1 次提交
    • A
      efi/libstub: arm: Print CPU boot mode and MMU state at boot · 2a55280a
      Ard Biesheuvel 提交于
      On 32-bit ARM, we may boot at HYP mode, or with the MMU and caches off
      (or both), even though the EFI spec does not actually support this.
      While booting at HYP mode is something we might tolerate, fiddling
      with the caches is a more serious issue, as disabling the caches is
      tricky to do safely from C code, and running without the Dcache makes
      it impossible to support unaligned memory accesses, which is another
      explicit requirement imposed by the EFI spec.
      
      So take note of the CPU mode and MMU state in the EFI stub diagnostic
      output so that we can easily diagnose any issues that may arise from
      this. E.g.,
      
        EFI stub: Entering in SVC mode with MMU enabled
      
      Also, capture the CPSR and SCTLR system register values at EFI stub
      entry, and after ExitBootServices() returns, and check whether the
      MMU and Dcache were disabled at any point. If this is the case, a
      diagnostic message like the following will be emitted:
      
        efi: [Firmware Bug]: EFI stub was entered with MMU and Dcache disabled, please fix your firmware!
        efi: CPSR at EFI stub entry        : 0x600001d3
        efi: SCTLR at EFI stub entry       : 0x00c51838
        efi: CPSR after ExitBootServices() : 0x600001d3
        efi: SCTLR after ExitBootServices(): 0x00c50838
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Reviewed-by: NLeif Lindholm <leif@nuviainc.com>
      2a55280a
  12. 16 6月, 2020 1 次提交
  13. 23 5月, 2020 1 次提交
  14. 22 5月, 2020 1 次提交
  15. 21 5月, 2020 3 次提交
  16. 19 5月, 2020 3 次提交
  17. 14 5月, 2020 1 次提交
    • L
      efi/libstub/x86: Avoid EFI map buffer alloc in allocate_e820() · fd626195
      Lenny Szubowicz 提交于
      In allocate_e820(), call the EFI get_memory_map() service directly
      instead of indirectly via efi_get_memory_map(). This avoids allocation
      of a buffer and return of the full EFI memory map, which is not needed
      here and would otherwise need to be freed.
      
      Routine allocate_e820() only needs to know how many EFI memory
      descriptors there are in the map to allocate an adequately sized
      e820ext buffer, if it's needed. Note that since efi_get_memory_map()
      returns a memory map buffer sized with extra headroom, allocate_e820()
      now needs to explicitly factor that into the e820ext size calculation.
      Signed-off-by: NLenny Szubowicz <lszubowi@redhat.com>
      Suggested-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      fd626195
  18. 05 5月, 2020 2 次提交
  19. 01 5月, 2020 3 次提交
  20. 24 4月, 2020 7 次提交